notepad-plus-plus icon indicating copy to clipboard operation
notepad-plus-plus copied to clipboard

[CSVLint Plugin issue] Selected text bgcolor not showing in Current line

Open arfmach opened this issue 11 months ago • 6 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description of the Issue

Selected text background color is not showing in Current line (Current line background color overrides Selected text background color, but it shouldn't).

Steps To Reproduce

  1. Open NPP
  2. Type any text in NPP (or open any file already with text)
  3. You'll notice that the "Current line background color" is not what configured in Style Configurator, but only slightly different from Global background color

Image

  1. If you select any text, its background will be highlighted according to the "Selected text colour" configured in Styler Configurator

Image

Image

  1. Go to "Settings" / "Style Configurator…" / "Current line background colour" and change the "Background colour" to anything (it will apply the change immediately in the editor canvas), then click "Cancel" in the dialog box – you'll notice that now the "Current line background color" is the color configured in Style Configurator
  2. Now place the caret in any line containing text and select any part of the text – you'll notice that the selected text doesn't change color, being indistinguishable from the remaining text in current line (it is even more noticeable when the text contains other occurrences of the selected text – it will highlight the repeating occurrences but the main selected text is still not highlighted)

Image

  1. If you make a multi-line selection (e.g. by holding Shift and typing Up or Down arrow), then all selected text not in current line becomes highlighted with the configured background color, but the part of the selected text that is in the current line keeps without any color change (the whole Current line remains with its background color)

Image

Current Behavior

  1. Current line background color is not loaded from Style Configurator setting when opening NPP
  2. When forcing Current line background color to be loaded, then Selected text color becomes ignored (bypassed by Current line background color)

Expected Behavior

  1. When opening NPP, Current line background color should be correctly loaded as configured in Style Configurator
  2. Selected text background color should appear even in current line (higher styling priority than Current line background color)

Debug Information

Notepad++ v8.7.9   (64-bit)
Build time : Mar 26 2025 - 03:20:28
Scintilla/Lexilla included : 5.5.5/5.4.3
Boost Regex included : 1_85
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : C:\Users\REDACTED\OneDrive - REDACTED\Notepad++
Periodic Backup : ON
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Pro (64-bit)
OS Version : 24H2
OS Build : 26100.3775
Current ANSI codepage : 1252
Plugins : 
    BigFiles (0.1.3)
    BracketsCheck (1.2.2)
    CodeAlignmentNpp (14.1.107)
    ColumnTools (1.4.5.1)
    ComparePlugin (2.0.2)
    CSVLint (0.4.6.7)
    JsMapParser.NppPlugin (4.2)
    JSMinNPP (1.2312)
    JsonTools (8.1)
    MarkdownViewerPlusPlus (0.8.2)
    mimeTools (3.1)
    NppConverter (4.6)
    nppcrypt (1.0.1.6)
    NppExport (0.4)
    NppToolBucket (1.10.6622.41516)
    PoorMansTSqlFormatterNppPlugin (1.6.13.31508)
    XMLTools (3.1.1.13)

Anything else?

No response

arfmach avatar Apr 15 '25 02:04 arfmach

It seems that the theme in use in the Steps-to-Repro is "Black board"??

I tried to repro the issue as described and could not; specifically, I did not get the result in step 5.

alankilborn avatar Apr 15 '25 10:04 alankilborn

It seems that the theme in use in the Steps-to-Repro is "Black board"??

I tried to repro the issue as described and could not; specifically, I did not get the result in step 5.

Actually, I've customized the default theme in order to achieve the "dark theme" I wanted.

This is my current "stylers.xml"

stylers.xml.txt

arfmach avatar Apr 17 '25 12:04 arfmach

Also getting this issue with almost no customizations besides a few extra plugins.

faxx1080 avatar May 21 '25 19:05 faxx1080

I was getting the same issue. So I started without any plugins ("%ProgramFiles%\Notepad++\notepad++.exe" -noPlugin) and no more issue, I get the correct current line background. So restart normally, and disabled the plugins one by one to found the culprit. In my case it was CSV Lint

Image

angevoyager avatar May 30 '25 17:05 angevoyager

I was getting the same issue. So I started without any plugins ("%ProgramFiles%\Notepad++\notepad++.exe" -noPlugin) and no more issue, I get the correct current line background. So restart normally, and disabled the plugins one by one to found the culprit. In my case it was CSV Lint

Image

This resolved the issue for me.

faxx1080 avatar Jun 01 '25 23:06 faxx1080

This is specifically caused by the TransparentCursor setting in CSV Lint, which defaults to True. If this is intended behavior, then this setting should absolutely default to False.

Image

benlevycmp avatar Jun 13 '25 23:06 benlevycmp

In case somebody else is looking for answers to this problem: see https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16429#issuecomment-2971988263 above.

Observed behaviour which led me here:

  1. install CSVLint plugin (plus a couple others)

  2. Open a text file with some (large-ish) paragraphs of plain text, e.g. a MarkDown file.

  3. Note that the current line is subtly highlighted as you travel through the file.

    Image
  4. Now select a bit of text (e.g. part of a word) in the current line using Shift+Cursor_Right keys.

  5. Note that the selection highlighting does not show up. the selection in the screenshot is the message

    Image
  6. Grow the selection size by using Shift+Cursor_Down to have it encompass multiple lines of text:

    • as soon as you 'leave' the 'current highlighted line' the selection highlight shows up!

    the selection in the screenshot is from the message vertically down, i.e. the cursor is now before the 'o' in the duration

    Image

👍 After changing the TransparentCursor setting to FALSE, Notepad++ is, once again, behaving as you'd expect: see step (4+5):

  1. Image

... and step (6):

  1. Image

GerHobbelt avatar Nov 08 '25 10:11 GerHobbelt

I experienced this same issue with the Plastic Code Wrap theme and CSVLint (0.4.6.8) installed.

Alternative workaround (without disabling CSVLint entirely): Go to Settings > Preferences > Editing > Current Line Indicator and change from "Highlight Background" to either "None" or "Frame". This allows the selection color to display properly without losing CSVLint functionality.

Plugin-specific solution: As mentioned above, changing CSVLint's TransparentCursor setting to False (Settings > Preferences > CSVLint > TransparentCursor) and restarting Notepad++ also resolves the issue completely while keeping CSVLint active.

This confirms the issue is related to how CSVLint's TransparentCursor interacts with the current line indicator rendering, affecting selection color visibility across different themes.

piknockyou avatar Nov 16 '25 20:11 piknockyou

As this seems to be a issue caused by CSV Lint plugin I created https://github.com/BdR76/CSVLint/issues/111 . Please contribute further insights there.

chcg avatar Nov 17 '25 14:11 chcg