-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style Token not applied consistently within words #9751
Comments
This might be related to #5148 |
Discussed in the Community in the 7.9.5 release announcement thread, starting with this posting: https://community.notepad-plus-plus.org/post/64738 |
Note: "Style Token" > Using 1st Style is not an official name for the command. It (the "Style Token" part) is a right-click context menu folder grouping name. The command is actually found in the Search menu, submenu Mark All, then Using 1st Style. |
It is my idea to improve the situation described by this issue by adding the following: Only possible to have one item checked. The "classic" setting preserves existing behavior. I wasn't sure the best way to express "partial" word matching, because of course a "whole" word matches also when "partial" is in effect. So I expressed it as "partial/whole"...there may be a better way to express it. @donho and others, what are the thoughts about it? |
The idea behind "classic" settings was to retain how settings for the feature currently (7.9.5) work...but...there is a lot of overlap between classic and "use Find dialog" settings. Not total overlap however. My feeling is that probably "classic" should be dropped as a choice, but then there would be no retention of existing behavior. Of course, the existing behavior is a bit confusing for users... |
Creating a sub-menu makes the solution too complicated for users. Features in the context menu, such as Style Token, should be simple. The main issues I reported are that the matching behavior is inconsistent and using Find dialog settings makes no sense to someone right-clicking on a word. If someone breaks the link to the Find dialog settings, they'll have to choose a matching algorithm. I suggested matching within words. As far as I'm concerned, breaking the link to Find and matching within words is a complete solution. It seems like Mark All and Find are sharing code. I would look for a way to make the parameters relating to Find optional. Then Mark All and Find can share without affecting each other. I come from a discipline where you would pass those parameters explicitly. Instead, maybe the optional parameter can be whether to use the Find state or a hard coded state. It might be worth naming these features consistently if Search > Mark All and Style Token are the same. I found this article helpful: |
Thank you for your thoughts.
The suggested submenu is a "settings" area; users can ignore it (their choice) but for those that want extra configuration power, they will have that capability. It is probably not something that is changed before every "Mark All" operation; users will have their preferred way of working and probably set it one time and then forget about it.
I attempted to explain earlier, but the existing "Mark all" feature has more capability than what "Style Token" in the context menu implies.
And my addressing the issue acknowledges that.
The only sharing relevant to the discussion here is that currently Mark All grabs the case and whole word settings from the UI choices on the Find window, in certain circumstances.
Probably a good solution for the way you use it; maybe not good for everyone.
Apparently the author of Notepad++ likes the Style Token nomenclature in the context menu.
The reason that this is often the case is that if you remove parts, then something that has worked perfectly for N number of users for years is now broken. Now, you may think it is broken as it is, but I'm sure others would disagree, perhaps vehemently so. |
@sasumner |
@sasumner Although the above comment is not optimistic anyway to solve it in this way. |
Yes. It makes no sense for "Mark One". |
So the existing "mark with style" commands are supposed to be "lightweight" and not heavily UI involved. To keep with the spirit of lightweight UI, I came up with the design I did. Certainly we have precedent for "settings" within menus, here's one for example: I really wish people would have commented on the core idea presented in the issue, BEFORE I decided to go to the trouble to code it and prepare a PR. It's acknowledged that sometimes people trying out the exe from the PR generates additional commentary -- that is certainly acceptable -- but really isn't the case here. |
Yes, I know this one. It is an acceptable exception because
Sorry about that. I'm overwhelmed by all the issues and I cannot keep an eyes on all the issue activities (especially when I'm coding). I'll be more aware of the issue activities. |
These also seem to be somewhat of "settings within menus": Do the settings I've proposed above belong in the Preferences section? I think that tucking what I've proposed into the spot pointed out by @ArkadiuszMichalski might be a valid "exception" -- it feels better to me to be contextually close to the functions it affects -- much like the "save as *.*..." is better in the SaveAs dialog than located far away in the Preferences.
I suppose the mail could say "can you have a look at issue # xxxx comments?" |
Not for me. They are actions to turn each visual effect ON or OFF. Another point in your suggestion bothers me is these options for "Mark All". Putting "mark all" feature options aside, this issue (bug) is about Style Token not applied consistently, so I prefer to focus on fixing the bug than reconfiguring matching token possibility.
Yes, please.
No, I get a notification for every single issue/pr and all the conversation: I have to click on each message to find if I'm mentioned. |
I think we have a misunderstanding.
The 6 options allow ONE visit to the menu to set what you want.
Hmmm.
Ouch. |
Does this mean you are taking this issue over from me? Also note that this is a bit of an involved issue that I have done a complete investigation on already. |
If there was a way to always set "style token" to "whole word" matching, that would be nice for my workflow. :-) |
Yes, I just set the filter "@donho", it seems work fine - I won't have any excuse from now on :)
If I wanted to take over this issue, I would ask you before, then unassigned you. But it's not my intention.
Yes & no. Yes for the principle: such settings should always be in Preferences dialog. This issue is certainly a bug because the behaviour is not consistent. The fix for me is to define a consistent way. What @Ekopalypse has suggested (always set "style token" to "whole word" matching) could be the final solution. |
That is a good thought, except, from the data we have, there are 2 opposing opinions on a consistent way: OP says:
Eko says:
|
I think this is a twofold problem:
We have a similar feature called "Smart Highlighting": Double-clicking a word highlights other instances of the same word (or words that contain the clicked word, depending on option "Match whole word only", see below) in the whole text. These are the options to configure this feature: The three checkboxes in the red square are coupled together:
Notepad++ currently lacks a similar logic consisting of the same three settings for the styling feature. Maybe the preferences dialog's "Highlighting" group could be renamed to "Highlighting and Styling" to add a new groupbox entitled "Styling" which would contain the settings "Match case", "Match whole word only" and "Use Find dialog settings". Maybe the setting "Style in other view" could be added as well. The default values of these options could be the same as the ones for the "Smart Highlighting" feature. |
@sasumner The consist way is on the settings of Style token (similar as settings of Smart Highlighting, but it should have only |
The current behaviour IS already the one described above.
There's not enough room for a detailed description, and the translation will be even longer than English text, so I would say "Highlighting" is a good compromise. But you're right for 3 settings |
I'm not sure if you understood me. Thus I created a mockup of my imaginary GUI: |
@dinkumoil That's what I would do: |
First, "Styling" isn't a known thing to users, really. Second, these related commands are on the Search menu, so why wouldn't the Styling group box appear on the Searching subpage of the Preferences ? |
@sasumner Here's the code:
Please replace all the symbol IDs generated by VS. |
And please keep "Highlighting" section name unchanged. |
@sasumner Adding label for this 3 option? Note that these are the same options as before, still placed in Smart Highlighting. |
Oh. |
As @dinkumoil said, "Use Find dialog settings" option is not obvious for the most of users. Putting them together and adding "Match" label may make this option more explicit. |
OK, I will finish this one up soon as I am eager to get it off my plate. |
It is still unclear to me what will happen with the coupling of the styling/marking feature to F&R dialog settings. Since you refused to introduce an option to toggle that coupling, I hope it will be removed entirely. That's the reason why I wrote:
Having an option to toggle the coupling would allow users who like this coupling to continue working as they are used to. The other ones would be able to disable the coupling. Without having this option IMO it would be the best to remove the coupling in the source code. |
With current direction, this will be true. |
Sorry, what are you talking about? |
Your mock-up of the future UI: There is no checkbox in "Mark All" groupbox to toggle coupling of styling/marking feature to F&R dialog settings. |
What do you mean by "an option to toggle that coupling"? |
With "coupling" I mean that currently the way how the styling/marking feature works depends on settings in the F&R dialog. Marking takes into account the state of "Match whole word only" and "Match case" options from F&R dialog. But this is only true if F&R dialog has been opened at least once. Before its first opening it seems the marking feature uses some default values for "Match whole word only" and "Match case" options which presumably are hardcoded into N++ source code. |
@dinkumoil My intention is dissociate the settings of "Mark All" from "Smart Highlighting". |
This confuses me somewhat because the "Mark All" feature never used the "Smart Highlighting" settings. |
That's what I wanted to write too. |
Oups, my bad. I didn't check the code and I thought that "Mark All" feature is using the "Smart Highlighting" settings, including its "Use Find dialog settings" option. By separating the UI, I hope it'll be clear for users. |
I noticed an issue with the "style token" feature. The problem is that styling is not applied consistently within words.
Case 1
Under these conditions, only "train" on line 2 is styled.
Case 2
Under these conditions, "train" on lines 1 and 2 are styled: The token will be styled within words.
Style Token will continue to match within words after opening the Find dialog once.
Expected Behavior
I am accustomed to case 2 where style applies to matches within words. This is how Notepad++ operates most of the time.
It doesn't make sense that a Find dialog option would affect Style Token. I suggest decoupling Style Token from the Find dialog. If people want to control this behavior then I suggest adding a formal preference: Style Token Matching.
Debug Information
Notepad++ v7.9.5 (32-bit)
Build time : Mar 21 2021 - 02:09:07
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19042.867
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll
The text was updated successfully, but these errors were encountered: