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

Selection register "*" is clobbered whenever a user textobj is used #51

Open
h3xx opened this issue Jun 6, 2016 · 4 comments
Open

Selection register "*" is clobbered whenever a user textobj is used #51

h3xx opened this issue Jun 6, 2016 · 4 comments

Comments

@h3xx
Copy link

h3xx commented Jun 6, 2016

When using user textobjs, the contents of the * register aren't preserved.

Builtin textobjs preserve this register, so I would expect user textobjs to preserve it as well.

Steps to reproduce:

  1. Download and install vim-textobj-user and vim-textobj-line.
  2. yil on any text
  3. Run :registers and look at "*.
@h3xx h3xx changed the title Selection register "* is clobbered whenever a user textobj is used Selection register "*" is clobbered whenever a user textobj is used Jun 6, 2016
@kana
Copy link
Owner

kana commented Jun 7, 2016

I couldn't reproduce the problem. The * register is not used by default unless it is explicitly specified like "*yil or 'clipboard' option is set to unnamed. In the latter case, built-in text objects also yank text to the * register.

@h3xx
Copy link
Author

h3xx commented Jun 9, 2016

The * register is not used by default.

That's not true. My &clipboard is set to the default value autoselect,exclude:cons\|linux.

The autoselect value in this option means this:

autoselect: Works like the 'a' flag in 'guioptions': If present, then whenever Visual mode is started, or the Visual area extended, Vim tries to become the owner of the
windowing system's global selection or put the selected text on the clipboard used by the selection register "*. See |guioptions_a| and |quotestar| for details. When the GUI is active, the 'a' flag in 'guioptions' is used, when the GUI is not active, this "autoselect" flag is used.
Also applies to the modeless selection.

I'm running under Linux by the way, with text-mode vim enabled for xterm clipboard (+xterm_clipboard) and X11 stuff (+X11).

@kana
Copy link
Owner

kana commented Jun 10, 2016

Anyway your Vim behaves as documented. The problem is not caused by vim-textobj-user.

@h3xx
Copy link
Author

h3xx commented Jun 11, 2016

How would you suggest I configure vim such that:

  • Visual selection is automatically stored on the * register
  • Using a user textobj leaves the * register untouched.

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

No branches or pull requests

2 participants