Skip to content
This repository was archived by the owner on Jun 24, 2023. It is now read-only.

Opfunc decorator#17

Open
averagehat wants to merge 15 commits into
amoffat:masterfrom
averagehat:master
Open

Opfunc decorator#17
averagehat wants to merge 15 commits into
amoffat:masterfrom
averagehat:master

Conversation

@averagehat
Copy link
Copy Markdown
Contributor

This is not ready to merge, but I am opening it up for input.
This works well enough for my purposes (I don't need to replace the text just to get it), however, the behavior when replacing the text doesn't always work as expected. I suspect this is because there is something I don't understand about how visual selection/replacement works in vim/snake.

For example, sometimes when making a selection with "V", the first character that was selected ends up outside of the replacing test instead of being replaced. The same thing seems to happen in normal mode sometimes.

Comment thread plugin/snake/__init__.py
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, but I can't see this working without a change to register_fn, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you have to pass the extra args from within a vim command, which is a mess. I just kept register_fn as it is and omitted the closing paren in the returned string in order to pass the extra vim args. A bit of a hack. I suppose register_fn could optionally format those keyword arguments itself, but I don't know if that would be used at all because AutoCommand context handles those situations where it might be useful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants