• Notepad++ Syntax Highlighting Plugin
    188 replies, posted
  • Avatar of SSAAMM
  • Depending on which disk you're using, YourDisk:\Program Files\ e.g. C:\Program Files\
  • Avatar of Garthex
  • My apologies for leaving the plugin out of commission for so long. It's fully functional now and I'm looking into adding new features such as a function list and auto-complete. So, without further ado: [b]Version 1.2 has been released![/b] * Fixed the issue created when N++ switched to Unicode from ANSI. * Converted the plugin to the system created by Thell Fowler. (thell@almostautomated.com) * Updated GmodLua.xml to reflect the most recent lua function set. * Removed the unoptimized and lite versions. [url]http://code.google.com/p/npp-gmod-lua/downloads/detail?name=NppGmodLuaPlugin-1.2.zip[/url]
  • Avatar of jonney934
  • Awesome, thanks! I have been wanting to be able to use this with the most recent Notepad++.
  • Avatar of JSharpe
  • [QUOTE=Garthex;13632369]My apologies for leaving the plugin out of commission for so long. It's fully functional now and I'm looking into adding new features such as a function list and auto-complete. So, without further ado: [b]Version 1.2 has been released![/b] * Fixed the issue created when N++ switched to Unicode from ANSI. * Converted the plugin to the system created by Thell Fowler. (thell@almostautomated.com) * Updated GmodLua.xml to reflect the most recent lua function set. * Removed the unoptimized and lite versions. [url]http://npp-gmod-lua.googlecode.com/files/NppGmodLuaPlugin-1.2.zip[/url][/QUOTE] Heads up, auto function complete has already been done: [url]http://www.facepunch.com/showthread.php?t=588255[/url]
  • Avatar of Garthex
  • [QUOTE=JSharpe;13635087]Heads up, auto function complete has already been done: [url]http://www.facepunch.com/showthread.php?t=588255[/url][/QUOTE] Oh, awesome! Are you generating the function list similar to how I generate it? If you have functions that my generator can't generate, I can incorporate it. Also--I can look into the '.' issue in N++ if you can help describe the problem to me in more detail. Or any other problem that can be fixed by a patch to N++.
  • Avatar of JSharpe
  • [QUOTE=Garthex;13636265]Oh, awesome! Are you generating the function list similar to how I generate it? If you have functions that my generator can't generate, I can incorporate it. Also--I can look into the '.' issue in N++ if you can help describe the problem to me in more detail. Or any other problem that can be fixed by a patch to N++.[/QUOTE] [quote=Stupid JSharpe] Yeah i'm using the same way you did the list, just slightly different structure. And i'll try to explain it in as much detail, but it's best trying it yourself too. Basically, NP++ in the lua language automatically thinks that after a "." it is a new function name. So you can start typing out tim (for timer) and the dialog box will show up. Carry on typing until you get to timer (don't put the full stop on yet) and the dialog box shows you all the timer functions. Now add a "." in to the end to create "timer." and you will notice that that dialog box goes away. If you force opening the auto completion dialog box it then it will think you are making a whole new function entirely, and starts from the top. I have looked into it myself, looking at some of the base code from the source and the configuration .xml files and i can't seem to find a way to fix it. I've tried taking away/adding different functions/parameters to the .xml files so that NP++ knows that when it's on the lua language to not interperate a "." as a function ending. Yet i have got no where with it. Some one else was able to make me a plugin for it, though he couldn't compile it due to missing headers. It's the exact same for the parameter hinting too i tried to implement. [/quote] Infact i just did a retest and it seems to be working perfectly fine besides this: [url]http://upload.xer0.info/uploads/a3dvfqle/Untitled.gif[/url] (don't take the return types as an error, it was just testing purpose i put bool and action) Unless that's a silly error i made i can get to work on a parameter list straight away. Could some one confirm if the "."s do interfier with it please and post results? Could just be i over looked it and tried doing too much testing at once and missed a few things.
  • Avatar of aVoN
  • Thanks for the update. And for anyone how now upgraded to the UNICODE version and finally found out "function list" does not work there anymore: Here is a UNICODE recompile. [url]http://randronov.blogspot.com/2008/11/function-list-for-notepad-5x-unicode.html[/url] Sadly, this wonderfull addon here is does not work with the function list. I already tried to edit the "plugins/config/FunctionListRules.xml" with no success (my idea was adding a new paragraphe by copy & pasting the "Lua" part and naming it "Gmod 10 Lua".)
  • Avatar of JSharpe
  • [QUOTE=aVoN;13636954]Thanks for the update. And for anyone how now upgraded to the UNICODE version and finally found out "function list" does not work there anymore: Here is a UNICODE recompile. [url]http://randronov.blogspot.com/2008/11/function-list-for-notepad-5x-unicode.html[/url] Sadly, this wonderfull addon here is does not work with the function list. I already tried to edit the "plugins/config/FunctionListRules.xml" with no success (my idea was adding a new paragraphe by copy & pasting the "Lua" part and naming it "Gmod 10 Lua".)[/QUOTE] I was able to get function list working with GMod10, i was fucking around with alot of the configuration files and got it working on GMod10, though it's been a long while and the only screen shot i have is when i showed #luahelp how far i have got so far since Rambo_Sechs wanted it. [img]http://upload.xer0.info/uploads/333g/luv_Marine.png[/img]
  • Avatar of JSharpe
  • [QUOTE=aVoN;13637856]JSharpe, this is a joke right?[/QUOTE] The functions where just testing purpose. Rambo_Sechs wanted proof i got it working. I uploaded a pic. it's the only one i have left aswell.
  • Avatar of Garthex
  • I'll look into both. I have the source code for the function list plugin and I can rewrite some of it to work with external plugins if needed. I'm sure Jens will be happy for the patch anyways. As for the auto-complete, there may or may not be a solution, but I'll also look into that.
  • Avatar of aVoN
  • Did you came further? Because I really [b]need[/b] the function list but your highlighting addon made me addictive. I'm constantly switching between both styles (Lua/GMod 10 Lua) which annoys me. Today, I downloaded the source of the function list addon and saw this: [code] case L_LUA : { _strKeyWBBeg = ""; _strKeyWBEnd = "\\<do\\>|\\<if\\>|\\<function\\>"; _matchCase = SCFIND_MATCHCASE; _commList.addParam("\"", "\""); _commList.addParam("\'", "\'"); _commList.addParam("--"); _commList.addParam("--\\[\\[", "\\]\\]"); bufSyntax.strRegExBegin = "^[- \\t]*function[ \\t]+"; bufSyntax.strRegExEnd = "[ \\t]*\\([0-9A-Za-z_,. \\t]*\\)"; bufSyntax.strRegExFunc = "[0-9A-Za-z_:.]+"; bufSyntax.strBodyBegin = ""; bufSyntax.strBodyEnd = "\\<end\\>"; bufSyntax.strSep = ""; _searchSyn.push_back(bufSyntax); bufSyntax.strRegExBegin = "^[- \\t]*"; bufSyntax.strRegExEnd = "[ \\t]*=[ \\t]*function[ \\t]*\\([0-9A-Za-z_, \\t]*\\)"; bufSyntax.strRegExFunc = "[0-9A-Za-z_:.]+"; _searchSyn.push_back(bufSyntax); /* bufSyntax.strRegExBegin = "^"; bufSyntax.strRegExEnd = "[ \\t]*="; bufSyntax.strRegExFunc = REGEX_SPLUS; bufSyntax.strBodyBegin = "\\{"; bufSyntax.strBodyEnd = "\\}"; bufSyntax.strSep = ""; _searchSyn.push_back(bufSyntax); */ break; } [/code] Since I know what this means, couldn't you just simply add another case to the switch with "L_GMODLUA", and recompile it? (Simply search the files for L_LUA and where it appears (just 2 times), also add a "L_GMODLUA" equivalent) I searched your highlight addon, but something like "L_GMODLUA" does not exist. The only closest to it I found was "l_gmodlua", but I have no idea if this is the correct one. I'm also unable to test, if this would work, because I'm not familiar with C++. Also I'm sure, a simple recompile of the function list addon might be sufficient since it isn't getting developed anymore :(
  • Avatar of aVoN
  • Ah, and before I forget: I also tried deleting Notepad++'s default Lua style and then I renamed your style-data from "Gmod 10 Lua" to "Lua". This worked, but just for a few keywords and with mixed up colors.
  • Avatar of Rago
  • I installed this but how can i run this Everything is still same :( EDIT: NVM found it :D
  • Avatar of aVoN
  • Any news on the function-list update? I principally showed how to add this feature by recompiling function-list. Sadly I'm unable to - I never did anything in C++.
  • Avatar of Garthex
  • Jens released Function List 2.0 BETA recently, so I've recompiled it to work with this plugin. (had to fix some bugs) [b]To Install:[/b] Just extract it to the plugins folder and it should work. I'm sure there are bugs, so let me know! Google Code: [url]http://code.google.com/p/npp-gmod-lua/downloads/detail?name=GmodLua_FunctionList_v1.0.zip[/url]
  • Avatar of CowThing
  • I found a bug; when the current file on screen is a normal text file and the function list is open, opening a Lua file crashes NP++. [editline]More info on bug[/editline] Hmm, it only happens sometimes though.
  • Avatar of Garthex
  • Yea I noticed that too. Unfortunately Function List is in Beta at the moment, so until Jens fixes a lot of the bugs, we're going to have to deal with the occasional crash. Hopefully the features are worth it. Save often! =D
  • Avatar of bromvlieg
  • at the top bar plugins>function list>list btw, its never crashing here.... and one bug, it sees "text" as a string, but not 'text' might fix since i often use '' instead of "" :P
  • Avatar of Garthex
  • Can you give a snippet of code to show me where it doesn't work properly?
  • Avatar of kevkev
  • I noticed that NP++ crashes when you have closed a tab and then open a new tab. [editline]07:33AM[/editline] [QUOTE=bromvlieg;15327727]at the top bar plugins>function list>list btw, its never crashing here.... and one bug, it sees "text" as a string, but not 'text' might fix since i often use '' instead of "" :P[/QUOTE] Works fine for me.
  • Avatar of bromvlieg
  • [QUOTE=Garthex;15333507]Can you give a snippet of code to show me where it doesn't work properly?[/QUOTE] if test == "porn" then shit = 'yah' elseif test == 'lol' then shit = "nope" end EDIT: colors seem to work of the leter itself, sry but the background collor like gray, wont.
  • Avatar of aVoN
  • [QUOTE=Garthex;15287337]Jens released Function List 2.0 BETA recently, so I've recompiled it to work with this plugin. (had to fix some bugs) [b]To Install:[/b] Just extract it to the plugins folder and it should work. I'm sure there are bugs, so let me know! Google Code: [url]http://code.google.com/p/npp-gmod-lua/downloads/detail?name=GmodLua_FunctionList_v1.0.zip[/url][/QUOTE] This saved my day. Thank you really really much!