Skip to content
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

Allow to add highlight rules from selected text #270

Closed
variar opened this issue Apr 6, 2021 · 23 comments
Closed

Allow to add highlight rules from selected text #270

variar opened this issue Apr 6, 2021 · 23 comments
Assignees
Labels
Milestone

Comments

@variar
Copy link
Owner

variar commented Apr 6, 2021

That sounds pretty cool, but I'd like to add one more thing: some shortcuts support for this. Such as Ctrl + Shift + Num<1-9> to set a different color. For example, when you select a keyword or a word you want to remember, you can mark it red by Ctrl + Shift +1, and then if others keyword or a word you want to remember again, you can mark it yellow by Ctrl + Shift +2, etc. Of course , the right-click selection is also supported. Hope it can be adopted, thank you!

Originally posted by @Junbo-Zheng in #259 (comment)

@Junbo-Zheng
Copy link

Hi~Thank you very much for receiving your reply, and also thank you for treating it as a new feature. I want to continue to add that the "Ctrl + Shift + Num<1-9>" I mentioned is just a reference. What I want to express is to use different shortcut keys to support different color labels. I believe it is very convenient for most users, thanks again!

@variar variar added this to the 2021.06 milestone Apr 10, 2021
@xaljer
Copy link

xaljer commented Jun 26, 2021

As my most expectant feature, I'm just curious about is there some progress or plan on this?

variar added a commit that referenced this issue Jun 28, 2021
This is work in progress. Allows to assign color labels to selected
text. For now there are 3 color labels: red, green and cyan.
Selected words can be colored with one of these labels using shortcuts:
`Ctrl+Shift+1/2/3`. All labels are cleared using shortcut `Ctrl+Shift+0`.
@variar
Copy link
Owner Author

variar commented Jun 28, 2021

I've been experimenting with this. For now core part is ready but UI is lacking. There are three predefined color labels (red, green and cyan) and shortcuts to assign them (Ctrl+Shift+1-3). No context menu yet. And the only way to clear all labels is by using another shortcut Ctrl+Shift+0. I'll make this implementation available in next ci builds, so you can play with it.

Ideally there should be a color configuration dialog for labels and context menu to assign and remove them.

@Junbo-Zheng
Copy link

I've been experimenting with this. For now core part is ready but UI is lacking. There are three predefined color labels (red, green and cyan) and shortcuts to assign them (Ctrl+Shift+1-3). No context menu yet. And the only way to clear all labels is by using another shortcut Ctrl+Shift+0. I'll make this implementation available in next ci builds, so you can play with it.

Ideally there should be a color configuration dialog for labels and context menu to assign and remove them.

So cool, that sounds great, I can’t wait to experience it!

@variar
Copy link
Owner Author

variar commented Jun 28, 2021

Can be tested in builds 21.06.0.1050+

@xaljer
Copy link

xaljer commented Jul 25, 2021

This is cool and super useful for me, thanks.

I found that Ctrl+Shift+0 is not work, but It's ok when I add another shortcut like Ctrl+L for it.

One more optimization, would you like to add the logic that when I press Ctrl+Shift+1-3 on the same pattern, than clear the highlight on the single pattern. For now, I must clear all patterns when I just want change one of them.

@variar
Copy link
Owner Author

variar commented Jul 26, 2021

@xaljer thanks for the feedback. Clearing single pattern should be available in 21.07.0.1069

@xaljer
Copy link

xaljer commented Jul 31, 2021

Just list some further idea on this feature to track:

  • configuration dialog to set predefined colors for labels.
  • context menu to assign and remove them.
  • A single shortcut to do shift+ctrl+1/2/3 in turn automatically and corresponding context menu.
  • Both background color and font color configurable which may helps when we use like ten colors.
  • Support up to 9 colors.
  • Allow user to select highlighters for cycling.
  • better default colors.

@variar
Copy link
Owner Author

variar commented Aug 2, 2021

Added color configuration to current highlighters configuration dialog. Cycling shortcut is Ctrl+D. Context menu will require some more effort. Should be in 21.07.0.1086+

@xaljer
Copy link

xaljer commented Aug 22, 2021

Thanks a lot. A suggestion: cycling shortcut should have same behave as shift+ctrl+1/2/3, means when press ctrl+D on a colored pattern, it should clear current color but not change it to another color, so that when user don't care specified color, ctrl+D can replace shift+ctrl+1/2/3. similar function in vim/VSCode also do like this.

@variar
Copy link
Owner Author

variar commented Aug 22, 2021

Should be in 21.08.0.1112

@variar variar added the status: ready for testing resolved but needs testing label Aug 22, 2021
@variar
Copy link
Owner Author

variar commented Aug 23, 2021

For some reasons colors do not show up in context menu on Windows. Should be like this
image

but looks like this
image

@xaljer
Copy link

xaljer commented Aug 28, 2021

I found that color label setting page is empty if highlighters is never configured. Is that a bug? color label and highlighters should be two separate features.
image

@variar
Copy link
Owner Author

variar commented Aug 28, 2021

Yes, this is strange. Color labels are supposed to be reset to default if none are found in current configuration. I'll take a look.

@variar
Copy link
Owner Author

variar commented Aug 30, 2021

Fixed default initialization of color labels in 21.08.0.1154

@variar
Copy link
Owner Author

variar commented Sep 3, 2021

Fixed colors in menu for Windows in 21.09.0.1159

@xaljer
Copy link

xaljer commented Sep 11, 2021

One more suggestion: default colors can be improved. Some color is not so clear, such as:
image

Some theme from other software could be referenced.
image

@speeeeed
Copy link

This feature is pretty cool, now I can uninstall notepad++.

variar added a commit that referenced this issue Sep 21, 2021
@xaljer
Copy link

xaljer commented Sep 25, 2021

One more suggestion: reset the color label cycle to first when clear all labels. This will make cycling behavior more definite.

@variar
Copy link
Owner Author

variar commented Sep 27, 2021

Better default colors are in 21.09.0.1165.

@variar
Copy link
Owner Author

variar commented Nov 17, 2021

I consider this finished for current milestone.

@variar variar closed this as completed Nov 17, 2021
@xaljer
Copy link

xaljer commented Dec 18, 2021

One more suggestion: reset the color label cycle to first when clear all labels. This will make cycling behavior more definite.

@variar would you like to also implement this?

@variar
Copy link
Owner Author

variar commented Dec 18, 2021

@xaljer sorry, missed that part. Should be in next builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants