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

findJump.blockChar command #5

Open
johnlindquist opened this issue Sep 10, 2017 · 1 comment
Open

findJump.blockChar command #5

johnlindquist opened this issue Sep 10, 2017 · 1 comment

Comments

@johnlindquist
Copy link

I'd love a command that could jump to the characters that determine a "block" of code, such as: (){}[]<>

The tricky bit would be I'd love to be able to jump before or after the character.

Also, "narrowing down" might be difficult since many special chars are followed by the same character.

Thoughts?

@msafi
Copy link
Owner

msafi commented Sep 10, 2017

So in its current incarnation, Find-Jump can match block characters. You just type the block character and try to narrow down the search by entering the characters that appear after it.

The "narrowing down" is actually nothing fancy. The more characters you type, the more unique your search becomes so the fewer hits there are on the document. So even if you are trying to reach a location with )), if you enter )) into Find-Jump, that'll help it narrow down the search.

The one place that is not possible for Find-Jump to jump to is end-of-line (EOL). I have an idea of how we can handle that, but I'm not sure about it. Currently, the enter key exits Find-Jump. We can make it instead highlight 26 EOLs above and 26 EOLs below the cursor. That would allow you to jump to the position after the last character on the line, even block character.

So with the exception of the EOL situation, Find-Jump as it is now can jump to before or after block characters. It maybe less convenient than: press a shortcut → highlight all block characters → enter jump sequence → done...But Find-Jump can't do that well the way it's designed because it only has 52 jump characters to suggest. And I would think that many times there would be more than 52 locations before and after all block characters on the document. I don't think it's a good experience for the user to trigger this command and sometimes the location that they want to go to is not highlighted because all the jump characters were used up by other locations in the document.

What do you think?

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

2 participants