]> granicus.if.org Git - vim/commitdiff
patch 9.0.0111: "nocombine" is missing from synIDattr() v9.0.0111
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2022 13:56:17 +0000 (14:56 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Jul 2022 13:56:17 +0000 (14:56 +0100)
Problem:    "nocombine" is missing from synIDattr().
Solution:   Add "nocombine". (Muni Tanjim, closes #10816)

runtime/doc/builtin.txt
src/evalfunc.c
src/testdir/test_syn_attr.vim
src/version.c

index f700d4e9d3e96e80ba4be82b11206f2bf2f1a451..a65f60d413619e51859d87f93c77ff125bb9953a 100644 (file)
@@ -9233,6 +9233,7 @@ synIDattr({synID}, {what} [, {mode}])                     *synIDattr()*
                "underline"     "1" if underlined
                "undercurl"     "1" if undercurled
                "strike"        "1" if strikethrough
+               "nocombine"     "1" if nocombine
 
                Returns an empty string on error.
 
index 1505418fb9a14ddb4aadc323685a0f36214264dd..9b09caab733be869840ff1f51815479eee95255d 100644 (file)
@@ -10083,8 +10083,11 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
                    p = highlight_has_attr(id, HL_ITALIC, modec);
                break;
 
-       case 'n':                                       // name
-               p = get_highlight_name_ext(NULL, id - 1, FALSE);
+       case 'n':                                       
+               if (TOLOWER_ASC(what[1]) == 'o')        // nocombine
+                   p = highlight_has_attr(id, HL_NOCOMBINE, modec);
+               else                                    // name
+                   p = get_highlight_name_ext(NULL, id - 1, FALSE);
                break;
 
        case 'r':                                       // reverse
index 366f39f46885386989bacd4d6e7c3cd9e7692dad..bf4dfbcaf072934231d374f069171b8ab828b392 100644 (file)
@@ -22,8 +22,10 @@ func Test_missing_attr()
   call assert_equal('1', synIDattr(hlID("Mine"), "underdotted", 'cterm'))
   call assert_equal('1', synIDattr("Mine"->hlID(), "underdashed", 'gui'))
 
-  hi Mine gui=strikethrough
+  hi Mine term=nocombine gui=strikethrough
   call assert_equal('1', synIDattr(hlID("Mine"), "strikethrough", 'gui'))
+  call assert_equal('1', synIDattr(hlID("Mine"), "nocombine", 'term'))
+  call assert_equal('', synIDattr(hlID("Mine"), "nocombine", 'gui'))
   hi Mine term=NONE cterm=NONE gui=NONE
   call assert_equal('', synIDattr(hlID("Mine"), "bold", 'term'))
   call assert_equal('', synIDattr(hlID("Mine"), "italic", 'cterm'))
index c3b5b6520825b36e3c6e25c0042b5b2947418ef8..3ba672db5d2df6390744a1529a82e84554793f96 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    111,
 /**/
     110,
 /**/