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

Langmap breaks <Plug> Mappings #5147

Open
SirVer opened this issue Oct 30, 2019 · 5 comments
Open

Langmap breaks <Plug> Mappings #5147

SirVer opened this issue Oct 30, 2019 · 5 comments

Comments

@SirVer
Copy link

SirVer commented Oct 30, 2019

This surfaced while investigating SirVer/ultisnips#1114.

Describe the bug
Using this minimal vimrc:

set nocompatible
inoremap <Plug>(Blub) <C-R>=Foobla()<cr>
imap <Tab> <Plug>(Blub)

" The next two lines are the interesting ones.
" set langmap=ln
" set langnoremap " <- This does not change anything.

And opening vim, hitting <tab> in insert mode:

$ vim -u vim.config
i<tab>

gives the expected error: Unknown function: Foobla. Commenting in the langmap line however changes the output: The literal string <Plug>(Blub) is inserted into the buffer.

Expected behavior
The langnoremap option does not change the behavior inside Vim, i.e. I'd still expect the Unknown function error in all cases for langmap. I am unsure about the job of langnoremap, but it does not affect this particular case.

Screenshots
Here is a screencap: https://asciinema.org/a/5UVsrorS8xsGbXmqRyprLVX2I, of course the pressing of <tab> is invisible here.

Environment (please complete the following information):
Output of vim --version:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 19 2019 12:50:19)
Included patches: 1
Compiled by root@390aeaaa713b
Huge version without GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    -gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               -perl              +vertsplit
-clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           -python            +vreplace
+conceal           +linebreak         +python3           +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       -lua               -ruby              -X11
+dialog_con        +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             -xim
+digraphs          +modify_fname      +smartindent       -xpm
-dnd               +mouse             +startuptime       -xsmp
-ebcdic            -mouseshape        +statusline        -xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              -mouse_gpm         +syntax            
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -I/usr/local/include/python3.6m -I/usr/local/include/python3.6m  -Wno-unused-result -Wsign-compare  -DNDEBUG -g -fwrapv -O3 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl   -lncurses -ldl     -L/usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm      
  • OS: Ubuntu 18.04, but reproducible in Mac OS as well (see travis runs for the UltiSnips issue).
  • Terminal: tested in MacVim & vim inside ITerm2 & vim inside tmux inside docker.
@SirVer
Copy link
Author

SirVer commented Oct 30, 2019

/cc @blueyed

Daniel, this seems to be the root bug behind why the <Plug> mappings do not work as expected in UltiSnips.

@chrisbra
Copy link
Member

I think this is essentially the same as #3018

The fix would need a bigger refactoring, thus I haven't tried it yet.

@SirVer
Copy link
Author

SirVer commented Oct 30, 2019

@chrisbra The symptom seems very different (since there are only ASCII letters involved here), but the underlying cause might of course be the same.

@zeertzjq
Copy link
Member

There seems to be a fix for this in neovim/neovim#7919 and Bram has been pinged in that PR.

@brammool
Copy link
Contributor

brammool commented Oct 18, 2022 via email

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

4 participants