Is it possible to show the number of occurrences of words which are smart highlighted? I mean when you double click on a word.
In Matlab e.g. smart highlighting is activated by having the cursor touching a word and in the tool bar it instantly says for instance 4 usages of "weight" found
.
Doing a search for the word/phrase will give you the same information, but how about having the count directly be shown somewhere?
BTW: Can smart highlighting be activated in a different manner than double clicking?
Open your Notepad++ by double-clicking the shortcut or searching it through the Windows search feature. Click on File and choose the Open option to open your document. Opening a file in Notepad++ Now click on the View menu in the menu bar and choose the Summary This will show you the word count of the document.
Currently “Sel:” shows how may letters and how many lines are selected.
+\b\1\b) Click on the Count button, or hit the ALT + T shortcut.
You first need to enable this feature in Notepad++. Do this by going to Settings → Preferences → Editing and then enable Multi-Line Edit. Now when you hold Ctrl and click around your text, a cursor will be left at the location of each click.
You can get counts of words or matches in other ways.
The normal Find window has a Count button. If you press it, it will display the total number of items found in the status bar of the find window.
Also the Mark tab of the Find window shows the number of items found when Mark all is pressed. In addition, the items found by this kind of search are highlighted permanently.
Found the answer here.
SelectedTextCountIntoStatusBar.py
def callback_sci_UPDATEUI(args):
if args['updated'] & UPDATE.SELECTION:
matches = []
if editor.getTextLength() < 100000: # don't search "big" files
if editor.getSelections() == 1 and not editor.getSelectionEmpty():
try:
editor.research(r'\Q' + editor.getSelText() + r'\E', lambda m: matches.append(1))
except:
matches = []
l = len(matches)
notepad.setStatusBar(STATUSBARSECTION.DOCTYPE, ' ' if l == 0 else '{} occurrence(s) of selected text'.format(l))
editor.callback(callback_sci_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With