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

Mappings with Alt in operator-pending mode have a timing issue #9109

Open
urxvtcd opened this issue Nov 9, 2021 · 6 comments
Open

Mappings with Alt in operator-pending mode have a timing issue #9109

urxvtcd opened this issue Nov 9, 2021 · 6 comments

Comments

@urxvtcd
Copy link

urxvtcd commented Nov 9, 2021

Steps to reproduce

  1. Run gvim --clean
  2. Source the following script:
 " otherwise using alt brings up items from the menu
 set guioptions-=m
 " random mapping using c as its first character
 map cw dwi
 " random operator-pending mode mapping
 omap <A-w> $
  1. Now, to use the second mapping, we need to type c, then wait until time equal to timeoutlen setting passes, and the cursor changes its height to half of the line, and only then type <A-w>. Otherwise the mapping won't trigger.

Expected behaviour

I believe the mapping should be possible to trigger without waiting until timeoutlen elapses.

Operating system

Linux, Ubuntu 21.04, no desktop environment -- running bare i3 windom manager

Version of Vim

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 20 2021 11:49:18)

Logs and stack traces

No response

@tonymec
Copy link

tonymec commented Nov 9, 2021

In the output of the :version command, does your Vim include a second line beginning Included patches: and if it does, what is there after that on the same line?

@urxvtcd
Copy link
Author

urxvtcd commented Nov 9, 2021

Thanks for your reply! The line looks like follows:

Included patches: 1-2434, 3402-3403, 3409, 3428

@tonymec
Copy link

tonymec commented Nov 9, 2021

Hm, I wonder why so many patches (almost a thousand) were omitted by whoever built that Vim.

The usual way to build Vim on Linux is to include all patches, then let "make" and "configure" define the appropriate macros so that #ifdef and #ifndef will include or exclude code according to which packages are installed and which features are desired.

I used to have a HowTo page online but my ISP has zapped all user sites (except those built by one of their webmasters and presumably paid for).

Best regards,
Tony.

@chrisbra
Copy link
Member

chrisbra commented Nov 9, 2021

those are most likely security related patches that have been included.

FWIW: I do not see this issue on Windows gvim.

@lacygoill
Copy link

lacygoill commented Nov 9, 2021

I can reproduce in xterm on linux:

vim -Nu NONE -S <(cat <<'EOF'
    map cw dwi
    omap <A-a> $
    put ='this is a test'
EOF
)

Press c then immediately afterward Alt-a.
Expected: this is a test is cut.
Actual: nothing happens.

Press c, then wait &timeoutlen ms, then Alt-a.
Expected: this is a test is cut.
Actual: this is a test is cut.


Regression introduced in 8.2.0916.

The same patch is also responsible for the issue #7082


FWIW: I do not see this issue on Windows gvim.

It might depend on the system. In the issue #7082 , the OP wrote:

It see this in GTK2 GVIM, but not in Windows Vim.

Behavior has changed and now is inconsistent between terminal and GUI and different OSs (GTK Linux vs. Windows).

@brammool
Copy link
Contributor

The problem is that the key with modifiers may be mapped with modifyOtherKeys as-is or with the modifier applied.
If I change the code to fix this issue, then Test_modifyOtherKeys_mapped() fails, since it depends on the other behavior.
It's going to be hard to handle both.

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

5 participants