Re: Patch 8.1.0313

2018-08-21 Fir de Conversatie Christian Brabandt


On Di, 21 Aug 2018, Bram Moolenaar wrote:

> 
> Christian Brabandt wrote:
> 
> > On Di, 21 Aug 2018, Bram Moolenaar wrote:
> > 
> > > 
> > > Patch 8.1.0313
> > > Problem:Information about a swap file is unavailable.
> > > Solution:   Add swapinfo(). (Enzo Ferber)
> > > Files:runtime/doc/eval.txt, src/evalfunc.c, src/memline.c,
> > > src/proto/memline.pro, src/testdir/test_swap.vim
> > 
> > Is this information valid when the SwapFileExists autocommand triggers?
> 
> It directly reads the swap file, thus it should always be valid.
> Only thing is that on MS-Windows an exclusive read could block it.

Ah, one needs to provide the swapfile name and not the file name being 
edited. Makes sense, thanks and seems to work after a quick test.

Best,
Christian
-- 
Avantgardisten:
  Leute, die nicht genau wissen, wo sie hinwollen, aber als erste da sind.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0313

2018-08-21 Fir de Conversatie James McCoy
On Tue, Aug 21, 2018 at 09:02:42PM -0400, James McCoy wrote:
> On Tue, Aug 21, 2018 at 08:29:09PM +0200, Bram Moolenaar wrote:
> > *** ../vim-8.1.0312/src/testdir/test_swap.vim   2018-05-12 
> > 15:57:33.0 +0200
> > --- src/testdir/test_swap.vim   2018-08-21 20:18:23.395917660 +0200
> > ***
> > *** 97,99 
> > --- 97,133 
> > set directory&
> > call delete('Xswapdir', 'rf')
> >   endfunc
> > + 
> > + func Test_swapinfo()
> > +   new Xswapinfo
> > +   call setline(1, ['one', 'two', 'three'])
> > +   w
> > +   let fname = trim(execute('swapname'))
> > +   call assert_match('Xswapinfo', fname)
> > +   let info = swapinfo(fname)
> > +   call assert_match('8\.', info.version)
> 
> What about this patch so the test doesn't have to change whenever the
> version changes?
> 
> diff --git i/src/testdir/test_swap.vim w/src/testdir/test_swap.vim
> index c12693c81..d65960679 100644
> --- i/src/testdir/test_swap.vim
> +++ w/src/testdir/test_swap.vim
> @@ -105,7 +105,8 @@ func Test_swapinfo()
>let fname = trim(execute('swapname'))
>call assert_match('Xswapinfo', fname)
>let info = swapinfo(fname)
> -  call assert_match('8\.', info.version)
> +  let ver = printf('VIM %d.%d', v:version / 100, v:version % 100)
> +  call assert_equal(ver, info.version)
>call assert_match('\w', info.user)
>call assert_equal(hostname(), info.host)
>call assert_match('Xswapinfo', info.fname)
> 

Also, the test is currently failing on Travis[0] because b0_hname is
limited to B0_HNAME_SIZE bytes, including the NUL byte.

diff --git i/src/testdir/test_swap.vim w/src/testdir/test_swap.vim
index c12693c81..c296e6f08 100644
--- i/src/testdir/test_swap.vim
+++ w/src/testdir/test_swap.vim
@@ -107,7 +107,7 @@ func Test_swapinfo()
   let info = swapinfo(fname)
   call assert_match('8\.', info.version)
   call assert_match('\w', info.user)
-  call assert_equal(hostname(), info.host)
+  call assert_equal(hostname()[:38], info.host)
   call assert_match('Xswapinfo', info.fname)
   call assert_match(0, info.dirty)
   call assert_equal(getpid(), info.pid)

[0]: https://api.travis-ci.org/v3/job/418866411/log.txt

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Test failure on arch ppc

2018-08-21 Fir de Conversatie James McCoy
On Wed, Aug 22, 2018 at 03:12:34AM +0200, Elimar Riesebieter wrote:
> Hi all,
> 
> compiling vim 8.1.0315 on arch powerpc gives the following failure:
> 
> From test_cscope.vim:
> Found errors in Test_cscope_add_dir():
> Caught exception in Test_cscope_add_dir(): Vim(cscope):E563: 
> stat(/source/vim/vim-8.1.0315/src/vim-basic/testdir/Xcscopedir/cscope.out) 
> error: 2 @ function RunTheTest[40]..Test_cscope_add_dir, line 3

It looks like you're building in a shadow directory.  cscope doesn't
follow symlinks, so the test fails to build a database for
../memfile_test.c.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Test failure on arch i386

2018-08-21 Fir de Conversatie Elimar Riesebieter
* Elimar Riesebieter  [2018-08-22 03:16 +0200]:

> Hi all,
> 
> compiling vim 8.1.0315 on arch i386 gives the following failure:
> 
> >From test_search.vim:
> Found errors in Test_incsearch_substitute_dump():
> function RunTheTest[40]..Test_incsearch_substitute_dump[69]..VerifyScreenDump 
> line 14: See dump file difference: call 
> term_dumpdiff("Test_incsearch_substitute_07.dump.failed", 
> "dumps/Test_incsearch_substitute_07.dump")


The diff is as follows:


--- ./src/testdir/dumps/Test_incsearch_substitute_07.dump   2018-08-21 
21:58:13.0 +0200
+++ ./src/vim-gtk3/testdir/Test_incsearch_substitute_07.dump.failed 
2018-08-22 03:11:40.341265509 +0200
@@ -6,4 +6,4 @@
 |f|o@1| |9| @64
 |f|o@1| |1|0| @63
 |b+9&&|a|r| +8&&|1@1| @63
-|:+0&&|9|,|1@1|s|/|b|a|r> @59
+|:+0&&|9|,|1@1|s|/|b|a|r> @31| @1| @25


-- 
  "Talking much about oneself can also
   be a means to conceal oneself."
 -Friedrich Nietzsche

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Test failure on arch i386

2018-08-21 Fir de Conversatie Elimar Riesebieter
Hi all,

compiling vim 8.1.0315 on arch i386 gives the following failure:

>From test_search.vim:
Found errors in Test_incsearch_substitute_dump():
function RunTheTest[40]..Test_incsearch_substitute_dump[69]..VerifyScreenDump 
line 14: See dump file difference: call 
term_dumpdiff("Test_incsearch_substitute_07.dump.failed", 
"dumps/Test_incsearch_substitute_07.dump")


Elimar
-- 
  "Talking much about oneself can also
   be a means to conceal oneself."
 -Friedrich Nietzsche

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Test failure on arch ppc

2018-08-21 Fir de Conversatie Elimar Riesebieter
Hi all,

compiling vim 8.1.0315 on arch powerpc gives the following failure:

>From test_cscope.vim:
Found errors in Test_cscope_add_dir():
Caught exception in Test_cscope_add_dir(): Vim(cscope):E563: 
stat(/source/vim/vim-8.1.0315/src/vim-basic/testdir/Xcscopedir/cscope.out) 
error: 2 @ function RunTheTest[40]..Test_cscope_add_dir, line 3



Elimar
-- 
  "Talking much about oneself can also
   be a means to conceal oneself."
 -Friedrich Nietzsche

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0313

2018-08-21 Fir de Conversatie James McCoy
On Tue, Aug 21, 2018 at 08:29:09PM +0200, Bram Moolenaar wrote:
> *** ../vim-8.1.0312/src/testdir/test_swap.vim 2018-05-12 15:57:33.0 
> +0200
> --- src/testdir/test_swap.vim 2018-08-21 20:18:23.395917660 +0200
> ***
> *** 97,99 
> --- 97,133 
> set directory&
> call delete('Xswapdir', 'rf')
>   endfunc
> + 
> + func Test_swapinfo()
> +   new Xswapinfo
> +   call setline(1, ['one', 'two', 'three'])
> +   w
> +   let fname = trim(execute('swapname'))
> +   call assert_match('Xswapinfo', fname)
> +   let info = swapinfo(fname)
> +   call assert_match('8\.', info.version)

What about this patch so the test doesn't have to change whenever the
version changes?

diff --git i/src/testdir/test_swap.vim w/src/testdir/test_swap.vim
index c12693c81..d65960679 100644
--- i/src/testdir/test_swap.vim
+++ w/src/testdir/test_swap.vim
@@ -105,7 +105,8 @@ func Test_swapinfo()
   let fname = trim(execute('swapname'))
   call assert_match('Xswapinfo', fname)
   let info = swapinfo(fname)
-  call assert_match('8\.', info.version)
+  let ver = printf('VIM %d.%d', v:version / 100, v:version % 100)
+  call assert_equal(ver, info.version)
   call assert_match('\w', info.user)
   call assert_equal(hostname(), info.host)
   call assert_match('Xswapinfo', info.fname)

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] (regression) inputlist() no longer takes mouse into account in inputlist() (#3239)

2018-08-21 Fir de Conversatie h_east
Hi,

2018-8-22(Wed) 0:30:20 UTC+9 h_east:
> Hi Bram,
> 
> 2018-8-21(Tue) 22:57:39 UTC+9 Bram Moolenaar:
> > 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 
> > > > > 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 
> > > > 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.
> 
> Before 8.0.0722 worked fine.  So that I reverted this.
> But implement again.
> 
> > 
> > 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?
> 
> Probably I think so.
> Patch updated.
> 
> Note:
> I have not confirmed yet on GUI version.
> I will be able to confirm by going to work. (After about 8 hours)

I confirmed "fix_mouse_select_regression2.patch" on Ubuntu 18.04 at my 
workplace.
it seems for me that it works properly.
--
Best regards,
Hirohito 

Patch 8.1.0315

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0315
Problem:Helpgrep with language doesn't work properly. (Takuya Fujiwara)
Solution:   Check for the language earlier. (Hirohito Higashi)
Files:  src/quickfix.c, src/testdir/test_quickfix.vim


*** ../vim-8.1.0314/src/quickfix.c  2018-08-18 19:59:48.418322409 +0200
--- src/quickfix.c  2018-08-21 21:47:55.412902244 +0200
***
*** 5385,5391 
  if (qf_restore_list(qi, save_qfid) == FAIL)
goto theend;
  
! /* Jump to first match. */
  if (!qf_list_empty(qi, qi->qf_curlist))
  {
if ((flags & VGR_NOJUMP) == 0)
--- 5385,5391 
  if (qf_restore_list(qi, save_qfid) == FAIL)
goto theend;
  
! // Jump to first match.
  if (!qf_list_empty(qi, qi->qf_curlist))
  {
if ((flags & VGR_NOJUMP) == 0)
***
*** 6844,6859 
  /*
   * Search for a pattern in all the help files in the 'runtimepath'
   * and add the matches to a quickfix list.
!  * 'arg' is the language specifier.  If supplied, then only matches in the
   * specified language are found.
   */
  static void
! hgr_search_in_rtp(qf_info_T *qi, regmatch_T *p_regmatch, char_u *arg)
  {
  char_u*p;
- #ifdef FEAT_MULTI_LANG
- char_u*lang;
- #endif
  
  #ifdef FEAT_MBYTE
  vimconv_T vc;
--- 6844,6856 
  /*
   * Search for a pattern in all the help files in the 'runtimepath'
   * and add the matches to a quickfix list.
!  * 'lang' is the language specifier.  If supplied, then only matches in the
   * specified language are found.
   */
  static void
! hgr_search_in_rtp(qf_info_T *qi, regmatch_T *p_regmatch, char_u *lang)
  {
  char_u*p;
  
  #ifdef FEAT_MBYTE
  vimconv_T vc;
***
*** 6865,6874 
convert_setup(, (char_u *)"utf-8", p_enc);
  #endif
  
- #ifdef FEAT_MULTI_LANG
- /* Check for a specified language */
- lang = check_help_lang(arg);
- #endif
  
  /* Go through all the directories in 'runtimepath' */
  p = p_rtp;
--- 6862,6867 
***
*** 6903,6908 
--- 6896,6902 
  qf_info_T *qi = _info;
  int   new_qi = FALSE;
  char_u*au_name =  NULL;
+ char_u*lang = NULL;
  
  switch (eap->cmdidx)
  {
***
*** 6919,6925 
  #endif
  }
  
! /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
  save_cpo = p_cpo;
  p_cpo = empty_option;
  
--- 6913,6919 
  #endif
  }
  
! // Make 'cpoptions' empty, the 'l' flag should not be used here.
  save_cpo = p_cpo;
  p_cpo = empty_option;
  
***
*** 6930,6943 
return;
  }
  
  regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING);
  regmatch.rm_ic = FALSE;
  if (regmatch.regprog != NULL)
  {
!   /* create a new quickfix list */
qf_new_list(qi, qf_cmdtitle(*eap->cmdlinep));
  
!   hgr_search_in_rtp(qi, , eap->arg);
  
vim_regfree(regmatch.regprog);
  
--- 6924,6941 
return;
  }
  
+ #ifdef FEAT_MULTI_LANG
+ // Check for a specified language
+ lang = check_help_lang(eap->arg);
+ #endif
  regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING);
  regmatch.rm_ic = FALSE;
  if (regmatch.regprog != NULL)
  {
!   // create a new quickfix list
qf_new_list(qi, qf_cmdtitle(*eap->cmdlinep));
  
!   hgr_search_in_rtp(qi, , lang);
  
vim_regfree(regmatch.regprog);
  
***
*** 6950,6956 
  if (p_cpo == empty_option)
p_cpo = save_cpo;
  else
!   /* Darn, some plugin changed the value. */
free_string_option(save_cpo);
  
  qf_list_changed(qi, qi->qf_curlist);
--- 6948,6954 
  if (p_cpo == empty_option)
p_cpo = save_cpo;
  else
!   // Darn, some plugin changed the value.
free_string_option(save_cpo);
  
  qf_list_changed(qi, qi->qf_curlist);
***
*** 6973,6980 
  
  if (eap->cmdidx == CMD_lhelpgrep)
  {
!   /* If the help window is not opened or if it already points to the
!* correct location list, then free the new location list. */
if (!bt_help(curwin->w_buffer) || curwin->w_llist == qi)
{
if (new_qi)
--- 6971,6978 
  
  if (eap->cmdidx == CMD_lhelpgrep)
  {
!   // If the help window is not opened or if it already points to the
!   // correct location list, then free the new location list.
if (!bt_help(curwin->w_buffer) || curwin->w_llist == qi)
{
if (new_qi)
*** ../vim-8.1.0314/src/testdir/test_quickfix.vim   2018-08-15 
22:29:46.977604162 +0200
--- src/testdir/test_quickfix.vim   2018-08-21 21:44:49.058013219 +0200
***
*** 3091,3096 
--- 3091,3110 
call Xqftick_tests('l')
  endfunc
  
+ " Test helpgrep with lang specifier
+ func Xtest_helpgrep_with_lang_specifier(cchar)
+   call s:setup_commands(a:cchar)
+   Xhelpgrep Vim@en
+   call 

Re: Link error if eval feature not included after patches 8.1. 311-313

2018-08-21 Fir de Conversatie Tony Mechelynck
Ha! Brenton Horne beat me to the ball.

Best regards,
Tony.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Link error if eval feature not included after patches 8.1. 311-313

2018-08-21 Fir de Conversatie Tony Mechelynck
After applying patches 8.1.311 to 8.1.311, I get a link error in the
Tiny build (shown below) and also in Small (the same error, not
shown). These two builds are without expression evaluation, which
makes me think that an #ifdef was forgotten in src/memline.c around
the "dictionary" operations about which the linker complains.

Best regards,
Tony.


link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly.
  gcc   -L/usr/local/lib -Wl,--as-needed-o vi objects/arabic.o
objects/beval.o objects/buffer.o objects/blowfish.o objects/crypt.o
objects/crypt_zip.o objects/dict.o objects/diff.o objects/digraph.o
objects/edit.o objects/eval.o objects/evalfunc.o objects/ex_cmds.o
objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o
objects/ex_getln.o objects/farsi.o objects/fileio.o objects/fold.o
objects/getchar.o objects/hardcopy.o objects/hashtab.o
objects/if_cscope.o objects/if_xcmdsrv.o objects/list.o objects/mark.o
objects/memline.o objects/menu.o objects/misc1.o objects/misc2.o
objects/move.o objects/mbyte.o objects/normal.o objects/ops.o
objects/option.o objects/os_unix.o objects/pathdef.o
objects/popupmnu.o objects/pty.o objects/quickfix.o objects/regexp.o
objects/screen.o objects/search.o objects/sha256.o objects/spell.o
objects/spellfile.o objects/syntax.o objects/tag.o objects/term.o
objects/terminal.o objects/ui.o objects/undo.o objects/userfunc.o
objects/version.o objects/window.o   objects/charset.o
objects/json.o objects/main.o objects/memfile.o objects/message.o
-lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf
-lgpm -ldl
objects/memline.o: In function `get_b0_dict':
memline.c:(.text+0x26d9): undefined reference to `dict_add_string'
memline.c:(.text+0x26f3): undefined reference to `dict_add_string'
memline.c:(.text+0x270d): undefined reference to `dict_add_string'
memline.c:(.text+0x2727): undefined reference to `dict_add_string'
memline.c:(.text+0x2738): undefined reference to `dict_add_number'
memline.c:(.text+0x2749): undefined reference to `dict_add_number'
memline.c:(.text+0x275a): undefined reference to `dict_add_number'
memline.c:(.text+0x2776): undefined reference to `dict_add_string'
memline.c:(.text+0x27b6): undefined reference to `dict_add_string'
collect2: error: ld returned 1 exit status
link.sh: Linking failed
make: *** [Makefile:1959: vi] Error 1
exit status 2
Tue 21 Aug 21:01:25 CEST 2018

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0313

2018-08-21 Fir de Conversatie Bram Moolenaar


Christian Brabandt wrote:

> On Di, 21 Aug 2018, Bram Moolenaar wrote:
> 
> > 
> > Patch 8.1.0313
> > Problem:Information about a swap file is unavailable.
> > Solution:   Add swapinfo(). (Enzo Ferber)
> > Files:  runtime/doc/eval.txt, src/evalfunc.c, src/memline.c,
> > src/proto/memline.pro, src/testdir/test_swap.vim
> 
> Is this information valid when the SwapFileExists autocommand triggers?

It directly reads the swap file, thus it should always be valid.
Only thing is that on MS-Windows an exclusive read could block it.

-- 
Hanson's Treatment of Time:
There are never enough hours in a day, but always too
many days before Saturday.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0314

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0314 (after 8.1.0313)
Problem:Build failure without the +eval feature. (Brenton Horne)
Solution:   Add #ifdef.  Also add the "dirty" item.
Files:  src/memline.c, runtime/doc/eval.txt, src/testdir/test_swap.vim


*** ../vim-8.1.0313/src/memline.c   2018-08-21 20:28:49.888006612 +0200
--- src/memline.c   2018-08-21 21:07:08.927388911 +0200
***
*** 2041,2046 
--- 2041,2047 
  static int process_still_running;
  #endif
  
+ #if defined(FEAT_EVAL) || defined(PROTO)
  /*
   * Return information found in swapfile "fname" in dictionary "d".
   * This is used by the swapinfo() function.
***
*** 2055,2065 
  {
if (read_eintr(fd, , sizeof(b0)) == sizeof(b0))
{
!   if (b0_magic_wrong())
!   {
dict_add_string(d, "error",
!  vim_strsave((char_u *)"magic number mismatch"));
!   }
else
{
/* we have swap information */
--- 2056,2067 
  {
if (read_eintr(fd, , sizeof(b0)) == sizeof(b0))
{
!   if (ml_check_b0_id() == FAIL)
dict_add_string(d, "error",
!  vim_strsave((char_u *)"Not a swap file"));
!   else if (b0_magic_wrong())
!   dict_add_string(d, "error",
!  vim_strsave((char_u *)"Magic number mismatch"));
else
{
/* we have swap information */
***
*** 2070,2078 
  
dict_add_number(d, "pid", char_to_long(b0.b0_pid));
dict_add_number(d, "mtime", char_to_long(b0.b0_mtime));
! #ifdef CHECK_INODE
dict_add_number(d, "inode", char_to_long(b0.b0_ino));
! #endif
}
}
else
--- 2072,2081 
  
dict_add_number(d, "pid", char_to_long(b0.b0_pid));
dict_add_number(d, "mtime", char_to_long(b0.b0_mtime));
!   dict_add_number(d, "dirty", b0.b0_dirty ? 1 : 0);
! # ifdef CHECK_INODE
dict_add_number(d, "inode", char_to_long(b0.b0_ino));
! # endif
}
}
else
***
*** 2083,2088 
--- 2086,2092 
  else
dict_add_string(d, "error", vim_strsave((char_u *)"Cannot open file"));
  }
+ #endif
  
  /*
   * Give information about an existing swap file.
*** ../vim-8.1.0313/runtime/doc/eval.txt2018-08-21 20:28:49.884006638 
+0200
--- runtime/doc/eval.txt2018-08-21 21:06:33.431590332 +0200
***
*** 8011,8020 
file
mtime   last modification time in seconds
inode   Optional: INODE number of the file
In case of failure an "error" item is added with the reason:
Cannot open file: file not found or in accessible
Cannot read file: cannot read first block
!   magic number mismatch: info in first block is invalid
  
  synID({lnum}, {col}, {trans}) *synID()*
The result is a Number, which is the syntax ID at the position
--- 8020,8031 
file
mtime   last modification time in seconds
inode   Optional: INODE number of the file
+   dirty   1 if file was modified, 0 if not
In case of failure an "error" item is added with the reason:
Cannot open file: file not found or in accessible
Cannot read file: cannot read first block
!   Not a swap file: does not contain correct block ID
!   Magic number mismatch: Info in first block is invalid
  
  synID({lnum}, {col}, {trans}) *synID()*
The result is a Number, which is the syntax ID at the position
*** ../vim-8.1.0313/src/testdir/test_swap.vim   2018-08-21 20:28:49.892006588 
+0200
--- src/testdir/test_swap.vim   2018-08-21 21:07:26.571288544 +0200
***
*** 109,114 
--- 109,115 
call assert_match('\w', info.user)
call assert_equal(hostname(), info.host)
call assert_match('Xswapinfo', info.fname)
+   call assert_match(0, info.dirty)
call assert_equal(getpid(), info.pid)
call assert_match('^\d*$', info.mtime)
if has_key(info, 'inode')
***
*** 128,133 
  
call writefile([repeat('x', 1)], 'Xnotaswapfile')
let info = swapinfo('Xnotaswapfile')
!   call assert_equal('magic number mismatch', info.error)
call delete('Xnotaswapfile')
  endfunc
--- 129,134 
  
call writefile([repeat('x', 1)], 'Xnotaswapfile')
let info = swapinfo('Xnotaswapfile')
!   call assert_equal('Not a swap file', info.error)
call delete('Xnotaswapfile')
  endfunc
*** ../vim-8.1.0313/src/version.c   2018-08-21 20:28:49.892006588 +0200
--- 

Re: Patch 8.1.0313

2018-08-21 Fir de Conversatie Christian Brabandt


On Di, 21 Aug 2018, Bram Moolenaar wrote:

> 
> Patch 8.1.0313
> Problem:Information about a swap file is unavailable.
> Solution:   Add swapinfo(). (Enzo Ferber)
> Files:runtime/doc/eval.txt, src/evalfunc.c, src/memline.c,
> src/proto/memline.pro, src/testdir/test_swap.vim

Is this information valid when the SwapFileExists autocommand triggers?

Best,
Christian
-- 
Faulheit ist der Hang zur Ruhe ohne vorhergehende Arbeit.
-- Immanuel Kant

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0313

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0313
Problem:Information about a swap file is unavailable.
Solution:   Add swapinfo(). (Enzo Ferber)
Files:  runtime/doc/eval.txt, src/evalfunc.c, src/memline.c,
src/proto/memline.pro, src/testdir/test_swap.vim


*** ../vim-8.1.0312/runtime/doc/eval.txt2018-08-21 16:56:28.363325301 
+0200
--- runtime/doc/eval.txt2018-08-21 20:12:15.882157860 +0200
***
*** 2409,2414 
--- 2416,2422 
specific match in ":s" or substitute()
  substitute({expr}, {pat}, {sub}, {flags})
String  all {pat} in {expr} replaced with {sub}
+ swapinfo({fname}) Dictinformation about swap file {fname}
  synID({lnum}, {col}, {trans}) Number  syntax ID at {lnum} and {col}
  synIDattr({synID}, {what} [, {mode}])
String  attribute {what} of syntax ID {synID}
***
*** 7999,8004 
--- 8009,8030 
|submatch()| returns.  Example: >
   :echo substitute(s, '%\(\x\x\)', {m -> '0x' . m[1]}, 'g')
  
+ swapinfo({fname}) swapinfo()
+   The result is a dictionary, which holds information about the
+   swapfile {fname}. The available fields are:
+   version VIM version
+   useruser name
+   hosthost name
+   fname   original file name
+   pid PID of the VIM process that created the swap
+   file
+   mtime   last modification time in seconds
+   inode   Optional: INODE number of the file
+   In case of failure an "error" item is added with the reason:
+   Cannot open file: file not found or in accessible
+   Cannot read file: cannot read first block
+   magic number mismatch: info in first block is invalid
+ 
  synID({lnum}, {col}, {trans}) *synID()*
The result is a Number, which is the syntax ID at the position
{lnum} and {col} in the current window.
*** ../vim-8.1.0312/src/evalfunc.c  2018-08-21 16:56:28.367325278 +0200
--- src/evalfunc.c  2018-08-21 20:26:36.876842294 +0200
***
*** 398,403 
--- 398,404 
  static void f_strwidth(typval_T *argvars, typval_T *rettv);
  static void f_submatch(typval_T *argvars, typval_T *rettv);
  static void f_substitute(typval_T *argvars, typval_T *rettv);
+ static void f_swapinfo(typval_T *argvars, typval_T *rettv);
  static void f_synID(typval_T *argvars, typval_T *rettv);
  static void f_synIDattr(typval_T *argvars, typval_T *rettv);
  static void f_synIDtrans(typval_T *argvars, typval_T *rettv);
***
*** 859,864 
--- 860,866 
  {"strwidth",  1, 1, f_strwidth},
  {"submatch",  1, 2, f_submatch},
  {"substitute",4, 4, f_substitute},
+ {"swapinfo",  1, 1, f_swapinfo},
  {"synID", 3, 3, f_synID},
  {"synIDattr", 2, 3, f_synIDattr},
  {"synIDtrans",1, 1, f_synIDtrans},
***
*** 12314,12319 
--- 12316,12331 
  }
  
  /*
+  * "swapinfo(swap_filename)" function
+  */
+ static void
+ f_swapinfo(typval_T *argvars, typval_T *rettv)
+ {
+ if (rettv_dict_alloc(rettv) == OK)
+   get_b0_dict(get_tv_string(argvars), rettv->vval.v_dict);
+ }
+ 
+ /*
   * "synID(lnum, col, trans)" function
   */
  static void
*** ../vim-8.1.0312/src/memline.c   2018-08-21 18:50:11.153501902 +0200
--- src/memline.c   2018-08-21 20:18:30.815871851 +0200
***
*** 2042,2047 
--- 2042,2090 
  #endif
  
  /*
+  * Return information found in swapfile "fname" in dictionary "d".
+  * This is used by the swapinfo() function.
+  */
+ void
+ get_b0_dict(char_u *fname, dict_T *d)
+ {
+ int fd;
+ struct block0 b0;
+ 
+ if ((fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) >= 0)
+ {
+   if (read_eintr(fd, , sizeof(b0)) == sizeof(b0))
+   {
+   if (b0_magic_wrong())
+   {
+   dict_add_string(d, "error",
+  vim_strsave((char_u *)"magic number mismatch"));
+   }
+   else
+   {
+   /* we have swap information */
+   dict_add_string(d, "version", vim_strsave(b0.b0_version));
+   dict_add_string(d, "user", vim_strsave(b0.b0_uname));
+   dict_add_string(d, "host", vim_strsave(b0.b0_hname));
+   dict_add_string(d, "fname", vim_strsave(b0.b0_fname));
+ 
+   dict_add_number(d, "pid", char_to_long(b0.b0_pid));
+   dict_add_number(d, "mtime", char_to_long(b0.b0_mtime));
+ #ifdef CHECK_INODE
+   dict_add_number(d, "inode", char_to_long(b0.b0_ino));
+ #endif
+   }
+   }
+   else
+   

Patch 8.1.0312

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0312
Problem:Wrong type for flags used in signal handlers.
Solution:   Use sig_atomic_t. (Dominique Pelle, closes #3356)
Files:  src/globals.h, src/os_unix.c, src/os_win32.h


*** ../vim-8.1.0311/src/globals.h   2018-08-14 13:38:12.744559267 +0200
--- src/globals.h   2018-08-21 19:32:32.566883918 +0200
***
*** 518,524 
   *
   * volatile because it is used in signal handler sig_sysmouse().
   */
! EXTERN volatile int hold_gui_events INIT(= 0);
  
  /*
   * When resizing the shell is postponed, remember the new size, and call
--- 518,524 
   *
   * volatile because it is used in signal handler sig_sysmouse().
   */
! EXTERN volatile sig_atomic_t hold_gui_events INIT(= 0);
  
  /*
   * When resizing the shell is postponed, remember the new size, and call
***
*** 655,661 
/* TRUE when in or after free_all_mem() */
  #endif
  /* volatile because it is used in signal handler deathtrap(). */
! EXTERN volatile int full_screen INIT(= FALSE);
/* TRUE when doing full-screen output
 * otherwise only writing some messages */
  
--- 655,661 
/* TRUE when in or after free_all_mem() */
  #endif
  /* volatile because it is used in signal handler deathtrap(). */
! EXTERN volatile sig_atomic_t full_screen INIT(= FALSE);
/* TRUE when doing full-screen output
 * otherwise only writing some messages */
  
***
*** 800,810 
  EXTERN JMP_BUF lc_jump_env;   /* argument to SETJMP() */
  # ifdef SIGHASARG
  /* volatile because it is used in signal handlers. */
! EXTERN volatile int lc_signal;/* caught signal number, 0 when no was 
signal
   caught; used for mch_libcall() */
  # endif
  /* volatile because it is used in signal handler deathtrap(). */
! EXTERN volatile int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is 
valid. */
  #endif
  
  #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
--- 800,810 
  EXTERN JMP_BUF lc_jump_env;   /* argument to SETJMP() */
  # ifdef SIGHASARG
  /* volatile because it is used in signal handlers. */
! EXTERN volatile sig_atomic_t lc_signal;   /* caught signal number, 0 when 
no was signal
   caught; used for mch_libcall() */
  # endif
  /* volatile because it is used in signal handler deathtrap(). */
! EXTERN volatile sig_atomic_t lc_active INIT(= FALSE); /* TRUE when 
lc_jump_env is valid. */
  #endif
  
  #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
***
*** 1037,1043 
  EXTERN intread_cmd_fd INIT(= 0);  /* fd to read commands from */
  
  /* volatile because it is used in signal handler catch_sigint(). */
! EXTERN volatile int got_int INIT(= FALSE);/* set to TRUE when interrupt
signal occurred */
  #ifdef USE_TERM_CONSOLE
  EXTERN intterm_console INIT(= FALSE); /* set to TRUE when console used */
--- 1037,1043 
  EXTERN intread_cmd_fd INIT(= 0);  /* fd to read commands from */
  
  /* volatile because it is used in signal handler catch_sigint(). */
! EXTERN volatile sig_atomic_t got_int INIT(= FALSE); /* set to TRUE when 
interrupt
signal occurred */
  #ifdef USE_TERM_CONSOLE
  EXTERN intterm_console INIT(= FALSE); /* set to TRUE when console used */
*** ../vim-8.1.0311/src/os_unix.c   2018-08-21 13:09:06.250115910 +0200
--- src/os_unix.c   2018-08-21 19:32:32.570883895 +0200
***
*** 161,167 
  static int get_x11_icon(int);
  
  static char_u *oldtitle = NULL;
! static volatile int oldtitle_outdated = FALSE;
  static intdid_set_title = FALSE;
  static char_u *oldicon = NULL;
  static intdid_set_icon = FALSE;
--- 161,167 
  static int get_x11_icon(int);
  
  static char_u *oldtitle = NULL;
! static volatile sig_atomic_t oldtitle_outdated = FALSE;
  static intdid_set_title = FALSE;
  static char_u *oldicon = NULL;
  static intdid_set_icon = FALSE;
***
*** 205,211 
  # define SET_SIG_ALARM
  static RETSIGTYPE sig_alarm SIGPROTOARG;
  /* volatile because it is used in signal handler sig_alarm(). */
! static volatile int sig_alarm_called;
  #endif
  static RETSIGTYPE deathtrap SIGPROTOARG;
  
--- 205,211 
  # define SET_SIG_ALARM
  static RETSIGTYPE sig_alarm SIGPROTOARG;
  /* volatile because it is used in signal handler sig_alarm(). */
! static volatile sig_atomic_t sig_alarm_called;
  #endif
  static RETSIGTYPE deathtrap SIGPROTOARG;
  
***
*** 231,243 
  #endif
  
  /* volatile because it is used in signal handler sig_winch(). */
! static volatile int do_resize = FALSE;
  static char_u *extra_shell_arg = NULL;
  static intshow_shell_mess = TRUE;
  /* volatile because it is used in signal handler 

Patch 8.1.0311

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0311
Problem:Filtering entries in a quickfix list is not easy.
Solution:   Add the cfilter plugin. (Yegappan Lakshmanan)
Files:  runtime/pack/dist/opt/cfilter/plugin/cfilter.vim,
runtime/doc/quickfix.txt


*** ../vim-8.1.0310/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim
1970-01-01 01:00:00.0 +0100
--- runtime/pack/dist/opt/cfilter/plugin/cfilter.vim2018-08-21 
18:56:37.027118962 +0200
***
*** 0 
--- 1,43 
+ " cfilter.vim: Plugin to filter entries from a quickfix/location list
+ " Last Change:May 12, 2018
+ " Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
+ " Version:1.0
+ "
+ " Commands to filter the quickfix list:
+ "   :Cfilter[!] {pat}
+ "   Create a new quickfix list from entries matching {pat} in the current
+ "   quickfix list. Both the file name and the text of the entries are
+ "   matched against {pat}. If ! is supplied, then entries not matching
+ "   {pat} are used.
+ "   :Lfilter[!] {pat}
+ "   Same as :Cfilter but operates on the current location list.
+ "
+ if exists("loaded_cfilter")
+ finish
+ endif
+ let loaded_cfilter = 1
+ 
+ func s:Qf_filter(qf, pat, bang)
+ if a:qf
+   let Xgetlist = function('getqflist')
+   let Xsetlist = function('setqflist')
+   let cmd = ':Cfilter' . a:bang
+ else
+   let Xgetlist = function('getloclist', [0])
+   let Xsetlist = function('setloclist', [0])
+   let cmd = ':Lfilter' . a:bang
+ endif
+ 
+ if a:bang == '!'
+   let cond = 'v:val.text !~# a:pat && bufname(v:val.bufnr) !~# a:pat'
+ else
+   let cond = 'v:val.text =~# a:pat || bufname(v:val.bufnr) =~# a:pat'
+ endif
+ 
+ let items = filter(Xgetlist(), cond)
+ let title = cmd . ' ' . a:pat
+ call Xsetlist([], ' ', {'title' : title, 'items' : items})
+ endfunc
+ 
+ com! -nargs=+ -bang Cfilter call s:Qf_filter(1, , )
+ com! -nargs=+ -bang Lfilter call s:Qf_filter(0, , )
*** ../vim-8.1.0310/runtime/doc/quickfix.txt2018-07-08 18:20:18.111521913 
+0200
--- runtime/doc/quickfix.txt2018-08-21 19:02:00.097112470 +0200
***
*** 1551,1556 
--- 1551,1572 
  recognized as a command separator.  The backslash before each space is
  required for the set command.
  
+   *cfilter-plugin*
+ If you have too many matching messages, you can use the cfilter plugin to
+ reduce the number of entries.  Load the plugin with: >
+packadd cfilter
+ 
+ Then you can use these command: >
+:Cfilter[!] {pat}
+:Lfilter[!] {pat}
+ 
+ :Cfilter creates a new quickfix list from entries matching {pat} in the
+ current quickfix list. Both the file name and the text of the entries are
+ matched against {pat}. If ! is supplied, then entries not matching {pat} are
+ used.
+ 
+ :Lfilter does the same as :Cfilter but operates on the current location list.
+ 
  =
  8. The directory stack
*quickfix-directory-stack*
  
*** ../vim-8.1.0310/src/version.c   2018-08-21 18:50:11.153501902 +0200
--- src/version.c   2018-08-21 19:01:28.421309486 +0200
***
*** 796,797 
--- 796,799 
  {   /* Add new patch number below this line */
+ /**/
+ 311,
  /**/

-- 
ARTHUR:Be quiet!  I order you to shut up.
OLD WOMAN: Order, eh -- who does he think he is?
ARTHUR:I am your king!
OLD WOMAN: Well, I didn't vote for you.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0310

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0310
Problem:File info message not always suppressed with 'F' in 'shortmess'.
(Asheq Imran)
Solution:   Save and restore msg_silent. (Christian Brabandt, closes #3221)
Files:  src/buffer.c, src/memline.c, src/testdir/test_options.vim


*** ../vim-8.1.0309/src/buffer.c2018-08-21 15:12:10.831801698 +0200
--- src/buffer.c2018-08-21 18:36:25.882450971 +0200
***
*** 1035,1041 
--- 1035,1048 
buf = old_curbuf->br_buf;
if (buf != NULL)
{
+   int old_msg_silent = msg_silent;
+ 
+   if (shortmess(SHM_FILEINFO))
+   msg_silent = 1;  // prevent fileinfo message
enter_buffer(buf);
+   // restore msg_silent, so that the command line will be shown
+   msg_silent = old_msg_silent;
+ 
  # ifdef FEAT_SYN_HL
if (old_tw != curbuf->b_p_tw)
check_colorcolumn(curwin);
*** ../vim-8.1.0309/src/memline.c   2018-08-20 22:53:00.210105086 +0200
--- src/memline.c   2018-08-21 18:38:03.481885916 +0200
***
*** 828,837 
   */
  void
  check_need_swap(
! int   newfile)/* reading file into new buffer */
  {
  if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile))
ml_open_file(curbuf);
  }
  
  /*
--- 828,840 
   */
  void
  check_need_swap(
! int   newfile)// reading file into new buffer
  {
+ int old_msg_silent = msg_silent; // might be reset by an E325 message
+ 
  if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile))
ml_open_file(curbuf);
+ msg_silent = old_msg_silent;
  }
  
  /*
*** ../vim-8.1.0309/src/testdir/test_options.vim2018-08-11 
17:52:57.848311971 +0200
--- src/testdir/test_options.vim2018-08-21 18:34:20.687161831 +0200
***
*** 414,416 
--- 414,437 
set shortmess&
bwipe
  endfunc
+ 
+ func Test_shortmess_F2()
+   e file1
+   e file2
+   call assert_match('file1', execute('bn', ''))
+   call assert_match('file2', execute('bn', ''))
+   set shortmess+=F
+   call assert_true(empty(execute('bn', '')))
+   call assert_true(empty(execute('bn', '')))
+   set hidden
+   call assert_true(empty(execute('bn', '')))
+   call assert_true(empty(execute('bn', '')))
+   set nohidden
+   call assert_true(empty(execute('bn', '')))
+   call assert_true(empty(execute('bn', '')))
+   set shortmess&
+   call assert_match('file1', execute('bn', ''))
+   call assert_match('file2', execute('bn', ''))
+   bwipe
+   bwipe
+ endfunc
*** ../vim-8.1.0309/src/version.c   2018-08-21 17:49:50.993308900 +0200
--- src/version.c   2018-08-21 18:42:36.348269248 +0200
***
*** 796,797 
--- 796,799 
  {   /* Add new patch number below this line */
+ /**/
+ 310,
  /**/

-- 
"The future's already arrived - it's just not evenly distributed yet."
-- William Gibson

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0309

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0309
Problem:Profiling does not show a count for condition lines. (Daniel
Hahler)
Solution:   Count lines when not skipping. (Ozaki Kiichi, closes #2499)
Files:  src/ex_docmd.c, src/testdir/test_profile.vim


*** ../vim-8.1.0308/src/ex_docmd.c  2018-08-21 15:12:10.839801647 +0200
--- src/ex_docmd.c  2018-08-21 17:40:31.920546399 +0200
***
*** 1766,1782 
  ea.skip = (if_level > 0);
  #endif
  
  #ifdef FEAT_EVAL
  # ifdef FEAT_PROFILE
! /* Count this line for profiling if ea.skip is FALSE. */
! if (do_profiling == PROF_YES && !ea.skip)
  {
!   if (getline_equal(fgetline, cookie, get_func_line))
!   func_line_exec(getline_cookie(fgetline, cookie));
!   else if (getline_equal(fgetline, cookie, getsourceline))
!   script_line_exec();
  }
! #endif
  
  /* May go to debug mode.  If this happens and the ">quit" debug command is
   * used, throw an interrupt exception and skip the next command. */
--- 1766,1816 
  ea.skip = (if_level > 0);
  #endif
  
+ /*
+  * 3. Skip over the range to find the command.  Let "p" point to after it.
+  *
+  * We need the command to know what kind of range it uses.
+  */
+ cmd = ea.cmd;
+ ea.cmd = skip_range(ea.cmd, NULL);
+ if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
+   ea.cmd = skipwhite(ea.cmd + 1);
+ p = find_command(, NULL);
+ 
  #ifdef FEAT_EVAL
  # ifdef FEAT_PROFILE
! // Count this line for profiling if skip is TRUE.
! if (do_profiling == PROF_YES
!   && (!ea.skip || cstack->cs_idx == 0 || (cstack->cs_idx > 0
!&& (cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE
  {
!   int skip = did_emsg || got_int || did_throw;
! 
!   if (ea.cmdidx == CMD_catch)
!   skip = !skip && !(cstack->cs_idx >= 0
! && (cstack->cs_flags[cstack->cs_idx] & CSF_THROWN)
! && !(cstack->cs_flags[cstack->cs_idx] & CSF_CAUGHT));
!   else if (ea.cmdidx == CMD_else || ea.cmdidx == CMD_elseif)
!   skip = skip || !(cstack->cs_idx >= 0
! && !(cstack->cs_flags[cstack->cs_idx]
! & (CSF_ACTIVE | CSF_TRUE)));
!   else if (ea.cmdidx == CMD_finally)
!   skip = FALSE;
!   else if (ea.cmdidx != CMD_endif
!   && ea.cmdidx != CMD_endfor
!   && ea.cmdidx != CMD_endtry
!   && ea.cmdidx != CMD_endwhile)
!   skip = ea.skip;
! 
!   if (!skip)
!   {
!   if (getline_equal(fgetline, cookie, get_func_line))
!   func_line_exec(getline_cookie(fgetline, cookie));
!   else if (getline_equal(fgetline, cookie, getsourceline))
!   script_line_exec();
!   }
  }
! # endif
  
  /* May go to debug mode.  If this happens and the ">quit" debug command is
   * used, throw an interrupt exception and skip the next command. */
***
*** 1789,1805 
  #endif
  
  /*
-  * 3. Skip over the range to find the command.  Let "p" point to after it.
-  *
-  * We need the command to know what kind of range it uses.
-  */
- cmd = ea.cmd;
- ea.cmd = skip_range(ea.cmd, NULL);
- if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
-   ea.cmd = skipwhite(ea.cmd + 1);
- p = find_command(, NULL);
- 
- /*
   * 4. parse a range specifier of the form: addr [,addr] [;addr] ..
   *
   * where 'addr' is:
--- 1823,1828 
*** ../vim-8.1.0308/src/testdir/test_profile.vim2018-06-30 
21:18:10.486300954 +0200
--- src/testdir/test_profile.vim2018-08-21 17:35:04.318354275 +0200
***
*** 67,73 
call assert_match('^\s*1\s\+.*\slet l:count = 100$', lines[13])
call assert_match('^\s*101\s\+.*\swhile l:count > 0$',   lines[14])
call assert_match('^\s*100\s\+.*\s  let l:count = l:count - 1$', lines[15])
!   call assert_match('^\s*100\s\+.*\sendwhile$',lines[16])
call assert_equal('',lines[17])
call assert_equal('FUNCTIONS SORTED ON TOTAL TIME',  lines[18])
call assert_equal('count  total (s)   self (s)  function',   lines[19])
--- 67,73 
call assert_match('^\s*1\s\+.*\slet l:count = 100$', lines[13])
call assert_match('^\s*101\s\+.*\swhile l:count > 0$',   lines[14])
call assert_match('^\s*100\s\+.*\s  let l:count = l:count - 1$', lines[15])
!   call assert_match('^\s*101\s\+.*\sendwhile$',lines[16])
call assert_equal('',lines[17])
call assert_equal('FUNCTIONS SORTED ON TOTAL TIME',  lines[18])
call assert_equal('count  total (s)   self (s)  function',   lines[19])
***
*** 84,89 
--- 84,310 
call delete('Xprofile_func.log')
  endfunc
  
+ func Test_profile_func_with_ifelse()
+   

Re: [vim/vim] (regression) inputlist() no longer takes mouse into account in inputlist() (#3239)

2018-08-21 Fir de Conversatie h_east
Hi Bram,

2018-8-21(Tue) 22:57:39 UTC+9 Bram Moolenaar:
> 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 
> > > > 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 
> > > 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.

Before 8.0.0722 worked fine.  So that I reverted this.
But implement again.

> 
> 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?

Probably I think so.
Patch updated.

Note:
I have not confirmed yet on GUI version.
I will be able to confirm by going to work. (After about 8 hours)

Thanks.

--
Best regards,
Hirohito Higashi (h_east)

-- 
-- 
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 

Re: [vim/vim] Use sig_atomic_t instead of int in variables read/written by signal handlers (#3356)

2018-08-21 Fir de Conversatie Bram Moolenaar


Dominique wrote:

> Build failed in CI on Windows with error: unknown type name 'sig_atomic_t'
> Probably it's just missing an Include on Windows. Or if sig_atomic_t is
> not available on old Windows compilers, then a configure script change
> would be needed.
> 
> Hopefully someone more knowledgeable about Windows can suggest
> a fix the compilation error on Windows. 

The type is normally defined in signal.h, which isn't included on
MS-Windows.  I believe it should always exist:

#include 

-- 
OLD WOMAN: King of the WHO?
ARTHUR:The Britons.
OLD WOMAN: Who are the Britons?
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0306

2018-08-21 Fir de Conversatie Bram Moolenaar


Sergey Alyoshin wrote:

> > There are still more. (Big gvim 8.1.306 with GTK2 GUI)
> >
> > I just noticed that when hitting u (Undo), if the previous change
> > happened just 1 second ago, the message displayed at the bottom of the
> > screen says "1 change" (which is correct) but also "1 seconds ago"
> > (which is not).
> 
> Patch for this message in undo.c file

Thanks, I had just made a (very similar) patch.

-- 
DENNIS: Oh, very nice. King, eh!  I expect you've got a palace and fine
clothes and courtiers and plenty of food.  And how d'you get that?  By
exploiting the workers! By hanging on to outdated imperialist dogma
which perpetuates the social and economic differences in our society!
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0308

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0308
Problem:A quick undo shows "1 seconds ago". (Tony Mechelynck)
Solution:   Add singular/plural message.
Files:  src/undo.c


*** ../vim-8.1.0307/src/undo.c  2018-07-13 16:31:11.952226727 +0200
--- src/undo.c  2018-08-21 17:05:23.300046260 +0200
***
*** 3124,3131 
  }
  else
  #endif
!   vim_snprintf((char *)buf, buflen, _("%ld seconds ago"),
! (long)(vim_time() - tt));
  }
  
  /*
--- 3124,3136 
  }
  else
  #endif
! {
!   long seconds = (long)(vim_time() - tt);
! 
!   vim_snprintf((char *)buf, buflen,
!   NGETTEXT("%ld second ago", "%ld seconds ago", seconds),
!   seconds);
! }
  }
  
  /*
*** ../vim-8.1.0307/src/version.c   2018-08-21 16:56:28.371325254 +0200
--- src/version.c   2018-08-21 17:06:12.627737719 +0200
***
*** 796,797 
--- 796,799 
  {   /* Add new patch number below this line */
+ /**/
+ 308,
  /**/

-- 
ARTHUR: I've said I'm sorry about the old woman, but from the behind you
looked ...
DENNIS: What I object to is that you automatically treat me like an inferior...
ARTHUR: Well ... I AM king.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0307

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0307
Problem:There is no good way to get the window layout.
Solution:   Add the winlayout() function. (Yegappan Lakshmanan)
Files:  runtime/doc/eval.txt, src/evalfunc.c, src/proto/window.pro,
src/window.c, src/testdir/test_window_id.vim


*** ../vim-8.1.0306/runtime/doc/eval.txt2018-07-29 15:34:20.864300100 
+0200
--- runtime/doc/eval.txt2018-08-21 16:35:43.299154086 +0200
***
*** 2497,2502 
--- 2504,2510 
  winbufnr({nr})Number  buffer number of window {nr}
  wincol()  Number  window column of the cursor
  winheight({nr})   Number  height of window {nr}
+ winlayout([{tabnr}])  Listlayout of windows in tab {tabnr}
  winline() Number  window line of the cursor
  winnr([{expr}])   Number  number of current window
  winrestcmd()  String  returns command to restore window sizes
***
*** 9087,9092 
--- 9096,9130 
Examples: >
:echo "The current window has " . winheight(0) . " lines."
  <
+ winlayout([{tabnr}])  *winlayout()*
+   The result is a nested List containing the layout of windows
+   in a tabpage.
+ 
+   Without {tabnr} use the current tabpage, otherwise the tabpage
+   with number {tabnr}. If the tabpage {tabnr} is not found,
+   returns an empty list.
+ 
+   For a leaf window, it returns:
+   ['leaf', {winid}]
+   For horizontally split windows, which form a column, it
+   returns:
+   ['col', [{nested list of windows}]]
+   For vertically split windows, which form a row, it returns:
+   ['row', [{nested list of windows}]]
+ 
+   Example: >
+   " Only one window in the tab page
+   :echo winlayout()
+   ['leaf', 1000]
+   " Two horizontally split windows
+   :echo winlayout()
+   ['col', [['leaf', 1000], ['leaf', 1001]]]
+   " Three horizontally split windows, with two
+   " vertically split windows in the middle window
+   :echo winlayout(2)
+   ['col', [['leaf', 1002], ['row', ['leaf', 1003],
+['leaf', 1001]]], ['leaf', 1000]]
+ <
*winline()*
  winline() The result is a Number, which is the screen line of the cursor
in the window.  This is counting screen lines from the top of
*** ../vim-8.1.0306/src/evalfunc.c  2018-08-11 13:57:16.211969806 +0200
--- src/evalfunc.c  2018-08-21 16:19:29.914566586 +0200
***
*** 463,468 
--- 463,469 
  static void f_winbufnr(typval_T *argvars, typval_T *rettv);
  static void f_wincol(typval_T *argvars, typval_T *rettv);
  static void f_winheight(typval_T *argvars, typval_T *rettv);
+ static void f_winlayout(typval_T *argvars, typval_T *rettv);
  static void f_winline(typval_T *argvars, typval_T *rettv);
  static void f_winnr(typval_T *argvars, typval_T *rettv);
  static void f_winrestcmd(typval_T *argvars, typval_T *rettv);
***
*** 952,957 
--- 953,959 
  {"winbufnr",  1, 1, f_winbufnr},
  {"wincol",0, 0, f_wincol},
  {"winheight", 1, 1, f_winheight},
+ {"winlayout", 0, 1, f_winlayout},
  {"winline",   0, 0, f_winline},
  {"winnr", 0, 1, f_winnr},
  {"winrestcmd",0, 0, f_winrestcmd},
***
*** 13743,13748 
--- 13745,13773 
  }
  
  /*
+  * "winlayout()" function
+  */
+ static void
+ f_winlayout(typval_T *argvars, typval_T *rettv)
+ {
+ tabpage_T *tp;
+ 
+ if (rettv_list_alloc(rettv) != OK)
+   return;
+ 
+ if (argvars[0].v_type == VAR_UNKNOWN)
+   tp = curtab;
+ else
+ {
+   tp = find_tabpage((int)get_tv_number([0]));
+   if (tp == NULL)
+   return;
+ }
+ 
+ get_framelayout(tp->tp_topframe, rettv->vval.v_list, TRUE);
+ }
+ 
+ /*
   * "winline()" function
   */
  static void
*** ../vim-8.1.0306/src/proto/window.pro2018-06-12 16:49:26.366028607 
+0200
--- src/proto/window.pro2018-08-21 16:38:15.282101882 +0200
***
*** 94,97 
--- 94,98 
  win_T *win_id2wp(typval_T *argvars);
  int win_id2win(typval_T *argvars);
  void win_findbuf(typval_T *argvars, list_T *list);
+ void get_framelayout(frame_T *fr, list_T *l, int topframe);
  /* vim: set ft=c : */
*** ../vim-8.1.0306/src/window.c2018-07-25 22:36:48.991518559 +0200
--- src/window.c2018-08-21 16:43:30.963948179 +0200
***
*** 7236,7239 
--- 7236,7288 
list_append_number(list, 

Re: Patch 8.1.0306

2018-08-21 Fir de Conversatie Sergey Alyoshin
On Tue, Aug 21, 2018 at 5:08 PM, Tony Mechelynck
 wrote:
> On Tue, Aug 21, 2018 at 3:12 PM, Bram Moolenaar  wrote:
>>
>> Patch 8.1.0306
>> Problem:Plural messages are not translated properly.
>> Solution:   Add more usage of NGETTEXT(). (Sergey Alyoshin)
>> Files:  src/vim.h, src/buffer.c, src/ex_cmds.c, src/ex_docmd.c,
>> src/fileio.c, src/misc1.c, src/ops.c
>
> There are still more. (Big gvim 8.1.306 with GTK2 GUI)
>
> I just noticed that when hitting u (Undo), if the previous change
> happened just 1 second ago, the message displayed at the bottom of the
> screen says "1 change" (which is correct) but also "1 seconds ago"
> (which is not).

Patch for this message in undo.c file


> Hitting u that fast doesn't happen much, but we shouldn't forget the
> possibility that languages other than English form their plural
> differently: for instance Russian has "agreement by proximity" after a
> numeral, so that the singular is used not only with 1 but also with
> 21, 31, 41, etc. (and the dual with 2-4, 22-24, 32-34, 42-44, etc.).
> (Russian cardinal numbers are constructed in a mannar parallel to
> those of English, French, etc., where 11-19 have their own single-word
> names not ending in 1-9.) Не правда ли, Сережа? ;-)

Чистая правда.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
From 7afa749f843de8fcf63f0736bfc21d678aa95124 Mon Sep 17 00:00:00 2001
From: Sergey Alyoshin 
Date: Tue, 21 Aug 2018 17:27:23 +0300
Subject: [PATCH] Use NGETTEXT() for undo was "seconds ago" message

---
 src/undo.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/undo.c b/src/undo.c
index 040ec54..d74a42c 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -3109,13 +3109,15 @@ ex_undolist(exarg_T *eap UNUSED)
 static void
 u_add_time(char_u *buf, size_t buflen, time_t tt)
 {
+time_t td = vim_time() - tt;
+
 #ifdef HAVE_STRFTIME
 struct tm	*curtime;
 
-if (vim_time() - tt >= 100)
+if (td >= 100)
 {
 	curtime = localtime();
-	if (vim_time() - tt < (60L * 60L * 12L))
+	if (td < (60L * 60L * 12L))
 	/* within 12 hours */
 	(void)strftime((char *)buf, buflen, "%H:%M:%S", curtime);
 	else
@@ -3124,8 +3126,8 @@ u_add_time(char_u *buf, size_t buflen, time_t tt)
 }
 else
 #endif
-	vim_snprintf((char *)buf, buflen, _("%ld seconds ago"),
-		  (long)(vim_time() - tt));
+	vim_snprintf((char *)buf, buflen, NGETTEXT("%ld second ago",
+		"%ld seconds ago", (long)td), (long)td);
 }
 
 /*
-- 
2.18.0



Re: ATTENTION message with spurious (still running) warning

2018-08-21 Fir de Conversatie Tony Mechelynck
On Tue, Aug 21, 2018 at 3:57 PM, Bram Moolenaar  wrote:
>
> Tony wrote:
>
>> If Vim is reloaded after a crash there will usually be one or more
>> ATTENTION (E325) messages. This is usually no problem for me as I save
>> my work at regular intervals, which means that I can usually delete
>> the swapfiles left standing after the crash (they will have "modified:
>> no"). However (especially after a system crash and a reboot) sometimes
>> the PID of the previous Vim has been reused, the ATTENTION message
>> says "(still running)" and the "delete" option is not available, even
>> though the program currently using that PID is not the Vim which
>> created the swapfile (and then crashed, or was involved in a system
>> crash). I'm not sure if (and how) it is possible to get over this
>> problem. Maybe in the (still running) case the ATTENTION message could
>> list the name of the program currently using that PID, and still offer
>> the "delete" option (possibly with an "are you sure" confirmation) if
>> that name isn't one of those (vim, gvim, view, etc.; even vi nowadays)
>> usually associated with a Vim executable?
>
> This is a corner case that is difficult to deal with.
> There is no standard way to get the name of a process from the pid.

Under Linux, on systems where the /proc filesystem is in use (which
IIUC is the general case), and if I represent the PID by $PID,
/proc/$PID/exe is a symlink to the executable, and /proc/$PID/cmdline
is a text file containing the $0, $1, etc. (the invoked executable
name and any command-line arguments), each of them null-terminated.
I'm not sure whether or not the /proc filesystem is in use on other
Unix-like systems (but I wouldn't bet against it), and of course on
Windows I suppose that even the existence of a given PID (the "(still
running)" part) must be got in a different way.

See "man 5 proc" and search (with less's regexps, very similar to
Vim's) for /proc/[pid]/cmdline and /proc/[pid]/exe

Best regards,
Tony.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ATTENTION message with spurious (still running) warning

2018-08-21 Fir de Conversatie Christian Brabandt


On Di, 21 Aug 2018, Bram Moolenaar wrote:

> There is no standard way to get the name of a process from the pid.

Yeah, that is also my understanding. However, on a best effort 
implementation, one could try reading /proc/$PID/status which I think 
only works on Linux (but is better than nothing). Not sure if Windows 
allows something like this.

Best,
Christian
-- 
Wie man sein Kind nicht nennen sollte: 
  Knut Schfleck 

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0306

2018-08-21 Fir de Conversatie Tony Mechelynck
On Tue, Aug 21, 2018 at 3:12 PM, Bram Moolenaar  wrote:
>
> Patch 8.1.0306
> Problem:Plural messages are not translated properly.
> Solution:   Add more usage of NGETTEXT(). (Sergey Alyoshin)
> Files:  src/vim.h, src/buffer.c, src/ex_cmds.c, src/ex_docmd.c,
> src/fileio.c, src/misc1.c, src/ops.c

There are still more. (Big gvim 8.1.306 with GTK2 GUI)

I just noticed that when hitting u (Undo), if the previous change
happened just 1 second ago, the message displayed at the bottom of the
screen says "1 change" (which is correct) but also "1 seconds ago"
(which is not).

Hitting u that fast doesn't happen much, but we shouldn't forget the
possibility that languages other than English form their plural
differently: for instance Russian has "agreement by proximity" after a
numeral, so that the singular is used not only with 1 but also with
21, 31, 41, etc. (and the dual with 2-4, 22-24, 32-34, 42-44, etc.).
(Russian cardinal numbers are constructed in a mannar parallel to
those of English, French, etc., where 11-19 have their own single-word
names not ending in 1-9.) Не правда ли, Сережа? ;-)

Best regards,
Tony.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ATTENTION message with spurious (still running) warning

2018-08-21 Fir de Conversatie Bram Moolenaar


Tony wrote:

> If Vim is reloaded after a crash there will usually be one or more
> ATTENTION (E325) messages. This is usually no problem for me as I save
> my work at regular intervals, which means that I can usually delete
> the swapfiles left standing after the crash (they will have "modified:
> no"). However (especially after a system crash and a reboot) sometimes
> the PID of the previous Vim has been reused, the ATTENTION message
> says "(still running)" and the "delete" option is not available, even
> though the program currently using that PID is not the Vim which
> created the swapfile (and then crashed, or was involved in a system
> crash). I'm not sure if (and how) it is possible to get over this
> problem. Maybe in the (still running) case the ATTENTION message could
> list the name of the program currently using that PID, and still offer
> the "delete" option (possibly with an "are you sure" confirmation) if
> that name isn't one of those (vim, gvim, view, etc.; even vi nowadays)
> usually associated with a Vim executable?

This is a corner case that is difficult to deal with.
There is no standard way to get the name of a process from the pid.

-- 
"Lisp has all the visual appeal of oatmeal with nail clippings thrown in."
 -- Larry Wall

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] (regression) inputlist() no longer takes mouse into account in inputlist() (#3239)

2018-08-21 Fir de Conversatie Bram Moolenaar


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 
> > > 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 
> > 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 -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0306

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0306
Problem:Plural messages are not translated properly.
Solution:   Add more usage of NGETTEXT(). (Sergey Alyoshin)
Files:  src/vim.h, src/buffer.c, src/ex_cmds.c, src/ex_docmd.c,
src/fileio.c, src/misc1.c, src/ops.c


*** ../vim-8.1.0305/src/vim.h   2018-08-11 13:57:16.215969777 +0200
--- src/vim.h   2018-08-21 14:34:37.322333098 +0200
***
*** 553,558 
--- 553,562 
  /*
   * The _() stuff is for using gettext().  It is a no-op when libintl.h is not
   * found or the +multilang feature is disabled.
+  * Use NGETTEXT(single, multi, number) to get plural behavior:
+  * - single - message for singular form
+  * - multi  - message for plural form
+  * - number - the count
   */
  #ifdef FEAT_GETTEXT
  # ifdef DYNAMIC_GETTEXT
*** ../vim-8.1.0305/src/buffer.c2018-08-11 13:57:16.207969835 +0200
--- src/buffer.c2018-08-21 14:39:25.584435950 +0200
***
*** 1174,1199 
else if (deleted >= p_report)
{
if (command == DOBUF_UNLOAD)
!   {
!   if (deleted == 1)
!   MSG(_("1 buffer unloaded"));
!   else
!   smsg((char_u *)_("%d buffers unloaded"), deleted);
!   }
else if (command == DOBUF_DEL)
!   {
!   if (deleted == 1)
!   MSG(_("1 buffer deleted"));
!   else
!   smsg((char_u *)_("%d buffers deleted"), deleted);
!   }
else
!   {
!   if (deleted == 1)
!   MSG(_("1 buffer wiped out"));
!   else
!   smsg((char_u *)_("%d buffers wiped out"), deleted);
!   }
}
  }
  
--- 1174,1187 
else if (deleted >= p_report)
{
if (command == DOBUF_UNLOAD)
!   smsg((char_u *)NGETTEXT("%d buffer unloaded",
!   "%d buffers unloaded", deleted), deleted);
else if (command == DOBUF_DEL)
!   smsg((char_u *)NGETTEXT("%d buffer deleted",
!   "%d buffers deleted", deleted), deleted);
else
!   smsg((char_u *)NGETTEXT("%d buffer wiped out",
!   "%d buffers wiped out", deleted), deleted);
}
  }
  
***
*** 3485,3503 
n = (int)(((long)curwin->w_cursor.lnum * 100L) /
(long)curbuf->b_ml.ml_line_count);
  if (curbuf->b_ml.ml_flags & ML_EMPTY)
- {
vim_snprintf_add((char *)buffer, IOSIZE, "%s", _(no_lines_msg));
- }
  #ifdef FEAT_CMDL_INFO
  else if (p_ru)
- {
/* Current line and column are already on the screen -- webb */
!   if (curbuf->b_ml.ml_line_count == 1)
!   vim_snprintf_add((char *)buffer, IOSIZE, _("1 line --%d%%--"), n);
!   else
!   vim_snprintf_add((char *)buffer, IOSIZE, _("%ld lines --%d%%--"),
!(long)curbuf->b_ml.ml_line_count, n);
! }
  #endif
  else
  {
--- 3473,3486 
n = (int)(((long)curwin->w_cursor.lnum * 100L) /
(long)curbuf->b_ml.ml_line_count);
  if (curbuf->b_ml.ml_flags & ML_EMPTY)
vim_snprintf_add((char *)buffer, IOSIZE, "%s", _(no_lines_msg));
  #ifdef FEAT_CMDL_INFO
  else if (p_ru)
/* Current line and column are already on the screen -- webb */
!   vim_snprintf_add((char *)buffer, IOSIZE,
!   NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--",
!  curbuf->b_ml.ml_line_count),
!   (long)curbuf->b_ml.ml_line_count, n);
  #endif
  else
  {
*** ../vim-8.1.0305/src/ex_cmds.c   2018-08-11 14:41:48.326928864 +0200
--- src/ex_cmds.c   2018-08-21 15:09:35.720800340 +0200
***
*** 985,996 
ml_delete(line1 + extra, TRUE);
  
  if (!global_busy && num_lines > p_report)
! {
!   if (num_lines == 1)
!   MSG(_("1 line moved"));
!   else
!   smsg((char_u *)_("%ld lines moved"), num_lines);
! }
  
  /*
   * Leave the cursor on the last of the moved lines.
--- 985,992 
ml_delete(line1 + extra, TRUE);
  
  if (!global_busy && num_lines > p_report)
!   smsg((char_u *)NGETTEXT("%ld line moved", "%ld lines moved", num_lines),
!   (long)num_lines);
  
  /*
   * Leave the cursor on the last of the moved lines.
***
*** 5940,5962 
|| count_only)
&& messaging())
  {
if (got_int)
STRCPY(msg_buf, _("(Interrupted) "));
else
*msg_buf = NUL;
!   if (sub_nsubs == 1)
!   vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
!   "%s", count_only ? _("1 match") : _("1 substitution"));
!   else
!   vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
!  

Re: [vim/vim] (regression) inputlist() no longer takes mouse into account in inputlist() (#3239)

2018-08-21 Fir de Conversatie h_east
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 
> > 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 
> 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.
--
Best regards,
Hirohito Higashi (h_east)

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/misc1.c b/src/misc1.c
index 1647aa952..6b93889ea 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3752,12 +3752,7 @@ prompt_for_number(int *mouse_used)
 save_cmdline_row = cmdline_row;
 cmdline_row = 0;
 save_State = State;
-State = ASKMORE;	/* prevents a screen update when using a timer */
-#ifdef FEAT_MOUSE
-/* May show different mouse shape. */
-setmouse();
-#endif
-
+State = CMDLINE;
 
 i = get_number(TRUE, mouse_used);
 if (KeyTyped)
@@ -3772,10 +3767,6 @@ prompt_for_number(int *mouse_used)
 else
 	cmdline_row = save_cmdline_row;
 State = save_State;
-#ifdef FEAT_MOUSE
-/* May need to restore mouse shape. */
-setmouse();
-#endif
 
 return i;
 }
diff --git a/src/screen.c b/src/screen.c
index a4eef3205..db5f1dbc2 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -458,9 +458,11 @@ redraw_after_callback(int call_update_screen)
 #endif
 		&& call_update_screen)
 	update_screen(0);
-	/* Redraw in the same position, so that the user can continue
-	 * 

Patch 8.1.0305

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0305
Problem:Missing support for Lua 5.4 32 bits on Unix.
Solution:   Define lua_newuserdatauv. (Kazunobu Kuriyama)
Files:  src/if_lua.c


*** ../vim-8.1.0304/src/if_lua.c2018-07-25 22:02:32.227966325 +0200
--- src/if_lua.c2018-08-21 14:00:16.783006997 +0200
***
*** 164,170 
  #define lua_rawget dll_lua_rawget
  #define lua_rawgeti dll_lua_rawgeti
  #define lua_createtable dll_lua_createtable
! #define lua_newuserdata dll_lua_newuserdata
  #define lua_getmetatable dll_lua_getmetatable
  #define lua_setfield dll_lua_setfield
  #define lua_rawset dll_lua_rawset
--- 164,174 
  #define lua_rawget dll_lua_rawget
  #define lua_rawgeti dll_lua_rawgeti
  #define lua_createtable dll_lua_createtable
! #if LUA_VERSION_NUM >= 504
!  #define lua_newuserdatauv dll_lua_newuserdatauv
! #else
!  #define lua_newuserdata dll_lua_newuserdata
! #endif
  #define lua_getmetatable dll_lua_getmetatable
  #define lua_setfield dll_lua_setfield
  #define lua_rawset dll_lua_rawset
***
*** 261,267 
--- 265,275 
  int (*dll_lua_rawgeti) (lua_State *L, int idx, lua_Integer n);
  #endif
  void (*dll_lua_createtable) (lua_State *L, int narr, int nrec);
+ #if LUA_VERSION_NUM >= 504
+ void *(*dll_lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue);
+ #else
  void *(*dll_lua_newuserdata) (lua_State *L, size_t sz);
+ #endif
  int (*dll_lua_getmetatable) (lua_State *L, int objindex);
  void (*dll_lua_setfield) (lua_State *L, int idx, const char *k);
  void (*dll_lua_rawset) (lua_State *L, int idx);
***
*** 362,368 
--- 370,380 
  {"lua_rawget", (luaV_function) _lua_rawget},
  {"lua_rawgeti", (luaV_function) _lua_rawgeti},
  {"lua_createtable", (luaV_function) _lua_createtable},
+ #if LUA_VERSION_NUM >= 504
+ {"lua_newuserdatauv", (luaV_function) _lua_newuserdatauv},
+ #else
  {"lua_newuserdata", (luaV_function) _lua_newuserdata},
+ #endif
  {"lua_getmetatable", (luaV_function) _lua_getmetatable},
  {"lua_setfield", (luaV_function) _lua_setfield},
  {"lua_rawset", (luaV_function) _lua_rawset},
*** ../vim-8.1.0304/src/version.c   2018-08-21 13:09:06.254115882 +0200
--- src/version.c   2018-08-21 14:03:03.910066481 +0200
***
*** 796,797 
--- 796,799 
  {   /* Add new patch number below this line */
+ /**/
+ 305,
  /**/

-- 
Why I like vim:
> I like VIM because, when I ask a question in this newsgroup, I get a
> one-line answer.  With xemacs, I get a 1Kb lisp script with bugs in it ;-)

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ATTENTION message with spurious (still running) warning

2018-08-21 Fir de Conversatie Tony Mechelynck
If Vim is reloaded after a crash there will usually be one or more
ATTENTION (E325) messages. This is usually no problem for me as I save
my work at regular intervals, which means that I can usually delete
the swapfiles left standing after the crash (they will have "modified:
no"). However (especially after a system crash and a reboot) sometimes
the PID of the previous Vim has been reused, the ATTENTION message
says "(still running)" and the "delete" option is not available, even
though the program currently using that PID is not the Vim which
created the swapfile (and then crashed, or was involved in a system
crash). I'm not sure if (and how) it is possible to get over this
problem. Maybe in the (still running) case the ATTENTION message could
list the name of the program currently using that PID, and still offer
the "delete" option (possibly with an "are you sure" confirmation) if
that name isn't one of those (vim, gvim, view, etc.; even vi nowadays)
usually associated with a Vim executable?

Best regards,
Tony.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0304

2018-08-21 Fir de Conversatie Bram Moolenaar


Patch 8.1.0304
Problem:No redraw when using a STOP signal on Vim and then a CONT signal.
Solution:   Catch the CONT signal and set the terminal to raw mode.  This is
like 8.1.0244 but without the screen redraw and a fix for
multi-threading suggested by Dominique Pelle.
Files:  src/os_unix.c, src/term.c, src/proto/term.pro


*** ../vim-8.1.0303/src/os_unix.c   2018-08-20 21:58:53.505410802 +0200
--- src/os_unix.c   2018-08-21 13:01:23.341522963 +0200
***
*** 1228,1241 
  SIGRETURN;
  }
  
- #if defined(_REENTRANT) && defined(SIGCONT)
  /*
!  * On Solaris with multi-threading, suspending might not work immediately.
!  * Catch the SIGCONT signal, which will be used as an indication whether the
!  * suspending has been done or not.
   *
   * On Linux, signal is not always handled immediately either.
   * See https://bugs.launchpad.net/bugs/291373
   *
   * volatile because it is used in signal handler sigcont_handler().
   */
--- 1228,1262 
  SIGRETURN;
  }
  
  /*
!  * Invoked after receiving SIGCONT.  We don't know what happened while
!  * sleeping, deal with part of that.
!  */
! static void
! after_sigcont(void)
! {
! # ifdef FEAT_TITLE
! // Don't change "oldtitle" in a signal handler, set a flag to obtain it
! // again later.
! oldtitle_outdated = TRUE;
! # endif
! settmode(TMODE_RAW);
! need_check_timestamps = TRUE;
! did_check_timestamps = FALSE;
! }
! 
! #if defined(SIGCONT)
! static RETSIGTYPE sigcont_handler SIGPROTOARG;
! static volatile int in_mch_suspend = FALSE;
! 
! /*
!  * With multi-threading, suspending might not work immediately.  Catch the
!  * SIGCONT signal, which will be used as an indication whether the suspending
!  * has been done or not.
   *
   * On Linux, signal is not always handled immediately either.
   * See https://bugs.launchpad.net/bugs/291373
+  * Probably because the signal is handled in another thread.
   *
   * volatile because it is used in signal handler sigcont_handler().
   */
***
*** 1248,1254 
  static RETSIGTYPE
  sigcont_handler SIGDEFARG(sigarg)
  {
! sigcont_received = TRUE;
  SIGRETURN;
  }
  #endif
--- 1269,1290 
  static RETSIGTYPE
  sigcont_handler SIGDEFARG(sigarg)
  {
! if (in_mch_suspend)
! {
!   sigcont_received = TRUE;
! }
! else
! {
!   // We didn't suspend ourselves, assume we were stopped by a SIGSTOP
!   // signal (which can't be intercepted) and get a SIGCONT.  Need to get
!   // back to a sane mode. We should redraw, but we can't really do that
!   // in a signal handler, do a redraw later.
!   after_sigcont();
!   redraw_later(CLEAR);
!   cursor_on_force();
!   out_flush();
! }
! 
  SIGRETURN;
  }
  #endif
***
*** 1331,1336 
--- 1367,1374 
  {
  /* BeOS does have SIGTSTP, but it doesn't work. */
  #if defined(SIGTSTP) && !defined(__BEOS__)
+ in_mch_suspend = TRUE;
+ 
  out_flush();  /* needed to make cursor visible on some systems */
  settmode(TMODE_COOK);
  out_flush();  /* needed to disable mouse on some systems */
***
*** 1338,1377 
  # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
  loose_clipboard();
  # endif
! 
! # if defined(_REENTRANT) && defined(SIGCONT)
  sigcont_received = FALSE;
  # endif
  kill(0, SIGTSTP); /* send ourselves a STOP signal */
! # if defined(_REENTRANT) && defined(SIGCONT)
  /*
   * Wait for the SIGCONT signal to be handled. It generally happens
!  * immediately, but somehow not all the time. Do not call pause()
!  * because there would be race condition which would hang Vim if
!  * signal happened in between the test of sigcont_received and the
!  * call to pause(). If signal is not yet received, call sleep(0)
!  * to just yield CPU. Signal should then be received. If somehow
!  * it's still not received, sleep 1, 2, 3 ms. Don't bother waiting
!  * further if signal is not received after 1+2+3+4 ms (not expected
!  * to happen).
   */
  {
long wait_time;
for (wait_time = 0; !sigcont_received && wait_time <= 3L; wait_time++)
-   /* Loop is not entered most of the time */
mch_delay(wait_time, FALSE);
  }
  # endif
  
! # ifdef FEAT_TITLE
! /*
!  * Set oldtitle to NULL, so the current title is obtained again.
!  */
! VIM_CLEAR(oldtitle);
! # endif
! settmode(TMODE_RAW);
! need_check_timestamps = TRUE;
! did_check_timestamps = FALSE;
  #else
  suspend_shell();
  #endif
--- 1376,1407 
  # if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
  loose_clipboard();
  # endif
! # if defined(SIGCONT)
  sigcont_received = FALSE;
  # endif
+ 
  kill(0, SIGTSTP); /* send ourselves a STOP signal */
! 
! # if defined(SIGCONT)
  /*
   * Wait for the SIGCONT signal to be handled. It generally happens
!  *