Patch 8.2.2814

2021-04-26 Fir de Conversatie Bram Moolenaar


Patch 8.2.2814 (after 8.2.2812)
Problem:Vim9: unused variable. (John Marriott)
Solution:   Adjust #ifdef.
Files:  src/vim9execute.c


*** ../vim-8.2.2813/src/vim9execute.c   2021-04-26 20:32:54.918399234 +0200
--- src/vim9execute.c   2021-04-26 21:33:24.168672436 +0200
***
*** 543,553 
  estack_T  *entry;
  int   prev_dfunc_idx = STACK_TV(ectx->ec_frame_idx
+ STACK_FRAME_FUNC_OFF)->vval.v_number;
  dfunc_T   *prev_dfunc = ((dfunc_T *)def_functions.ga_data)
  + prev_dfunc_idx;
- funclocal_T   *floc;
  
- #ifdef FEAT_PROFILE
  if (do_profiling == PROF_YES)
  {
ufunc_T *caller = prev_dfunc->df_ufunc;
--- 543,553 
  estack_T  *entry;
  int   prev_dfunc_idx = STACK_TV(ectx->ec_frame_idx
+ STACK_FRAME_FUNC_OFF)->vval.v_number;
+ funclocal_T   *floc;
+ #ifdef FEAT_PROFILE
  dfunc_T   *prev_dfunc = ((dfunc_T *)def_functions.ga_data)
  + prev_dfunc_idx;
  
  if (do_profiling == PROF_YES)
  {
ufunc_T *caller = prev_dfunc->df_ufunc;
*** ../vim-8.2.2813/src/version.c   2021-04-26 21:14:12.713924760 +0200
--- src/version.c   2021-04-26 21:34:26.984552038 +0200
***
*** 752,753 
--- 752,755 
  {   /* Add new patch number below this line */
+ /**/
+ 2814,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
176. You lie, even to user-friends, about how long you were online yesterday.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202104261940.13QJefJ12519193%40masaka.moolenaar.net.


Patch 8.2.2813

2021-04-26 Fir de Conversatie Bram Moolenaar


Patch 8.2.2813
Problem:Cannot grep using fuzzy matching.
Solution:   Add the "f" flag to :vimgrep. (Yegappan Lakshmanan, closes #8152)
Files:  runtime/doc/quickfix.txt, src/ex_cmds.c, src/proto/search.pro,
src/quickfix.c, src/search.c, src/vim.h,
src/testdir/test_quickfix.vim


*** ../vim-8.2.2812/runtime/doc/quickfix.txt2021-01-31 17:02:06.258490157 
+0100
--- runtime/doc/quickfix.txt2021-04-26 20:57:53.242860143 +0200
***
*** 1008,1014 
  5.1 using Vim's internal grep
  
*:vim* *:vimgrep* *E682* *E683*
! :vim[grep][!] /{pattern}/[g][j] {file} ...
Search for {pattern} in the files {file} ... and set
the error list to the matches.  Files matching
'wildignore' are ignored; files in 'suffixes' are
--- 1008,1014 
  5.1 using Vim's internal grep
  
*:vim* *:vimgrep* *E682* *E683*
! :vim[grep][!] /{pattern}/[g][j][f] {file} ...
Search for {pattern} in the files {file} ... and set
the error list to the matches.  Files matching
'wildignore' are ignored; files in 'suffixes' are
***
*** 1025,1030 
--- 1025,1042 
'smartcase' is not used.
If {pattern} is empty (e.g. // is specified), the last
used search pattern is used. |last-pattern|
+ 
+   When the 'f' flag is specified, fuzzy string matching
+   is used to find matching lines. In this case,
+   {pattern} is treated as a literal string instead of a
+   regular expression.  See |matchfuzzy()| for more info
+   about fuzzy matching.
+ 
+   |QuickFixCmdPre| and |QuickFixCmdPost| are triggered.
+   A file that is opened for matching may use a buffer
+   number, but it is reused if possible to avoid
+   consuming buffer numbers.
+ 
  :{count}vim[grep] ...
When a number is put before the command this is used
as the maximum number of matches to find.  Use
***
*** 1053,1072 
:vimgrep Error *.c
  <
*:lv* *:lvimgrep*
! :lv[imgrep][!] /{pattern}/[g][j] {file} ...
  :lv[imgrep][!] {pattern} {file} ...
Same as ":vimgrep", except the location list for the
current window is used instead of the quickfix list.
  
*:vimgrepa* *:vimgrepadd*
! :vimgrepa[dd][!] /{pattern}/[g][j] {file} ...
  :vimgrepa[dd][!] {pattern} {file} ...
Just like ":vimgrep", but instead of making a new list
of errors the matches are appended to the current
list.
  
*:lvimgrepa* *:lvimgrepadd*
! :lvimgrepa[dd][!] /{pattern}/[g][j] {file} ...
  :lvimgrepa[dd][!] {pattern} {file} ...
Same as ":vimgrepadd", except the location list for
the current window is used instead of the quickfix
--- 1065,1084 
:vimgrep Error *.c
  <
*:lv* *:lvimgrep*
! :lv[imgrep][!] /{pattern}/[g][j][f] {file} ...
  :lv[imgrep][!] {pattern} {file} ...
Same as ":vimgrep", except the location list for the
current window is used instead of the quickfix list.
  
*:vimgrepa* *:vimgrepadd*
! :vimgrepa[dd][!] /{pattern}/[g][j][f] {file} ...
  :vimgrepa[dd][!] {pattern} {file} ...
Just like ":vimgrep", but instead of making a new list
of errors the matches are appended to the current
list.
  
*:lvimgrepa* *:lvimgrepadd*
! :lvimgrepa[dd][!] /{pattern}/[g][j][f] {file} ...
  :lvimgrepa[dd][!] {pattern} {file} ...
Same as ":vimgrepadd", except the location list for
the current window is used instead of the quickfix
*** ../vim-8.2.2812/src/ex_cmds.c   2021-04-19 16:48:44.435055499 +0200
--- src/ex_cmds.c   2021-04-26 20:49:47.376741284 +0200
***
*** 5288,5301 
++p;
  
// Find the flags
!   while (*p == 'g' || *p == 'j')
{
if (flags != NULL)
{
if (*p == 'g')
*flags |= VGR_GLOBAL;
!   else
*flags |= VGR_NOJUMP;
}
++p;
}
--- 5288,5303 
++p;
  
// Find the f

Re: Patch 8.2.2812

2021-04-26 Fir de Conversatie John Marriott


On 27-Apr-2021 04:33, Bram Moolenaar wrote:

Patch 8.2.2812
Problem:Vim9: still crash when using substitute expression.
Solution:   Put the instruction list in the stack frame. (closes #8154)
Files:  src/vim9execute.c, src/vim9.h, src/testdir/test_vim9_cmd.vim



After this patch I noticed this warning from mingw64 (gcc 10.3.0):

gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO 
-pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return 
-fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD vim9execute.c -o 
gobjnative/vim9execute.o

vim9execute.c: In function 'func_return':
vim9execute.c:546:14: warning: unused variable 'prev_dfunc' 
[-Wunused-variable]

  546 | dfunc_T *prev_dfunc = ((dfunc_T *)def_functions.ga_data)
  |  ^~


I think this warning came from patch 8.2.2530 which is where the 
relevant lines were added but it is weird that I hadn't noticed the 
warning before.


Anyway, the attached patch tries to fix it.

Cheers

--
--
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/bb780dc2-016d-491f-169b-aaba2add8cc8%40internode.on.net.
--- vim9execute.c.orig  2021-04-27 04:59:56.101619600 +1000
+++ vim9execute.c   2021-04-27 05:02:22.228856000 +1000
@@ -543,8 +543,10 @@
 estack_T   *entry;
 intprev_dfunc_idx = STACK_TV(ectx->ec_frame_idx
+ STACK_FRAME_FUNC_OFF)->vval.v_number;
+#ifdef FEAT_PROFILE
 dfunc_T*prev_dfunc = ((dfunc_T *)def_functions.ga_data)
  + prev_dfunc_idx;
+#endif
 funclocal_T*floc;
 
 #ifdef FEAT_PROFILE


Re: [vim/vim] Add fuzzy matching support to the vimgrep command (#8152)

2021-04-26 Fir de Conversatie Bram Moolenaar



> The Github actions for this PR didn't run because it says
> "This workflow is awaiting approval from a maintainer".
> I haven't seen this message before.

Looks like there is no way around this.  I hope we can approve quickly,
but it does require one of the maintainers to spot the request.

I also found a way to add the author to the commit.  I hope that works,
then the number of approvals should also be reduced.


-- 
If Microsoft would build a car...
... The airbag system would ask "are you SURE?" before deploying.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202104261925.13QJPvH82515901%40masaka.moolenaar.net.


Patch 8.2.2812

2021-04-26 Fir de Conversatie Bram Moolenaar


Patch 8.2.2812
Problem:Vim9: still crash when using substitute expression.
Solution:   Put the instruction list in the stack frame. (closes #8154)
Files:  src/vim9execute.c, src/vim9.h, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.2811/src/vim9execute.c   2021-04-25 14:48:45.500794221 +0200
--- src/vim9execute.c   2021-04-26 20:28:26.379200014 +0200
***
*** 279,284 
--- 279,285 
  // Store current execution state in stack frame for ISN_RETURN.
  STACK_TV_BOT(STACK_FRAME_FUNC_OFF)->vval.v_number = ectx->ec_dfunc_idx;
  STACK_TV_BOT(STACK_FRAME_IIDX_OFF)->vval.v_number = ectx->ec_iidx;
+ STACK_TV_BOT(STACK_FRAME_INSTR_OFF)->vval.v_string = (void 
*)ectx->ec_instr;
  STACK_TV_BOT(STACK_FRAME_OUTER_OFF)->vval.v_string = (void 
*)ectx->ec_outer;
  STACK_TV_BOT(STACK_FRAME_FUNCLOCAL_OFF)->vval.v_string = (void *)floc;
  STACK_TV_BOT(STACK_FRAME_IDX_OFF)->vval.v_number = ectx->ec_frame_idx;
***
*** 592,597 
--- 593,600 
  ectx->ec_dfunc_idx = prev_dfunc_idx;
  ectx->ec_iidx = STACK_TV(ectx->ec_frame_idx
+ STACK_FRAME_IIDX_OFF)->vval.v_number;
+ ectx->ec_instr = (void *)STACK_TV(ectx->ec_frame_idx
+  + STACK_FRAME_INSTR_OFF)->vval.v_string;
  ectx->ec_outer = (void *)STACK_TV(ectx->ec_frame_idx
   + STACK_FRAME_OUTER_OFF)->vval.v_string;
  floc = (void *)STACK_TV(ectx->ec_frame_idx
***
*** 599,611 
  // restoring ec_frame_idx must be last
  ectx->ec_frame_idx = STACK_TV(ectx->ec_frame_idx
   + STACK_FRAME_IDX_OFF)->vval.v_number;
- ectx->ec_instr = INSTRUCTIONS(prev_dfunc);
- 
- // If the call was inside an ISN_SUBSTITUTE instruction need to use its
- // list of instructions.
- if (ectx->ec_instr[ectx->ec_iidx - 1].isn_type == ISN_SUBSTITUTE)
-   ectx->ec_instr = ectx->ec_instr[ectx->ec_iidx - 1]
- .isn_arg.subs.subs_instr;
  
  if (floc == NULL)
ectx->ec_funclocal.floc_restore_cmdmod = FALSE;
--- 602,607 
*** ../vim-8.2.2811/src/vim9.h  2021-04-19 20:49:58.156857538 +0200
--- src/vim9.h  2021-04-26 20:22:43.064076181 +0200
***
*** 427,441 
  // Number of entries used by stack frame for a function call.
  // - ec_dfunc_idx:   function index
  // - ec_iidx:instruction index
  // - ec_outer: stack used for closures
  // - funclocal:function-local data
  // - ec_frame_idx:   previous frame index
  #define STACK_FRAME_FUNC_OFF 0
  #define STACK_FRAME_IIDX_OFF 1
! #define STACK_FRAME_OUTER_OFF 2
! #define STACK_FRAME_FUNCLOCAL_OFF 3
! #define STACK_FRAME_IDX_OFF 4
! #define STACK_FRAME_SIZE 5
  
  
  #ifdef DEFINE_VIM9_GLOBALS
--- 427,443 
  // Number of entries used by stack frame for a function call.
  // - ec_dfunc_idx:   function index
  // - ec_iidx:instruction index
+ // - ec_instr:   instruction list pointer
  // - ec_outer: stack used for closures
  // - funclocal:function-local data
  // - ec_frame_idx:   previous frame index
  #define STACK_FRAME_FUNC_OFF 0
  #define STACK_FRAME_IIDX_OFF 1
! #define STACK_FRAME_INSTR_OFF 2
! #define STACK_FRAME_OUTER_OFF 3
! #define STACK_FRAME_FUNCLOCAL_OFF 4
! #define STACK_FRAME_IDX_OFF 5
! #define STACK_FRAME_SIZE 6
  
  
  #ifdef DEFINE_VIM9_GLOBALS
*** ../vim-8.2.2811/src/testdir/test_vim9_cmd.vim   2021-04-25 
16:35:52.101622736 +0200
--- src/testdir/test_vim9_cmd.vim   2021-04-26 20:29:44.006995388 +0200
***
*** 1208,1222 
--- 1208,1225 
CheckDefFailure(['s/from/\="x"/9'], 'E488:')
  
# When calling a function the right instruction list needs to be restored.
+   g:cond = true
var lines =<< trim END
vim9script
def Foo()
Bar([])
enddef
def Bar(l: list)
+ if g:cond
s/^/\=Rep()/
for n in l[:]
endfor
+ endif
enddef
def Rep(): string
return 'rep'
***
*** 1227,1232 
--- 1230,1236 
bwipe!
END
CheckScriptSuccess(lines)
+   unlet g:cond
  enddef
  
  def Test_redir_to_var()
*** ../vim-8.2.2811/src/version.c   2021-04-25 16:35:52.101622736 +0200
--- src/version.c   2021-04-26 20:31:35.054699695 +0200
***
*** 752,753 
--- 752,755 
  {   /* Add new patch number below this line */
+ /**/
+ 2812,
  /**/

-- 
The CIA drives around in cars with the "Intel inside" logo.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim

Re: [vim/vim] Add fuzzy matching support to the vimgrep command (#8152)

2021-04-26 Fir de Conversatie Yegappan Lakshmanan
Hi Christian,

On Sun, Apr 25, 2021 at 11:21 PM Christian Brabandt <
vim-dev-git...@256bit.org> wrote:

> not sure why this is needed now. I approved the GH workflow
>
>
> It looks like Github changed the policies:

https://github.blog/changelog/2021-04-22-github-actions-maintainers-must-approve-first-time-contributer-workflow-runs/
https://github.blog/2021-04-22-github-actions-update-helping-maintainers-combat-bad-actors/

When I updated the PR, the Github actions now requires maintainer
approval to run again.

- Yegappan

-- 
-- 
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/CAAW7x7nYf9z2-TzK8xrdJdr6OXetn0nEauSiazPvutUoa_1dtw%40mail.gmail.com.