Re: [vim/vim] :help netrw-browse-maps show wrong mapping for netrw-c (#6266)

2020-06-15 Fir de Conversatie Charles Campbell

DiegoRenner (Vim Github Repository) wrote:


*Describe the bug*
In the output of :help netrw-browse-maps the keybinding to change the 
diretory to the current one is declared to be c.
In the output of :help netrw-c however it is said that the keybinding 
for this is now cd which seems to be correct.


*To Reproduce*

 1. Run vim
 2. Enter command :help netrw-browse-maps
 3. Check keybinding for netrw-c
 4. Enter command :help netrw-c
 5. Check keybinding for netrw-c

*Expected behavior*
:help netrw-browse-maps should show cd as the keybinding for
changing directory

*Screenshots*
From :help netrw-browse-maps
c Make browsing directory the current directory netrw-c
From :help netrw-c
netrw-c : This map's name has been changed from "c" to cd (see netrw-cd).
This change was done to allow for netrw-cb and netrw-cB maps.

*Environment (please complete the following information):*

  * Vim version 8.2.814
  * OS: 5.7.2-arch1-1
  * Terminal: st


Your environment should include information about which netrw you're 
using.  The latest one is netrw v170g, which you may get from my 
website: http://www.drchip.org/astronaut/vim/index.html#NETRW ; you'll 
find that address in :help netrw-debug .


Regards,
Chip Campbell

--
--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/758b7d17-304e-9c74-71f1-f655fe44a999%40drchip.org.


Patch 8.2.0986

2020-06-15 Fir de Conversatie Bram Moolenaar


Patch 8.2.0986 (after 8.2.0985)
Problem:MS-Windows: functions test fails.
Solution:   Only simplify ///path on Unix.
Files:  src/testdir/test_functions.vim


*** ../vim-8.2.0985/src/testdir/test_functions.vim  2020-06-15 
21:41:51.791814391 +0200
--- src/testdir/test_functions.vim  2020-06-15 23:16:35.076913147 +0200
***
*** 464,471 
call assert_equal('/',   simplify('/..'))
call assert_equal('/...',simplify('/...'))
call assert_equal('//path',  simplify('//path'))
!   call assert_equal('/path',   simplify('///path'))
!   call assert_equal('/path',   simplify('path'))
  
call assert_equal('./dir/file',  './dir/file'->simplify())
call assert_equal('./dir/file',  simplify('.///dir//file'))
--- 464,473 
call assert_equal('/',   simplify('/..'))
call assert_equal('/...',simplify('/...'))
call assert_equal('//path',  simplify('//path'))
!   if has('unix')
! call assert_equal('/path',   simplify('///path'))
! call assert_equal('/path',   simplify('path'))
!   endif
  
call assert_equal('./dir/file',  './dir/file'->simplify())
call assert_equal('./dir/file',  simplify('.///dir//file'))
*** ../vim-8.2.0985/src/version.c   2020-06-15 21:41:51.795814374 +0200
--- src/version.c   2020-06-15 22:57:46.753369662 +0200
***
*** 756,757 
--- 756,759 
  {   /* Add new patch number below this line */
+ /**/
+ 986,
  /**/

-- 
Seen on the back of a biker's vest: If you can read this, my wife fell off.

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202006152119.05FLJSi61196714%40masaka.moolenaar.net.


Re: [vim/vim] "simplify()" does not reduce multiple leading path separators (#6263)

2020-06-15 Fir de Conversatie Gary Johnson
On 2020-06-15, dylnmc wrote:
> @brammool I have been following this issue, and I was hoping that there could
> be an optional parameter to remove all forward slashes at the front except for
> the first one.
> 
> This is because I am using paths as keys to a dictionary, and without simplify
> () removing all leading duplicate forward slashes, there is no good option 
> than
> adding unnecessary stuff.
> 
> These are the best two ways of doing it without this optional "remove all
> prefixed duplicate forward slashes":
> 
>   • let foo = function({ path -> simplify(path[:0] is '/' ? '//'..path : path)
> }(expand(a:path)
>   • let foo = substitute(simplify(expand(a:path)), '^/\{2.}', '/', '')
> 
> I am not a big fan of either of these happening many times per second in a 
> loop
> or in a repeatedly called function. let foo = simplify(a:path, v:true) is much
> more preferable.

So what is the measured performance difference of

let foo = simplify(expand(a:path)

vs.

let foo = substitute(simplify(expand(a:path)), '^/\{2.}', '/', '')

in your application?

Regards,
Gary

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20200615210200.GD29345%40phoenix.


Patch 8.2.0985

2020-06-15 Fir de Conversatie Bram Moolenaar


Patch 8.2.0985
Problem:Simplify() does not remove slashes from "///path".
Solution:   Reduce > 2 slashes to one. (closes #6263)
Files:  src/findfile.c, src/testdir/test_functions.vim


*** ../vim-8.2.0984/src/findfile.c  2020-06-12 22:59:07.266097201 +0200
--- src/findfile.c  2020-06-15 21:41:04.872019011 +0200
***
*** 2641,2646 
--- 2641,2654 
while (vim_ispathsep(*p));
  }
  start = p;// remember start after "c:/" or "/" or "///"
+ #ifdef UNIX
+ // Posix says that "//path" is unchanged but "///path" is "/path".
+ if (start > filename + 2)
+ {
+   STRMOVE(filename + 1, p);
+   start = p = filename + 1;
+ }
+ #endif
  
  do
  {
*** ../vim-8.2.0984/src/testdir/test_functions.vim  2020-06-10 
16:54:09.569078300 +0200
--- src/testdir/test_functions.vim  2020-06-15 21:40:36.148144972 +0200
***
*** 463,468 
--- 463,472 
call assert_equal('/',   simplify('/.'))
call assert_equal('/',   simplify('/..'))
call assert_equal('/...',simplify('/...'))
+   call assert_equal('//path',  simplify('//path'))
+   call assert_equal('/path',   simplify('///path'))
+   call assert_equal('/path',   simplify('path'))
+ 
call assert_equal('./dir/file',  './dir/file'->simplify())
call assert_equal('./dir/file',  simplify('.///dir//file'))
call assert_equal('./dir/file',  simplify('./dir/./file'))
***
*** 1355,1360 
--- 1359,1365 
  
  " Test for the inputdialog() function
  func Test_inputdialog()
+   set timeout timeoutlen=10
if has('gui_running')
  call assert_fails('let v=inputdialog([], "xx")', 'E730:')
  call assert_fails('let v=inputdialog("Q", [])', 'E730:')
***
*** 1364,1369 
--- 1369,1375 
  call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\\", 'xt')
  call assert_equal('yy', v)
endif
+   set timeout& timeoutlen&
  endfunc
  
  " Test for inputlist()
***
*** 1916,1922 
  \ ->map({-> v:val.name})
call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt'])
  
!   " report brocken link correctly
if has("unix")
  call writefile([], 'Xdir/abc.txt')
  call system("ln -s Xdir/abc.txt Xdir/link")
--- 1922,1928 
  \ ->map({-> v:val.name})
call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt'])
  
!   " report broken link correctly
if has("unix")
  call writefile([], 'Xdir/abc.txt')
  call system("ln -s Xdir/abc.txt Xdir/link")
*** ../vim-8.2.0984/src/version.c   2020-06-15 21:19:04.017590497 +0200
--- src/version.c   2020-06-15 21:37:05.553088144 +0200
***
*** 756,757 
--- 756,759 
  {   /* Add new patch number below this line */
+ /**/
+ 985,
  /**/

-- 
ARTHUR:  Shut up!  Will you shut up!
DENNIS:  Ah, now we see the violence inherent in the system.
ARTHUR:  Shut up!
DENNIS:  Oh!  Come and see the violence inherent in the system!
 HELP! HELP!  I'm being repressed!
  The Quest for the Holy Grail (Monty Python)

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202006151945.05FJj0px1172498%40masaka.moolenaar.net.


Re: Enhancement idea: "vim --get-vimruntime"

2020-06-15 Fir de Conversatie Gary Johnson
On 2020-06-15, Peter Whittaker wrote:
> On Fri, Jun 12, 2020 at 1:36 PM Bram Moolenaar  wrote:
> > Peter Whittaker wrote:
> >
> > > vimrntm=$(vim --not-a-term -T dumb --cmd 'echo $VIMRUNTIME' --cmd quit | \
> > > tr -d '\n\r' |sed -E 's,[^/]+,,')
> > >
> > > What I'd really like is "vimrntm=$(vim --get-vimruntime)"
> >
> > I think you already found a way that works:
> > vi --not-a-term -c 'echo $VIMRUNTIME' -c q
> >
> > Why would a command line argument be needed that would do the same
> > thing?
> 
> It's not exactly doing the same thing: The existing capability
> requires post-processing to remove extraneous characters, which isn't
> surprising, since those characters aren't extraneous for vim's default
> behaviour, which is managing a graphical display. Based on a 10+ year
> old example I found online, I hacked together a double pipeline of tr
> and sed to remove those characters, but that's definitely ugly, and it
> also feels fragile: I'm hardcoding in knowledge of what those
> characters are; it works everywhere I need it to right now, but it
> feels iffy.

I just threw this together and saw no extraneous characters.

$ vim -u NONE -es -c '!echo $VIMRUNTIME' -c q

Regards,
Gary

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20200615193831.GC29345%40phoenix.


Patch 8.2.0984

2020-06-15 Fir de Conversatie Bram Moolenaar


Patch 8.2.0984
Problem:Not using previous window when closing a shell popup window.
Solution:   Use "prevwin" if it was set. (closes #6267)
Files:  src/popupwin.c, src/testdir/test_popupwin.vim


*** ../vim-8.2.0983/src/popupwin.c  2020-05-30 20:30:42.896816552 +0200
--- src/popupwin.c  2020-06-15 21:18:24.249750346 +0200
***
*** 2148,2153 
--- 2148,2166 
  }
  
  /*
+  * Make "prevwin" the current window, unless it's equal to "wp".
+  * Otherwise make "firstwin" the current window.
+  */
+ static void
+ back_to_prevwin(win_T *wp)
+ {
+ if (win_valid(prevwin) && wp != prevwin)
+   win_enter(prevwin, FALSE);
+ else
+   win_enter(firstwin, FALSE);
+ }
+ 
+ /*
   * Close popup "wp" and invoke any close callback for it.
   */
  static void
***
*** 2178,2187 
break;
if (owp != NULL)
win_enter(owp, FALSE);
-   else if (win_valid(prevwin) && wp != prevwin)
-   win_enter(prevwin, FALSE);
else
!   win_enter(firstwin, FALSE);
}
  }
  #endif
--- 2191,2198 
break;
if (owp != NULL)
win_enter(owp, FALSE);
else
!   back_to_prevwin(wp);
}
  }
  #endif
***
*** 2583,2589 
error_for_popup_window();
return FAIL;
}
!   win_enter(firstwin, FALSE);
}
if (prev == NULL)
first_popupwin = wp->w_next;
--- 2594,2600 
error_for_popup_window();
return FAIL;
}
!   back_to_prevwin(wp);
}
if (prev == NULL)
first_popupwin = wp->w_next;
***
*** 2620,2626 
error_for_popup_window();
return FAIL;
}
!   win_enter(firstwin, FALSE);
}
if (prev == NULL)
*root = wp->w_next;
--- 2631,2637 
error_for_popup_window();
return FAIL;
}
!   back_to_prevwin(wp);
}
if (prev == NULL)
*root = wp->w_next;
*** ../vim-8.2.0983/src/testdir/test_popupwin.vim   2020-05-27 
23:15:12.846004351 +0200
--- src/testdir/test_popupwin.vim   2020-06-15 21:17:39.725929635 +0200
***
*** 2461,2466 
--- 2461,2483 
call assert_equal(origwin, win_getid())
  endfunc
  
+ func Test_popupwin_close_prevwin()
+   CheckFeature terminal
+ 
+   call assert_equal(1, winnr('$'))
+   split
+   wincmd b
+   call assert_equal(2, winnr())
+   let buf = term_start(, #{hidden: 1})
+   call popup_create(buf, {})
+   call term_wait(buf, 100)
+   call popup_clear(1)
+   call assert_equal(2, winnr())
+ 
+   quit
+   exe 'bwipe! ' .. buf
+ endfunc
+ 
  func Test_popupwin_with_buffer_and_filter()
new Xwithfilter
call setline(1, range(100))
*** ../vim-8.2.0983/src/version.c   2020-06-15 20:24:53.930811611 +0200
--- src/version.c   2020-06-15 21:06:14.560765771 +0200
***
*** 756,757 
--- 756,759 
  {   /* Add new patch number below this line */
+ /**/
+ 984,
  /**/

-- 
Q:   How many hardware engineers does it take to change a lightbulb?
A:   None.  We'll fix it in software.

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202006151919.05FJJigm1165833%40masaka.moolenaar.net.


Re: [vim/vim] "simplify()" does not reduce multiple leading path separators (#6263)

2020-06-15 Fir de Conversatie Gary Johnson
On 2020-06-15, lacygoill wrote:
> This is not a bug. The simplify() function should leave two leading
> slashes alone.
> 
> Although, if the specification says that more than 2 leading slashes should be
> treated as a single slash, then maybe this could be considered as a bug:
> 
> echo simplify('///tmp')
> ///tmp

I later thought about that, too.  I think you're probably right.
I'm not aware of any cases where more that two slashes has any
meaning, and POSIX says they should be treated as one, so it would
make sense for simplify() to collapse more than two to just one.

Regards,
Gary

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20200615185415.GB29345%40phoenix.


Re: Enhancement idea: "vim --get-vimruntime"

2020-06-15 Fir de Conversatie Peter Whittaker
On Fri, Jun 12, 2020 at 1:36 PM Bram Moolenaar  wrote:
> Peter Whittaker wrote:
>
> > vimrntm=$(vim --not-a-term -T dumb --cmd 'echo $VIMRUNTIME' --cmd quit | \
> > tr -d '\n\r' |sed -E 's,[^/]+,,')
> >
> > What I'd really like is "vimrntm=$(vim --get-vimruntime)"
>
> I think you already found a way that works:
> vi --not-a-term -c 'echo $VIMRUNTIME' -c q
>
> Why would a command line argument be needed that would do the same
> thing?

It's not exactly doing the same thing: The existing capability
requires post-processing to remove extraneous characters, which isn't
surprising, since those characters aren't extraneous for vim's default
behaviour, which is managing a graphical display. Based on a 10+ year
old example I found online, I hacked together a double pipeline of tr
and sed to remove those characters, but that's definitely ugly, and it
also feels fragile: I'm hardcoding in knowledge of what those
characters are; it works everywhere I need it to right now, but it
feels iffy.

So the difference is that --get-default-runtime would just spit out
exactly that, no screen driving characters; this would be directly
assignable without further filtering.

There should be difference between what is displayed on the screen or
what is written to a file; right now, with the "echo" method, there
is.

My first, simplest thought was to add an appropriate function to
version.c, since version.c already has code to do this it's done as
part of list_version(): list_version() doesn't add the extraneous
format controls (unless it is called as a vim function, e.g., as
":version", not on the command line). It occurs to me we do define a
vim function for this as well.

I started pulling together the list of files that should be changed,
e.g., code, documentation, for both cases. If we decide this is
worthwhile, I'll create a github issue and add the design thoughts and
file list therein, and then bash away at it a while.

Thoughts?

P


Peter Whittaker
EdgeKeep Inc.
www.edgekeep.com

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAGeouKGSn%3DFXo%2BLTYEbQoeGqNKQ%3D49H83bFcxuw0Gts1DRcS5Q%40mail.gmail.com.


Patch 8.2.0983

2020-06-15 Fir de Conversatie Bram Moolenaar


Patch 8.2.0983
Problem:SConstruct file type not recognized.
Solution:   Use python for SConstruct files. (Roland Hieber)
Files:  runtime/filetype.vim, src/testdir/test_filetype.vim


*** ../vim-8.2.0982/runtime/filetype.vim2020-06-14 20:04:28.432529296 
+0200
--- runtime/filetype.vim2020-06-15 20:22:46.895302214 +0200
***
*** 1296,1302 
  
  " Python, Python Shell Startup and Python Stub Files
  " Quixote (Python-based web framework)
! au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc,*.ptl,*.pyi  setf 
python
  
  " Radiance
  au BufNewFile,BufRead *.rad,*.mat setf radiance
--- 1296,1303 
  
  " Python, Python Shell Startup and Python Stub Files
  " Quixote (Python-based web framework)
! au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc  setf python
! au BufNewFile,BufRead *.ptl,*.pyi,SConstruct setf python
  
  " Radiance
  au BufNewFile,BufRead *.rad,*.mat setf radiance
*** ../vim-8.2.0982/src/testdir/test_filetype.vim   2020-06-14 
20:04:28.432529296 +0200
--- src/testdir/test_filetype.vim   2020-06-15 20:23:02.427244667 +0200
***
*** 361,367 
  \ 'protocols': ['/etc/protocols'],
  \ 'psf': ['file.psf'],
  \ 'pyrex': ['file.pyx', 'file.pxd'],
! \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 
'file.ptl', 'file.pyi'],
  \ 'quake': ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg'],
  \ 'radiance': ['file.rad', 'file.mat'],
  \ 'ratpoison': ['.ratpoisonrc', 'ratpoisonrc'],
--- 361,367 
  \ 'protocols': ['/etc/protocols'],
  \ 'psf': ['file.psf'],
  \ 'pyrex': ['file.pyx', 'file.pxd'],
! \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 
'file.ptl', 'file.pyi', 'SConstruct'],
  \ 'quake': ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg'],
  \ 'radiance': ['file.rad', 'file.mat'],
  \ 'ratpoison': ['.ratpoisonrc', 'ratpoisonrc'],
*** ../vim-8.2.0982/src/version.c   2020-06-15 19:51:52.637404472 +0200
--- src/version.c   2020-06-15 20:24:21.862950037 +0200
***
*** 756,757 
--- 756,759 
  {   /* Add new patch number below this line */
+ /**/
+ 983,
  /**/

-- 
Windows
M!uqoms

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202006151826.05FIQMtd1156527%40masaka.moolenaar.net.


Patch 8.2.0982

2020-06-15 Fir de Conversatie Bram Moolenaar


Patch 8.2.0982
Problem:Insufficient testing for reading/writing files.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #6257)
Add "ui_delay" to test_override() and use it for the CTRL-O test.
Files:  src/testing.c, src/globals.h, src/ui.c, runtime/doc/testing.txt,
src/testdir/test_autocmd.vim, src/testdir/test_edit.vim,
src/testdir/test_filechanged.vim, src/testdir/test_writefile.vim


*** ../vim-8.2.0981/src/testing.c   2020-06-13 15:47:21.070282268 +0200
--- src/testing.c   2020-06-15 19:41:02.363850273 +0200
***
*** 854,859 
--- 854,861 
no_query_mouse_for_testing = val;
else if (STRCMP(name, (char_u *)"no_wait_return") == 0)
no_wait_return = val;
+   else if (STRCMP(name, (char_u *)"ui_delay") == 0)
+   ui_delay_for_testing = val;
else if (STRCMP(name, (char_u *)"term_props") == 0)
reset_term_props_on_termresponse = val;
else if (STRCMP(name, (char_u *)"ALL") == 0)
***
*** 863,868 
--- 865,871 
ignore_redraw_flag_for_testing = FALSE;
nfa_fail_for_testing = FALSE;
no_query_mouse_for_testing = FALSE;
+   ui_delay_for_testing = 0;
reset_term_props_on_termresponse = FALSE;
if (save_starting >= 0)
{
*** ../vim-8.2.0981/src/globals.h   2020-06-13 18:09:16.096199169 +0200
--- src/globals.h   2020-06-15 19:41:29.727738730 +0200
***
*** 1841,1846 
--- 1841,1847 
  EXTERN int  ignore_redraw_flag_for_testing INIT(= FALSE);
  EXTERN int  nfa_fail_for_testing INIT(= FALSE);
  EXTERN int  no_query_mouse_for_testing INIT(= FALSE);
+ EXTERN int  ui_delay_for_testing INIT(= 0);
  EXTERN int  reset_term_props_on_termresponse INIT(= FALSE);
  
  EXTERN int  in_free_unref_items INIT(= FALSE);
*** ../vim-8.2.0981/src/ui.c2020-05-30 18:14:37.828521058 +0200
--- src/ui.c2020-06-15 19:42:24.455515333 +0200
***
*** 523,530 
   * cancel the delay if a key is hit.
   */
  void
! ui_delay(long msec, int ignoreinput)
  {
  #ifdef FEAT_JOB_CHANNEL
  ch_log(NULL, "ui_delay(%ld)", msec);
  #endif
--- 523,536 
   * cancel the delay if a key is hit.
   */
  void
! ui_delay(long msec_arg, int ignoreinput)
  {
+ long msec = msec_arg;
+ 
+ #ifdef FEAT_EVAL
+ if (ui_delay_for_testing > 0)
+   msec = ui_delay_for_testing;
+ #endif
  #ifdef FEAT_JOB_CHANNEL
  ch_log(NULL, "ui_delay(%ld)", msec);
  #endif
*** ../vim-8.2.0981/runtime/doc/testing.txt 2020-06-13 15:47:21.074282253 
+0200
--- runtime/doc/testing.txt 2020-06-15 19:45:44.694695488 +0200
***
*** 165,170 
--- 165,172 
terminals
no_wait_return  set the "no_wait_return" flag.  Not restored
with "ALL".
+   ui_delay time in msec to use in ui_delay(); overrules a
+wait time of up to 3 seconds for messages
term_props   reset all terminal properties when the version
 string is detected
ALL  clear all overrides ({val} is not used)
*** ../vim-8.2.0981/src/testdir/test_autocmd.vim2020-06-12 
22:08:56.414965077 +0200
--- src/testdir/test_autocmd.vim2020-06-15 19:33:44.953617319 +0200
***
*** 2526,2529 
--- 2526,2582 
unlet g:sigusr1_passed
  endfunc
  
+ " Test for BufReadPre autocmd deleting the file
+ func Test_BufReadPre_delfile()
+   augroup TestAuCmd
+ au!
+ autocmd BufReadPre Xfile call delete('Xfile')
+   augroup END
+   call writefile([], 'Xfile')
+   call assert_fails('new Xfile', 'E200:')
+   call assert_equal('Xfile', @%)
+   call assert_equal(1, )
+   call delete('Xfile')
+   augroup TestAuCmd
+ au!
+   augroup END
+   close!
+ endfunc
+ 
+ " Test for BufReadPre autocmd changing the current buffer
+ func Test_BufReadPre_changebuf()
+   augroup TestAuCmd
+ au!
+ autocmd BufReadPre Xfile edit Xsomeotherfile
+   augroup END
+   call writefile([], 'Xfile')
+   call assert_fails('new Xfile', 'E201:')
+   call assert_equal('Xsomeotherfile', @%)
+   call assert_equal(1, )
+   call delete('Xfile')
+   augroup TestAuCmd
+ au!
+   augroup END
+   close!
+ endfunc
+ 
+ " Test for BufWipeouti autocmd changing the current buffer when reading a file
+ " in an empty buffer with 'f' flag in 'cpo'
+ func Test_BufDelete_changebuf()
+   new
+   augroup TestAuCmd
+ au!
+ autocmd BufWipeout * let bufnr = bufadd('somefile') | exe "b " .. bufnr
+   augroup END
+   let save_cpo = 
+   set cpo+=f
+   call assert_fails('r Xfile', 'E484:')
+   call assert_equal('somefile', @%)
+   let  = save_cpo
+   augroup TestAuCmd
+ au!
+   augroup END
+   close!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0981/src/testdir/test_edit.vim   2020-06-13 13:20:21.092620451 
+0200

Re: [vim/vim] "simplify()" does not reduce multiple leading path separators (#6263)

2020-06-15 Fir de Conversatie Gary Johnson
On 2020-06-15, lacygoill wrote:
> Describe the bug
> 
> simplify() does not reduce multiple leading path separators.
> 
> To Reproduce
> 
> Run this shell command:
> 
> vim -Nu NONE -es +"pu=simplify('//tmp')|%p" +'qa!'
> 
> The output is //tmp.
> 
> Expected behavior
> 
> The output is /tmp.
> 
> Environment
> 
>   • Vim version: 8.2 Included patches: 1-981
>   • OS: Ubuntu 16.04.6 LTS
>   • Terminal: XTerm(322)

This is not a bug.  The simplify() function should leave two leading
slashes alone.  The POSIX spec states:

A pathname that begins with two successive slashes may be
interpreted in an implementation-defined manner, although more
than two leading slashes shall be treated as a single slash.

Regards,
Gary

--
http://pubs.opengroup.org/onlinepubs/95399/basedefs/xbd_chap04.html#tag_04_11
https://unix.stackexchange.com/questions/12283/unix-difference-between-path-starting-with-and

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20200615165352.GA29345%40phoenix.


Re: [vim/vim] How can we distinguish normal windows and aucmd_win? (#6264)

2020-06-15 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Mon, Jun 15, 2020 at 9:22 AM itchyny  wrote:

> *Is your feature request about something that is currently impossible or
> hard to do? Please describe the problem.*
> The :doautoall command uses the temporary window (aucmd_win) for a buffer
> which does not belong to the visible windows. But we cannot distinguish the
> temporary window for :doautoall and normal windows.
>
> :autocmd BufEnter * echom [bufname(), winnr(), winnr('$')]
>
> :edit a" ['a', 1, 1]
> :tabnew b" ['b', 1, 1]
> " We expect winnr('$') always returns the window count, however
> :doautoall BufEnter" ['a', 1, 2] => winnr('$') returns 2 due to aucmd_win" 
> ['b', 1, 1]
>
> :autocmd! BufEnter *
>
> :autocmd BufEnter * echom map(range(1, winnr('$')), 
> '[bufname(winbufnr(v:val)), winnr() == v:val]')
>
> :doautoall BufEnter" [['a', 1], ['b', 0]]" [['b', 1]]
>
> :tabp" [['a', 1]]
> " We expect that the window number is equal to winnr() only for the active 
> window, however
> :doautoall BufEnter" [['a', 1]]" [['b', 1], ['a', 0]] " => The 'b' buffer is 
> associated with aucmd_win
>
> This behavior confuses plugins which assume that winnr() always returns
> the active window number, but this is incorrect due to :doautoall
> command. This happens with any events because :doautoall does not
> restrict the event to emit. User can :doautoall FileType or even :doautoall
> WinEnter. The plugins cannot tell the event is fired with :doautoall or
> not.
>
> The issue occurs when using sessions too. The session file created by
> :mksession contains doautoall SessionLoadPost (see src/session.c#L1253
> ),
> which makes the same problem happen.
>
> *Describe the solution you'd like*
> Provide a way to detect a window is aucmd_win or not within Vim script.
> Something like v:aucmd_win_used or expand(''). Or provide a
> function whether or not a window is listed or not
> 
> .
>

If the getwininfo() function returns whether a window is an autocmd window
or not, will that meet
this requirement?

- Yegappan


> *Describe alternatives you've considered*
> The :doautoall command with any events causes the problem but I'm
> troubled with the fact that session file contains the :doautoall command.
> Does it need to fire SessionLoadPost with doautoall actually? I don't
> need it to emit the event for all the buffers, but just want to do
> something once on session load. I suggest adding another event which is
> fired only once on session load OR just add doautocmd WinEnter at the end
> of the session.
>
> *Additional context*
> Original issue: itchyny/lightline.vim#448
> 
>
>
>

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7n_nuzt%3DFhm8e3qN88yVNXxn3pjmgVw23AeycvDCH0%3DpA%40mail.gmail.com.


Re: Patch 8.2.0970

2020-06-15 Fir de Conversatie Bram Moolenaar


Christ van Willegen wrote:

> two typos fixed below...

Thanks!


-- 
WOMAN:   Well, 'ow did you become king then?
ARTHUR:  The Lady of the Lake, [angels sing] her arm clad in the purest
 shimmering samite, held aloft Excalibur from the bosom of the water
 signifying by Divine Providence that I, Arthur, was to carry
 Excalibur.  [singing stops] That is why I am your king!
  The Quest for the Holy Grail (Monty Python)

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202006150809.05F89WVI1035643%40masaka.moolenaar.net.


Re: Patch 8.2.0970

2020-06-15 Fir de Conversatie Christ van Willegen
Hi,

two typos fixed below...

Christ van Willegen

On Sat, Jun 13, 2020 at 3:48 PM Bram Moolenaar  wrote:
> Patch 8.2.0970
> Problem:Terminal properties are not available in Vim script.
> Solution:   Add the terminalprops() function.
> Files:  src/term.c, src/proto/term.pro, src/evalfunc.c, src/main.c,
> src/testing.c, src/globals.h, src/testdir/test_termcodes.vim,
> runtime/doc/usr_41.txt, runtime/doc/eval.txt,
> runtime/doc/testing.txt
>
>
> *** ../vim-8.2.0969/runtime/doc/eval.txt2020-06-10 15:32:04.451653647 
> +0200
> +   If "cursor_style" is 'y' then |t_RS| will be send to request 
> the
> +   current cursor style.

will be sent

> +   If "cursor_blink_mode" is 'y' then |t_RC| will be send to
> +   request the cursor blink status.

will be sent

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CA%2BOt1OyOhTsvkvupZO%2BqxYLAHkepxWjEwaJqLn1AA_KkYjY3vw%40mail.gmail.com.