How can I unmark any seperated word?
-
When I write any things with notepad++ frequently I mark any word(From menubar [search-mark-tick in selection-click Mark All]),But It is impossible for me to unmark one or two word,It just unmark all word [search-mark-tick in selection-click Clear all mark] which I have marked previously.I really want to know how can I unmark not all word which I have marked, but just one or several word.
and I enabled multi editing setting(setting-preferences-Editing-tick Multi Editing Settings).I use ctrl+mouse click in order to highlight any seperated word but It seems that It just highlight only one color and canât highlight any word with two or three colors.Is there any method to display two or three color when I use Multi Editing in notepad++?
-
Currently there is no way to âunmarkâ partially. As you noticed it is an all or nothing clearing of marking.
Regarding your second question, I for one am not following what you are asking about.
-
Then,Would you recommend any editor of notepad++ alternative which enable me to highlight Non-Contiguous word(seperated word) in two or three colors?
-
Then,Would you recommend any editor of notepad++ alternative which enable me to highlight Non-Contiguous word(seperated word) in two or three colors?
this is a very good and nicely paradoxic question. i like. đ
i suppose that most users at the notepad++ community are mainly notepad++ users, and most people that have found a more suitable editor, will hang around at the community forum of their respective new editor, hence not visiting the notepad++ community.
so even if they know which one would be best, they probably could not answer this question, due to their absence at this platform.so the big question is how can anyone find the most suitable editor for all own personal needs, without trying out all of them ?
-
@sang-heon-baik said:
Then,Would you recommend any editor of notepad++ alternative
Nope. :)
canât highlight any word with two or three colors
Well, you can do this with Search > Mark All > Using xxx Style multiple times, but you canât partially undo it later (in relation to your first original question).
-
concerning your first request of deleting existing marks resulted from mark dialog,
if you donât mind to install pythonscript plugin you might be able to get around this limitation by using a script like thisFIND_MARK_INDICATOR = 31 for i in range(editor.getSelections()): start = editor.getSelectionNStart(i) end = editor.wordEndPosition(start, True) editor.setIndicatorCurrent(FIND_MARK_INDICATOR) editor.indicatorClearRange(start, end-start)
You would either double click the word or select the whole word and run the script
to clear the marks. Works with multiedit setting as well. -
I was thinking of a Pythonscript, too, but then I thought what if a user marks with a regular expressionâŠhow to tell the script the regex to unmark. It gets complicated. I like yours, unmarking possible only for simple, selectable textâŠ
-
user marks with a regular expression
that what made me holding back at first glance as well but then I thought, at least
a possible workaround even if it doesnât fit into every possible unmark wish.
Letâs see what OP is thinking about it. :-) -
Yea, I often donât do things because I see the complications right from the beginning. Or maybe more accurately, I overcomplicate it from the beginning⊠:)
-
maybe more accurately, I overcomplicate it from the beginningâŠ
LOL :_D - A good advise which I should have known by yesterday - wink, wink
-
@Meta-Chuh
It seemed that I misunderstand there must be some of veteran user in notepad++ community who have a lot of experience in text editor field So they would already known what text editor is able to highlight seperated word in two or three color.@Alan-Kilborn
I follow your advice(Search > Mark All > Using xxx Style) but it is impossible to highlight selected word in two color. For example, If I selected just letter âaâ from below word, It only highlight all of letter âaâ in different color. I want to highlight just two or three of letter âaâ from below word and it must be different color each to each.aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
ssssssssssssss@Ekopalypse
Thank you very much for your wonderful plugin,It really remove any mark which I selected.But if there is any mark which is created by Mark All command(Search > Mark All > Using xxx Style),your plugin cannot remove them⊠-
if there is any mark which is created by Mark All command(Search > Mark All > Using xxx Style),your plugin cannot remove themâŠ
You are correct, would you mind specifying how exactly you want it to behave?
If you just want to have a single script which clears every possible mark indicator
we could change it like soINDICATORS = [21, 22, 23, 24, 25, 31] for i in range(editor.getSelections()): start = editor.getSelectionNStart(i) end = editor.wordEndPosition(start, True) for indicator in INDICATORS: editor.setIndicatorCurrent(indicator) editor.indicatorClearRange(start, end-start)
but if you want to have a different behavior just let me know.
I want to highlight just two or three of letter âaâ from below word and it must be different color each to each
Sorry, but still confused about this.
Letâs assume you have a text like thisJust a sample text with a couple of a like in apple
Now if you select the
a
in betweenJust
andsample
,
you want to have automatically selected
a
fromsample
,
a
beforecouple
,
a
beforelike
anda
inapple
and each of them in different color?
Or something else? -
@sang-heon-baik said:
I follow your advice(Search > Mark All > Using xxx Style) but it is impossible to highlight selected word in two color. For example, If I selected just letter âaâ from below word, It only highlight all of letter âaâ in different color. I want to highlight just two or three of letter âaâ from below word and it must be different color each to each.
The feature is called âMark allâ. Thus if you highlight a single
a
and invoke the feature, of course it will do all of thea
present.Regarding âtwo colorâ, what I meant was, if you first color with, say Style1 and then you color the same thing with Style2, what will result will be a color combination of the colors of Style1 and Style2.
Is there still remaining confusion? I think the answer is that you canât do what you are trying to do.
-
@Ekopalypse
your script is excellent.I am content with your script.With your example of below text, I intend to highlight letter âaâ in between âJustâ and âsampleâ in blue color, and to highlight letter âaâ in between âofâ and âlikeâ in green color.
Just a sample text with a couple of a like in apple
But As Alan Kilborn said, Notepad++ wonât support to highlight(mark) seperated word in respectively different color.So It would be impossible that your script Implement the function of my request.
-
It would be impossible that your script Implement the function of my request.
Thatâs not exactly true.
It is true that Notepad++ does not provide such a function,
but that doesnât mean that we canât create it with a python script.
For example, putting the cursor into a word (no selection) and running this script
would result in marking the current word and the next 2 occurrences in different color.
Using style1, 2 and 3.def find(): current_pos = editor.getCurrentPos() start = editor.wordStartPosition(current_pos, True) end = editor.wordEndPosition(current_pos, True) text = editor.getTextRange(start, end) document_end_pos = editor.getTextLength() while start: yield start, end pos = editor.findText(0, end, document_end_pos, text) if pos is None: break start, end = pos _find = find() number_of_matches = 3 try: for i in range(number_of_matches ): start, end = next(_find) editor.setIndicatorCurrent(21+i) editor.indicatorFillRange(start, end-start) except StopIteration: pass
-
@Ekopalypse said:
marking the current word and the next 2 occurrences in different color
It can be done, but is there value in that? Not sure Iâm following what the OPâs true end-goal is, and how something like that helps.
-
I agree, I canât see the benefit too but I hope the OP will clarify why this is a good thing.
:-)