summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0235
blob: ecc85a9373fdbb22067e3a88a7d26eed3cd74035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0235
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0235 (after 8.1.0231)
Problem:    More help tags that jump to the wrong location.
Solution:   Add more exceptions and a table for "expr-" tags. (Hirohito
            Higashi)
Files:	    src/ex_cmds.c, src/testdir/test_help_tagjump.vim


*** ../vim-8.1.0234/src/ex_cmds.c	2018-08-01 18:02:57.493860532 +0200
--- src/ex_cmds.c	2018-08-02 22:21:56.015278660 +0200
***************
*** 6583,6589 ****
      static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
  			       "/*", "/\\*", "\"*", "**",
  			       "cpo-*", "/\\(\\)", "/\\%(\\)",
! 			       "?", ":?", "-?", "?<CR>", "g?", "g?g?", "g??",
  			       "/\\?", "/\\z(\\)", "\\=", ":s\\=",
  			       "[count]", "[quotex]",
  			       "[range]", ":[range]",
--- 6583,6590 ----
      static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
  			       "/*", "/\\*", "\"*", "**",
  			       "cpo-*", "/\\(\\)", "/\\%(\\)",
! 			       "?", ":?", "?<CR>", "g?", "g?g?", "g??",
! 			       "-?", "q?", "v_g?",
  			       "/\\?", "/\\z(\\)", "\\=", ":s\\=",
  			       "[count]", "[quotex]",
  			       "[range]", ":[range]",
***************
*** 6593,6619 ****
      static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star",
  			       "/star", "/\\\\star", "quotestar", "starstar",
  			       "cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)",
! 			       "?", ":?", "-?", "?<CR>", "g?", "g?g?", "g??",
  			       "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
  			       "\\[count]", "\\[quotex]",
  			       "\\[range]", ":\\[range]",
  			       "\\[pattern]", "\\\\bar", "/\\\\%\\$",
  			       "s/\\\\\\~", "s/\\\\U", "s/\\\\L",
  			       "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"};
      int flags;
  
      d = IObuff;		    /* assume IObuff is long enough! */
  
!     /*
!      * Recognize a few exceptions to the rule.	Some strings that contain '*'
!      * with "star".  Otherwise '*' is recognized as a wildcard.
!      */
!     for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
! 	if (STRCMP(arg, mtable[i]) == 0)
! 	{
! 	    STRCPY(d, rtable[i]);
! 	    break;
! 	}
  
      if (i < 0)	/* no match in table */
      {
--- 6594,6636 ----
      static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star",
  			       "/star", "/\\\\star", "quotestar", "starstar",
  			       "cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)",
! 			       "?", ":?", "?<CR>", "g?", "g?g?", "g??",
! 			       "-?", "q?", "v_g?",
  			       "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
  			       "\\[count]", "\\[quotex]",
  			       "\\[range]", ":\\[range]",
  			       "\\[pattern]", "\\\\bar", "/\\\\%\\$",
  			       "s/\\\\\\~", "s/\\\\U", "s/\\\\L",
  			       "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"};
+     static char *(expr_table[]) = {"!=?", "!~?", "<=?", "<?", "==?", "=~?",
+ 				">=?", ">?", "is?", "isnot?"};
      int flags;
  
      d = IObuff;		    /* assume IObuff is long enough! */
  
!     if (STRNICMP(arg, "expr-", 5) == 0)
!     {
! 	// When the string starting with "expr-" and containing '?' and matches
! 	// the table, it is taken literally.  Otherwise '?' is recognized as a
! 	// wildcard.
! 	for (i = (int)(sizeof(expr_table) / sizeof(char *)); --i >= 0; )
! 	    if (STRCMP(arg + 5, expr_table[i]) == 0)
! 	    {
! 		STRCPY(d, arg);
! 		break;
! 	    }
!     }
!     else
!     {
! 	// Recognize a few exceptions to the rule.  Some strings that contain
! 	// '*' with "star".  Otherwise '*' is recognized as a wildcard.
! 	for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
! 	    if (STRCMP(arg, mtable[i]) == 0)
! 	    {
! 		STRCPY(d, rtable[i]);
! 		break;
! 	    }
!     }
  
      if (i < 0)	/* no match in table */
      {
*** ../vim-8.1.0234/src/testdir/test_help_tagjump.vim	2018-08-01 18:02:57.493860532 +0200
--- src/testdir/test_help_tagjump.vim	2018-08-02 22:16:50.581068403 +0200
***************
*** 26,36 ****
--- 26,59 ----
    call assert_true(getline('.') =~ '\*:?\*')
    helpclose
  
+   help q?
+   call assert_equal("help", &filetype)
+   call assert_true(getline('.') =~ '\*q?\*')
+   call assert_true(expand('<cword>') == 'q?')
+   helpclose
+ 
    help -?
    call assert_equal("help", &filetype)
    call assert_true(getline('.') =~ '\*-?\*')
    helpclose
  
+   help v_g?
+   call assert_equal("help", &filetype)
+   call assert_true(getline('.') =~ '\*v_g?\*')
+   helpclose
+ 
+   help expr-!=?
+   call assert_equal("help", &filetype)
+   call assert_true(getline('.') =~ '\*expr-!=?\*')
+   call assert_true(expand('<cword>') == 'expr-!=?')
+   helpclose
+ 
+   help expr-isnot?
+   call assert_equal("help", &filetype)
+   call assert_true(getline('.') =~ '\*expr-isnot?\*')
+   call assert_true(expand('<cword>') == 'expr-isnot?')
+   helpclose
+ 
    help FileW*Post
    call assert_equal("help", &filetype)
    call assert_true(getline('.') =~ '\*FileWritePost\*')
*** ../vim-8.1.0234/src/version.c	2018-08-02 21:46:47.579548771 +0200
--- src/version.c	2018-08-02 22:18:16.740563501 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     235,
  /**/

-- 
ARTHUR:  Be quiet!
DENNIS:  Well you can't expect to wield supreme executive power just 'cause
         some watery tart threw a sword at you!
ARTHUR:  Shut up!
DENNIS:  I mean, if I went around sayin' I was an empereror just because some
         moistened bint had lobbed a scimitar at me they'd put me away!
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- Bram@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    ///