[patch] typo fixes in documentation

2020-10-24 Fir de Conversatie Dominique Pellé
Hi

Attached patch fixes a few typos in vim-8.2.1900
documentation.

Regards
Dominique

-- 
-- 
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/CAON-T_ju%2BaYV%2B1TZbwv9%3DhSziZP2oP5CgHsEhGTBkc%3Du-mRq4A%40mail.gmail.com.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index f15cd96f0..f87768001 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -883,7 +883,7 @@ InsertEnter			Just before starting Insert mode.  Also for
 string.
 			*InsertLeavePre*
 InsertLeavePre			Just before leaving Insert mode.  Also when
-using CTRL-O |i_CTRL-O|.  Be caseful not to
+using CTRL-O |i_CTRL-O|.  Be careful not to
 change mode or use `:normal`, it will likely
 cause trouble.
 			*InsertLeave*
diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt
index 430c365cc..8493796f2 100644
--- a/runtime/doc/usr_11.txt
+++ b/runtime/doc/usr_11.txt
@@ -294,7 +294,7 @@ If you really don't want to see this message, you can add the 'A' flag to the
 'shortmess' option.  But it's very unusual that you need this.
 
 For remarks about encryption and the swap file, see |:recover-crypt|.
-For programatic access to the swap file, see |swapinfo()|.
+For programmatic access to the swap file, see |swapinfo()|.
 
 ==
 *11.4*	Further reading
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 1ad90f2bd..6784b105a 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -10260,7 +10260,7 @@ Commands:
 	Brabandt)
 
 Other:
-	Lua interface now also uses userdata binded to Vim structures. (Taro
+	Lua interface now also uses userdata bound to Vim structures. (Taro
 	Muraoka, Luis Carvalho)
 
 	glob() and autocommand patterns used to work with the undocumented
diff --git a/runtime/doc/version8.txt b/runtime/doc/version8.txt
index 431b9cd47..238e7e99b 100644
--- a/runtime/doc/version8.txt
+++ b/runtime/doc/version8.txt
@@ -47698,7 +47698,7 @@ Files:  src/eval.c, src/testdir/test_vim9_expr.vim
 
 Patch 8.2.1064
 Problem:Vim9: no line break allowed before comparators.
-Solution:   Check for comperator after line break.
+Solution:   Check for comparator after line break.
 Files:  src/eval.c, src/testdir/test_vim9_expr.vim
 
 Patch 8.2.1065


Patch 8.2.1800

2020-10-24 Fir de Conversatie Bram Moolenaar


Patch 8.2.1900
Problem:Vim9: command modifiers do not work.
Solution:   Make most command modifiers work.
Files:  src/vim9.h, src/vim9compile.c, src/vim9execute.c,
src/usercmd.c, src/proto/usercmd.pro, src/scriptfile.c,
src/testdir/test_vim9_disassemble.vim


*** ../vim-8.2.1899/src/vim9.h  2020-10-23 18:02:28.707453763 +0200
--- src/vim9.h  2020-10-24 21:37:25.489883302 +0200
***
*** 142,149 
  
  ISN_PUT,  // ":put", uses isn_arg.put
  
! ISN_SILENT,   // set msg_silent or emsg_silent if arg_number is 
non-zero
! ISN_UNSILENT,   // undo ISN_SILENT
  
  ISN_SHUFFLE,// move item on stack up or down
  ISN_DROP  // pop stack and discard value
--- 142,149 
  
  ISN_PUT,  // ":put", uses isn_arg.put
  
! ISN_CMDMOD,   // set cmdmod
! ISN_CMDMOD_REV, // undo ISN_CMDMOD
  
  ISN_SHUFFLE,// move item on stack up or down
  ISN_DROP  // pop stack and discard value
***
*** 278,283 
--- 278,288 
  linenr_T  put_lnum;   // line number to put below
  } put_T;
  
+ // arguments to ISN_CMDMOD
+ typedef struct {
+ cmdmod_T  *cf_cmdmod; // allocated
+ } cmod_T;
+ 
  /*
   * Instruction
   */
***
*** 314,319 
--- 319,325 
checklen_T  checklen;
shuffle_T   shuffle;
put_T   put;
+   cmod_T  cmdmod;
  } isn_arg;
  };
  
*** ../vim-8.2.1899/src/vim9compile.c   2020-10-24 20:49:37.502683026 +0200
--- src/vim9compile.c   2020-10-24 22:05:17.881470884 +0200
***
*** 142,148 
  garray_T  ctx_type_stack; // type of each item on the stack
  garray_T  *ctx_type_list; // list of pointers to allocated types
  
! int   ctx_silent; // set when ISN_SILENT was generated
  };
  
  static void delete_def_function_contents(dfunc_T *dfunc);
--- 142,148 
  garray_T  ctx_type_stack; // type of each item on the stack
  garray_T  *ctx_type_list; // list of pointers to allocated types
  
! int   ctx_has_cmdmod; // ISN_CMDMOD was generated
  };
  
  static void delete_def_function_contents(dfunc_T *dfunc);
***
*** 1823,1858 
  }
  
  /*
!  * Generate any instructions for side effects of "cmdmod".
   */
  static int
  generate_cmdmods(cctx_T *cctx, cmdmod_T *cmod)
  {
  isn_T *isn;
  
! // TODO: use more modifiers in the command
! if (cmod->cmod_flags & (CMOD_SILENT | CMOD_ERRSILENT))
  {
!   if ((isn = generate_instr(cctx, ISN_SILENT)) == NULL)
return FAIL;
!   isn->isn_arg.number = (cmod->cmod_flags & CMOD_ERRSILENT) != 0;
!   cctx->ctx_silent = (cmod->cmod_flags & CMOD_ERRSILENT) ? 2 : 1;
  }
  return OK;
  }
  
  static int
! generate_restore_cmdmods(cctx_T *cctx)
  {
  isn_T *isn;
  
! if (cctx->ctx_silent > 0)
  {
!   if ((isn = generate_instr(cctx, ISN_UNSILENT)) == NULL)
return FAIL;
-   isn->isn_arg.number = cctx->ctx_silent == 2;
-   cctx->ctx_silent = 0;
  }
  return OK;
  }
  
--- 1823,1867 
  }
  
  /*
!  * Generate an instruction for any command modifiers.
   */
  static int
  generate_cmdmods(cctx_T *cctx, cmdmod_T *cmod)
  {
  isn_T *isn;
  
! if (cmod->cmod_flags != 0
!   || cmod->cmod_split != 0
!   || cmod->cmod_verbose != 0
!   || cmod->cmod_tab != 0
!   || cmod->cmod_filter_regmatch.regprog != NULL)
  {
!   cctx->ctx_has_cmdmod = TRUE;
! 
!   if ((isn = generate_instr(cctx, ISN_CMDMOD)) == NULL)
!   return FAIL;
!   isn->isn_arg.cmdmod.cf_cmdmod = ALLOC_ONE(cmdmod_T);
!   if (isn->isn_arg.cmdmod.cf_cmdmod == NULL)
return FAIL;
!   mch_memmove(isn->isn_arg.cmdmod.cf_cmdmod, cmod, sizeof(cmdmod_T));
!   // filter progam now belongs to the instruction
!   cmod->cmod_filter_regmatch.regprog = NULL;
  }
+ 
  return OK;
  }
  
  static int
! generate_undo_cmdmods(cctx_T *cctx)
  {
  isn_T *isn;
  
! if (cctx->ctx_has_cmdmod)
  {
!   if ((isn = generate_instr(cctx, ISN_CMDMOD_REV)) == NULL)
return FAIL;
  }
+ 
  return OK;
  }
  
***
*** 7092,7100 
  for (;;)
  {
exarg_T ea;
-   cmdmod_Tlocal_cmdmod;
int starts_with_colon = FALSE;
char_u  *cmd;
  
// Bail out on the first error to avoid a flood of errors and report
// the right line number when inside try/catch.
--- 7101,7109 
  for (;;)
  {
exarg_T ea;
int starts_with_colon = FALSE;
char_u  *cmd;
+   cmdmod_Tlocal_cmdmod;
  
// Bail out on the first error to avoid a flood of errors and report
// the right line number when inside try/catch.
***
*** 7175,7181 
/*
 * 

Re: [vim/vim] netrw: Fix gx command (#7188)

2020-10-24 Fir de Conversatie Ingo Karkat
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 24/10/2020 20:52, Charles Campbell wrote:
> Charles Campbell wrote:
>> James McCoy wrote:
>>> On Thu, Oct 22, 2020, 21:39 Charles Campbell
>>> mailto:campb...@drchip.org>> wrote:
>>>
>>> I confess that I'm not a git master.  It'd be a help if you
>>> could send me a patch instead of a commit which I don't use
>>>
>>>
>>> If you append ".diff" to a pull request URL, you get a diff you
>>> can download.  For example,
>>> https://github.com/vim/vim/pull/7188.diff
>>>
>>> Cheers, James
>>>
>>>
>>
>> Hello:
>>
>> Unfortunately:
>>
>> sphinx?   https://github.com/vim/vim/pull/7188.diff ksh:
>> https://github.com/vim/vim/pull/7188.diff: not found [No such
>> file or directory] sphinx?
>> https://github.com/vim/vim/pull/7188.patch ksh:
>> https://github.com/vim/vim/pull/7188.patch: not found [No such
>> file or directory]
>>
>> Regards, Chip Campbell
>>
> Well, that was dumb on my part.  Here's a new and updated problem:
>
> git pull  https://github.com/vim/vim/pull/7188.diff fatal: Not a
> git repository (or any parent up to mount point /home) Stopping at
> filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
>
> Again, I want to pull the diff/patch and not have it bother what
> I've got. I need to check it over, run it through my test suite,
> merge it with the latest netrw (at v171b at the moment).

Charles, that URL gives you a plain diff; download it via

$ curl -L https://github.com/vim/vim/pull/7188.diff

or simply open the URL in the browser and save the page as a text file.

You can also stay within Git, but then would have to set up Vim's
GitHub repository as a remote, pull it (Vim's GitHub page has all the
details behind the "Clone or download" button), and then you can diff
it there, but it would be way more complex, and not so useful, anyway,
as you maintain your plugin separately from what gets included by
Bram. (So sooner or later you'd still need to produce a diff to move
the changes over to your copy.)

Like Vim, Git has a steep initial learning curve (I've been there as
well); take your time!

- -- regards, ingo
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJflIlmAAoJEA7ziXlAzQ/vIWwH/Az1SjjjNbVwbp8+W7JE+t2J
tmEESsMPId38bO2qBe7jSXKXPZdvn/4twaW8JZuid35XxKVRUpC0RH44XiBYHlKB
XKe/3/h8HBPJuqUwPrnh7LiQzM3erkiDt0qo8QEovU3SueG5BGwAzWThcHamxoOn
DK2eTtz/f3ED91EU8RuZ5g6BvEYVVpLlSx5JQ42SyuuHi8HS4GoXIwE1CA2C0hUD
AMN+XBx8rVOQLKR+1rvfWb0UwgMgh4x7LEwf7Glonp0B3cvusoX05s0cT2xHtcrv
c7qCzjNB/99KgbRpsNahmre1JqUZ4b9Dd13ENhB9d9Dvmb6BpF8PzLU71jxqmt4=
=smqM
-END PGP SIGNATURE-

-- 
-- 
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/a024c195-767b-df85-cbb2-0efcd8f1a92a%40ingo-karkat.de.


Patch 8.2.1899

2020-10-24 Fir de Conversatie Bram Moolenaar


Patch 8.2.1899
Problem:Crash in out-of-memory situation.
Solution:   Bail out if shell_name is NULL. (Dominique Pellé, closes #7196)
Files:  src/ex_cmds.c


*** ../vim-8.2.1898/src/ex_cmds.c   2020-10-24 20:49:37.494683051 +0200
--- src/ex_cmds.c   2020-10-24 20:55:40.725560050 +0200
***
*** 1544,1549 
--- 1544,1552 
  int   is_fish_shell;
  char_u*shell_name = get_isolated_shell_name();
  
+ if (shell_name == NULL)
+   return NULL;
+ 
  // Account for fish's different syntax for subshells
  is_fish_shell = (fnamecmp(shell_name, "fish") == 0);
  vim_free(shell_name);
*** ../vim-8.2.1898/src/version.c   2020-10-24 20:49:37.506683014 +0200
--- src/version.c   2020-10-24 20:56:34.817392859 +0200
***
*** 752,753 
--- 752,755 
  {   /* Add new patch number below this line */
+ /**/
+ 1899,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
124. You begin conversations with, "Who is your internet service provider?"

 /// 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/202010241858.09OIwfxg1102151%40masaka.moolenaar.net.


Re: [vim/vim] netrw: Fix gx command (#7188)

2020-10-24 Fir de Conversatie Charles Campbell

Charles Campbell wrote:

James McCoy wrote:
On Thu, Oct 22, 2020, 21:39 Charles Campbell > wrote:


    I confess that I'm not a git master.  It'd be a help if you could
    send
    me a patch instead of a commit which I don't use


If you append ".diff" to a pull request URL, you get a diff you can 
download.  For example, https://github.com/vim/vim/pull/7188.diff


Cheers,
James




Hello:

Unfortunately:

   sphinx?   https://github.com/vim/vim/pull/7188.diff
   ksh: https://github.com/vim/vim/pull/7188.diff: not found [No such
   file or directory]
   sphinx?   https://github.com/vim/vim/pull/7188.patch
   ksh: https://github.com/vim/vim/pull/7188.patch: not found [No such
   file or directory]

Regards,
Chip Campbell


Well, that was dumb on my part.  Here's a new and updated problem:

git pull  https://github.com/vim/vim/pull/7188.diff
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Again, I want to pull the diff/patch and not have it bother what I've 
got. I need to check it over, run it through my test suite, merge it 
with the latest netrw (at v171b at the moment).


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/a6f119b3-420f-11b3-44b6-ed72675c0f3a%40drchip.org.


Patch 8.2.1898

2020-10-24 Fir de Conversatie Bram Moolenaar


Patch 8.2.1898
Problem:Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
Files:  src/structs.h, src/arglist.c src/buffer.c, src/bufwrite.c,
src/diff.c, src/change.c, src/cmdhist.c, src/edit.c,
src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_getln.c,
src/fileio.c, src/filepath.c, src/gui.c, src/gui_gtk_x11.c,
src/help.c, src/if_cscope.c, src/indent.c, src/mark.c,
src/memline.c, src/message.c, src/option.c, src/ops.c,
src/os_unix.c, src/quickfix.c, src/register.c, src/scriptfile.c,
src/search.c, src/session.c, src/tag.c, src/terminal.c,
src/textformat.c, src/usercmd.c, src/vim9compile.c, src/window.c,
src/proto/ex_docmd.pro


*** ../vim-8.2.1897/src/structs.h   2020-10-24 17:19:12.135743402 +0200
--- src/structs.h   2020-10-24 20:19:08.416401166 +0200
***
*** 625,648 
   */
  typedef struct
  {
! int   cmod_flags; // CMOD_ flags, see below
! int   hide;   // TRUE when ":hide" was used
! # ifdef FEAT_BROWSE_CMD
! int   browse; // TRUE to invoke file dialog
! # endif
! int   split;  // flags for win_split()
! int   tab;// > 0 when ":tab" was used
! # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
! int   confirm;// TRUE to invoke yes/no dialog
! # endif
! int   keepalt;// TRUE when ":keepalt" was used
! int   keepmarks;  // TRUE when ":keepmarks" was 
used
! int   keepjumps;  // TRUE when ":keepjumps" was 
used
! int   lockmarks;  // TRUE when ":lockmarks" was 
used
! int   keeppatterns;   // TRUE when ":keeppatterns" 
was used
! int   noswapfile; // TRUE when ":noswapfile" was 
used
! regmatch_Tfilter_regmatch;// set by :filter /pat/
! int   filter_force;   // set for :filter!
  
  int   cmod_verbose;   // non-zero to set 'verbose'
  
--- 625,650 
   */
  typedef struct
  {
! int   cmod_flags; // CMOD_ flags
! #define CMOD_SANDBOX  0x0001  // ":sandbox"
! #define CMOD_SILENT   0x0002  // ":silent"
! #define CMOD_ERRSILENT0x0004  // ":silent!"
! #define CMOD_UNSILENT 0x0008  // ":unsilent"
! #define CMOD_NOAUTOCMD0x0010  // ":noautocmd"
! #define CMOD_HIDE 0x0020  // ":hide"
! #define CMOD_BROWSE   0x0040  // ":browse" - invoke file dialog
! #define CMOD_CONFIRM  0x0080  // ":confirm" - invoke yes/no dialog
! #define CMOD_KEEPALT  0x0100  // ":keepalt"
! #define CMOD_KEEPMARKS0x0200  // ":keepmarks"
! #define CMOD_KEEPJUMPS0x0400  // ":keepjumps"
! #define CMOD_LOCKMARKS0x0800  // ":lockmarks"
! #define CMOD_KEEPPATTERNS   0x1000// ":keeppatterns"
! #define CMOD_NOSWAPFILE   0x2000  // ":noswapfile"
! 
! int   cmod_split; // flags for win_split()
! int   cmod_tab;   // > 0 when ":tab" was used
! regmatch_Tcmod_filter_regmatch;   // set by :filter /pat/
! int   cmod_filter_force;  // set for :filter!
  
  int   cmod_verbose;   // non-zero to set 'verbose'
  
***
*** 655,669 
// p_verbose plus one
  int   cmod_save_msg_silent;   // if non-zero: saved value of
// msg_silent + 1
  int   cmod_did_esilent;   // incremented when emsg_silent 
is
  } cmdmod_T;
  
- #define CMOD_SANDBOX  0x01
- #define CMOD_SILENT   0x02
- #define CMOD_ERRSILENT0x04
- #define CMOD_UNSILENT 0x08
- #define CMOD_NOAUTOCMD0x10
- 
  #define MF_SEED_LEN   8
  
  struct memfile
--- 657,666 
// p_verbose plus one
  int   cmod_save_msg_silent;   // if non-zero: saved value of
// msg_silent + 1
+ int   cmod_save_msg_scroll;   // for restoring msg_scroll
  int   cmod_did_esilent;   // incremented when emsg_silent 
is
  } cmdmod_T;
  
  #define MF_SEED_LEN   8
  
  struct memfile
*** ../vim-8.2.1897/src/arglist.c   2020-08-30 19:26:40.736556825 +0200
--- src/arglist.c   2020-10-24 18:05:47.876210088 +0200
***
*** 657,663 
  #endif
  
// split window or create new tab page first
!   if (*eap->cmd == 's' || cmdmod.tab != 0)
{
if (win_split(0, 0) == FAIL)

Re: [vim/vim] netrw: Fix gx command (#7188)

2020-10-24 Fir de Conversatie Charles Campbell

James McCoy wrote:
On Thu, Oct 22, 2020, 21:39 Charles Campbell > wrote:


I confess that I'm not a git master.  It'd be a help if you could
send
me a patch instead of a commit which I don't use


If you append ".diff" to a pull request URL, you get a diff you can 
download.  For example, https://github.com/vim/vim/pull/7188.diff


Cheers,
James




Hello:

Unfortunately:

   sphinx?   https://github.com/vim/vim/pull/7188.diff
   ksh: https://github.com/vim/vim/pull/7188.diff: not found [No such
   file or directory]
   sphinx?   https://github.com/vim/vim/pull/7188.patch
   ksh: https://github.com/vim/vim/pull/7188.patch: not found [No such
   file or directory]

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/29368858-9bf7-80c0-5f4d-218f6702%40drchip.org.


Re: Possible bug in pattern processing for try/catch blocks

2020-10-24 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Sat, Oct 24, 2020 at 8:15 AM Jason Franklin  wrote:

> Greetings:
>
> I have discovered that the pattern matching in try/catch blocks does not
> conform to my expectations.
>
> Try this example:
>
> try
> echoerr 'foo bar baz'
> catch /foo/
> echo 'caught'
> endtry
>
> The string "caught" is printed, as I would expect.
>
> Now try this:
>
> try
> echoerr 'foo bar baz'
> catch /^foo/
> echo 'caught'
> endtry
>
> You will see that the message was NOT caught.  It appears that using the
> "^" metacharacter here causes the message not to match.
>
> Can anyone else confirm this?  Is this a bug?
>
> It definitely surprised me.
>
>
The exception that is thrown is "Vim(echoerr):foo bar baz". So if you want
to
match the beginning of the exception string, then you need to
use /^Vim(echoerr):foo/

- 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/CAAW7x7np3u%3D8SqdnruAiei6kwnrZHJEeS1tH%3DnkzzU_Wau3qDw%40mail.gmail.com.


Patch 8.2.1897

2020-10-24 Fir de Conversatie Bram Moolenaar


Patch 8.2.1897
Problem:Command modifiers are saved and set inconsistently.
Solution:   Separate parsing and applying command modifiers.  Save values in
cmdmod_T.
Files:  src/structs.h, src/ex_docmd.c, src/proto/ex_docmd.pro,
src/ex_cmds.h, src/vim9compile.c


*** ../vim-8.2.1896/src/structs.h   2020-10-23 18:02:28.707453763 +0200
--- src/structs.h   2020-10-24 17:08:45.893235506 +0200
***
*** 625,630 
--- 625,631 
   */
  typedef struct
  {
+ int   cmod_flags; // CMOD_ flags, see below
  int   hide;   // TRUE when ":hide" was used
  # ifdef FEAT_BROWSE_CMD
  int   browse; // TRUE to invoke file dialog
***
*** 640,652 
  int   lockmarks;  // TRUE when ":lockmarks" was 
used
  int   keeppatterns;   // TRUE when ":keeppatterns" 
was used
  int   noswapfile; // TRUE when ":noswapfile" was 
used
- char_u*save_ei;   // saved value of 'eventignore'
  regmatch_Tfilter_regmatch;// set by :filter /pat/
  int   filter_force;   // set for :filter!
! int   msg_silent; // TRUE when ":silent" was used
! int   emsg_silent;// TRUE when ":silent!" was used
  } cmdmod_T;
  
  #define MF_SEED_LEN   8
  
  struct memfile
--- 641,669 
  int   lockmarks;  // TRUE when ":lockmarks" was 
used
  int   keeppatterns;   // TRUE when ":keeppatterns" 
was used
  int   noswapfile; // TRUE when ":noswapfile" was 
used
  regmatch_Tfilter_regmatch;// set by :filter /pat/
  int   filter_force;   // set for :filter!
! 
! int   cmod_verbose;   // non-zero to set 'verbose'
! 
! // values for undo_cmdmod()
! char_u*cmod_save_ei;  // saved value of 'eventignore'
! #ifdef HAVE_SANDBOX
! int   cmod_did_sandbox;   // set when "sandbox" was 
incremented
! #endif
! long  cmod_verbose_save;  // if 'verbose' was set: value of
!   // p_verbose plus one
! int   cmod_save_msg_silent;   // if non-zero: saved value of
!   // msg_silent + 1
! int   cmod_did_esilent;   // incremented when emsg_silent 
is
  } cmdmod_T;
  
+ #define CMOD_SANDBOX  0x01
+ #define CMOD_SILENT   0x02
+ #define CMOD_ERRSILENT0x04
+ #define CMOD_UNSILENT 0x08
+ #define CMOD_NOAUTOCMD0x10
+ 
  #define MF_SEED_LEN   8
  
  struct memfile
*** ../vim-8.2.1896/src/ex_docmd.c  2020-10-23 18:51:03.531271374 +0200
--- src/ex_docmd.c  2020-10-24 17:10:01.761070302 +0200
***
*** 1764,1769 
--- 1764,1770 
  #endif
  if (parse_command_modifiers(, , FALSE) == FAIL)
goto doend;
+ apply_cmdmod();
  
  after_modifier = ea.cmd;
  
***
*** 2515,2526 
  
  // The :try command saves the emsg_silent flag, reset it here when
  // ":silent! try" was used, it should only apply to :try itself.
! if (ea.cmdidx == CMD_try && ea.did_esilent > 0)
  {
!   emsg_silent -= ea.did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
!   ea.did_esilent = 0;
  }
  
  /*
--- 2516,2527 
  
  // The :try command saves the emsg_silent flag, reset it here when
  // ":silent! try" was used, it should only apply to :try itself.
! if (ea.cmdidx == CMD_try && cmdmod.cmod_did_esilent > 0)
  {
!   emsg_silent -= cmdmod.cmod_did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
!   cmdmod.cmod_did_esilent = 0;
  }
  
  /*
***
*** 2597,2611 
? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
  #endif
  
! undo_cmdmod(, save_msg_scroll);
  cmdmod = save_cmdmod;
  reg_executing = save_reg_executing;
  
- #ifdef HAVE_SANDBOX
- if (ea.did_sandbox)
-   --sandbox;
- #endif
- 
  if (ea.nextcmd && *ea.nextcmd == NUL) // not really a next command
ea.nextcmd = NULL;
  
--- 2598,2607 
? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
  #endif
  
! undo_cmdmod(save_msg_scroll);
  cmdmod = save_cmdmod;
  reg_executing = save_reg_executing;
  
  if (ea.nextcmd && *ea.nextcmd == NUL) // not really a next command
ea.nextcmd = NULL;
  
***
*** 2641,2650 
   * - Set ex_pressedreturn for an empty command line.
   * - set msg_silent for ":silent"
   * - set 'eventignore' to "all" for ":noautocmd"
-  * - set p_verbose for ":verbose"
-  * - Increment "sandbox" for ":sandbox"
   * When "skip_only" is TRUE the global variables are not changed, except for
   * 

Possible bug in pattern processing for try/catch blocks

2020-10-24 Fir de Conversatie Jason Franklin
Greetings:

I have discovered that the pattern matching in try/catch blocks does not
conform to my expectations.

Try this example:

try
echoerr 'foo bar baz'
catch /foo/
echo 'caught'
endtry

The string "caught" is printed, as I would expect.

Now try this:

try
echoerr 'foo bar baz'
catch /^foo/
echo 'caught'
endtry

You will see that the message was NOT caught.  It appears that using the
"^" metacharacter here causes the message not to match.

Can anyone else confirm this?  Is this a bug?

It definitely surprised me.

-- 
Jason Franklin

-- 
-- 
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/dabc1bf3b549ab0503dc26ebdd97c0c30fd733bb.camel%40elitemail.org.


Patch 8.2.1896

2020-10-24 Fir de Conversatie Bram Moolenaar


Patch 8.2.1896
Problem:Valgrind warns for using uninitialized memory.
Solution:   NUL terminate the SmcOpenConnection() error message. (Dominique
Pellé, closes #7194)
Files:  src/os_unix.c


*** ../vim-8.2.1895/src/os_unix.c   2020-10-09 23:04:43.676144228 +0200
--- src/os_unix.c   2020-10-24 13:29:02.516565586 +0200
***
*** 8068,8077 
errorstring);
  if (xsmp.smcconn == NULL)
  {
-   char errorreport[132];
- 
if (p_verbose > 0)
{
vim_snprintf(errorreport, sizeof(errorreport),
 _("XSMP SmcOpenConnection failed: %s"), errorstring);
verb_msg(errorreport);
--- 8068,8080 
errorstring);
  if (xsmp.smcconn == NULL)
  {
if (p_verbose > 0)
{
+   char errorreport[132];
+ 
+   // If the message is too long it might not be NUL terminated.  Add
+   // a NUL at the end to make sure we don't go over the end.
+   errorstring[sizeof(errorstring) - 1] = NUL;
vim_snprintf(errorreport, sizeof(errorreport),
 _("XSMP SmcOpenConnection failed: %s"), errorstring);
verb_msg(errorreport);
*** ../vim-8.2.1895/src/version.c   2020-10-23 18:51:03.531271374 +0200
--- src/version.c   2020-10-24 13:30:31.956285408 +0200
***
*** 752,753 
--- 752,755 
  {   /* Add new patch number below this line */
+ /**/
+ 1896,
  /**/

-- 
"Computers in the future may weigh no more than 1.5 tons."
   Popular Mechanics, 1949

 /// 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/202010241132.09OBWjvG977572%40masaka.moolenaar.net.