![]() When the new window pops up, find the first on the left and click it. ini file to your PSPad editor\Syntax folder On the new window that pops up, click the Import button and browse to the included xml file.Ĭopy the contained. #Ultraedit lua freeI'd like to hope it's just my inexperience with the program, so if you have experience with syntax highlighting in Notepad , please feel free to edit it.Ĭopy the uew file to your %APPDATA%\IDMComp\UltraEdit\wo rdfiles\ folder, and make sure Ultra-Edit is configured to look in that folder by going to:Īt the top of the right hand side, under the heading "Full directory path for wordfiles" browse to the wordfiles folder #Ultraedit lua archiveYou might uncomment these two code lines if you want lines with just spaces/tabs to be automatically trimmed by the script too.The archive linked at the bottom of the post contains syntax highlighting files for Lua that include LotRO classes, methods and events for Ultra-Edit, PSPad and Notepad Finally please note that I commented out two code lines. Please let me also know if something is not working as expected by you. Please let me know if you want the single script to add/remove line comments depending on - in first non-blank line after 0 or more spaces/tabs split up into two scripts, one which adds always line comments and another one which removes always line comments. ![]() #Ultraedit lua windowsI tested the script with UltraEdit for Windows v22.20 (last for Windows XP) and v28.10 (currently latest version) for hopefully all possible selection scenarios. Join the lines back to a single string and write it to the file. Add/remove comment from all non-blank lines.ĪsLines = asLines.replace(rReplaceRegExp,sReplaceString) Do the comment add/remove on all remaining non-blank lines.įor ( nLineIndex < asLines.length nLineIndex ) Var sFirstTwoChars = asLines.substr(nFirstCharPos,2) Get the first two characters of the line after 0 or more spaces/tabs. asLines = "" // Trim lines containing only spaces/tabs.Ĭontinue // Ignore lines containing only spaces/tabs. If (nFirstCharPos < 0) // Does the line contain only sapces/tabs? If (!asLines.length) continue // Ignore empty lines. applied on all lines of the selection, otherwise a comment add.įor (nLineIndex = 0 nLineIndex < asLines.length nLineIndex ) after 0 or more spaces/tabs in which case a comment remove is Find out if the non-blank line has a line comment at the beginning Split up the loaded block into an array of lines. already loaded block with deletion from the active file. Select the rest of last selected line and append it to selection ends at end of file with no line termination. the last selected line was not completely selected or the The user selected a block spanning over multiple lines, but If (sBlock.substr(sBlock.length - sLineTerm.length) != sLineTerm) Does the selected block not end with a line termination? ![]() Is the line termination already determined? the rest of the line and append it to the already loaded block. The user selected most likely just a part within a line. or just carriage return in the loaded block? Is there no carriage return line-feed or just line-feed Determine the line termination type from selected block. ![]() must be also loaded from file and prepended to the already loaded block. reason the string from current caret position to beginning of the line The selection started somewhere in the middle of a line and for that Load the selected block as string into memory of script. ![]() at end of the file and there is no line termination at end of the active file. Further there must be taken into account that the selection ends line and end of last selected line with including the line termination of last more or less expand the selection of the user to beginning of first selected For that reason lots of extra code is necessary to But the user can start a selection anywhere inside a line and end it also It is necessary that entire lines are selected for correct comment add/remove. Is there nothing selected in active file? If (typeof(lumnModeOff) = "function") lumnModeOff() Įlse if (typeof() = "function") () Code: Select all if ( > 0) // Is any file opened? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |