GithubHelp home page GithubHelp logo

Comments (2)

BdR76 avatar BdR76 commented on September 28, 2024

Thanks for posting the issue. You can fix the colors by triggering a refresh of the syntax highlight buffer, i.e. make Notepad++ re-evaluate the syntax colors for the entire file. Like you point out, this can be done by closing/opening the file, but you can also switch between different tabs to another file and back, or select Language > None (normal text) and then back to Language > CSVLint.

This is indeed a bug and it is caused by when you edit halfway in the file then the lexer (which determines the syntax highlighting) only re-evaluates the colors starting from the position where you edited the text. In this case the variables are not initialised correctly because it always starts with color 1 instead of color 3 in this case.

The code for syntax highlighting the multiline text values with quotes is already tricky, but I'll see if I can fix it.

from csvlint.

BdR76 avatar BdR76 commented on September 28, 2024

I've updated the lexer which only slightly improves it, meaning in some cases it will handle a two-line quote string correctly now, but in most cases it will still result in incorrect syntax highlighting when you edit a quoted-multiline-string on the second/third/fourth/etc line.

The problem is that when the user edits the text, the lexer will be triggered with the start position of the edit part as a parameter. When the opening quote " character is located one or more lines before that edit point, then the lexer assumes it is just a new line, so a new record, and it will initialise with the first color index. There's no way to tell if the user was editing in the middle of a quoted string, and always checking backwards to find an opening-quote would in most cases go all the way back to the start of a file which could lead to performance issues.

You can download the beta DLL here which contains this "update". Not sure how to properly fix this in all cases, I'll return to this at a later time.

from csvlint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.