-
Notifications
You must be signed in to change notification settings - Fork 89
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
provide option to ignore concealed characters #30
Comments
after some thought, this doesn't have many use cases and will be more confusing that helpful |
I think there's actually a major use case: vim-dirvish. The directory buffer in dirvish uses concealed text: each line contains the full path, but only the filename is visible. This can cause sneak to fail hard. In many cases, every line becomes a match. In fact, depending on the way folders are laid out, each line can effectively be multiple matches! I think the confusion consideration cuts both ways on this one. When I use sneak, I'm usually jumping to something I can see. It was confusing at first to be jumping to lots of intermediate results, none of which were even visually highlighted. Now, of course, I understand how it works, and have for many years, so I'm used to it. But at some point, I realized that the thing I was initially trying to do (i.e., jump among visible results) might actually be the more desirable behaviour intrinsically. 🙂 @justinmk: WDYT about reopening and reconsidering this? |
I think it would be best to set Edit: nevermind, I forgot that Sneak actually uses conceal to display the labels (on Vim) |
Yeah, though not in Nvim 0.5+: 3ff1033 It probably makes sense to special-case dirvish buffers. In any case, first need to figure out how to only search "visible" text. |
I had a thought this morning: can we simply discard any matches after the fact, if it turns out that their text is completely concealed? (I have no idea how these things work, but if it's possible to tell whether text is or is not concealed, then we should be able to use this as a post-processing filter without needing to mess with the "core" search algorithm.) |
It would be great for help files too. In fact, cannot think of a single situation where it would make sense to match hidden characters with such a jumping plugin (well, for label mode at least). |
A search may fail even though the visible text appears to be a match, because the actual text contains a concealed character that prevents the match. Maybe Sneak can provide an option to match only visible/non-concealed text.
The text was updated successfully, but these errors were encountered: