:help inputlist() says:
inputlist({textlist}) *inputlist()*
...snip...
The user can also select an item by clicking on it with the
mouse. For the first string 0 is returned. When clicking
above the first item a negative number is returned. When
clicking on the prompt one more than the length of {textlist}
is returned.
...snip...
Example: >
let color = inputlist(['Select color:', '1. red',
\ '2. green', '3. blue'])
Yet, the mouse is taken into account.
I tried this:
$ vim --clean -c 'set mouse=a' -c "let color = inputlist(['Select color:', '1. red', '2. green', '3. blue'])"
I can only select an item with the keyboard but not with the mouse.
It's broken at least in the latest vim-8.1.203 in terminal and the gtk3 GUI.
I see that it works fine in the older /usr/bin/vim (8.0.1453) which comes with xubuntu-18.04.
Doing a git bissection, I found that:
So this patch broke mouse selection in inputlist():
commit 73658317bacd9a0264dfaa32288de6ea1f236fe5
Author: Bram Moolenaar <Br...@vim.org>
Date: Tue Apr 24 17:41:57 2018 +0200
patch 8.0.1756: GUI: after prompting for a number the mouse shape is wrong
Problem: GUI: after prompting for a number the mouse shape is sometimes
wrong.
Solution: Call setmouse() after setting "State". (Hirohito Higashi,
closes #2709)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
Attached a patch on vim_dev.
https://groups.google.com/d/msg/vim_dev/WY7QoL85sBM/OQZPIiZpAQAJ
Patch 8.1.0328 is meant to fix this issue. However, the fix introduces problems in the terminal: moving the mouse shows garbage characters both in the buffer and in the statusline.
To reproduce it, run this in a terminal:
$ vim --clean -c 'set mouse=a' -c "let color = inputlist(['Select color:', '1. red', '2. green', '3. blue'])
Then click with the mouse on red, green or blue. Observe that the buffer is then in INSERT mode (prior to patch, vim was in normal mode) and moving the mouse inserts displays gibberish in the buffer as well as in the status line at the bottom: status line shows things like "E6[[<MCED1,1" for example at the bottom right and it keeps changing as the mouse is moved.
I'm using vim-8.0.128 (huge) on xubuntu-18.04.1
@dpelle
I can not reproduce it.
What the terminal emulator are you using?
I am using GNOME treminal 3.28.2 (VTE 0.52.2) or PuTTY 0.70.
Both are using with "TERM=xterm-256color"
--
Best regards,
Hirohito Higashi (h_east)
—
@h-east wrote:
I can not reproduce it.
What the terminal emulator are you using?
I see this bug in both xfce4-terminal (0.8.7.4) and xterm (330).
I use "TERM=xterm-256color". Same issue happens with "TERM=xterm".
Here is my full vim version:
$ ./vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 26 2018 23:07:20)
Included patches: 1-328
Compiled by pel@pel-cirrus7
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl +extra_search +mouse_netterm +tag_old_static
+arabic +farsi +mouse_sgr -tag_any_white
+autocmd +file_in_path -mouse_sysmouse +tcl
+autochdir +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 +vartabs
+clipboard +jumplist +persistent_undo +vertsplit
+cmdline_compl +keymap +postscript +virtualedit
+cmdline_hist +lambda +printer +visual
+cmdline_info +langmap +profile +visualextra
+comments +libcall +python/dyn +viminfo
+conceal +linebreak +python3/dyn +vreplace
+cryptv +lispindent +quickfix +wildignore
+cscope +listcmds +reltime +wildmenu
+cursorbind +localmap +rightleft +windows
+cursorshape +lua +ruby +writebackup
+dialog_con_gui +menu +scrollbind +X11
+diff +mksession +signs -xfontset
+digraphs +modify_fname +smartindent +xim
+dnd +mouse +startuptime +xpm
-ebcdic +mouseshape +statusline +xsmp_interact
+emacs_tags +mouse_dec -sun_workshop +xterm_clipboard
+eval +mouse_gpm +syntax -xterm_save
+ex_extra -mouse_jsbterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang-6.0 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DEXITFREE -DABORT_ON_INTERNAL_ERROR
Linking: clang-6.0 -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.2 -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-2.5 -lpthread -lgmp -ldl -lcrypt -lm
The bug does not happen in the GUI version, i.e. it works fine when adding -g as follows:
$ vim --clean -g -c 'set mouse=a' -c "let color = inputlist(['Select color:', '1. red', '2. green', '3. blue'])"
@dpelle
Tnaks! I can reproduced on xfce4-terminal (0.8.7.4).
This also be reproduced in the 8.0.0721 just before the first regression (8.0.0722) of a series of issues.
The first regression (8.0.0722) does not reproduce the bug reported today.
Because regression makes it impossible to select inputlist() with the mouse.
Since 8.1.0328 inputlist() can be selected again with the mouse, the problem was revealed.
Namely, it seems that the bug reported today was originally latent.
Related comment is here.
https://groups.google.com/d/msg/vim_dev/WY7QoL85sBM/UhRh0SaRBAAJ
--
Best regards,
Hirohito Higashi (h_east)
Related comment is here.
https://groups.google.com/d/msg/vim_dev/WY7QoL85sBM/UhRh0SaRBAAJ