gnome-clipboard-history icon indicating copy to clipboard operation
gnome-clipboard-history copied to clipboard

Add option + shortcut like private mode to toggle between regex and non-regex search

Open jacksongoode opened this issue 2 years ago • 7 comments

Describe the bug

Searching for ( or ) (along with strings pre or suffixed to the character) will not appear in a clipboard.

For programmers this is irksome as searching for a function like function( when the text def function(stuff) is in the clipboard results in nothing.

How To Reproduce

Have an item in the clipboard with either ( or ) and search.

Versions

org.gnome.shell.extensions.clipboard-history GNOME Shell 42.0 GCH Version: 15 org.gnome.shell.extensions.clipboard-history cache-only-favorites false org.gnome.shell.extensions.clipboard-history cache-size 100 org.gnome.shell.extensions.clipboard-history clear-history @as [] org.gnome.shell.extensions.clipboard-history confirm-clear true org.gnome.shell.extensions.clipboard-history disable-down-arrow true org.gnome.shell.extensions.clipboard-history display-mode 0 org.gnome.shell.extensions.clipboard-history enable-keybindings true org.gnome.shell.extensions.clipboard-history history-size 1000 org.gnome.shell.extensions.clipboard-history move-item-first true org.gnome.shell.extensions.clipboard-history next-entry @as [] org.gnome.shell.extensions.clipboard-history notify-on-copy false org.gnome.shell.extensions.clipboard-history paste-on-selection false org.gnome.shell.extensions.clipboard-history prev-entry @as [] org.gnome.shell.extensions.clipboard-history private-mode false org.gnome.shell.extensions.clipboard-history process-primary-selection false org.gnome.shell.extensions.clipboard-history strip-text true org.gnome.shell.extensions.clipboard-history toggle-menu ['Insert'] org.gnome.shell.extensions.clipboard-history toggle-private-mode ['<Super><Shift>P'] org.gnome.shell.extensions.clipboard-history topbar-preview-size 10 org.gnome.shell.extensions.clipboard-history window-width-percentage 25

jacksongoode avatar May 07 '22 00:05 jacksongoode

Yeah, search is regex so you'll have to escape it: \(.

SUPERCILEX avatar May 07 '22 00:05 SUPERCILEX

Could be interesting to provide a sanitized, non-regex option :thinking: :)

jacksongoode avatar May 07 '22 00:05 jacksongoode

Yeah, I couldn't figure out what to do UX wise though because I feel like you'd want to switch between the two often. Maybe that's not true and it could just be a setting, but I'm not sure.

SUPERCILEX avatar May 07 '22 00:05 SUPERCILEX

Yeah, I couldn't figure out what to do UX wise though because I feel like you'd want to switch between the two often.

An additional toggle to enable/disable regex parsing alongside the existing private mode toggle would be awesome.

salim-b avatar May 10 '22 21:05 salim-b

That actually sounds very reasonable. Should a global shortcut also be added or nah?

SUPERCILEX avatar May 10 '22 23:05 SUPERCILEX

Should a global shortcut also be added or nah?

Would be really handy I guess, so you could leave your fingers on the keyboard... 🧙

salim-b avatar May 10 '22 23:05 salim-b

Sounds like a plan to me!

SUPERCILEX avatar May 10 '22 23:05 SUPERCILEX

I don't have enough time, so I went with a dumb solution: just search both the raw query and its regex equivalent. This will over-return search results, but you should almost always be able to refine your search using regex (unless you're searching for regex in which case things get weird).

SUPERCILEX avatar Aug 13 '22 02:08 SUPERCILEX