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?
As of now, Notepad++ does not show the count for smart highlighting (i.e. highlighting words by double-clicking on one occurrence).
As an alternative:
Search > Find...
)Mark
tabFind What:
input areaMark All
This will mark all the occurrences as well show the count of matches in the status bar.
There is another alternative for smart highlighting using
Style Token
which is available from the right-click context menu. Watch the animated tutorial below: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])