Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4868 SQL stored procedure code containing '\' causes incorrect highlighting

Next_Major_Version
open
nobody
SQL code (1)
5
2014-06-13
2014-06-13
leeib
No

When editing a SQL stored procedure file, a line like:

SET @SubPath = '\e'+substring(@Hex,3,2)+'\'+substring(@Hex,5,2)+'\'+substring(@Hex,7,2)+'\'

causes the rest of the file to be highlighted as a comment in Notepad++, starting with the first instance of '\'. Substituting "\\" for "\" causes the highlighting to display correctly but produces an incorrect result when the SQL runs.

Discussion

  • Whether or not the backslash is an escape character depends on the SQL dialect. There is a setting for this in N++ but due to bugs the situation is a bit complex at the moment. See my answer in this bug for more info:

    http://sourceforge.net/p/notepad-plus/bugs/4861/