Bugs: Indent & Surround is messing up CRLF line endings Bugs: Delete Blank lines won't delete every line if only blank lines are marked. To install this plugin, unpack NPPTextFX.DLL and NPPTextFX\*.HTM;*.TXT ;*.INI to the plugins folder in the N++ install folder then load N++. Delete those files without N++ running to remove the plugin. If everything is working, a Plugins menu will appear and the new tool should be listed under it. To develop this plugin if you have the source, unpack the entire structure to the plugins folder. Dev-C++ and Code::Blocks projects are provided. All the compilers are supported but OpenWatcom32 1.3 produces a DLL that is incompatible with Windows 98. To view this demo, load it into Notepad++ and perform the actions suggested to see how they work. If many tools are similar, only a few may be shown. No descriptions will be provided for tools that are totally obvious. **Demo: Characters Menu **Demo: NPPTextFX Programmers waste lots of time and make lots of mistakes doing repetetive but simple tasks. TextFX performs a lot of very odd transforms the purpose and usage of which may not be immediately obvious from the menu descriptions even if you perform them manually on a regular basis. Because of the limited user interface implemented, some transforms require obscure actions on your part. This demo will show you in detail what the transforms do and how they are used. Always remember that no matter what happens, Notepad++ can undo it so you can try again, unless of course, you ask TextFX to erase the Undo Buffer. **Demo: Quote Changers & Text Converters all require some text to be selected You are often programming several languages at once and each may have different quote ("') rules. The Quote Changers allow you to alter quotes in large blocks in ways that are neither easy nor reliable with normal or regex search and replace. The rules are not tied to the current language selected since some languages are embedded in others. ... This PHP code is incorrect since proper HTML tolerates ' but prefers ". echo "<Action type='1' message='2170' wParam='0' lParam='0' sParam=' ' />\n"; ... We can use the Swap Quotes to alter it to this: echo '<Action type="1" message="2170" wParam="0" lParam="0" sParam=" " />\n'; ... but that is still not correct because \n does not expand inside of 'PHP' strings. ... Undo that and Escape ' to \" to get the correct result. echo "<Action type=\"1\" message=\"2170\" wParam=\"0\" lParam=\"0\" sParam=\" \" />\n"; ... Doing this is neither reliable nor easy with search and replace. **Demo: Zap all characters This tool is usually used with a rectangular selection on text that is in columns. All it does is convert every character to a space, useful for erasing columns so that new text can be written in. It easily zaps all characters in a non rectangular selection but I can't think of any reason why this would be useful. Zapping all non **Demo: Zap all non printable characters to # No compiler will accept following math but it's not immediately obvious where the problem is. Mark it and zap all characters to # and you'll immediately see what the compiler doesn't like. Any character that isn't a part of standard ASCII (32-126 TAB CR LF) is replaced with a # sign. Typically you'll want to undo any changes this tool makes and manually make the corrections. The purpose is to make it easy to find where the odd characters are. c=x�4; **Demo: Quick Menu (this menu can be pulled out of the Plugins menu by ticking Move quick ... in TextFX Settings) **Demo: Mark word or find Reverse/Forward Programmers need fast and handy ways to jump to different points in a file. In this file, there are some printf statements. Search-Find is clumsy because it requires so many check boxes and text entries to get what you want. Instead, you can move to the nearest printf and hit Ctrl-Alt-DOWN ARROW. If nothing is marked, the nearest word will be marked, and when you hit the key again, the next occurance will be found and remarked to make it easy to find again. You can easily navigate between every such word in this file, including using Ctrl-Alt-UP ARROW to come right back up and continue the demo. If the automatic word selection is insufficient you can make a more precise selection and search for that. Some languages and situations will require that the search word be case sensitive. To make movement fast and easy, no beeps or screen flashes occur when the text is not found. For example, we want to write a new convert() all line but we have forgotten the proper calling sequence. I've written in "convertall" below so I can return to this point then we can find the next occurance to see how the function is used, make a copy, and bring it back. convertall **Demo: Matching Brace tools require a brace to the left or right of your cursor. The left will be used if there is a brace on each side. You may optionally select the brace but this is usually not necessary. Mark to matching brace is best used to grab () enclosed text. In the following, we would like to move (bktpos=...) somewhere else but it's hard to visually pick out the correct ending parenthesis because of the confusion. Place your cursor to the left of "(bkt..." and select "Mark to matching brace". We can be to the left because there is no other brace to the left of the carat that could be used instead. You could also place your carat to the right of the ) if you knew which one it was. if (curpos>0 && (bktpos=SendMessage(getCurrentHScintilla(currentEdit), SCI_BRACEMATCH, curpos-1, 0))>=0) { Mark lines to matching brace is best to grab complete function, do, while, and if code blocks. We want to move the following struct somewhere else. If we were to select Mark to matching brace, we would need to manually augment the selection to include the "struct NppData" and some whitespace at the end which is quite difficult. Place your cursor on either { or } and select Mark lines to matching brace. struct NppData { HWND _nppHandle; HWND _scintillaMainHandle; HWND _scintillaSecondHandle; }; ... Notice that lines are marked after the end of the } up to the next non CR/LF so the entire function along with the trailing whitespace is marked. No whitespace left behind! If demand warrants I'll support crossing over "} else {" lines to reach the end of the if statement. **Demo: Edit Menu **Demo: Fill down & insert We have just modified the convertall() function to take an additional integer parameter after the first char. I have modified the first line with the new desired value but I'd prefer not to hit the down-left sequence that everyone loves to hate. Having recently lined up the by a (,), I'd prefer making a rectangular selection around the text and the lines to which it is to be copied and having the editor insert the text for me when I pick Fill down & insert. Spreadsheets have done this for like, ever. Why can't editors do it? v Alt-Click before the 0 convertall('c',0,"'" ,"\"" ,NULL,NULL);} convertall('c',"\"" ,"'" ,NULL,NULL); } convertall('C',"\"'","'\"",NULL,NULL);} ^drag until after the slash (for demo above) ^drag until after the 0 (for demo below) Thanks to us putting in the wrong value, we can demonstrate the other fill tool. We want all (1) ones to be in that newly created parameter. Change the first one to a (1) one then box out a single column for the 3 digits vertically. Select Fill down & overwrite and they will all switch to ones. **Demo: Insert (Clipboard) at column through lines This demo is tricky at first but is quite easy when you get used to it, much easier than hitting down-left-text-down-left-text... The first step is to specify the text to be inserted. The following lines need to have id changed to "testid". First, we mark the word test (<- you can mark that one if you want) and copy that to the clipboard. Then, we mark the following text without the Alt key starting just before the i of id and mark down to just before the i of the last id, then select Insert ... through lines. In standard editors, transforms typically do something to the entire selection. For a programmer's editor, we don't adhere to that rule for substantially greater functionality. v-start before this i <Item id="42001"/> <Item id="0"/> <Item id="42022"/> <Item id="42023"/> ^end before this i ... inserting is not limited to static text. You can use # to specify incrementing counters and $+-number$ to insert before, at, or after the end of line. Here are some // Examples: // "text" insert text // "#" insert 0..1..2..3... // "#5" insert 5..6..7..8..9... (the default increment is +1) // "#5+2" insert 5..7..9..11... // "$#5-2" insert 5..3..1..-1... at end of line // "$$M$soft" insert M$soft at end of line // "$4$text" insert text 4 characters beyond end of line. line will be ammended as necessary // "$-3$#-5-2" insert -5..-7..-9..-11... 3 characters before end of line. lines that are too short will be skipped This capability is likely to be expanded greatly when someone thinks of how. **Demo Reindent C++ code: This feature is begged for over and over in editor forums. It's a shame that more editors don't have it since it is easy enough to implement. It calculates the starting indent from the first marked line then simply counts { and } to increase and decrease the indent. This is not intended to be a full styler. All it does is reindent, particularly so you can find that bracket nesting error which is suddenly causing everything to crash. If you code doesn't compile, you might get some unexpected indent results. There are some special cases: 1) Indents for /* stream comments */ are not changed. ...
michalgoga19821