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

Macro not recording auto-completion result #791

Open
yishayw opened this issue Sep 12, 2017 · 5 comments
Open

Macro not recording auto-completion result #791

yishayw opened this issue Sep 12, 2017 · 5 comments

Comments

@yishayw
Copy link

yishayw commented Sep 12, 2017

Steps to reproduce:

  • Start recording macro (qq)
  • Use auto completing (ctrl-space + some-keys arrow keys + enter)
  • Stop recording (q)
  • Replay macro

Desired result: the result of pressing <enter> will appear in the played macro result.
Actual result: Only some-keys appear, so I have to manually complete on each macro replay

@albertdev
Copy link
Member

albertdev commented Sep 16, 2017

Thank you for letting us know.

I can reproduce that recording a macro and doing command completion in Insert mode does not record the final text in the macro.

However, is this exactly what you are talking about? Just to be clear, while the "repeat insert" works (i.e. pressing .), Vrapper never records that you start command completion and select the second item. Instead the repeat will simply insert the same text as edited the last time Insert mode was used.

In other words, the fix I'm thinking of will simply record the text result from the last insert session but it won't do a real command completion.

I appreciate the feedback.

@yishayw
Copy link
Author

yishayw commented Sep 17, 2017 via email

@albertdev
Copy link
Member

albertdev commented Oct 15, 2017

Ok, I have been thinking some more about this and it sounds like it is possible.

What I'm more concerned about is the change in behaviour: as it stands, the macro recorder captures all keypresses (as long as those don't trigger Eclipse editing features like auto complete). This means that changing it to capture just the final text would then no longer run Insert mode remaps, but those could be context-sensitive and hence might need to be executed every single time. Also, the new code would "fake" a bunch of keypresses so that the macro contains all text as it finally looked during the macro recording, but that text may inadvertently trigger Insert mode remaps during a replay of the macro.

This is why I'm inclined to put in a new option which switches the behavior and support both old and new recording modes. I'll then have to discuss with @keforbes what the new default should be.

@keforbes
Copy link
Contributor

@albertdev, how would you capture the final text? Would you check to see if we're recording when we exit insert mode and if so, capture whatever was entered?

For what it's worth, 5 years ago I mentioned an issue where using the arrow keys while in insert mode wouldn't be captured by a macro. That issue is now fixed. Would we be able to ensure that non-text key presses (arrow keys) while in insert mode would still be captured in the macro if we're just capturing the final text entered?

@albertdev
Copy link
Member

albertdev commented Oct 16, 2017

@keforbes that is a valid remark. Since I was thinking of just capturing the text when we exit Insert mode that arrow-key-recording feature would no longer work.

Of course, if this new behavior can be enabled or disabled by an option then you can always choose to toggle it when you record a macro or set the desired default behavior from your .vrapperrc.

Your remark shows though that we can't make it the default as that would surprise our existing users or new people who want a Vim-like experience.

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