Patch 8.2.3631
Problem:    "syntax enable" does not work properly in Vim9 context.
Solution:   Also handle Vim9 context. (closes #9161)
Files:      src/syntax.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.3630/src/syntax.c        2021-08-05 19:39:59.350053671 +0100
--- src/syntax.c        2021-11-20 19:48:24.517184375 +0000
***************
*** 3777,3783 ****
      static void
  syn_cmd_enable(exarg_T *eap, int syncing UNUSED)
  {
!     set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"enable");
      syn_cmd_onoff(eap, "syntax");
      do_unlet((char_u *)"g:syntax_cmd", TRUE);
  }
--- 3777,3783 ----
      static void
  syn_cmd_enable(exarg_T *eap, int syncing UNUSED)
  {
!     set_internal_string_var((char_u *)"g:syntax_cmd", (char_u *)"enable");
      syn_cmd_onoff(eap, "syntax");
      do_unlet((char_u *)"g:syntax_cmd", TRUE);
  }
***************
*** 3792,3798 ****
      set_nextcmd(eap, eap->arg);
      if (!eap->skip)
      {
!       set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"reset");
        do_cmdline_cmd((char_u *)"runtime! syntax/syncolor.vim");
        do_unlet((char_u *)"g:syntax_cmd", TRUE);
      }
--- 3792,3798 ----
      set_nextcmd(eap, eap->arg);
      if (!eap->skip)
      {
!       set_internal_string_var((char_u *)"g:syntax_cmd", (char_u *)"reset");
        do_cmdline_cmd((char_u *)"runtime! syntax/syncolor.vim");
        do_unlet((char_u *)"g:syntax_cmd", TRUE);
      }
*** ../vim-8.2.3630/src/testdir/test_vim9_cmd.vim       2021-11-16 
17:19:24.506463307 +0000
--- src/testdir/test_vim9_cmd.vim       2021-11-20 19:46:08.249444927 +0000
***************
*** 1581,1585 ****
--- 1581,1593 ----
    set previewpopup&
  enddef
  
+ def Test_syntax_enable_clear()
+   syntax clear
+   syntax enable
+   highlight clear String
+   assert_equal(true, hlget('String')->get(0, {})->get('default', false))
+   syntax clear
+ enddef
+ 
  
  " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
*** ../vim-8.2.3630/src/version.c       2021-11-20 19:38:22.158489234 +0000
--- src/version.c       2021-11-20 19:47:44.365259725 +0000
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3631,
  /**/

-- 
The Law of VIM:
For each member b of the possible behaviour space B of program P, there exists
a finite time t before which at least one user u in the total user space U of
program P will request b becomes a member of the allowed behaviour space B'
(B' <= B).
In other words: Sooner or later everyone wants everything as an option.
                                        -- Vince Negri

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211120195209.126271C044E%40moolenaar.net.

Raspunde prin e-mail lui