Update
Command line "TitlePart ClassWindow CurrentWord TestFlag" supported for 3rd party Scintilla editors.
Now you can use the same executable for PureBasic, SciTE, Notepad++. In the description of the program, I added configuration files for SciTE and Notepad++
Video of how it works
Show all occurrences of a word in the IDE
Re: Show all occurrences of a word in the IDE
Update (download)
When searching for tmp$ variables, the \$ character is escaped and as a result I get tmp\$
Two regular expressions for searching strings
The search for which procedure a word is in can be speeded up by obtaining the positions of all procedures and line numbers in one pass through the file, and then compare whether the word is inside the positions that are marked as the beginning and end of the procedure. This is faster than searching backwards, as it forces you to navigate through the same text multiple times.
Uploaded it again. Improved the source code for Linux
When searching for tmp$ variables, the \$ character is escaped and as a result I get tmp\$
Code: Select all
; Escape metacharacters in SelectedWord
rex1 = CreateRegularExpression(#PB_Any, "[][{}()*+?.\\^$|=<>#]", #PB_RegularExpression_NoCase)
If rex1
Text\s = SelectedWord
RegexReplace2(rex1, @Text, "\\0")
SelectedWord = Text\s
FreeRegularExpression(rex1)
EndIf
Code: Select all
AddGadgetItem(#cmbRex, -1, "(?# String )(?m)~?" + #q$ + ".*?[^\\]" + #q$)
AddGadgetItem(#cmbRex, -1, "(?# ~String )(?m)~" + #q$ + ".*?[^\\]" + #q$)
Uploaded it again. Improved the source code for Linux
Re: Show all occurrences of a word in the IDE
I request a very practical extention of that Tool
I tried to use it as a help to declare public functions of a Module
That's possible if you slect show all Procedures and then copy it wiht right Mouse-Click.
Then I paste It into a new File in PB-IDE, replaced all Prucedure with Declare and removed empty lines.
Then I removed private Functions.
Here the idea for the new function
- search for all Public Procedures (eliminate such which start with '_' what's the most used sign for private
- integrate a copy function what copies the Procedures as Declare statements to the Clipboard
I tried to use it as a help to declare public functions of a Module
That's possible if you slect show all Procedures and then copy it wiht right Mouse-Click.
Then I paste It into a new File in PB-IDE, replaced all Prucedure with Declare and removed empty lines.
Then I removed private Functions.
Here the idea for the new function
- search for all Public Procedures (eliminate such which start with '_' what's the most used sign for private
- integrate a copy function what copies the Procedures as Declare statements to the Clipboard
Re: Show all occurrences of a word in the IDE
for information, my own tool made with a scintilla gadget is updated, see the very first post.
M.
M.