Go Back   WowAce Forums > General > General Chat

Reply
 
Thread Tools
Old 2 Weeks Ago   #1
freefog
Member
 
Join Date: Sep 2008
Posts: 38
Default How to Stop Literal String Highlight in Notepad++

Hi there, would be wonderful that Notepad++ stopped highlighting the literal strings so it would be much nicer to code Handlers Snippets?.

I have been digging arround Notepad++ plug-ins forums and playing with the Notepad++ configurations files for hours with no good results; if anyone has achieved this or anything similar I would really greet the answer.

Thanks for your Time.
FF.
freefog is offline   Reply With Quote
Old 2 Weeks Ago   #2
OrionShock
Legendary Member
 
OrionShock's Avatar
 
Join Date: May 2006
Location: Arizona
Posts: 3,377
Default Re: How to Stop Literal String Highlight in Notepad++

you could always remove the brackets when debugging. Granted you'll have to put them back in when you go to load it in game..
__________________
Author of GuildCraft, SickOfClickingDailies, and CursorCooldown

"I was there in the beginning... and things were very different back then" --An Echo from a time before.
OrionShock is offline   Reply With Quote
Old 2 Weeks Ago   #3
freefog
Member
 
Join Date: Sep 2008
Posts: 38
Default Re: How to Stop Literal String Highlight in Notepad++

Xd
I know.
That is what I want but ...
If it is possible in a more automated way...

Thanks any way.
freefog is offline   Reply With Quote
Old 2 Weeks Ago   #4
Arrowmaster
Hero Member
 
Join Date: Apr 2006
Posts: 764
Default Re: How to Stop Literal String Highlight in Notepad++

Notepad++ is based of of SciTE so I think this should work. The literal string matching in SciTE doesn't check for balanced sides it just checks for "[=*[" and "]=*]" so you can break it with nesting.

Try the following.

str = [=[
--[[
]]
code here
]=]
Arrowmaster is offline   Reply With Quote
Old 1 Week Ago   #5
Xinhuan
Asian Sheep Lover
 
Xinhuan's Avatar
 
Join Date: Aug 2007
Location: Singapore
Posts: 3,418
Default Re: How to Stop Literal String Highlight in Notepad++

Quote:
Originally Posted by Arrowmaster View Post
Notepad++ is based of of SciTE so I think this should work. The literal string matching in SciTE doesn't check for balanced sides it just checks for "[=*[" and "]=*]" so you can break it with nesting.

Try the following.

str = [=[
--[[
]]
code here
]=]
Notepad++ does check for balanced sides, but its not 100% foolproof and can be broken. Your example will highlight correctly. but

str = [[
--[[
code here
]]

would highlight incorrectly (it would in fact color the rest of the document as a comment). Of course my literal string example here wouldn't compile.
__________________
Author/Maintainer of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, Routes, HandyNotes and some others.

Last edited by Xinhuan; 1 Week Ago at 01:34 AM.
Xinhuan is offline   Reply With Quote
Old 1 Week Ago   #6
Nevcairiel
Super Moderator
 
Nevcairiel's Avatar
 
Join Date: Aug 2005
Location: Germany/Hamburg
Posts: 1,189
Default Re: How to Stop Literal String Highlight in Notepad++

So its not exactly broken, as it apparently behaves like the Lua parser?

Also, just for correctness, Notepad++ is NOT based on SciTE. Both Notepad++ and SciTE are based on the Scintilla Editor Framework (SciTE initially was a reference implementation), but Notepad++ extended the Syntax Highlighting itself alot, you can even define your own rules, if you wish.
__________________
Author of Ace3, Bartender, Mapster, HotCandy, and various small and helpful addons
WoWAce Administrator and AddOn Moderator
You can Donate if you want, any help is appreciated!
Nevcairiel is offline   Reply With Quote
Old 1 Week Ago   #7
Arrowmaster
Hero Member
 
Join Date: Apr 2006
Posts: 764
Default Re: How to Stop Literal String Highlight in Notepad++

I was just too lazy to lookup how to spell Scintilla.

Does this work?

str = [[
--]]
code here
]]

I completely broke SciTE's syntax highlighting with something like this before.

--[=[
code
--[==[
--]=]
code
--]==]

If you are wondering about my sanity, I would change to first line to have either 2 or 3 -'s and use it as a giant toggle.

Last edited by Arrowmaster; 1 Week Ago at 10:22 AM.
Arrowmaster is offline   Reply With Quote
Old 1 Week Ago   #8
Nevcairiel
Super Moderator
 
Nevcairiel's Avatar
 
Join Date: Aug 2005
Location: Germany/Hamburg
Posts: 1,189
Default Re: How to Stop Literal String Highlight in Notepad++

Quote:
Originally Posted by Arrowmaster View Post
Does this work?

str = [[
--]]
code here
]]
It shouldn't parse in Lua.
__________________
Author of Ace3, Bartender, Mapster, HotCandy, and various small and helpful addons
WoWAce Administrator and AddOn Moderator
You can Donate if you want, any help is appreciated!
Nevcairiel is offline   Reply With Quote
Old 1 Week Ago   #9
Xinhuan
Asian Sheep Lover
 
Xinhuan's Avatar
 
Join Date: Aug 2007
Location: Singapore
Posts: 3,418
Default Re: How to Stop Literal String Highlight in Notepad++

Quote:
Originally Posted by Arrowmaster View Post
I was just too lazy to lookup how to spell Scintilla.

Does this work?

str = [[
--]]
code here
]]

I completely broke SciTE's syntax highlighting with something like this before.

--[=[
code
--[==[
--]=]
code
--]==]

If you are wondering about my sanity, I would change to first line to have either 2 or 3 -'s and use it as a giant toggle.
both of your examples here highlight as expected by Lua parsing rules:

str = [[
--]]

code here
]]

--[=[
code
--[==[
--]=]

code
--]==]

The underlined parts above are what is in "green comment colouring" in Notepad++.
__________________
Author/Maintainer of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, Routes, HandyNotes and some others.
Xinhuan is offline   Reply With Quote
Old 1 Week Ago   #10
Whitetooth
Full Member
 
Whitetooth's Avatar
 
Join Date: Apr 2005
Posts: 119
Default Re: How to Stop Literal String Highlight in Notepad++

You could always edit the source, its easy to do too.
  1. Download src from: http://sourceforge.net/projects/notepad-plus/files/
  2. Comment out the lines responsible for SCE_LUA_LITERALSTRING in \scintilla\src\LexLua.cxx:
    Code:
    			} else if (sc.ch == '[') {
    				sepCount = LongDelimCheck(sc);
    				if (sepCount == 0) {
    					sc.SetState(SCE_LUA_OPERATOR);
    				} else {
    					//nestLevel = 1;
    					//sc.SetState(SCE_LUA_LITERALSTRING);
    					//sc.Forward(sepCount);
    				}
  3. Compile SciLexer.dll
  4. Backup/Replace original SciLexer.dll
  5. Done.

I have one compiled for windows if you feel lazy: http://rapidshare.de/files/48657362/...r.dll.zip.html
Whitetooth is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:45 AM.