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

Support move-[nNpP] when patterns is a list #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Boolean263
Copy link

This patch allows move-n etc. to work when a textobject is defined using a list with separate start and end patterns. Without this fix, an error is generated when the keybind is pressed for moving between these objects.

This patch allows `move-n` etc. to work when a textobject is defined
using a list with separate start and end patterns. Without this fix, an
error is generated when the keybind is pressed for moving between these
objects.
@kana
Copy link
Owner

kana commented Jan 21, 2020

Thank you for the patch. I'll update tests and the document, then merge this patch.

@kana
Copy link
Owner

kana commented Jan 28, 2020

I thought at first your patch looks good, but there is a problem. If a text object is defined by a list "pattern", that text object can be nested like HTML tags. Your patch doesn't correctly handle nested objects.

Suppose that a text object is defined by ['<<', '>>'], and the current buffer contains the following text:

AAA <<BBB <<CCC>> DDD>> EEE

Doing move-N at the first column should move the cursor to the end of DDD>>, but, with your patch, the cursor is moved to the end of CCC>>.

@Boolean263
Copy link
Author

Ah, drat. I should have thought of that, but I only tested it in my own use case. Sorry to waste your time!

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

Successfully merging this pull request may close these issues.

2 participants