-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Is there an existing issue for this?
- I have searched the existing issues
Description of the Issue
When you toggle Settings > Preferences > Language > Treat Backslash as escape character for SQL, since the UI doesn't say otherwise, the general expectation is that it will take immediate effect. It does not. (update: This was revealed by @alankilborn in this Community post, which is what prompted this bug report.)
The actual behavior depends on version (see StR)
Steps To Reproduce
using the file escape.sql:
select 'ABCDE' from dual where 1=1;
select 'AB\CDE' from dual where 1=1;
select 'ABCDE\' from dual where 1=1;
select 'ABCDE' from dual where 1=1;
select 'AB\CDE' from dual where 1=1;
older behavior
- Start with fresh portable v8.7.5 or earlier, and open
license.txt - open
escape.sqland ensure it's in the normal Language > S > SQL - set Settings > Preferences > Language > Treat Backslash ... to be checkmarked (if it's not already)
- switch to
license.txtand back toescape.sqland confirm that\is being treated as escape (the string on line 3 doesn't end)

- uncheck Treat Backslash... option
- Expectation: SQL should re-render, either immediately or when preferences are closed, with the string on ending because \ is no longer an escape
- Reality: SQL doesn't re-render yet, so the string continues beyond that line
- Switch to
license.txtand back toescape.sql:
newer behavior
- Start with fresh portable v8.7.5 or earlier, and open
license.txt - open
escape.sqland ensure it's in the normal Language > S > SQL - set Settings > Preferences > Language > Treat Backslash ... to be checkmarked (if it's not already)
- switch to
license.txtand back toescape.sqland confirm that\is being treated as escape (the string on line 3 doesn't end)

- uncheck Treat Backslash... option
- Expectation: SQL should re-render, either immediately or when preferences are closed, with the string on ending because \ is no longer an escape
- Reality: SQL doesn't re-render yet, so the string continues beyond that line
- Switch to
license.txtand back toescape.sql:- Expectation: SQL should re-render
- Reality: SQL still doesn't re-render
- Close
escape.sqland useCtrl+Shift+Tor equivalent to re-open
Current Behavior
In v8.7.5 and earlier, after you toggle the preference, you must switch away from the SQL file tab to something else, and then back, to see the preference change take effect.
In v8.7.6 and newer, after you toggle the preference, you must close the SQL file and re-open it to see the preference change take effect
Expected Behavior
You should be able to immediately see the rendering of SQL change immediately when you toggle the preference on or off.
Debug Information
Notepad++ v8.7.5 (64-bit)
Build time : Dec 21 2024 - 05:13:03
Path : C:\usr\local\apps\npp\npp.8.7.5.portable.x64\notepad++.exe
Command Line : escape.sql
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
DirectWrite : ON
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.3194
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)
==========
Notepad++ v8.7.6 (64-bit)
Build time : Jan 24 2025 - 08:27:33
Path : C:\usr\local\apps\npp\npp.8.7.6.portable.x64\notepad++.exe
Command Line : escape.sql
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
DirectWrite : ON
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.3194
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)
=====
Notepad++ v8.7.8 (64-bit)
Build time : Feb 27 2025 - 21:10:34
Path : C:\usr\local\apps\npp\npp.8.7.8-RC2.portable.x64\notepad++.exe
Command Line : escape.sql
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
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 Home (64-bit)
OS Version : 24H2
OS Build : 26100.3194
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)Anything else?
raw lexilla behavior
If I use PythonScript plugin to set the lexilla property ( editor.setProperty('sql.backslash.escapes', '0') or editor.setProperty('sql.backslash.escapes', '1') ), it immediately toggles the rendering, so the problem is not on the lexilla side of things.
