Hirohito Higash wrote:
> Hi Bram and Good developers,
>
> 2018-7-23(Mon) 0:00:23 UTC+9 h_east:
> > Hi Dominique and developers,
> >
> > 2018-7-22(Sun) 19:49:19 UTC+9 Dominique Pellé:
> > > :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:
> > >
> > > vim-8.0.1755 works fine
> > > vim-8.0.1756 does not work
> > >
> > >
> > > So this patch broke mouse selection in inputlist():
> > > commit 73658317bacd9a0264dfaa32288de6ea1f236fe5
> > > Author: Bram Moolenaar <[email protected]>
> > > 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)
> >
> > Thank you for reporting this.
> >
> > I investigated a little.
> > Certainly the behavior on the terminal is broken at 8.0.1756.
> > However, the behavior is not working properly before 8.0.1756 on gvim.
> > I did `git bisect`. gvim broken at 8.0.0722
> >
> > commit c9041079a199d753e73d3b242f21cc8db620179a (tag: v8.0.0722)
> > Author: Bram Moolenaar <[email protected]>
> > Date: Sun Jul 16 15:48:46 2017 +0200
> >
> > patch 8.0.0722: screen is messed by timer up at inputlist() prompt
> >
> > Problem: Screen is messed by timer up at inputlist() prompt.
> > Solution: Set state to ASKMORE. (closes #1843)
>
> I had more investigation.
>
> I figured out why the cursor position moves to a wrong position when timer
> expired.
>
> ---- Simple function call stack ----
> // On calling inputlist()
> f_inputlist();
> prompt_for_number();
> cmdline_row = 0; // (A)
> State = CMDLINE;
> get_number();
> windgoto(msg_row, msg_col);
> c = safe_vgetc(); // <----- waiting key typed
>
>
> // On timer expired
> check_due_timer();
> redraw_after_callback();
> redrawcmd():
> if (ccline.cmdbuff == NULL)
> {
> // cmdline_row is Zero by (A). So cursor position set to wrong.
> windgoto(cmdline_row, 0);
> msg_clr_eos();
> return;
> }
> --------
>
> I wrote and attached a patch.
> - Revert 8.0.0722 and 8.0.1756
> - when cmdline_row greater than zero, call redrawcmd() in
> redraw_after_callback().
>
> I confirmed Vim 8.1.0304 on fedora 28 via PuTTY(TERM=xterm-256color) from
> Win10
> and GVim on fedora 28. Also good Ubuntu 18.04.
>
> Please check out this.
Why remove the calls to setmouse()? We do want the mouse pointer shape
to be adjusted.
redraw_after_callback() also calls update_screen(), depending on some
conditions. Perhaps the check for cmdline_row to be non-zero should be
added there as well?
--
Looking at Perl through Lisp glasses, Perl looks atrocious.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.