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

Search only matches beginning of clipboard entries #36

Open
sebastianst opened this issue Feb 7, 2017 · 3 comments
Open

Search only matches beginning of clipboard entries #36

sebastianst opened this issue Feb 7, 2017 · 3 comments

Comments

@sebastianst
Copy link
Contributor

Only the beginning of clipboard entries is matched when typing a word in the clipboard history window. Searching should match anywhere inside the entries, not just the beginning.

Related to this, there's no way to jump to the next match of a search (or is there?).

@mrichar1
Copy link
Owner

mrichar1 commented Feb 17, 2017

Hi,

I have to admit that I didn't realise that the selection widget actually offered search capabilities - it looks like this is enabled by default when you create the TreeView object!

Having had a quick play around, I've figured out how to create a custom search function, which does case-insensitive x in y rather than y.startswith(x) comparison:

...snip...
tree = Gtk.TreeView(model)
tree.set_search_equal_func(self.search_selection, tree)
...snip...

@staticmethod
def search_selection(model, column, key, iterator, data):
        return not key.lower() in model[iterator][0].lower()

However I'd like to tidy up the whole search interface in the UI to add things like prev/next match buttons, case-sensitivity toggle, starts with/contains toggles etc. Since it's there, we might as well make it useful!

I'll see about doing some work on this in the near future - but of course you're welcome to take a look yourself if you like!

@magnetophon
Copy link

@sebastianst
A workaround is to use clipster together with rofi, which has fuzzy matching:
clipster -o -n 0 -0 | rofi -i -dmenu -sep '\x00' -eh 2 -p paste: | sed -ze 's/\n$//' | clipster

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
@mrichar1 mrichar1 reopened this Apr 28, 2022
@stale stale bot removed the stale label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants