Mercurial > vim
annotate src/structs.h @ 11529:998d2cf59caa v8.0.0647
patch 8.0.0647: syntax highlighting can make cause a freeze
commit https://github.com/vim/vim/commit/06f1ed2f78c5c03af95054fc3a8665df39dec362
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 18 22:41:03 2017 +0200
patch 8.0.0647: syntax highlighting can make cause a freeze
Problem: Syntax highlighting can make cause a freeze.
Solution: Apply 'redrawtime' to syntax highlighting, per window.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 18 Jun 2017 22:45:04 +0200 |
parents | 698ee9d4fe9f |
children | b8299e742f41 |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
10025
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
7 | 2 * |
3 * VIM - Vi IMproved by Bram Moolenaar | |
4 * | |
5 * Do ":help uganda" in Vim to read copying and usage conditions. | |
6 * Do ":help credits" in Vim to see a list of people who contributed. | |
7 */ | |
8 | |
9 /* | |
10 * This file contains various definitions of structures that are used by Vim | |
11 */ | |
12 | |
13 /* | |
14 * There is something wrong in the SAS compiler that makes typedefs not | |
15 * valid in include files. Has been fixed in version 6.58. | |
16 */ | |
17 #if defined(SASC) && SASC < 658 | |
18 typedef long linenr_T; | |
1872 | 19 typedef int colnr_T; |
7 | 20 typedef unsigned short short_u; |
21 #endif | |
22 | |
23 /* | |
24 * position in file or buffer | |
25 */ | |
26 typedef struct | |
27 { | |
28 linenr_T lnum; /* line number */ | |
29 colnr_T col; /* column number */ | |
30 #ifdef FEAT_VIRTUALEDIT | |
31 colnr_T coladd; | |
32 #endif | |
33 } pos_T; | |
34 | |
35 #ifdef FEAT_VIRTUALEDIT | |
1869 | 36 # define INIT_POS_T(l, c, ca) {l, c, ca} |
7 | 37 #else |
1869 | 38 # define INIT_POS_T(l, c, ca) {l, c} |
7 | 39 #endif |
40 | |
41 /* | |
42 * Same, but without coladd. | |
43 */ | |
44 typedef struct | |
45 { | |
46 linenr_T lnum; /* line number */ | |
47 colnr_T col; /* column number */ | |
48 } lpos_T; | |
49 | |
50 /* | |
51 * Structure used for growing arrays. | |
52 * This is used to store information that only grows, is deleted all at | |
53 * once, and needs to be accessed by index. See ga_clear() and ga_grow(). | |
54 */ | |
55 typedef struct growarray | |
56 { | |
57 int ga_len; /* current number of items used */ | |
41 | 58 int ga_maxlen; /* maximum number of items possible */ |
8 | 59 int ga_itemsize; /* sizeof(item) */ |
7 | 60 int ga_growsize; /* number of items to grow each time */ |
61 void *ga_data; /* pointer to the first item */ | |
62 } garray_T; | |
63 | |
64 #define GA_EMPTY {0, 0, 0, 0, NULL} | |
65 | |
4444 | 66 typedef struct window_S win_T; |
67 typedef struct wininfo_S wininfo_T; | |
68 typedef struct frame_S frame_T; | |
69 typedef int scid_T; /* script ID */ | |
70 typedef struct file_buffer buf_T; /* forward declaration */ | |
71 | |
11447
698ee9d4fe9f
patch 8.0.0607: after :bwipe + :new bufref might still be valid
Christian Brabandt <cb@256bit.org>
parents:
11325
diff
changeset
|
72 /* |
698ee9d4fe9f
patch 8.0.0607: after :bwipe + :new bufref might still be valid
Christian Brabandt <cb@256bit.org>
parents:
11325
diff
changeset
|
73 * Reference to a buffer that stores the value of buf_free_count. |
9475
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
74 * bufref_valid() only needs to check "buf" when the count differs. |
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
75 */ |
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
76 typedef struct { |
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
77 buf_T *br_buf; |
11447
698ee9d4fe9f
patch 8.0.0607: after :bwipe + :new bufref might still be valid
Christian Brabandt <cb@256bit.org>
parents:
11325
diff
changeset
|
78 int br_fnum; |
9475
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
79 int br_buf_free_count; |
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
80 } bufref_T; |
4d8f7f8da90c
commit https://github.com/vim/vim/commit/b25f9a97e9aad3cbb4bc3fe87cdbd5700f8aa0c6
Christian Brabandt <cb@256bit.org>
parents:
9414
diff
changeset
|
81 |
7 | 82 /* |
83 * This is here because regexp.h needs pos_T and below regprog_T is used. | |
84 */ | |
85 #include "regexp.h" | |
86 | |
87 /* | |
88 * This is here because gui.h needs the pos_T and win_T, and win_T needs gui.h | |
89 * for scrollbar_T. | |
90 */ | |
91 #ifdef FEAT_GUI | |
92 # include "gui.h" | |
93 #else | |
94 # ifdef FEAT_XCLIPBOARD | |
95 # include <X11/Intrinsic.h> | |
96 # endif | |
9939
ccb6461b82df
commit https://github.com/vim/vim/commit/1b58cdd160c2e0ada0f638679a2aa27e4665fc48
Christian Brabandt <cb@256bit.org>
parents:
9885
diff
changeset
|
97 # define guicolor_T long |
8969
c83e2c1e7f2b
commit https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd
Christian Brabandt <cb@256bit.org>
parents:
8863
diff
changeset
|
98 # define INVALCOLOR ((guicolor_T)0x1ffffff) |
7 | 99 #endif |
100 | |
101 /* | |
102 * marks: positions in a file | |
103 * (a normal mark is a lnum/col pair, the same as a file position) | |
104 */ | |
105 | |
106 /* (Note: for EBCDIC there are more than 26, because there are gaps in the | |
107 * alphabet coding. To minimize changes to the code, I decided to just | |
108 * increase the number of possible marks. */ | |
109 #define NMARKS ('z' - 'a' + 1) /* max. # of named marks */ | |
110 #define JUMPLISTSIZE 100 /* max. # of marks in jump list */ | |
111 #define TAGSTACKSIZE 20 /* max. # of tags in tag stack */ | |
112 | |
113 typedef struct filemark | |
114 { | |
115 pos_T mark; /* cursor position */ | |
116 int fnum; /* file number */ | |
117 } fmark_T; | |
118 | |
119 /* Xtended file mark: also has a file name */ | |
120 typedef struct xfilemark | |
121 { | |
122 fmark_T fmark; | |
123 char_u *fname; /* file name, used when fnum == 0 */ | |
9284
78712a2f687a
commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents:
9240
diff
changeset
|
124 #ifdef FEAT_VIMINFO |
9347
25c562442f8c
commit https://github.com/vim/vim/commit/f4fba6dcd508cb369ffa6916d9cb3fcf3d7ed548
Christian Brabandt <cb@256bit.org>
parents:
9284
diff
changeset
|
125 time_T time_set; |
9284
78712a2f687a
commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents:
9240
diff
changeset
|
126 #endif |
7 | 127 } xfmark_T; |
128 | |
129 /* | |
130 * The taggy struct is used to store the information about a :tag command. | |
131 */ | |
132 typedef struct taggy | |
133 { | |
134 char_u *tagname; /* tag name */ | |
135 fmark_T fmark; /* cursor position BEFORE ":tag" */ | |
136 int cur_match; /* match number */ | |
137 int cur_fnum; /* buffer number used for cur_match */ | |
138 } taggy_T; | |
139 | |
140 /* | |
141 * Structure that contains all options that are local to a window. | |
142 * Used twice in a window: for the current buffer and for all buffers. | |
143 * Also used in wininfo_T. | |
144 */ | |
145 typedef struct | |
146 { | |
147 #ifdef FEAT_ARABIC | |
148 int wo_arab; | |
149 # define w_p_arab w_onebuf_opt.wo_arab /* 'arabic' */ | |
150 #endif | |
5995 | 151 #ifdef FEAT_LINEBREAK |
152 int wo_bri; | |
153 # define w_p_bri w_onebuf_opt.wo_bri /* 'breakindent' */ | |
6243 | 154 char_u *wo_briopt; |
5995 | 155 # define w_p_briopt w_onebuf_opt.wo_briopt /* 'breakindentopt' */ |
156 #endif | |
7 | 157 #ifdef FEAT_DIFF |
158 int wo_diff; | |
159 # define w_p_diff w_onebuf_opt.wo_diff /* 'diff' */ | |
160 #endif | |
161 #ifdef FEAT_FOLDING | |
162 long wo_fdc; | |
163 # define w_p_fdc w_onebuf_opt.wo_fdc /* 'foldcolumn' */ | |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
164 int wo_fdc_save; |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
165 # define w_p_fdc_save w_onebuf_opt.wo_fdc_save /* 'foldenable' saved for diff mode */ |
7 | 166 int wo_fen; |
167 # define w_p_fen w_onebuf_opt.wo_fen /* 'foldenable' */ | |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
168 int wo_fen_save; |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
169 # define w_p_fen_save w_onebuf_opt.wo_fen_save /* 'foldenable' saved for diff mode */ |
7 | 170 char_u *wo_fdi; |
171 # define w_p_fdi w_onebuf_opt.wo_fdi /* 'foldignore' */ | |
172 long wo_fdl; | |
173 # define w_p_fdl w_onebuf_opt.wo_fdl /* 'foldlevel' */ | |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
174 int wo_fdl_save; |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
175 # define w_p_fdl_save w_onebuf_opt.wo_fdl_save /* 'foldlevel' state saved for diff mode */ |
7 | 176 char_u *wo_fdm; |
177 # define w_p_fdm w_onebuf_opt.wo_fdm /* 'foldmethod' */ | |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
178 char_u *wo_fdm_save; |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
179 # define w_p_fdm_save w_onebuf_opt.wo_fdm_save /* 'fdm' saved for diff mode */ |
7 | 180 long wo_fml; |
181 # define w_p_fml w_onebuf_opt.wo_fml /* 'foldminlines' */ | |
182 long wo_fdn; | |
707 | 183 # define w_p_fdn w_onebuf_opt.wo_fdn /* 'foldnestmax' */ |
7 | 184 # ifdef FEAT_EVAL |
185 char_u *wo_fde; | |
186 # define w_p_fde w_onebuf_opt.wo_fde /* 'foldexpr' */ | |
187 char_u *wo_fdt; | |
188 # define w_p_fdt w_onebuf_opt.wo_fdt /* 'foldtext' */ | |
189 # endif | |
190 char_u *wo_fmr; | |
191 # define w_p_fmr w_onebuf_opt.wo_fmr /* 'foldmarker' */ | |
192 #endif | |
193 #ifdef FEAT_LINEBREAK | |
194 int wo_lbr; | |
195 # define w_p_lbr w_onebuf_opt.wo_lbr /* 'linebreak' */ | |
196 #endif | |
197 int wo_list; | |
198 #define w_p_list w_onebuf_opt.wo_list /* 'list' */ | |
199 int wo_nu; | |
200 #define w_p_nu w_onebuf_opt.wo_nu /* 'number' */ | |
2178
c6f1aa1e9f32
Add 'relativenumber' patch from Markus Heidelberg.
Bram Moolenaar <bram@vim.org>
parents:
2171
diff
changeset
|
201 int wo_rnu; |
c6f1aa1e9f32
Add 'relativenumber' patch from Markus Heidelberg.
Bram Moolenaar <bram@vim.org>
parents:
2171
diff
changeset
|
202 #define w_p_rnu w_onebuf_opt.wo_rnu /* 'relativenumber' */ |
13 | 203 #ifdef FEAT_LINEBREAK |
204 long wo_nuw; | |
205 # define w_p_nuw w_onebuf_opt.wo_nuw /* 'numberwidth' */ | |
206 #endif | |
7 | 207 #if defined(FEAT_WINDOWS) |
208 int wo_wfh; | |
209 # define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */ | |
782 | 210 int wo_wfw; |
211 # define w_p_wfw w_onebuf_opt.wo_wfw /* 'winfixwidth' */ | |
7 | 212 #endif |
213 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | |
214 int wo_pvw; | |
215 # define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */ | |
216 #endif | |
217 #ifdef FEAT_RIGHTLEFT | |
218 int wo_rl; | |
219 # define w_p_rl w_onebuf_opt.wo_rl /* 'rightleft' */ | |
220 char_u *wo_rlc; | |
221 # define w_p_rlc w_onebuf_opt.wo_rlc /* 'rightleftcmd' */ | |
222 #endif | |
223 long wo_scr; | |
224 #define w_p_scr w_onebuf_opt.wo_scr /* 'scroll' */ | |
744 | 225 #ifdef FEAT_SPELL |
221 | 226 int wo_spell; |
744 | 227 # define w_p_spell w_onebuf_opt.wo_spell /* 'spell' */ |
228 #endif | |
229 #ifdef FEAT_SYN_HL | |
230 int wo_cuc; | |
231 # define w_p_cuc w_onebuf_opt.wo_cuc /* 'cursorcolumn' */ | |
232 int wo_cul; | |
233 # define w_p_cul w_onebuf_opt.wo_cul /* 'cursorline' */ | |
2314
233eb4412f5d
Added 'colorcolumn' option. Partly by Gregor Uhlenheuer.
Bram Moolenaar <bram@vim.org>
parents:
2281
diff
changeset
|
234 char_u *wo_cc; |
233eb4412f5d
Added 'colorcolumn' option. Partly by Gregor Uhlenheuer.
Bram Moolenaar <bram@vim.org>
parents:
2281
diff
changeset
|
235 # define w_p_cc w_onebuf_opt.wo_cc /* 'colorcolumn' */ |
221 | 236 #endif |
40 | 237 #ifdef FEAT_STL_OPT |
238 char_u *wo_stl; | |
239 #define w_p_stl w_onebuf_opt.wo_stl /* 'statusline' */ | |
240 #endif | |
7 | 241 #ifdef FEAT_SCROLLBIND |
242 int wo_scb; | |
243 # define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */ | |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
244 int wo_diff_saved; /* options were saved for starting diff mode */ |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
245 # define w_p_diff_saved w_onebuf_opt.wo_diff_saved |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
246 int wo_scb_save; /* 'scrollbind' saved for diff mode*/ |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
247 # define w_p_scb_save w_onebuf_opt.wo_scb_save |
7 | 248 #endif |
249 int wo_wrap; | |
250 #define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */ | |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
251 #ifdef FEAT_DIFF |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
252 int wo_wrap_save; /* 'wrap' state saved for diff mode*/ |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
253 # define w_p_wrap_save w_onebuf_opt.wo_wrap_save |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
254 #endif |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
255 #ifdef FEAT_CONCEAL |
2378
85b7dc8da5eb
Add the 'concealcursor' option to decide when the cursor line is to be
Bram Moolenaar <bram@vim.org>
parents:
2360
diff
changeset
|
256 char_u *wo_cocu; /* 'concealcursor' */ |
85b7dc8da5eb
Add the 'concealcursor' option to decide when the cursor line is to be
Bram Moolenaar <bram@vim.org>
parents:
2360
diff
changeset
|
257 # define w_p_cocu w_onebuf_opt.wo_cocu |
85b7dc8da5eb
Add the 'concealcursor' option to decide when the cursor line is to be
Bram Moolenaar <bram@vim.org>
parents:
2360
diff
changeset
|
258 long wo_cole; /* 'conceallevel' */ |
85b7dc8da5eb
Add the 'concealcursor' option to decide when the cursor line is to be
Bram Moolenaar <bram@vim.org>
parents:
2360
diff
changeset
|
259 # define w_p_cole w_onebuf_opt.wo_cole |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
260 #endif |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
261 #ifdef FEAT_CURSORBIND |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
262 int wo_crb; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
263 # define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */ |
5102
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
264 int wo_crb_save; /* 'cursorbind' state saved for diff mode*/ |
11d0c6df1d7b
updated for version 7.3.1294
Bram Moolenaar <bram@vim.org>
parents:
5041
diff
changeset
|
265 # define w_p_crb_save w_onebuf_opt.wo_crb_save |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
266 #endif |
9852
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9810
diff
changeset
|
267 #ifdef FEAT_SIGNS |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9810
diff
changeset
|
268 char_u *wo_scl; |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9810
diff
changeset
|
269 # define w_p_scl w_onebuf_opt.wo_scl /* 'signcolumn' */ |
4eea48b76d03
commit https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
Christian Brabandt <cb@256bit.org>
parents:
9810
diff
changeset
|
270 #endif |
694 | 271 |
272 #ifdef FEAT_EVAL | |
273 int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */ | |
274 # define w_p_scriptID w_onebuf_opt.wo_scriptID | |
275 #endif | |
7 | 276 } winopt_T; |
277 | |
278 /* | |
279 * Window info stored with a buffer. | |
280 * | |
281 * Two types of info are kept for a buffer which are associated with a | |
282 * specific window: | |
283 * 1. Each window can have a different line number associated with a buffer. | |
284 * 2. The window-local options for a buffer work in a similar way. | |
285 * The window-info is kept in a list at b_wininfo. It is kept in | |
286 * most-recently-used order. | |
287 */ | |
667 | 288 struct wininfo_S |
7 | 289 { |
290 wininfo_T *wi_next; /* next entry or NULL for last entry */ | |
291 wininfo_T *wi_prev; /* previous entry or NULL for first entry */ | |
2150
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
292 win_T *wi_win; /* pointer to window that did set wi_fpos */ |
7 | 293 pos_T wi_fpos; /* last cursor position in the file */ |
294 int wi_optset; /* TRUE when wi_opt has useful values */ | |
295 winopt_T wi_opt; /* local window options */ | |
296 #ifdef FEAT_FOLDING | |
297 int wi_fold_manual; /* copy of w_fold_manual */ | |
298 garray_T wi_folds; /* clone of w_folds */ | |
299 #endif | |
300 }; | |
301 | |
302 /* | |
303 * Info used to pass info about a fold from the fold-detection code to the | |
304 * code that displays the foldcolumn. | |
305 */ | |
306 typedef struct foldinfo | |
307 { | |
308 int fi_level; /* level of the fold; when this is zero the | |
309 other fields are invalid */ | |
310 int fi_lnum; /* line number where fold starts */ | |
311 int fi_low_level; /* lowest fold level that starts in the same | |
312 line */ | |
313 } foldinfo_T; | |
314 | |
692 | 315 /* Structure to store info about the Visual area. */ |
316 typedef struct | |
317 { | |
318 pos_T vi_start; /* start pos of last VIsual */ | |
319 pos_T vi_end; /* end position of last VIsual */ | |
320 int vi_mode; /* VIsual_mode of last VIsual */ | |
321 colnr_T vi_curswant; /* MAXCOL from w_curswant */ | |
322 } visualinfo_T; | |
323 | |
7 | 324 /* |
1216 | 325 * structures used for undo |
7 | 326 */ |
327 | |
328 typedef struct u_entry u_entry_T; | |
329 typedef struct u_header u_header_T; | |
330 struct u_entry | |
331 { | |
332 u_entry_T *ue_next; /* pointer to next entry in list */ | |
333 linenr_T ue_top; /* number of line above undo block */ | |
334 linenr_T ue_bot; /* number of line below undo block */ | |
335 linenr_T ue_lcount; /* linecount when u_save called */ | |
336 char_u **ue_array; /* array of lines in undo block */ | |
337 long ue_size; /* number of lines in ue_array */ | |
1415 | 338 #ifdef U_DEBUG |
339 int ue_magic; /* magic number to check allocation */ | |
340 #endif | |
7 | 341 }; |
342 | |
343 struct u_header | |
344 { | |
2242
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
345 /* The following have a pointer and a number. The number is used when |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
346 * reading the undo file in u_read_undo() */ |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
347 union { |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
348 u_header_T *ptr; /* pointer to next undo header in list */ |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
349 long seq; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
350 } uh_next; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
351 union { |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
352 u_header_T *ptr; /* pointer to previous header in list */ |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
353 long seq; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
354 } uh_prev; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
355 union { |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
356 u_header_T *ptr; /* pointer to next header for alt. redo */ |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
357 long seq; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
358 } uh_alt_next; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
359 union { |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
360 u_header_T *ptr; /* pointer to previous header for alt. redo */ |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
361 long seq; |
bc4685345719
Don't use pointers to store numbers, use a union.
Bram Moolenaar <bram@vim.org>
parents:
2241
diff
changeset
|
362 } uh_alt_prev; |
753 | 363 long uh_seq; /* sequence number, higher == newer undo */ |
364 int uh_walk; /* used by undo_time() */ | |
7 | 365 u_entry_T *uh_entry; /* pointer to first entry */ |
366 u_entry_T *uh_getbot_entry; /* pointer to where ue_bot must be set */ | |
367 pos_T uh_cursor; /* cursor position before saving */ | |
368 #ifdef FEAT_VIRTUALEDIT | |
369 long uh_cursor_vcol; | |
370 #endif | |
371 int uh_flags; /* see below */ | |
372 pos_T uh_namedm[NMARKS]; /* marks before undo/after redo */ | |
692 | 373 visualinfo_T uh_visual; /* Visual areas before undo/after redo */ |
9347
25c562442f8c
commit https://github.com/vim/vim/commit/f4fba6dcd508cb369ffa6916d9cb3fcf3d7ed548
Christian Brabandt <cb@256bit.org>
parents:
9284
diff
changeset
|
374 time_T uh_time; /* timestamp when the change was made */ |
2281
e41433ea71df
Added ":earlier 1f" and ":later 1f".
Bram Moolenaar <bram@vim.org>
parents:
2280
diff
changeset
|
375 long uh_save_nr; /* set when the file was saved after the |
e41433ea71df
Added ":earlier 1f" and ":later 1f".
Bram Moolenaar <bram@vim.org>
parents:
2280
diff
changeset
|
376 changes in this block */ |
1415 | 377 #ifdef U_DEBUG |
378 int uh_magic; /* magic number to check allocation */ | |
379 #endif | |
7 | 380 }; |
381 | |
382 /* values for uh_flags */ | |
383 #define UH_CHANGED 0x01 /* b_changed flag before undo/after redo */ | |
384 #define UH_EMPTYBUF 0x02 /* buffer was empty */ | |
385 | |
386 /* | |
1216 | 387 * structures used in undo.c |
7 | 388 */ |
5684 | 389 #if VIM_SIZEOF_INT > 2 |
7 | 390 # define ALIGN_LONG /* longword alignment and use filler byte */ |
391 # define ALIGN_SIZE (sizeof(long)) | |
392 #else | |
393 # define ALIGN_SIZE (sizeof(short)) | |
394 #endif | |
395 | |
396 #define ALIGN_MASK (ALIGN_SIZE - 1) | |
397 | |
398 typedef struct m_info minfo_T; | |
399 | |
400 /* | |
2171 | 401 * structure used to link chunks in one of the free chunk lists. |
7 | 402 */ |
403 struct m_info | |
404 { | |
405 #ifdef ALIGN_LONG | |
406 long_u m_size; /* size of the chunk (including m_info) */ | |
407 #else | |
408 short_u m_size; /* size of the chunk (including m_info) */ | |
409 #endif | |
410 minfo_T *m_next; /* pointer to next free chunk in the list */ | |
411 }; | |
412 | |
413 /* | |
414 * things used in memfile.c | |
415 */ | |
416 | |
417 typedef struct block_hdr bhdr_T; | |
418 typedef struct memfile memfile_T; | |
419 typedef long blocknr_T; | |
420 | |
421 /* | |
2730 | 422 * mf_hashtab_T is a chained hashtable with blocknr_T key and arbitrary |
423 * structures as items. This is an intrusive data structure: we require | |
424 * that items begin with mf_hashitem_T which contains the key and linked | |
425 * list pointers. List of items in each bucket is doubly-linked. | |
426 */ | |
427 | |
428 typedef struct mf_hashitem_S mf_hashitem_T; | |
429 | |
430 struct mf_hashitem_S | |
431 { | |
432 mf_hashitem_T *mhi_next; | |
433 mf_hashitem_T *mhi_prev; | |
434 blocknr_T mhi_key; | |
435 }; | |
436 | |
437 #define MHT_INIT_SIZE 64 | |
438 | |
439 typedef struct mf_hashtab_S | |
440 { | |
441 long_u mht_mask; /* mask used for hash value (nr of items | |
442 * in array is "mht_mask" + 1) */ | |
443 long_u mht_count; /* nr of items inserted into hashtable */ | |
444 mf_hashitem_T **mht_buckets; /* points to mht_small_buckets or | |
445 *dynamically allocated array */ | |
446 mf_hashitem_T *mht_small_buckets[MHT_INIT_SIZE]; /* initial buckets */ | |
447 char mht_fixed; /* non-zero value forbids growth */ | |
448 } mf_hashtab_T; | |
449 | |
450 /* | |
7 | 451 * for each (previously) used block in the memfile there is one block header. |
452 * | |
453 * The block may be linked in the used list OR in the free list. | |
454 * The used blocks are also kept in hash lists. | |
455 * | |
456 * The used list is a doubly linked list, most recently used block first. | |
457 * The blocks in the used list have a block of memory allocated. | |
458 * mf_used_count is the number of pages in the used list. | |
459 * The hash lists are used to quickly find a block in the used list. | |
460 * The free list is a single linked list, not sorted. | |
461 * The blocks in the free list have no block of memory allocated and | |
462 * the contents of the block in the file (if any) is irrelevant. | |
463 */ | |
464 | |
465 struct block_hdr | |
466 { | |
2730 | 467 mf_hashitem_T bh_hashitem; /* header for hash table and key */ |
468 #define bh_bnum bh_hashitem.mhi_key /* block number, part of bh_hashitem */ | |
469 | |
7 | 470 bhdr_T *bh_next; /* next block_hdr in free or used list */ |
471 bhdr_T *bh_prev; /* previous block_hdr in used list */ | |
472 char_u *bh_data; /* pointer to memory (for used block) */ | |
473 int bh_page_count; /* number of pages in this block */ | |
474 | |
475 #define BH_DIRTY 1 | |
476 #define BH_LOCKED 2 | |
477 char bh_flags; /* BH_DIRTY or BH_LOCKED */ | |
478 }; | |
479 | |
480 /* | |
481 * when a block with a negative number is flushed to the file, it gets | |
482 * a positive number. Because the reference to the block is still the negative | |
483 * number, we remember the translation to the new positive number in the | |
484 * double linked trans lists. The structure is the same as the hash lists. | |
485 */ | |
486 typedef struct nr_trans NR_TRANS; | |
487 | |
488 struct nr_trans | |
489 { | |
2730 | 490 mf_hashitem_T nt_hashitem; /* header for hash table and key */ |
491 #define nt_old_bnum nt_hashitem.mhi_key /* old, negative, number */ | |
492 | |
7 | 493 blocknr_T nt_new_bnum; /* new, positive, number */ |
494 }; | |
495 | |
5649 | 496 |
497 typedef struct buffblock buffblock_T; | |
498 typedef struct buffheader buffheader_T; | |
499 | |
7 | 500 /* |
501 * structure used to store one block of the stuff/redo/recording buffers | |
502 */ | |
503 struct buffblock | |
504 { | |
5649 | 505 buffblock_T *b_next; /* pointer to next buffblock */ |
506 char_u b_str[1]; /* contents (actually longer) */ | |
7 | 507 }; |
508 | |
509 /* | |
510 * header used for the stuff buffer and the redo buffer | |
511 */ | |
512 struct buffheader | |
513 { | |
5649 | 514 buffblock_T bh_first; /* first (dummy) block of list */ |
515 buffblock_T *bh_curr; /* buffblock for appending */ | |
516 int bh_index; /* index for reading */ | |
517 int bh_space; /* space in bh_curr for appending */ | |
7 | 518 }; |
519 | |
11325
77f3b7316d8b
patch 8.0.0548: saving the redo buffer only works one time
Christian Brabandt <cb@256bit.org>
parents:
11087
diff
changeset
|
520 typedef struct |
77f3b7316d8b
patch 8.0.0548: saving the redo buffer only works one time
Christian Brabandt <cb@256bit.org>
parents:
11087
diff
changeset
|
521 { |
77f3b7316d8b
patch 8.0.0548: saving the redo buffer only works one time
Christian Brabandt <cb@256bit.org>
parents:
11087
diff
changeset
|
522 buffheader_T sr_redobuff; |
77f3b7316d8b
patch 8.0.0548: saving the redo buffer only works one time
Christian Brabandt <cb@256bit.org>
parents:
11087
diff
changeset
|
523 buffheader_T sr_old_redobuff; |
77f3b7316d8b
patch 8.0.0548: saving the redo buffer only works one time
Christian Brabandt <cb@256bit.org>
parents:
11087
diff
changeset
|
524 } save_redo_T; |
77f3b7316d8b
patch 8.0.0548: saving the redo buffer only works one time
Christian Brabandt <cb@256bit.org>
parents:
11087
diff
changeset
|
525 |
7 | 526 /* |
527 * used for completion on the command line | |
528 */ | |
529 typedef struct expand | |
530 { | |
531 int xp_context; /* type of expansion */ | |
532 char_u *xp_pattern; /* start of item to expand */ | |
1965 | 533 int xp_pattern_len; /* bytes in xp_pattern before cursor */ |
7 | 534 #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) |
535 char_u *xp_arg; /* completion function */ | |
536 int xp_scriptID; /* SID for completion function */ | |
537 #endif | |
538 int xp_backslash; /* one of the XP_BS_ values */ | |
632 | 539 #ifndef BACKSLASH_IN_FILENAME |
2511
2f5b709a6470
Fixed: on MS-Windows completion of shell commands didn't work.
Bram Moolenaar <bram@vim.org>
parents:
2425
diff
changeset
|
540 int xp_shell; /* TRUE for a shell command, more |
2f5b709a6470
Fixed: on MS-Windows completion of shell commands didn't work.
Bram Moolenaar <bram@vim.org>
parents:
2425
diff
changeset
|
541 characters need to be escaped */ |
632 | 542 #endif |
7 | 543 int xp_numfiles; /* number of files found by |
544 file name completion */ | |
545 char_u **xp_files; /* list of files */ | |
5033
7aa4e0822dec
updated for version 7.3.1260
Bram Moolenaar <bram@vim.org>
parents:
4861
diff
changeset
|
546 char_u *xp_line; /* text being completed */ |
7aa4e0822dec
updated for version 7.3.1260
Bram Moolenaar <bram@vim.org>
parents:
4861
diff
changeset
|
547 int xp_col; /* cursor position in line */ |
7 | 548 } expand_T; |
549 | |
550 /* values for xp_backslash */ | |
551 #define XP_BS_NONE 0 /* nothing special for backslashes */ | |
552 #define XP_BS_ONE 1 /* uses one backslash before a space */ | |
553 #define XP_BS_THREE 2 /* uses three backslashes before a space */ | |
554 | |
555 /* | |
556 * Command modifiers ":vertical", ":browse", ":confirm" and ":hide" set a flag. | |
557 * This needs to be saved for recursive commands, put them in a structure for | |
558 * easy manipulation. | |
559 */ | |
560 typedef struct | |
561 { | |
562 int hide; /* TRUE when ":hide" was used */ | |
1733 | 563 # ifdef FEAT_BROWSE_CMD |
7 | 564 int browse; /* TRUE to invoke file dialog */ |
565 # endif | |
566 # ifdef FEAT_WINDOWS | |
567 int split; /* flags for win_split() */ | |
683 | 568 int tab; /* > 0 when ":tab" was used */ |
7 | 569 # endif |
570 # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) | |
571 int confirm; /* TRUE to invoke yes/no dialog */ | |
572 # endif | |
22 | 573 int keepalt; /* TRUE when ":keepalt" was used */ |
7 | 574 int keepmarks; /* TRUE when ":keepmarks" was used */ |
575 int keepjumps; /* TRUE when ":keepjumps" was used */ | |
576 int lockmarks; /* TRUE when ":lockmarks" was used */ | |
5467 | 577 int keeppatterns; /* TRUE when ":keeppatterns" was used */ |
5737 | 578 int noswapfile; /* TRUE when ":noswapfile" was used */ |
590 | 579 # ifdef FEAT_AUTOCMD |
580 char_u *save_ei; /* saved value of 'eventignore' */ | |
581 # endif | |
9941
e975914c17e9
commit https://github.com/vim/vim/commit/7b668e83d0635d082b7ec90d7d2aa30a9d7d8928
Christian Brabandt <cb@256bit.org>
parents:
9939
diff
changeset
|
582 regmatch_T filter_regmatch; /* set by :filter /pat/ */ |
9980
b222552cf0c4
commit https://github.com/vim/vim/commit/d29459baa61819e59961804ed258efac5733ec70
Christian Brabandt <cb@256bit.org>
parents:
9955
diff
changeset
|
583 int filter_force; /* set for :filter! */ |
7 | 584 } cmdmod_T; |
585 | |
2267 | 586 #define MF_SEED_LEN 8 |
7 | 587 |
588 struct memfile | |
589 { | |
590 char_u *mf_fname; /* name of the file */ | |
591 char_u *mf_ffname; /* idem, full path */ | |
592 int mf_fd; /* file descriptor */ | |
593 bhdr_T *mf_free_first; /* first block_hdr in free list */ | |
594 bhdr_T *mf_used_first; /* mru block_hdr in used list */ | |
595 bhdr_T *mf_used_last; /* lru block_hdr in used list */ | |
596 unsigned mf_used_count; /* number of pages in used list */ | |
597 unsigned mf_used_count_max; /* maximum number of pages in memory */ | |
2730 | 598 mf_hashtab_T mf_hash; /* hash lists */ |
599 mf_hashtab_T mf_trans; /* trans lists */ | |
7 | 600 blocknr_T mf_blocknr_max; /* highest positive block number + 1*/ |
601 blocknr_T mf_blocknr_min; /* lowest negative block number - 1 */ | |
602 blocknr_T mf_neg_count; /* number of negative blocks numbers */ | |
603 blocknr_T mf_infile_count; /* number of pages in the file */ | |
604 unsigned mf_page_size; /* number of bytes in a page */ | |
605 int mf_dirty; /* TRUE if there are dirty blocks */ | |
2267 | 606 #ifdef FEAT_CRYPT |
5905 | 607 buf_T *mf_buffer; /* buffer this memfile is for */ |
2267 | 608 char_u mf_seed[MF_SEED_LEN]; /* seed for encryption */ |
609 | |
610 /* Values for key, method and seed used for reading data blocks when | |
611 * updating for a newly set key or method. Only when mf_old_key != NULL. */ | |
612 char_u *mf_old_key; | |
613 int mf_old_cm; | |
614 char_u mf_old_seed[MF_SEED_LEN]; | |
615 #endif | |
7 | 616 }; |
617 | |
618 /* | |
619 * things used in memline.c | |
620 */ | |
621 /* | |
622 * When searching for a specific line, we remember what blocks in the tree | |
623 * are the branches leading to that block. This is stored in ml_stack. Each | |
624 * entry is a pointer to info in a block (may be data block or pointer block) | |
625 */ | |
626 typedef struct info_pointer | |
627 { | |
628 blocknr_T ip_bnum; /* block number */ | |
629 linenr_T ip_low; /* lowest lnum in this block */ | |
630 linenr_T ip_high; /* highest lnum in this block */ | |
631 int ip_index; /* index for block with current lnum */ | |
632 } infoptr_T; /* block/index pair */ | |
633 | |
634 #ifdef FEAT_BYTEOFF | |
635 typedef struct ml_chunksize | |
636 { | |
637 int mlcs_numlines; | |
638 long mlcs_totalsize; | |
639 } chunksize_T; | |
640 | |
641 /* Flags when calling ml_updatechunk() */ | |
642 | |
643 #define ML_CHNK_ADDLINE 1 | |
644 #define ML_CHNK_DELLINE 2 | |
645 #define ML_CHNK_UPDLINE 3 | |
646 #endif | |
647 | |
648 /* | |
649 * the memline structure holds all the information about a memline | |
650 */ | |
651 typedef struct memline | |
652 { | |
653 linenr_T ml_line_count; /* number of lines in the buffer */ | |
654 | |
655 memfile_T *ml_mfp; /* pointer to associated memfile */ | |
656 | |
657 #define ML_EMPTY 1 /* empty buffer */ | |
658 #define ML_LINE_DIRTY 2 /* cached line was changed and allocated */ | |
659 #define ML_LOCKED_DIRTY 4 /* ml_locked was changed */ | |
660 #define ML_LOCKED_POS 8 /* ml_locked needs positive block number */ | |
661 int ml_flags; | |
662 | |
663 infoptr_T *ml_stack; /* stack of pointer blocks (array of IPTRs) */ | |
6933 | 664 int ml_stack_top; /* current top of ml_stack */ |
7 | 665 int ml_stack_size; /* total number of entries in ml_stack */ |
666 | |
667 linenr_T ml_line_lnum; /* line number of cached line, 0 if not valid */ | |
668 char_u *ml_line_ptr; /* pointer to cached line */ | |
669 | |
670 bhdr_T *ml_locked; /* block used by last ml_get */ | |
671 linenr_T ml_locked_low; /* first line in ml_locked */ | |
672 linenr_T ml_locked_high; /* last line in ml_locked */ | |
673 int ml_locked_lineadd; /* number of lines inserted in ml_locked */ | |
674 #ifdef FEAT_BYTEOFF | |
675 chunksize_T *ml_chunksize; | |
676 int ml_numchunks; | |
677 int ml_usedchunks; | |
678 #endif | |
679 } memline_T; | |
680 | |
681 #if defined(FEAT_SIGNS) || defined(PROTO) | |
682 typedef struct signlist signlist_T; | |
683 | |
684 struct signlist | |
685 { | |
686 int id; /* unique identifier for each placed sign */ | |
687 linenr_T lnum; /* line number which has this sign */ | |
688 int typenr; /* typenr of sign */ | |
689 signlist_T *next; /* next signlist entry */ | |
690 # ifdef FEAT_NETBEANS_INTG | |
691 signlist_T *prev; /* previous entry -- for easy reordering */ | |
692 # endif | |
693 }; | |
694 | |
695 /* type argument for buf_getsigntype() */ | |
696 #define SIGN_ANY 0 | |
697 #define SIGN_LINEHL 1 | |
698 #define SIGN_ICON 2 | |
699 #define SIGN_TEXT 3 | |
700 #endif | |
701 | |
702 /* | |
703 * Argument list: Array of file names. | |
704 * Used for the global argument list and the argument lists local to a window. | |
705 */ | |
706 typedef struct arglist | |
707 { | |
708 garray_T al_ga; /* growarray with the array of file names */ | |
709 int al_refcount; /* number of windows using this arglist */ | |
5942 | 710 int id; /* id of this arglist */ |
7 | 711 } alist_T; |
712 | |
713 /* | |
714 * For each argument remember the file name as it was given, and the buffer | |
715 * number that contains the expanded file name (required for when ":cd" is | |
716 * used. | |
717 */ | |
718 typedef struct argentry | |
719 { | |
720 char_u *ae_fname; /* file name as specified */ | |
721 int ae_fnum; /* buffer number with expanded file name */ | |
722 } aentry_T; | |
723 | |
724 #ifdef FEAT_WINDOWS | |
725 # define ALIST(win) (win)->w_alist | |
726 #else | |
727 # define ALIST(win) (&global_alist) | |
728 #endif | |
729 #define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data) | |
730 #define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data) | |
731 #define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data) | |
732 #define AARGLIST(al) ((aentry_T *)((al)->al_ga.ga_data)) | |
733 #define GARGCOUNT (global_alist.al_ga.ga_len) | |
734 #define ARGCOUNT (ALIST(curwin)->al_ga.ga_len) | |
735 #define WARGCOUNT(wp) (ALIST(wp)->al_ga.ga_len) | |
736 | |
737 /* | |
738 * A list used for saving values of "emsg_silent". Used by ex_try() to save the | |
739 * value of "emsg_silent" if it was non-zero. When this is done, the CSF_SILENT | |
740 * flag below is set. | |
741 */ | |
742 | |
743 typedef struct eslist_elem eslist_T; | |
744 struct eslist_elem | |
745 { | |
746 int saved_emsg_silent; /* saved value of "emsg_silent" */ | |
747 eslist_T *next; /* next element on the list */ | |
748 }; | |
749 | |
750 /* | |
751 * For conditional commands a stack is kept of nested conditionals. | |
752 * When cs_idx < 0, there is no conditional command. | |
753 */ | |
754 #define CSTACK_LEN 50 | |
755 | |
756 struct condstack | |
757 { | |
75 | 758 short cs_flags[CSTACK_LEN]; /* CSF_ flags */ |
7 | 759 char cs_pending[CSTACK_LEN]; /* CSTP_: what's pending in ":finally"*/ |
760 union { | |
75 | 761 void *csp_rv[CSTACK_LEN]; /* return typeval for pending return */ |
762 void *csp_ex[CSTACK_LEN]; /* exception for pending throw */ | |
7 | 763 } cs_pend; |
79 | 764 void *cs_forinfo[CSTACK_LEN]; /* info used by ":for" */ |
75 | 765 int cs_line[CSTACK_LEN]; /* line nr of ":while"/":for" line */ |
7 | 766 int cs_idx; /* current entry, or -1 if none */ |
75 | 767 int cs_looplevel; /* nr of nested ":while"s and ":for"s */ |
768 int cs_trylevel; /* nr of nested ":try"s */ | |
7 | 769 eslist_T *cs_emsg_silent_list; /* saved values of "emsg_silent" */ |
75 | 770 char cs_lflags; /* loop flags: CSL_ flags */ |
7 | 771 }; |
75 | 772 # define cs_rettv cs_pend.csp_rv |
773 # define cs_exception cs_pend.csp_ex | |
7 | 774 |
79 | 775 /* There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if" |
776 * was used. */ | |
75 | 777 # define CSF_TRUE 0x0001 /* condition was TRUE */ |
778 # define CSF_ACTIVE 0x0002 /* current state is active */ | |
779 # define CSF_ELSE 0x0004 /* ":else" has been passed */ | |
780 # define CSF_WHILE 0x0008 /* is a ":while" */ | |
781 # define CSF_FOR 0x0010 /* is a ":for" */ | |
782 | |
783 # define CSF_TRY 0x0100 /* is a ":try" */ | |
784 # define CSF_FINALLY 0x0200 /* ":finally" has been passed */ | |
785 # define CSF_THROWN 0x0400 /* exception thrown to this try conditional */ | |
786 # define CSF_CAUGHT 0x0800 /* exception caught by this try conditional */ | |
787 # define CSF_SILENT 0x1000 /* "emsg_silent" reset by ":try" */ | |
7 | 788 /* Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset |
789 * (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. */ | |
790 | |
791 /* | |
792 * What's pending for being reactivated at the ":endtry" of this try | |
793 * conditional: | |
794 */ | |
795 # define CSTP_NONE 0 /* nothing pending in ":finally" clause */ | |
796 # define CSTP_ERROR 1 /* an error is pending */ | |
797 # define CSTP_INTERRUPT 2 /* an interrupt is pending */ | |
798 # define CSTP_THROW 4 /* a throw is pending */ | |
799 # define CSTP_BREAK 8 /* ":break" is pending */ | |
800 # define CSTP_CONTINUE 16 /* ":continue" is pending */ | |
801 # define CSTP_RETURN 24 /* ":return" is pending */ | |
802 # define CSTP_FINISH 32 /* ":finish" is pending */ | |
803 | |
804 /* | |
75 | 805 * Flags for the cs_lflags item in struct condstack. |
806 */ | |
807 # define CSL_HAD_LOOP 1 /* just found ":while" or ":for" */ | |
808 # define CSL_HAD_ENDLOOP 2 /* just found ":endwhile" or ":endfor" */ | |
809 # define CSL_HAD_CONT 4 /* just found ":continue" */ | |
810 # define CSL_HAD_FINA 8 /* just found ":finally" */ | |
811 | |
812 /* | |
7 | 813 * A list of error messages that can be converted to an exception. "throw_msg" |
814 * is only set in the first element of the list. Usually, it points to the | |
815 * original message stored in that element, but sometimes it points to a later | |
816 * message in the list. See cause_errthrow() below. | |
817 */ | |
818 struct msglist | |
819 { | |
820 char_u *msg; /* original message */ | |
821 char_u *throw_msg; /* msg to throw: usually original one */ | |
822 struct msglist *next; /* next of several messages in a row */ | |
823 }; | |
824 | |
825 /* | |
10361
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
826 * The exception types. |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
827 */ |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
828 typedef enum |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
829 { |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
830 ET_USER, /* exception caused by ":throw" command */ |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
831 ET_ERROR, /* error exception */ |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
832 ET_INTERRUPT /* interrupt exception triggered by Ctrl-C */ |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
833 } except_type_T; |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
834 |
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
835 /* |
7 | 836 * Structure describing an exception. |
837 * (don't use "struct exception", it's used by the math library). | |
838 */ | |
839 typedef struct vim_exception except_T; | |
840 struct vim_exception | |
841 { | |
10361
147f45c283e1
commit https://github.com/vim/vim/commit/8a5883b7488e492419dde7e1637cc72f2d566ba4
Christian Brabandt <cb@256bit.org>
parents:
10311
diff
changeset
|
842 except_type_T type; /* exception type */ |
7 | 843 char_u *value; /* exception value */ |
844 struct msglist *messages; /* message(s) causing error exception */ | |
845 char_u *throw_name; /* name of the throw point */ | |
846 linenr_T throw_lnum; /* line number of the throw point */ | |
847 except_T *caught; /* next exception on the caught stack */ | |
848 }; | |
849 | |
850 /* | |
24 | 851 * Structure to save the error/interrupt/exception state between calls to |
852 * enter_cleanup() and leave_cleanup(). Must be allocated as an automatic | |
853 * variable by the (common) caller of these functions. | |
854 */ | |
855 typedef struct cleanup_stuff cleanup_T; | |
856 struct cleanup_stuff | |
857 { | |
858 int pending; /* error/interrupt/exception state */ | |
859 except_T *exception; /* exception value */ | |
860 }; | |
7 | 861 |
862 #ifdef FEAT_SYN_HL | |
863 /* struct passed to in_id_list() */ | |
864 struct sp_syn | |
865 { | |
866 int inc_tag; /* ":syn include" unique tag */ | |
867 short id; /* highlight group ID of item */ | |
868 short *cont_in_list; /* cont.in group IDs, if non-zero */ | |
869 }; | |
870 | |
871 /* | |
872 * Each keyword has one keyentry, which is linked in a hash list. | |
873 */ | |
874 typedef struct keyentry keyentry_T; | |
875 | |
876 struct keyentry | |
877 { | |
133 | 878 keyentry_T *ke_next; /* next entry with identical "keyword[]" */ |
7 | 879 struct sp_syn k_syn; /* struct passed to in_id_list() */ |
880 short *next_list; /* ID list for next match (if non-zero) */ | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
881 int flags; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
882 int k_char; /* conceal substitute character */ |
7 | 883 char_u keyword[1]; /* actually longer */ |
884 }; | |
885 | |
886 /* | |
887 * Struct used to store one state of the state stack. | |
888 */ | |
889 typedef struct buf_state | |
890 { | |
891 int bs_idx; /* index of pattern */ | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
892 int bs_flags; /* flags for pattern */ |
2425
b5ee68272ae5
Fix: concealed regions didn't get redrawn correctly when moving the cursor
Bram Moolenaar <bram@vim.org>
parents:
2419
diff
changeset
|
893 #ifdef FEAT_CONCEAL |
b5ee68272ae5
Fix: concealed regions didn't get redrawn correctly when moving the cursor
Bram Moolenaar <bram@vim.org>
parents:
2419
diff
changeset
|
894 int bs_seqnr; /* stores si_seqnr */ |
b5ee68272ae5
Fix: concealed regions didn't get redrawn correctly when moving the cursor
Bram Moolenaar <bram@vim.org>
parents:
2419
diff
changeset
|
895 int bs_cchar; /* stores si_cchar */ |
b5ee68272ae5
Fix: concealed regions didn't get redrawn correctly when moving the cursor
Bram Moolenaar <bram@vim.org>
parents:
2419
diff
changeset
|
896 #endif |
7 | 897 reg_extmatch_T *bs_extmatch; /* external matches from start pattern */ |
898 } bufstate_T; | |
899 | |
900 /* | |
901 * syn_state contains the syntax state stack for the start of one line. | |
902 * Used by b_sst_array[]. | |
903 */ | |
904 typedef struct syn_state synstate_T; | |
905 | |
906 struct syn_state | |
907 { | |
908 synstate_T *sst_next; /* next entry in used or free list */ | |
909 linenr_T sst_lnum; /* line number for this state */ | |
910 union | |
911 { | |
912 bufstate_T sst_stack[SST_FIX_STATES]; /* short state stack */ | |
913 garray_T sst_ga; /* growarray for long state stack */ | |
914 } sst_union; | |
915 int sst_next_flags; /* flags for sst_next_list */ | |
2171 | 916 int sst_stacksize; /* number of states on the stack */ |
7 | 917 short *sst_next_list; /* "nextgroup" list in this state |
918 * (this is a copy, don't free it! */ | |
919 disptick_T sst_tick; /* tick when last displayed */ | |
920 linenr_T sst_change_lnum;/* when non-zero, change in this line | |
921 * may have made the state invalid */ | |
922 }; | |
923 #endif /* FEAT_SYN_HL */ | |
924 | |
925 /* | |
926 * Structure shared between syntax.c, screen.c and gui_x11.c. | |
927 */ | |
928 typedef struct attr_entry | |
929 { | |
930 short ae_attr; /* HL_BOLD, etc. */ | |
931 union | |
932 { | |
933 struct | |
934 { | |
935 char_u *start; /* start escape sequence */ | |
936 char_u *stop; /* stop escape sequence */ | |
937 } term; | |
938 struct | |
939 { | |
685 | 940 /* These colors need to be > 8 bits to hold 256. */ |
941 short_u fg_color; /* foreground color number */ | |
942 short_u bg_color; /* background color number */ | |
9027
773d627cac0b
commit https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162
Christian Brabandt <cb@256bit.org>
parents:
8969
diff
changeset
|
943 # ifdef FEAT_TERMGUICOLORS |
9939
ccb6461b82df
commit https://github.com/vim/vim/commit/1b58cdd160c2e0ada0f638679a2aa27e4665fc48
Christian Brabandt <cb@256bit.org>
parents:
9885
diff
changeset
|
944 guicolor_T fg_rgb; /* foreground color RGB */ |
ccb6461b82df
commit https://github.com/vim/vim/commit/1b58cdd160c2e0ada0f638679a2aa27e4665fc48
Christian Brabandt <cb@256bit.org>
parents:
9885
diff
changeset
|
945 guicolor_T bg_rgb; /* background color RGB */ |
8969
c83e2c1e7f2b
commit https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd
Christian Brabandt <cb@256bit.org>
parents:
8863
diff
changeset
|
946 # endif |
7 | 947 } cterm; |
948 # ifdef FEAT_GUI | |
949 struct | |
950 { | |
951 guicolor_T fg_color; /* foreground color handle */ | |
952 guicolor_T bg_color; /* background color handle */ | |
205 | 953 guicolor_T sp_color; /* special color handle */ |
7 | 954 GuiFont font; /* font handle */ |
955 # ifdef FEAT_XFONTSET | |
956 GuiFontset fontset; /* fontset handle */ | |
957 # endif | |
958 } gui; | |
959 # endif | |
960 } ae_u; | |
961 } attrentry_T; | |
962 | |
963 #ifdef USE_ICONV | |
964 # ifdef HAVE_ICONV_H | |
965 # include <iconv.h> | |
966 # else | |
967 # if defined(MACOS_X) | |
968 # include <sys/errno.h> | |
969 # define EILSEQ ENOENT /* MacOS X does not have EILSEQ */ | |
970 typedef struct _iconv_t *iconv_t; | |
971 # else | |
972 # if defined(MACOS_CLASSIC) | |
973 typedef struct _iconv_t *iconv_t; | |
974 # define EINVAL 22 | |
975 # define E2BIG 7 | |
976 # define ENOENT 2 | |
977 # define EFAULT 14 | |
978 # define EILSEQ 123 | |
979 # else | |
980 # include <errno.h> | |
981 # endif | |
982 # endif | |
983 typedef void *iconv_t; | |
984 # endif | |
985 #endif | |
986 | |
987 /* | |
988 * Used for the typeahead buffer: typebuf. | |
989 */ | |
990 typedef struct | |
991 { | |
992 char_u *tb_buf; /* buffer for typed characters */ | |
993 char_u *tb_noremap; /* mapping flags for characters in tb_buf[] */ | |
994 int tb_buflen; /* size of tb_buf[] */ | |
995 int tb_off; /* current position in tb_buf[] */ | |
996 int tb_len; /* number of valid bytes in tb_buf[] */ | |
997 int tb_maplen; /* nr of mapped bytes in tb_buf[] */ | |
998 int tb_silent; /* nr of silently mapped bytes in tb_buf[] */ | |
999 int tb_no_abbr_cnt; /* nr of bytes without abbrev. in tb_buf[] */ | |
1000 int tb_change_cnt; /* nr of time tb_buf was changed; never zero */ | |
1001 } typebuf_T; | |
1002 | |
1003 /* Struct to hold the saved typeahead for save_typeahead(). */ | |
1004 typedef struct | |
1005 { | |
1006 typebuf_T save_typebuf; | |
1007 int typebuf_valid; /* TRUE when save_typebuf valid */ | |
1928 | 1008 int old_char; |
1009 int old_mod_mask; | |
5649 | 1010 buffheader_T save_readbuf1; |
1011 buffheader_T save_readbuf2; | |
7 | 1012 #ifdef USE_INPUT_BUF |
1013 char_u *save_inputbuf; | |
1014 #endif | |
1015 } tasave_T; | |
1016 | |
1017 /* | |
1018 * Used for conversion of terminal I/O and script files. | |
1019 */ | |
1020 typedef struct | |
1021 { | |
1022 int vc_type; /* zero or one of the CONV_ values */ | |
1023 int vc_factor; /* max. expansion factor */ | |
1024 # ifdef WIN3264 | |
1025 int vc_cpfrom; /* codepage to convert from (CONV_CODEPAGE) */ | |
1026 int vc_cpto; /* codepage to convert to (CONV_CODEPAGE) */ | |
1027 # endif | |
1028 # ifdef USE_ICONV | |
1029 iconv_t vc_fd; /* for CONV_ICONV */ | |
1030 # endif | |
1031 int vc_fail; /* fail for invalid char, don't use '?' */ | |
1032 } vimconv_T; | |
1033 | |
1034 /* | |
1035 * Structure used for reading from the viminfo file. | |
1036 */ | |
1037 typedef struct | |
1038 { | |
1039 char_u *vir_line; /* text of the current line */ | |
1040 FILE *vir_fd; /* file descriptor */ | |
1041 #ifdef FEAT_MBYTE | |
1042 vimconv_T vir_conv; /* encoding conversion */ | |
1043 #endif | |
9240
636cfa97200e
commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents:
9215
diff
changeset
|
1044 int vir_version; /* viminfo version detected or -1 */ |
7664
1fded31d9e04
commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
7266
diff
changeset
|
1045 garray_T vir_barlines; /* lines starting with | */ |
7 | 1046 } vir_T; |
1047 | |
1048 #define CONV_NONE 0 | |
1049 #define CONV_TO_UTF8 1 | |
26 | 1050 #define CONV_9_TO_UTF8 2 |
1051 #define CONV_TO_LATIN1 3 | |
1052 #define CONV_TO_LATIN9 4 | |
1053 #define CONV_ICONV 5 | |
7 | 1054 #ifdef WIN3264 |
26 | 1055 # define CONV_CODEPAGE 10 /* codepage -> codepage */ |
7 | 1056 #endif |
1057 #ifdef MACOS_X | |
26 | 1058 # define CONV_MAC_LATIN1 20 |
1059 # define CONV_LATIN1_MAC 21 | |
1060 # define CONV_MAC_UTF8 22 | |
1061 # define CONV_UTF8_MAC 23 | |
7 | 1062 #endif |
1063 | |
1064 /* | |
1065 * Structure used for mappings and abbreviations. | |
1066 */ | |
1067 typedef struct mapblock mapblock_T; | |
1068 struct mapblock | |
1069 { | |
1070 mapblock_T *m_next; /* next mapblock in list */ | |
2610 | 1071 char_u *m_keys; /* mapped from, lhs */ |
1072 char_u *m_str; /* mapped to, rhs */ | |
1073 char_u *m_orig_str; /* rhs as entered by the user */ | |
5041
558c815e1a38
updated for version 7.3.1264
Bram Moolenaar <bram@vim.org>
parents:
5033
diff
changeset
|
1074 int m_keylen; /* strlen(m_keys) */ |
7 | 1075 int m_mode; /* valid mode */ |
1076 int m_noremap; /* if non-zero no re-mapping for m_str */ | |
1077 char m_silent; /* <silent> used, don't echo commands */ | |
5041
558c815e1a38
updated for version 7.3.1264
Bram Moolenaar <bram@vim.org>
parents:
5033
diff
changeset
|
1078 char m_nowait; /* <nowait> used */ |
481 | 1079 #ifdef FEAT_EVAL |
724 | 1080 char m_expr; /* <expr> used, m_str is an expression */ |
481 | 1081 scid_T m_script_ID; /* ID of script where map was defined */ |
7 | 1082 #endif |
1083 }; | |
1084 | |
1085 /* | |
1086 * Used for highlighting in the status line. | |
1087 */ | |
1088 struct stl_hlrec | |
1089 { | |
1090 char_u *start; | |
680 | 1091 int userhl; /* 0: no HL, 1-9: User HL, < 0 for syn ID */ |
7 | 1092 }; |
1093 | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1094 |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1095 /* |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1096 * Syntax items - usually buffer-specific. |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1097 */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1098 |
123 | 1099 /* Item for a hashtable. "hi_key" can be one of three values: |
1100 * NULL: Never been used | |
1101 * HI_KEY_REMOVED: Entry was removed | |
1102 * Otherwise: Used item, pointer to the actual key; this usually is | |
1103 * inside the item, subtract an offset to locate the item. | |
1104 * This reduces the size of hashitem by 1/3. | |
1105 */ | |
1106 typedef struct hashitem_S | |
1107 { | |
1108 long_u hi_hash; /* cached hash number of hi_key */ | |
1109 char_u *hi_key; | |
133 | 1110 } hashitem_T; |
123 | 1111 |
1112 /* The address of "hash_removed" is used as a magic number for hi_key to | |
1113 * indicate a removed item. */ | |
1114 #define HI_KEY_REMOVED &hash_removed | |
1115 #define HASHITEM_EMPTY(hi) ((hi)->hi_key == NULL || (hi)->hi_key == &hash_removed) | |
1116 | |
1117 /* Initial size for a hashtable. Our items are relatively small and growing | |
1118 * is expensive, thus use 16 as a start. Must be a power of 2. */ | |
1119 #define HT_INIT_SIZE 16 | |
1120 | |
1121 typedef struct hashtable_S | |
1122 { | |
1123 long_u ht_mask; /* mask used for hash value (nr of items in | |
1124 * array is "ht_mask" + 1) */ | |
140 | 1125 long_u ht_used; /* number of items used */ |
1126 long_u ht_filled; /* number of items used + removed */ | |
123 | 1127 int ht_locked; /* counter for hash_lock() */ |
1128 int ht_error; /* when set growing failed, can't add more | |
1129 items before growing works */ | |
133 | 1130 hashitem_T *ht_array; /* points to the array, allocated when it's |
123 | 1131 not "ht_smallarray" */ |
133 | 1132 hashitem_T ht_smallarray[HT_INIT_SIZE]; /* initial array */ |
1133 } hashtab_T; | |
1134 | |
1135 typedef long_u hash_T; /* Type for hi_hash */ | |
1136 | |
1137 | |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1138 #ifdef FEAT_NUM64 |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1139 /* Use 64-bit Number. */ |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1140 # ifdef WIN3264 |
10025
068f397d0da4
commit https://github.com/vim/vim/commit/d90b6c02e2900576fb37d95b5e4f4a32b2d7383f
Christian Brabandt <cb@256bit.org>
parents:
9980
diff
changeset
|
1141 # ifdef PROTO |
068f397d0da4
commit https://github.com/vim/vim/commit/d90b6c02e2900576fb37d95b5e4f4a32b2d7383f
Christian Brabandt <cb@256bit.org>
parents:
9980
diff
changeset
|
1142 typedef long varnumber_T; |
068f397d0da4
commit https://github.com/vim/vim/commit/d90b6c02e2900576fb37d95b5e4f4a32b2d7383f
Christian Brabandt <cb@256bit.org>
parents:
9980
diff
changeset
|
1143 typedef unsigned long uvarnumber_T; |
10658
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1144 #define VARNUM_MIN LONG_MIN |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1145 #define VARNUM_MAX LONG_MAX |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1146 #define UVARNUM_MAX ULONG_MAX |
10025
068f397d0da4
commit https://github.com/vim/vim/commit/d90b6c02e2900576fb37d95b5e4f4a32b2d7383f
Christian Brabandt <cb@256bit.org>
parents:
9980
diff
changeset
|
1147 # else |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1148 typedef __int64 varnumber_T; |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1149 typedef unsigned __int64 uvarnumber_T; |
10658
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1150 #define VARNUM_MIN _I64_MIN |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1151 #define VARNUM_MAX _I64_MAX |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1152 #define UVARNUM_MAX _UI64_MAX |
10025
068f397d0da4
commit https://github.com/vim/vim/commit/d90b6c02e2900576fb37d95b5e4f4a32b2d7383f
Christian Brabandt <cb@256bit.org>
parents:
9980
diff
changeset
|
1153 # endif |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1154 # elif defined(HAVE_STDINT_H) |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1155 typedef int64_t varnumber_T; |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1156 typedef uint64_t uvarnumber_T; |
10658
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1157 #define VARNUM_MIN INT64_MIN |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1158 #define VARNUM_MAX INT64_MAX |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1159 #define UVARNUM_MAX UINT64_MAX |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1160 # else |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1161 typedef long varnumber_T; |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1162 typedef unsigned long uvarnumber_T; |
10658
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1163 #define VARNUM_MIN LONG_MIN |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1164 #define VARNUM_MAX LONG_MAX |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1165 #define UVARNUM_MAX ULONG_MAX |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1166 # endif |
133 | 1167 #else |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1168 /* Use 32-bit Number. */ |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1169 # if VIM_SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */ |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1170 typedef long varnumber_T; |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1171 typedef unsigned long uvarnumber_T; |
10658
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1172 #define VARNUM_MIN LONG_MIN |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1173 #define VARNUM_MAX LONG_MAX |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1174 #define UVARNUM_MAX ULONG_MAX |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1175 # else |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1176 typedef int varnumber_T; |
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1177 typedef unsigned int uvarnumber_T; |
10658
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1178 #define VARNUM_MIN INT_MIN |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1179 #define VARNUM_MAX INT_MAX |
77d66e9ac0ab
patch 8.0.0219: ubsan reports errors for overflow
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
1180 #define UVARNUM_MAX UINT_MAX |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1181 # endif |
133 | 1182 #endif |
9389
32e34e574716
commit https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
Christian Brabandt <cb@256bit.org>
parents:
9387
diff
changeset
|
1183 |
1622 | 1184 typedef double float_T; |
133 | 1185 |
1186 typedef struct listvar_S list_T; | |
1187 typedef struct dictvar_S dict_T; | |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1188 typedef struct partial_S partial_T; |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1189 |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1190 typedef struct jobvar_S job_T; |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1191 typedef struct readq_S readq_T; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1192 typedef struct jsonq_S jsonq_T; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1193 typedef struct cbq_S cbq_T; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1194 typedef struct channel_S channel_T; |
133 | 1195 |
7943
e875f0fbd9c0
commit https://github.com/vim/vim/commit/a03f23351588f04276469cd7742b7ec655bb604b
Christian Brabandt <cb@256bit.org>
parents:
7883
diff
changeset
|
1196 typedef enum |
e875f0fbd9c0
commit https://github.com/vim/vim/commit/a03f23351588f04276469cd7742b7ec655bb604b
Christian Brabandt <cb@256bit.org>
parents:
7883
diff
changeset
|
1197 { |
e875f0fbd9c0
commit https://github.com/vim/vim/commit/a03f23351588f04276469cd7742b7ec655bb604b
Christian Brabandt <cb@256bit.org>
parents:
7883
diff
changeset
|
1198 VAR_UNKNOWN = 0, |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1199 VAR_NUMBER, /* "v_number" is used */ |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1200 VAR_STRING, /* "v_string" is used */ |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1201 VAR_FUNC, /* "v_string" is function name */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1202 VAR_PARTIAL, /* "v_partial" is used */ |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1203 VAR_LIST, /* "v_list" is used */ |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1204 VAR_DICT, /* "v_dict" is used */ |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1205 VAR_FLOAT, /* "v_float" is used */ |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1206 VAR_SPECIAL, /* "v_number" is used */ |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1207 VAR_JOB, /* "v_job" is used */ |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1208 VAR_CHANNEL /* "v_channel" is used */ |
7943
e875f0fbd9c0
commit https://github.com/vim/vim/commit/a03f23351588f04276469cd7742b7ec655bb604b
Christian Brabandt <cb@256bit.org>
parents:
7883
diff
changeset
|
1209 } vartype_T; |
e875f0fbd9c0
commit https://github.com/vim/vim/commit/a03f23351588f04276469cd7742b7ec655bb604b
Christian Brabandt <cb@256bit.org>
parents:
7883
diff
changeset
|
1210 |
133 | 1211 /* |
1212 * Structure to hold an internal variable without a name. | |
1213 */ | |
1214 typedef struct | |
1215 { | |
7943
e875f0fbd9c0
commit https://github.com/vim/vim/commit/a03f23351588f04276469cd7742b7ec655bb604b
Christian Brabandt <cb@256bit.org>
parents:
7883
diff
changeset
|
1216 vartype_T v_type; |
148 | 1217 char v_lock; /* see below: VAR_LOCKED, VAR_FIXED */ |
133 | 1218 union |
1219 { | |
1220 varnumber_T v_number; /* number value */ | |
1622 | 1221 #ifdef FEAT_FLOAT |
1222 float_T v_float; /* floating number value */ | |
1223 #endif | |
133 | 1224 char_u *v_string; /* string value (can be NULL!) */ |
1225 list_T *v_list; /* list value (can be NULL!) */ | |
1226 dict_T *v_dict; /* dict value (can be NULL!) */ | |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1227 partial_T *v_partial; /* closure: function with args */ |
8493
caed4b2d305f
commit https://github.com/vim/vim/commit/509ce2a558e7e0c03242e32e844255af52f1c821
Christian Brabandt <cb@256bit.org>
parents:
8491
diff
changeset
|
1228 #ifdef FEAT_JOB_CHANNEL |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1229 job_T *v_job; /* job value (can be NULL!) */ |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1230 channel_T *v_channel; /* channel value (can be NULL!) */ |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1231 #endif |
133 | 1232 } vval; |
1233 } typval_T; | |
1234 | |
3687 | 1235 /* Values for "dv_scope". */ |
1236 #define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ | |
1237 #define VAR_DEF_SCOPE 2 /* l:, g: scope dictionaries: here funcrefs are not | |
1238 allowed to mask existing functions */ | |
1239 | |
148 | 1240 /* Values for "v_lock". */ |
1241 #define VAR_LOCKED 1 /* locked with lock(), can use unlock() */ | |
1242 #define VAR_FIXED 2 /* locked forever */ | |
1243 | |
133 | 1244 /* |
1245 * Structure to hold an item of a list: an internal variable without a name. | |
1246 */ | |
1247 typedef struct listitem_S listitem_T; | |
1248 | |
1249 struct listitem_S | |
1250 { | |
1251 listitem_T *li_next; /* next item in list */ | |
1252 listitem_T *li_prev; /* previous item in list */ | |
1253 typval_T li_tv; /* type and value of the variable */ | |
1254 }; | |
1255 | |
1256 /* | |
1257 * Struct used by those that are using an item in a list. | |
1258 */ | |
1259 typedef struct listwatch_S listwatch_T; | |
1260 | |
1261 struct listwatch_S | |
1262 { | |
1263 listitem_T *lw_item; /* item being watched */ | |
1264 listwatch_T *lw_next; /* next watcher */ | |
1265 }; | |
1266 | |
1267 /* | |
1268 * Structure to hold info about a list. | |
1269 */ | |
1270 struct listvar_S | |
1271 { | |
370 | 1272 listitem_T *lv_first; /* first item, NULL if none */ |
1273 listitem_T *lv_last; /* last item, NULL if none */ | |
133 | 1274 int lv_refcount; /* reference count */ |
153 | 1275 int lv_len; /* number of items */ |
133 | 1276 listwatch_T *lv_watch; /* first watcher, NULL if none */ |
153 | 1277 int lv_idx; /* cached index of an item */ |
1278 listitem_T *lv_idx_item; /* when not NULL item at index "lv_idx" */ | |
164 | 1279 int lv_copyID; /* ID used by deepcopy() */ |
1280 list_T *lv_copylist; /* copied list used by deepcopy() */ | |
148 | 1281 char lv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ |
510 | 1282 list_T *lv_used_next; /* next list in used lists list */ |
370 | 1283 list_T *lv_used_prev; /* previous list in used lists list */ |
133 | 1284 }; |
1285 | |
1286 /* | |
9626
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1287 * Static list with 10 items. Use init_static_list() to initialize. |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1288 */ |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1289 typedef struct { |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1290 list_T sl_list; /* must be first */ |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1291 listitem_T sl_items[10]; |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1292 } staticList10_T; |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1293 |
172131507c85
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Christian Brabandt <cb@256bit.org>
parents:
9608
diff
changeset
|
1294 /* |
133 | 1295 * Structure to hold an item of a Dictionary. |
1296 * Also used for a variable. | |
1297 * The key is copied into "di_key" to avoid an extra alloc/free for it. | |
1298 */ | |
1299 struct dictitem_S | |
1300 { | |
1301 typval_T di_tv; /* type and value of the variable */ | |
1302 char_u di_flags; /* flags (only used for variable) */ | |
1303 char_u di_key[1]; /* key (actually longer!) */ | |
1304 }; | |
1305 typedef struct dictitem_S dictitem_T; | |
1306 | |
8718
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1307 /* A dictitem with a 16 character key (plus NUL). */ |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1308 struct dictitem16_S |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1309 { |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1310 typval_T di_tv; /* type and value of the variable */ |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1311 char_u di_flags; /* flags (only used for variable) */ |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1312 char_u di_key[17]; /* key */ |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1313 }; |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1314 typedef struct dictitem16_S dictitem16_T; |
f1840a719771
commit https://github.com/vim/vim/commit/bee6c0cf86a75faa2aa893f2c9db82fd944a89a5
Christian Brabandt <cb@256bit.org>
parents:
8674
diff
changeset
|
1315 |
6751 | 1316 #define DI_FLAGS_RO 1 /* "di_flags" value: read-only variable */ |
1317 #define DI_FLAGS_RO_SBX 2 /* "di_flags" value: read-only in the sandbox */ | |
1318 #define DI_FLAGS_FIX 4 /* "di_flags" value: fixed: no :unlet or remove() */ | |
1319 #define DI_FLAGS_LOCK 8 /* "di_flags" value: locked variable */ | |
1320 #define DI_FLAGS_ALLOC 16 /* "di_flags" value: separately allocated */ | |
133 | 1321 |
1322 /* | |
1323 * Structure to hold info about a Dictionary. | |
1324 */ | |
1325 struct dictvar_S | |
1326 { | |
148 | 1327 char dv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ |
3687 | 1328 char dv_scope; /* zero, VAR_SCOPE, VAR_DEF_SCOPE */ |
4861
e79a20f07daa
updated for version 7.3.1177
Bram Moolenaar <bram@vim.org>
parents:
4766
diff
changeset
|
1329 int dv_refcount; /* reference count */ |
e79a20f07daa
updated for version 7.3.1177
Bram Moolenaar <bram@vim.org>
parents:
4766
diff
changeset
|
1330 int dv_copyID; /* ID used by deepcopy() */ |
e79a20f07daa
updated for version 7.3.1177
Bram Moolenaar <bram@vim.org>
parents:
4766
diff
changeset
|
1331 hashtab_T dv_hashtab; /* hashtab that refers to the items */ |
e79a20f07daa
updated for version 7.3.1177
Bram Moolenaar <bram@vim.org>
parents:
4766
diff
changeset
|
1332 dict_T *dv_copydict; /* copied dict used by deepcopy() */ |
370 | 1333 dict_T *dv_used_next; /* next dict in used dicts list */ |
1334 dict_T *dv_used_prev; /* previous dict in used dicts list */ | |
133 | 1335 }; |
1336 | |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1337 #if defined(FEAT_EVAL) || defined(PROTO) |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1338 typedef struct funccall_S funccall_T; |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1339 |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1340 /* |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1341 * Structure to hold info for a user function. |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1342 */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1343 typedef struct |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1344 { |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1345 int uf_varargs; /* variable nr of arguments */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1346 int uf_flags; |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1347 int uf_calls; /* nr of active calls */ |
10815
f883a1224396
patch 8.0.0297: double free on exit when using a closure
Christian Brabandt <cb@256bit.org>
parents:
10658
diff
changeset
|
1348 int uf_cleared; /* func_clear() was already called */ |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1349 garray_T uf_args; /* arguments */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1350 garray_T uf_lines; /* function lines */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1351 #ifdef FEAT_PROFILE |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1352 int uf_profiling; /* TRUE when func is being profiled */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1353 /* profiling the function as a whole */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1354 int uf_tm_count; /* nr of calls */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1355 proftime_T uf_tm_total; /* time spent in function + children */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1356 proftime_T uf_tm_self; /* time spent in function itself */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1357 proftime_T uf_tm_children; /* time spent in children this call */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1358 /* profiling the function per line */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1359 int *uf_tml_count; /* nr of times line was executed */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1360 proftime_T *uf_tml_total; /* time spent in a line + children */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1361 proftime_T *uf_tml_self; /* time spent in a line itself */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1362 proftime_T uf_tml_start; /* start time for current line */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1363 proftime_T uf_tml_children; /* time spent in children for this line */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1364 proftime_T uf_tml_wait; /* start wait time for current line */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1365 int uf_tml_idx; /* index of line being timed; -1 if none */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1366 int uf_tml_execed; /* line being timed was executed */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1367 #endif |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1368 scid_T uf_script_ID; /* ID of script where function was defined, |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1369 used for s: variables */ |
9733
59565cdd7261
commit https://github.com/vim/vim/commit/8dd3a43d75550e9b5736066124c97697564f769e
Christian Brabandt <cb@256bit.org>
parents:
9729
diff
changeset
|
1370 int uf_refcount; /* reference count, see func_name_refcount() */ |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1371 funccall_T *uf_scoped; /* l: local variables for closure */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1372 char_u uf_name[1]; /* name of function (actually longer); can |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1373 start with <SNR>123_ (<SNR> is K_SPECIAL |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1374 KS_EXTRA KE_SNR) */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1375 } ufunc_T; |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1376 |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1377 #define MAX_FUNC_ARGS 20 /* maximum number of function arguments */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1378 #define VAR_SHORT_LEN 20 /* short variable name length */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1379 #define FIXVAR_CNT 12 /* number of fixed variables */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1380 |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1381 /* structure to hold info for a function that is currently being executed. */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1382 struct funccall_S |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1383 { |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1384 ufunc_T *func; /* function being called */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1385 int linenr; /* next line to be executed */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1386 int returned; /* ":return" used */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1387 struct /* fixed variables for arguments */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1388 { |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1389 dictitem_T var; /* variable (without room for name) */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1390 char_u room[VAR_SHORT_LEN]; /* room for the name */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1391 } fixvar[FIXVAR_CNT]; |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1392 dict_T l_vars; /* l: local function variables */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1393 dictitem_T l_vars_var; /* variable for l: scope */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1394 dict_T l_avars; /* a: argument variables */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1395 dictitem_T l_avars_var; /* variable for a: scope */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1396 list_T l_varlist; /* list for a:000 */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1397 listitem_T l_listitems[MAX_FUNC_ARGS]; /* listitems for a:000 */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1398 typval_T *rettv; /* return value */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1399 linenr_T breakpoint; /* next line with breakpoint or zero */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1400 int dbg_tick; /* debug_tick when breakpoint was set */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1401 int level; /* top nesting level of executed function */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1402 #ifdef FEAT_PROFILE |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1403 proftime_T prof_child; /* time spent in a child */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1404 #endif |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1405 funccall_T *caller; /* calling function or NULL */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1406 |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1407 /* for closure */ |
9733
59565cdd7261
commit https://github.com/vim/vim/commit/8dd3a43d75550e9b5736066124c97697564f769e
Christian Brabandt <cb@256bit.org>
parents:
9729
diff
changeset
|
1408 int fc_refcount; /* number of user functions that reference this |
59565cdd7261
commit https://github.com/vim/vim/commit/8dd3a43d75550e9b5736066124c97697564f769e
Christian Brabandt <cb@256bit.org>
parents:
9729
diff
changeset
|
1409 * funccal */ |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1410 int fc_copyID; /* for garbage collection */ |
9733
59565cdd7261
commit https://github.com/vim/vim/commit/8dd3a43d75550e9b5736066124c97697564f769e
Christian Brabandt <cb@256bit.org>
parents:
9729
diff
changeset
|
1411 garray_T fc_funcs; /* list of ufunc_T* which keep a reference to |
59565cdd7261
commit https://github.com/vim/vim/commit/8dd3a43d75550e9b5736066124c97697564f769e
Christian Brabandt <cb@256bit.org>
parents:
9729
diff
changeset
|
1412 * "func" */ |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1413 }; |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1414 |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1415 /* |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1416 * Struct used by trans_function_name() |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1417 */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1418 typedef struct |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1419 { |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1420 dict_T *fd_dict; /* Dictionary used */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1421 char_u *fd_newkey; /* new key in "dict" in allocated memory */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1422 dictitem_T *fd_di; /* Dictionary item used */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1423 } funcdict_T; |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1424 |
9729
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1425 #else |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1426 /* dummy typedefs for function prototypes */ |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1427 typedef struct |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1428 { |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1429 int dummy; |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1430 } ufunc_T; |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1431 typedef struct |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1432 { |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1433 int dummy; |
02ba9b2f80e8
commit https://github.com/vim/vim/commit/acadbeabe1dafb314ae5fdba0432f313e55bb3a2
Christian Brabandt <cb@256bit.org>
parents:
9723
diff
changeset
|
1434 } funcdict_T; |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1435 #endif |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1436 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1437 struct partial_S |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1438 { |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1439 int pt_refcount; /* reference count */ |
9723
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1440 char_u *pt_name; /* function name; when NULL use |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1441 * pt_func->uf_name */ |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1442 ufunc_T *pt_func; /* function pointer; when NULL lookup function |
80ac9cf77c9b
commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents:
9626
diff
changeset
|
1443 * with pt_name */ |
9104
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
9085
diff
changeset
|
1444 int pt_auto; /* when TRUE the partial was created for using |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
9085
diff
changeset
|
1445 dict.member in handle_subscript() */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1446 int pt_argc; /* number of arguments */ |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1447 typval_T *pt_argv; /* arguments in allocated array */ |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1448 dict_T *pt_dict; /* dict for "self" */ |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1449 }; |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1450 |
10386
d3f0946b4a80
commit https://github.com/vim/vim/commit/7df915d113ac1981792c50e8b000c9f5f784b78b
Christian Brabandt <cb@256bit.org>
parents:
10361
diff
changeset
|
1451 /* Status of a job. Order matters! */ |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1452 typedef enum |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1453 { |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1454 JOB_FAILED, |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1455 JOB_STARTED, |
10386
d3f0946b4a80
commit https://github.com/vim/vim/commit/7df915d113ac1981792c50e8b000c9f5f784b78b
Christian Brabandt <cb@256bit.org>
parents:
10361
diff
changeset
|
1456 JOB_ENDED, /* detected job done */ |
d3f0946b4a80
commit https://github.com/vim/vim/commit/7df915d113ac1981792c50e8b000c9f5f784b78b
Christian Brabandt <cb@256bit.org>
parents:
10361
diff
changeset
|
1457 JOB_FINISHED /* job done and cleanup done */ |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1458 } jobstatus_T; |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1459 |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1460 /* |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1461 * Structure to hold info about a Job. |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1462 */ |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1463 struct jobvar_S |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1464 { |
8170
a0ffb1f3dedc
commit https://github.com/vim/vim/commit/65edff8f51e9e54f85407bdb9156ae8e3e1b76a1
Christian Brabandt <cb@256bit.org>
parents:
8165
diff
changeset
|
1465 job_T *jv_next; |
a0ffb1f3dedc
commit https://github.com/vim/vim/commit/65edff8f51e9e54f85407bdb9156ae8e3e1b76a1
Christian Brabandt <cb@256bit.org>
parents:
8165
diff
changeset
|
1466 job_T *jv_prev; |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1467 #ifdef UNIX |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1468 pid_t jv_pid; |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1469 #endif |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1470 #ifdef WIN32 |
8023
75e0831549f1
commit https://github.com/vim/vim/commit/76467dfcafcf295fd987f712730774c6f55317d3
Christian Brabandt <cb@256bit.org>
parents:
8015
diff
changeset
|
1471 PROCESS_INFORMATION jv_proc_info; |
10311
931422d27b69
commit https://github.com/vim/vim/commit/14207f487c9e79a913256a41e3e9716b03b46955
Christian Brabandt <cb@256bit.org>
parents:
10304
diff
changeset
|
1472 HANDLE jv_job_object; |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1473 #endif |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1474 jobstatus_T jv_status; |
8170
a0ffb1f3dedc
commit https://github.com/vim/vim/commit/65edff8f51e9e54f85407bdb9156ae8e3e1b76a1
Christian Brabandt <cb@256bit.org>
parents:
8165
diff
changeset
|
1475 char_u *jv_stoponexit; /* allocated */ |
8176
477c1d855698
commit https://github.com/vim/vim/commit/eab089d22f172ddd2d33367a998e68c2f1c6c989
Christian Brabandt <cb@256bit.org>
parents:
8174
diff
changeset
|
1476 int jv_exitval; |
8174
f2286ff0c102
commit https://github.com/vim/vim/commit/ee1cffc07a42441924c5353af7fd7ab6e97e5aae
Christian Brabandt <cb@256bit.org>
parents:
8170
diff
changeset
|
1477 char_u *jv_exit_cb; /* allocated */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1478 partial_T *jv_exit_partial; |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1479 |
8386
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1480 buf_T *jv_in_buf; /* buffer from "in-name" */ |
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1481 |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1482 int jv_refcount; /* reference count */ |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8761
diff
changeset
|
1483 int jv_copyID; |
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8761
diff
changeset
|
1484 |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1485 channel_T *jv_channel; /* channel for I/O, reference counted */ |
7957
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1486 }; |
b74549818500
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Christian Brabandt <cb@256bit.org>
parents:
7943
diff
changeset
|
1487 |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1488 /* |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1489 * Structures to hold info about a Channel. |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1490 */ |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1491 struct readq_S |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1492 { |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1493 char_u *rq_buffer; |
9215
d2d44592467d
commit https://github.com/vim/vim/commit/9ed96efb3d47d46e9637da04656efff715102407
Christian Brabandt <cb@256bit.org>
parents:
9201
diff
changeset
|
1494 long_u rq_buflen; |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1495 readq_T *rq_next; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1496 readq_T *rq_prev; |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1497 }; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1498 |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1499 struct jsonq_S |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1500 { |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1501 typval_T *jq_value; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1502 jsonq_T *jq_next; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1503 jsonq_T *jq_prev; |
10426
acfc83aca8ee
commit https://github.com/vim/vim/commit/958dc6923d341390531888058495569d73c356c3
Christian Brabandt <cb@256bit.org>
parents:
10404
diff
changeset
|
1504 int jq_no_callback; /* TRUE when no callback was found */ |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1505 }; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1506 |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1507 struct cbq_S |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1508 { |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1509 char_u *cq_callback; |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1510 partial_T *cq_partial; |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1511 int cq_seq_nr; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1512 cbq_T *cq_next; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1513 cbq_T *cq_prev; |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1514 }; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1515 |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1516 /* mode for a channel */ |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1517 typedef enum |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1518 { |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1519 MODE_NL = 0, |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1520 MODE_RAW, |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1521 MODE_JSON, |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1522 MODE_JS |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1523 } ch_mode_T; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1524 |
8674
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1525 typedef enum { |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1526 JIO_PIPE, /* default */ |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1527 JIO_NULL, |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1528 JIO_FILE, |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1529 JIO_BUFFER, |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1530 JIO_OUT |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1531 } job_io_T; |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1532 |
8049
15253130abd8
commit https://github.com/vim/vim/commit/16eb4f88000cfdba68df6c421fe44e7e029ba53e
Christian Brabandt <cb@256bit.org>
parents:
8047
diff
changeset
|
1533 /* Ordering matters, it is used in for loops: IN is last, only SOCK/OUT/ERR |
15253130abd8
commit https://github.com/vim/vim/commit/16eb4f88000cfdba68df6c421fe44e7e029ba53e
Christian Brabandt <cb@256bit.org>
parents:
8047
diff
changeset
|
1534 * are polled. */ |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1535 typedef enum { |
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1536 PART_SOCK = 0, |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1537 #define CH_SOCK_FD ch_part[PART_SOCK].ch_fd |
8493
caed4b2d305f
commit https://github.com/vim/vim/commit/509ce2a558e7e0c03242e32e844255af52f1c821
Christian Brabandt <cb@256bit.org>
parents:
8491
diff
changeset
|
1538 #ifdef FEAT_JOB_CHANNEL |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1539 PART_OUT, |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1540 # define CH_OUT_FD ch_part[PART_OUT].ch_fd |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1541 PART_ERR, |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1542 # define CH_ERR_FD ch_part[PART_ERR].ch_fd |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1543 PART_IN, |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1544 # define CH_IN_FD ch_part[PART_IN].ch_fd |
8047
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1545 #endif |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1546 PART_COUNT |
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1547 } ch_part_T; |
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1548 |
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1549 #define INVALID_FD (-1) |
8047
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1550 |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1551 /* The per-fd info for a channel. */ |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1552 typedef struct { |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1553 sock_T ch_fd; /* socket/stdin/stdout/stderr, -1 if not used */ |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1554 |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1555 # if defined(UNIX) && !defined(HAVE_SELECT) |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1556 int ch_poll_idx; /* used by channel_poll_setup() */ |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1557 # endif |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1558 |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1559 #ifdef FEAT_GUI_X11 |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1560 XtInputId ch_inputHandler; /* Cookie for input */ |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1561 #endif |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1562 #ifdef FEAT_GUI_GTK |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1563 gint ch_inputHandler; /* Cookie for input */ |
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1564 #endif |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1565 |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1566 ch_mode_T ch_mode; |
8674
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1567 job_io_T ch_io; |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1568 int ch_timeout; /* request timeout in msec */ |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1569 |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1570 readq_T ch_head; /* header for circular raw read queue */ |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1571 jsonq_T ch_json_head; /* header for circular json read queue */ |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1572 int ch_block_id; /* ID that channel_read_json_block() is |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1573 waiting for */ |
10845
c31782d57569
patch 8.0.0312: failure when a channel receives a split json message
Christian Brabandt <cb@256bit.org>
parents:
10815
diff
changeset
|
1574 /* When ch_wait_len is non-zero use ch_deadline to wait for incomplete |
c31782d57569
patch 8.0.0312: failure when a channel receives a split json message
Christian Brabandt <cb@256bit.org>
parents:
10815
diff
changeset
|
1575 * message to be complete. The value is the length of the incomplete |
c31782d57569
patch 8.0.0312: failure when a channel receives a split json message
Christian Brabandt <cb@256bit.org>
parents:
10815
diff
changeset
|
1576 * message when the deadline was set. If it gets longer (something was |
c31782d57569
patch 8.0.0312: failure when a channel receives a split json message
Christian Brabandt <cb@256bit.org>
parents:
10815
diff
changeset
|
1577 * received) the deadline is reset. */ |
c31782d57569
patch 8.0.0312: failure when a channel receives a split json message
Christian Brabandt <cb@256bit.org>
parents:
10815
diff
changeset
|
1578 size_t ch_wait_len; |
8655
1eb302bf2475
commit https://github.com/vim/vim/commit/ba61ac0d61f46de7d29c64bb0de6d25c2e378be0
Christian Brabandt <cb@256bit.org>
parents:
8643
diff
changeset
|
1579 #ifdef WIN32 |
1eb302bf2475
commit https://github.com/vim/vim/commit/ba61ac0d61f46de7d29c64bb0de6d25c2e378be0
Christian Brabandt <cb@256bit.org>
parents:
8643
diff
changeset
|
1580 DWORD ch_deadline; |
1eb302bf2475
commit https://github.com/vim/vim/commit/ba61ac0d61f46de7d29c64bb0de6d25c2e378be0
Christian Brabandt <cb@256bit.org>
parents:
8643
diff
changeset
|
1581 #else |
1eb302bf2475
commit https://github.com/vim/vim/commit/ba61ac0d61f46de7d29c64bb0de6d25c2e378be0
Christian Brabandt <cb@256bit.org>
parents:
8643
diff
changeset
|
1582 struct timeval ch_deadline; |
1eb302bf2475
commit https://github.com/vim/vim/commit/ba61ac0d61f46de7d29c64bb0de6d25c2e378be0
Christian Brabandt <cb@256bit.org>
parents:
8643
diff
changeset
|
1583 #endif |
8761
f8707ec9efe4
commit https://github.com/vim/vim/commit/8b877ac38e96424a08a8b8eb713ef4b3cf0064be
Christian Brabandt <cb@256bit.org>
parents:
8755
diff
changeset
|
1584 int ch_block_write; /* for testing: 0 when not used, -1 when write |
f8707ec9efe4
commit https://github.com/vim/vim/commit/8b877ac38e96424a08a8b8eb713ef4b3cf0064be
Christian Brabandt <cb@256bit.org>
parents:
8755
diff
changeset
|
1585 * does not block, 1 simulate blocking */ |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1586 |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1587 cbq_T ch_cb_head; /* dummy node for per-request callbacks */ |
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1588 char_u *ch_callback; /* call when a msg is not handled */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1589 partial_T *ch_partial; |
8386
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1590 |
9487
69ed2c9d34a6
commit https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
Christian Brabandt <cb@256bit.org>
parents:
9475
diff
changeset
|
1591 bufref_T ch_bufref; /* buffer to read from or write to */ |
9147
053bc64433ec
commit https://github.com/vim/vim/commit/9f5842e63fc63d438cbffcec503e072a06f74dc2
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
1592 int ch_nomodifiable; /* TRUE when buffer can be 'nomodifiable' */ |
053bc64433ec
commit https://github.com/vim/vim/commit/9f5842e63fc63d438cbffcec503e072a06f74dc2
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
1593 int ch_nomod_error; /* TRUE when e_modifiable was given */ |
8761
f8707ec9efe4
commit https://github.com/vim/vim/commit/8b877ac38e96424a08a8b8eb713ef4b3cf0064be
Christian Brabandt <cb@256bit.org>
parents:
8755
diff
changeset
|
1594 int ch_buf_append; /* write appended lines instead top-bot */ |
8386
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1595 linenr_T ch_buf_top; /* next line to send */ |
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1596 linenr_T ch_buf_bot; /* last line to send */ |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1597 } chanpart_T; |
8047
7c74cafac0a1
commit https://github.com/vim/vim/commit/7b3ca76a451b10d238ef946f3231762e0bd988e9
Christian Brabandt <cb@256bit.org>
parents:
8041
diff
changeset
|
1598 |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1599 struct channel_S { |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1600 channel_T *ch_next; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1601 channel_T *ch_prev; |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1602 |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1603 int ch_id; /* ID of the channel */ |
8667
8c80c21a1885
commit https://github.com/vim/vim/commit/e9d6a298df6108e2044b1f0da5a2712f0c51c7d9
Christian Brabandt <cb@256bit.org>
parents:
8655
diff
changeset
|
1604 int ch_last_msg_id; /* ID of the last message */ |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1605 |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1606 chanpart_T ch_part[PART_COUNT]; /* info for socket, out, err and in */ |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1607 |
8674
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1608 char *ch_hostname; /* only for socket, allocated */ |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1609 int ch_port; /* only for socket */ |
4a4d5815a974
commit https://github.com/vim/vim/commit/580984e026a46ea0c29789897b701057423b4923
Christian Brabandt <cb@256bit.org>
parents:
8667
diff
changeset
|
1610 |
10259
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1611 int ch_to_be_closed; /* bitset of readable fds to be closed. |
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1612 * When all readable fds have been closed, |
a09db7a4afe0
commit https://github.com/vim/vim/commit/dc0ccaee68ca24d10050117fbec757ad33590a17
Christian Brabandt <cb@256bit.org>
parents:
10147
diff
changeset
|
1613 * set to (1 << PART_COUNT). */ |
9085
d362e6df1deb
commit https://github.com/vim/vim/commit/fb6ffc732e65dbc459c89247ff78134402f1a18b
Christian Brabandt <cb@256bit.org>
parents:
9083
diff
changeset
|
1614 int ch_to_be_freed; /* When TRUE channel must be freed when it's |
d362e6df1deb
commit https://github.com/vim/vim/commit/fb6ffc732e65dbc459c89247ff78134402f1a18b
Christian Brabandt <cb@256bit.org>
parents:
9083
diff
changeset
|
1615 * safe to invoke callbacks. */ |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1616 int ch_error; /* When TRUE an error was reported. Avoids |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1617 * giving pages full of error messages when |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1618 * the other side has exited, only mention the |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1619 * first error until the connection works |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1620 * again. */ |
8049
15253130abd8
commit https://github.com/vim/vim/commit/16eb4f88000cfdba68df6c421fe44e7e029ba53e
Christian Brabandt <cb@256bit.org>
parents:
8047
diff
changeset
|
1621 |
8210
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1622 void (*ch_nb_close_cb)(void); |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1623 /* callback for Netbeans when channel is |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1624 * closed */ |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1625 |
8151
aa845d10c6fb
commit https://github.com/vim/vim/commit/42d38a2db17e70312d073095257555c27a5f9443
Christian Brabandt <cb@256bit.org>
parents:
8124
diff
changeset
|
1626 char_u *ch_callback; /* call when any msg is not handled */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1627 partial_T *ch_partial; |
8210
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1628 char_u *ch_close_cb; /* call when channel is closed */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1629 partial_T *ch_close_partial; |
10426
acfc83aca8ee
commit https://github.com/vim/vim/commit/958dc6923d341390531888058495569d73c356c3
Christian Brabandt <cb@256bit.org>
parents:
10404
diff
changeset
|
1630 int ch_drop_never; |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1631 |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1632 job_T *ch_job; /* Job that uses this channel; this does not |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1633 * count as a reference to avoid a circular |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8761
diff
changeset
|
1634 * reference, the job refers to the channel. */ |
8259
99a70c3b902f
commit https://github.com/vim/vim/commit/46c85439c966d7ed39fb3d711d4d6c61ac964647
Christian Brabandt <cb@256bit.org>
parents:
8222
diff
changeset
|
1635 int ch_job_killed; /* TRUE when there was a job and it was killed |
99a70c3b902f
commit https://github.com/vim/vim/commit/46c85439c966d7ed39fb3d711d4d6c61ac964647
Christian Brabandt <cb@256bit.org>
parents:
8222
diff
changeset
|
1636 * or we know it died. */ |
8041
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1637 |
c6443e78cf2d
commit https://github.com/vim/vim/commit/7707344ddec9069b495b2a5ed41f2104466fc88b
Christian Brabandt <cb@256bit.org>
parents:
8031
diff
changeset
|
1638 int ch_refcount; /* reference count */ |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8761
diff
changeset
|
1639 int ch_copyID; |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1640 }; |
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1641 |
8210
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1642 #define JO_MODE 0x0001 /* channel mode */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1643 #define JO_IN_MODE 0x0002 /* stdin mode */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1644 #define JO_OUT_MODE 0x0004 /* stdout mode */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1645 #define JO_ERR_MODE 0x0008 /* stderr mode */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1646 #define JO_CALLBACK 0x0010 /* channel callback */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1647 #define JO_OUT_CALLBACK 0x0020 /* stdout callback */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1648 #define JO_ERR_CALLBACK 0x0040 /* stderr callback */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1649 #define JO_CLOSE_CALLBACK 0x0080 /* close callback */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1650 #define JO_WAITTIME 0x0100 /* only for ch_open() */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1651 #define JO_TIMEOUT 0x0200 /* all timeouts */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1652 #define JO_OUT_TIMEOUT 0x0400 /* stdout timeouts */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1653 #define JO_ERR_TIMEOUT 0x0800 /* stderr timeouts */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1654 #define JO_PART 0x1000 /* "part" */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1655 #define JO_ID 0x2000 /* "id" */ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1656 #define JO_STOPONEXIT 0x4000 /* "stoponexit" */ |
8540
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1657 #define JO_EXIT_CB 0x8000 /* "exit_cb" */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1658 #define JO_OUT_IO 0x10000 /* "out_io" */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1659 #define JO_ERR_IO 0x20000 /* "err_io" (JO_OUT_IO << 1) */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1660 #define JO_IN_IO 0x40000 /* "in_io" (JO_OUT_IO << 2) */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1661 #define JO_OUT_NAME 0x80000 /* "out_name" */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1662 #define JO_ERR_NAME 0x100000 /* "err_name" (JO_OUT_NAME << 1) */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1663 #define JO_IN_NAME 0x200000 /* "in_name" (JO_OUT_NAME << 2) */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1664 #define JO_IN_TOP 0x400000 /* "in_top" */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1665 #define JO_IN_BOT 0x800000 /* "in_bot" */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1666 #define JO_OUT_BUF 0x1000000 /* "out_buf" */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1667 #define JO_ERR_BUF 0x2000000 /* "err_buf" (JO_OUT_BUF << 1) */ |
fec8655cf1bf
commit https://github.com/vim/vim/commit/d6c2f0526064eef6f8917d2bad00df707d79ea16
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
1668 #define JO_IN_BUF 0x4000000 /* "in_buf" (JO_OUT_BUF << 2) */ |
8491
daebcbd87bd3
commit https://github.com/vim/vim/commit/de27989157f35172b25f9e01e0c147ed8f6ae3ce
Christian Brabandt <cb@256bit.org>
parents:
8477
diff
changeset
|
1669 #define JO_CHANNEL 0x8000000 /* "channel" */ |
8761
f8707ec9efe4
commit https://github.com/vim/vim/commit/8b877ac38e96424a08a8b8eb713ef4b3cf0064be
Christian Brabandt <cb@256bit.org>
parents:
8755
diff
changeset
|
1670 #define JO_BLOCK_WRITE 0x10000000 /* "block_write" */ |
9147
053bc64433ec
commit https://github.com/vim/vim/commit/9f5842e63fc63d438cbffcec503e072a06f74dc2
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
1671 #define JO_OUT_MODIFIABLE 0x20000000 /* "out_modifiable" */ |
053bc64433ec
commit https://github.com/vim/vim/commit/9f5842e63fc63d438cbffcec503e072a06f74dc2
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
1672 #define JO_ERR_MODIFIABLE 0x40000000 /* "err_modifiable" (JO_OUT_ << 1) */ |
8761
f8707ec9efe4
commit https://github.com/vim/vim/commit/8b877ac38e96424a08a8b8eb713ef4b3cf0064be
Christian Brabandt <cb@256bit.org>
parents:
8755
diff
changeset
|
1673 #define JO_ALL 0x7fffffff |
8124
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1674 |
10147
65afd399ffa7
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Christian Brabandt <cb@256bit.org>
parents:
10122
diff
changeset
|
1675 #define JO2_OUT_MSG 0x0001 /* "out_msg" */ |
65afd399ffa7
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Christian Brabandt <cb@256bit.org>
parents:
10122
diff
changeset
|
1676 #define JO2_ERR_MSG 0x0002 /* "err_msg" (JO_OUT_ << 1) */ |
65afd399ffa7
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Christian Brabandt <cb@256bit.org>
parents:
10122
diff
changeset
|
1677 #define JO2_ALL 0x0003 |
65afd399ffa7
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Christian Brabandt <cb@256bit.org>
parents:
10122
diff
changeset
|
1678 |
8165
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1679 #define JO_MODE_ALL (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE) |
8210
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1680 #define JO_CB_ALL \ |
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1681 (JO_CALLBACK + JO_OUT_CALLBACK + JO_ERR_CALLBACK + JO_CLOSE_CALLBACK) |
8165
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1682 #define JO_TIMEOUT_ALL (JO_TIMEOUT + JO_OUT_TIMEOUT + JO_ERR_TIMEOUT) |
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1683 |
8084
3ea56a74077f
commit https://github.com/vim/vim/commit/9a6e33a19b18f20c25b73392cd2faa3ec4890c8c
Christian Brabandt <cb@256bit.org>
parents:
8059
diff
changeset
|
1684 /* |
8094
18a3f0f05244
commit https://github.com/vim/vim/commit/910b8aac5dc4693c4508b7acd2cef0bbfac04242
Christian Brabandt <cb@256bit.org>
parents:
8084
diff
changeset
|
1685 * Options for job and channel commands. |
8084
3ea56a74077f
commit https://github.com/vim/vim/commit/9a6e33a19b18f20c25b73392cd2faa3ec4890c8c
Christian Brabandt <cb@256bit.org>
parents:
8059
diff
changeset
|
1686 */ |
3ea56a74077f
commit https://github.com/vim/vim/commit/9a6e33a19b18f20c25b73392cd2faa3ec4890c8c
Christian Brabandt <cb@256bit.org>
parents:
8059
diff
changeset
|
1687 typedef struct |
3ea56a74077f
commit https://github.com/vim/vim/commit/9a6e33a19b18f20c25b73392cd2faa3ec4890c8c
Christian Brabandt <cb@256bit.org>
parents:
8059
diff
changeset
|
1688 { |
8124
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1689 int jo_set; /* JO_ bits for values that were set */ |
10147
65afd399ffa7
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Christian Brabandt <cb@256bit.org>
parents:
10122
diff
changeset
|
1690 int jo_set2; /* JO2_ bits for values that were set */ |
8124
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1691 |
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1692 ch_mode_T jo_mode; |
8165
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1693 ch_mode_T jo_in_mode; |
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1694 ch_mode_T jo_out_mode; |
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1695 ch_mode_T jo_err_mode; |
8267
108d30ed34ba
commit https://github.com/vim/vim/commit/187db50d0499aecf4cfd42fb4db0a1bebf61c8cd
Christian Brabandt <cb@256bit.org>
parents:
8259
diff
changeset
|
1696 |
108d30ed34ba
commit https://github.com/vim/vim/commit/187db50d0499aecf4cfd42fb4db0a1bebf61c8cd
Christian Brabandt <cb@256bit.org>
parents:
8259
diff
changeset
|
1697 job_io_T jo_io[4]; /* PART_OUT, PART_ERR, PART_IN */ |
108d30ed34ba
commit https://github.com/vim/vim/commit/187db50d0499aecf4cfd42fb4db0a1bebf61c8cd
Christian Brabandt <cb@256bit.org>
parents:
8259
diff
changeset
|
1698 char_u jo_io_name_buf[4][NUMBUFLEN]; |
108d30ed34ba
commit https://github.com/vim/vim/commit/187db50d0499aecf4cfd42fb4db0a1bebf61c8cd
Christian Brabandt <cb@256bit.org>
parents:
8259
diff
changeset
|
1699 char_u *jo_io_name[4]; /* not allocated! */ |
8477
c08c6d19db4d
commit https://github.com/vim/vim/commit/29fd03878c41526a586d77b3f3cd7938d26297af
Christian Brabandt <cb@256bit.org>
parents:
8455
diff
changeset
|
1700 int jo_io_buf[4]; |
9147
053bc64433ec
commit https://github.com/vim/vim/commit/9f5842e63fc63d438cbffcec503e072a06f74dc2
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
1701 int jo_modifiable[4]; |
10147
65afd399ffa7
commit https://github.com/vim/vim/commit/169ebb080454357279ad5ad21ac532deaec605e8
Christian Brabandt <cb@256bit.org>
parents:
10122
diff
changeset
|
1702 int jo_message[4]; |
8491
daebcbd87bd3
commit https://github.com/vim/vim/commit/de27989157f35172b25f9e01e0c147ed8f6ae3ce
Christian Brabandt <cb@256bit.org>
parents:
8477
diff
changeset
|
1703 channel_T *jo_channel; |
8267
108d30ed34ba
commit https://github.com/vim/vim/commit/187db50d0499aecf4cfd42fb4db0a1bebf61c8cd
Christian Brabandt <cb@256bit.org>
parents:
8259
diff
changeset
|
1704 |
8386
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1705 linenr_T jo_in_top; |
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1706 linenr_T jo_in_bot; |
3b9a306724ec
commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21
Christian Brabandt <cb@256bit.org>
parents:
8281
diff
changeset
|
1707 |
8124
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1708 char_u *jo_callback; /* not allocated! */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1709 partial_T *jo_partial; /* not referenced! */ |
8165
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1710 char_u *jo_out_cb; /* not allocated! */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1711 partial_T *jo_out_partial; /* not referenced! */ |
8165
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1712 char_u *jo_err_cb; /* not allocated! */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1713 partial_T *jo_err_partial; /* not referenced! */ |
8210
b717dae2f26d
commit https://github.com/vim/vim/commit/4e221c99e85ed40c98892068a01270b9e7492d98
Christian Brabandt <cb@256bit.org>
parents:
8176
diff
changeset
|
1714 char_u *jo_close_cb; /* not allocated! */ |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1715 partial_T *jo_close_partial; /* not referenced! */ |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1716 char_u *jo_exit_cb; /* not allocated! */ |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
1717 partial_T *jo_exit_partial; /* not referenced! */ |
10426
acfc83aca8ee
commit https://github.com/vim/vim/commit/958dc6923d341390531888058495569d73c356c3
Christian Brabandt <cb@256bit.org>
parents:
10404
diff
changeset
|
1718 int jo_drop_never; |
8124
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1719 int jo_waittime; |
310dd635e8c9
commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8
Christian Brabandt <cb@256bit.org>
parents:
8094
diff
changeset
|
1720 int jo_timeout; |
8165
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1721 int jo_out_timeout; |
973686665238
commit https://github.com/vim/vim/commit/b6b5252bcde68b296858bc090cb424493635dfec
Christian Brabandt <cb@256bit.org>
parents:
8163
diff
changeset
|
1722 int jo_err_timeout; |
8761
f8707ec9efe4
commit https://github.com/vim/vim/commit/8b877ac38e96424a08a8b8eb713ef4b3cf0064be
Christian Brabandt <cb@256bit.org>
parents:
8755
diff
changeset
|
1723 int jo_block_write; /* for testing only */ |
8157
74b44d06d3c7
commit https://github.com/vim/vim/commit/6f3a544228c1faf92211cbaf8bbedb1dff883f90
Christian Brabandt <cb@256bit.org>
parents:
8151
diff
changeset
|
1724 int jo_part; |
74b44d06d3c7
commit https://github.com/vim/vim/commit/6f3a544228c1faf92211cbaf8bbedb1dff883f90
Christian Brabandt <cb@256bit.org>
parents:
8151
diff
changeset
|
1725 int jo_id; |
8170
a0ffb1f3dedc
commit https://github.com/vim/vim/commit/65edff8f51e9e54f85407bdb9156ae8e3e1b76a1
Christian Brabandt <cb@256bit.org>
parents:
8165
diff
changeset
|
1726 char_u jo_soe_buf[NUMBUFLEN]; |
a0ffb1f3dedc
commit https://github.com/vim/vim/commit/65edff8f51e9e54f85407bdb9156ae8e3e1b76a1
Christian Brabandt <cb@256bit.org>
parents:
8165
diff
changeset
|
1727 char_u *jo_stoponexit; |
8084
3ea56a74077f
commit https://github.com/vim/vim/commit/9a6e33a19b18f20c25b73392cd2faa3ec4890c8c
Christian Brabandt <cb@256bit.org>
parents:
8059
diff
changeset
|
1728 } jobopt_T; |
3ea56a74077f
commit https://github.com/vim/vim/commit/9a6e33a19b18f20c25b73392cd2faa3ec4890c8c
Christian Brabandt <cb@256bit.org>
parents:
8059
diff
changeset
|
1729 |
8031
ece323e2b57f
commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab
Christian Brabandt <cb@256bit.org>
parents:
8023
diff
changeset
|
1730 |
6565 | 1731 /* structure used for explicit stack while garbage collecting hash tables */ |
1732 typedef struct ht_stack_S | |
1733 { | |
1734 hashtab_T *ht; | |
1735 struct ht_stack_S *prev; | |
1736 } ht_stack_T; | |
1737 | |
1738 /* structure used for explicit stack while garbage collecting lists */ | |
1739 typedef struct list_stack_S | |
1740 { | |
1741 list_T *list; | |
1742 struct list_stack_S *prev; | |
1743 } list_stack_T; | |
1744 | |
419 | 1745 /* values for b_syn_spell: what to do with toplevel text */ |
1746 #define SYNSPL_DEFAULT 0 /* spell check if @Spell not defined */ | |
1747 #define SYNSPL_TOP 1 /* spell check toplevel text */ | |
1748 #define SYNSPL_NOTOP 2 /* don't spell check toplevel text */ | |
1749 | |
625 | 1750 /* avoid #ifdefs for when b_spell is not available */ |
744 | 1751 #ifdef FEAT_SPELL |
625 | 1752 # define B_SPELL(buf) ((buf)->b_spell) |
1753 #else | |
1754 # define B_SPELL(buf) (0) | |
1755 #endif | |
1756 | |
800 | 1757 #ifdef FEAT_QUICKFIX |
644 | 1758 typedef struct qf_info_S qf_info_T; |
800 | 1759 #endif |
123 | 1760 |
4766
ec24ff78a79c
updated for version 7.3.1130
Bram Moolenaar <bram@vim.org>
parents:
4764
diff
changeset
|
1761 #ifdef FEAT_PROFILE |
4764
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1762 /* |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1763 * Used for :syntime: timing of executing a syntax pattern. |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1764 */ |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1765 typedef struct { |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1766 proftime_T total; /* total time used */ |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1767 proftime_T slowest; /* time of slowest call */ |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1768 long count; /* nr of times used */ |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1769 long match; /* nr of times matched */ |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1770 } syn_time_T; |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1771 #endif |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1772 |
6122 | 1773 #ifdef FEAT_CRYPT |
1774 /* | |
1775 * Structure to hold the type of encryption and the state of encryption or | |
1776 * decryption. | |
1777 */ | |
1778 typedef struct { | |
1779 int method_nr; | |
1780 void *method_state; /* method-specific state information */ | |
1781 } cryptstate_T; | |
1782 | |
1783 /* values for method_nr */ | |
1784 # define CRYPT_M_ZIP 0 | |
1785 # define CRYPT_M_BF 1 | |
1786 # define CRYPT_M_BF2 2 | |
1787 # define CRYPT_M_COUNT 3 /* number of crypt methods */ | |
1788 #endif | |
1789 | |
1790 | |
3570 | 1791 /* |
1792 * These are items normally related to a buffer. But when using ":ownsyntax" | |
1793 * a window may have its own instance. | |
1794 */ | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1795 typedef struct { |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1796 #ifdef FEAT_SYN_HL |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1797 hashtab_T b_keywtab; /* syntax keywords hash table */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1798 hashtab_T b_keywtab_ic; /* idem, ignore case */ |
4352 | 1799 int b_syn_error; /* TRUE when error occurred in HL */ |
11529
998d2cf59caa
patch 8.0.0647: syntax highlighting can make cause a freeze
Christian Brabandt <cb@256bit.org>
parents:
11447
diff
changeset
|
1800 # ifdef FEAT_RELTIME |
998d2cf59caa
patch 8.0.0647: syntax highlighting can make cause a freeze
Christian Brabandt <cb@256bit.org>
parents:
11447
diff
changeset
|
1801 int b_syn_slow; /* TRUE when 'redrawtime' reached */ |
998d2cf59caa
patch 8.0.0647: syntax highlighting can make cause a freeze
Christian Brabandt <cb@256bit.org>
parents:
11447
diff
changeset
|
1802 # endif |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1803 int b_syn_ic; /* ignore case for :syn cmds */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1804 int b_syn_spell; /* SYNSPL_ values */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1805 garray_T b_syn_patterns; /* table for syntax patterns */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1806 garray_T b_syn_clusters; /* table for syntax clusters */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1807 int b_spell_cluster_id; /* @Spell cluster ID or 0 */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1808 int b_nospell_cluster_id; /* @NoSpell cluster ID or 0 */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1809 int b_syn_containedin; /* TRUE when there is an item with a |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1810 "containedin" argument */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1811 int b_syn_sync_flags; /* flags about how to sync */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1812 short b_syn_sync_id; /* group to sync on */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1813 long b_syn_sync_minlines; /* minimal sync lines offset */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1814 long b_syn_sync_maxlines; /* maximal sync lines offset */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1815 long b_syn_sync_linebreaks; /* offset for multi-line pattern */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1816 char_u *b_syn_linecont_pat; /* line continuation pattern */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1817 regprog_T *b_syn_linecont_prog; /* line continuation program */ |
4766
ec24ff78a79c
updated for version 7.3.1130
Bram Moolenaar <bram@vim.org>
parents:
4764
diff
changeset
|
1818 #ifdef FEAT_PROFILE |
4764
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1819 syn_time_T b_syn_linecont_time; |
f824cb97eb92
updated for version 7.3.1129
Bram Moolenaar <bram@vim.org>
parents:
4444
diff
changeset
|
1820 #endif |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1821 int b_syn_linecont_ic; /* ignore-case flag for above */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1822 int b_syn_topgrp; /* for ":syntax include" */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1823 # ifdef FEAT_CONCEAL |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1824 int b_syn_conceal; /* auto-conceal for :syn cmds */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1825 # endif |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1826 # ifdef FEAT_FOLDING |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1827 int b_syn_folditems; /* number of patterns with the HL_FOLD |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1828 flag set */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1829 # endif |
2419
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1830 /* |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1831 * b_sst_array[] contains the state stack for a number of lines, for the |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1832 * start of that line (col == 0). This avoids having to recompute the |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1833 * syntax state too often. |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1834 * b_sst_array[] is allocated to hold the state for all displayed lines, |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1835 * and states for 1 out of about 20 other lines. |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1836 * b_sst_array pointer to an array of synstate_T |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1837 * b_sst_len number of entries in b_sst_array[] |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1838 * b_sst_first pointer to first used entry in b_sst_array[] or NULL |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1839 * b_sst_firstfree pointer to first free entry in b_sst_array[] or NULL |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1840 * b_sst_freecount number of free entries in b_sst_array[] |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1841 * b_sst_check_lnum entries after this lnum need to be checked for |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1842 * validity (MAXLNUM means no check needed) |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1843 */ |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1844 synstate_T *b_sst_array; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1845 int b_sst_len; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1846 synstate_T *b_sst_first; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1847 synstate_T *b_sst_firstfree; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1848 int b_sst_freecount; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1849 linenr_T b_sst_check_lnum; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1850 short_u b_sst_lasttick; /* last display tick */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1851 #endif /* FEAT_SYN_HL */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1852 |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1853 #ifdef FEAT_SPELL |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1854 /* for spell checking */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1855 garray_T b_langp; /* list of pointers to slang_T, see spell.c */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1856 char_u b_spell_ismw[256];/* flags: is midword char */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1857 # ifdef FEAT_MBYTE |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1858 char_u *b_spell_ismw_mb; /* multi-byte midword chars */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1859 # endif |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1860 char_u *b_p_spc; /* 'spellcapcheck' */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1861 regprog_T *b_cap_prog; /* program for 'spellcapcheck' */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1862 char_u *b_p_spf; /* 'spellfile' */ |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1863 char_u *b_p_spl; /* 'spelllang' */ |
5477 | 1864 # ifdef FEAT_MBYTE |
1865 int b_cjk; /* all CJK letters as OK */ | |
1866 # endif | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1867 #endif |
2419
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1868 #if !defined(FEAT_SYN_HL) && !defined(FEAT_SPELL) |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1869 int dummy; |
f579b934f51d
Fix build warnings and problems for tiny/small Win32 build. (Mike Williams)
Bram Moolenaar <bram@vim.org>
parents:
2378
diff
changeset
|
1870 #endif |
7687
61354fabf8a2
commit https://github.com/vim/vim/commit/b8060fe862f684b591f9ac679eac5b2594d6c5a0
Christian Brabandt <cb@256bit.org>
parents:
7664
diff
changeset
|
1871 char_u b_syn_chartab[32]; /* syntax iskeyword option */ |
61354fabf8a2
commit https://github.com/vim/vim/commit/b8060fe862f684b591f9ac679eac5b2594d6c5a0
Christian Brabandt <cb@256bit.org>
parents:
7664
diff
changeset
|
1872 char_u *b_syn_isk; /* iskeyword option */ |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1873 } synblock_T; |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1874 |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
1875 |
7 | 1876 /* |
1877 * buffer: structure that holds information about one file | |
1878 * | |
1879 * Several windows can share a single Buffer | |
1880 * A buffer is unallocated if there is no memfile for it. | |
1881 * A buffer is new if the associated file has never been loaded yet. | |
1882 */ | |
1883 | |
1884 struct file_buffer | |
1885 { | |
1886 memline_T b_ml; /* associated memline (also contains line | |
1887 count) */ | |
1888 | |
1889 buf_T *b_next; /* links in list of buffers */ | |
1890 buf_T *b_prev; | |
1891 | |
1892 int b_nwindows; /* nr of windows open on this buffer */ | |
1893 | |
1894 int b_flags; /* various BF_ flags */ | |
3570 | 1895 #ifdef FEAT_AUTOCMD |
10106
58e6dd1d8be3
commit https://github.com/vim/vim/commit/e0ab94e7123ca7855f45919114d948ef2bc1e8c3
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
1896 int b_locked; /* Buffer is being closed or referenced, don't |
58e6dd1d8be3
commit https://github.com/vim/vim/commit/e0ab94e7123ca7855f45919114d948ef2bc1e8c3
Christian Brabandt <cb@256bit.org>
parents:
10042
diff
changeset
|
1897 let autocommands wipe it out. */ |
3570 | 1898 #endif |
7 | 1899 |
1900 /* | |
1901 * b_ffname has the full path of the file (NULL for no name). | |
1902 * b_sfname is the name as the user typed it (or NULL). | |
1903 * b_fname is the same as b_sfname, unless ":cd" has been done, | |
1904 * then it is the same as b_ffname (NULL for no name). | |
1905 */ | |
1906 char_u *b_ffname; /* full path file name */ | |
1907 char_u *b_sfname; /* short file name */ | |
1908 char_u *b_fname; /* current file name */ | |
1909 | |
1910 #ifdef UNIX | |
1873 | 1911 int b_dev_valid; /* TRUE when b_dev has a valid number */ |
1912 dev_t b_dev; /* device number */ | |
7 | 1913 ino_t b_ino; /* inode number */ |
1914 #endif | |
1915 #ifdef FEAT_CW_EDITOR | |
1916 FSSpec b_FSSpec; /* MacOS File Identification */ | |
1917 #endif | |
1918 #ifdef VMS | |
22 | 1919 char b_fab_rfm; /* Record format */ |
1920 char b_fab_rat; /* Record attribute */ | |
1921 unsigned int b_fab_mrs; /* Max record size */ | |
7 | 1922 #endif |
1923 int b_fnum; /* buffer number for this file. */ | |
9511
c2e904cc064f
commit https://github.com/vim/vim/commit/480778b805bd8bdc5d657560230e9c50feda1d0f
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
1924 char_u b_key[VIM_SIZEOF_INT * 2 + 1]; |
c2e904cc064f
commit https://github.com/vim/vim/commit/480778b805bd8bdc5d657560230e9c50feda1d0f
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
1925 /* key used for buf_hashtab, holds b_fnum as |
c2e904cc064f
commit https://github.com/vim/vim/commit/480778b805bd8bdc5d657560230e9c50feda1d0f
Christian Brabandt <cb@256bit.org>
parents:
9487
diff
changeset
|
1926 hex string */ |
7 | 1927 |
1928 int b_changed; /* 'modified': Set to TRUE if something in the | |
1929 file has been changed and not written out. */ | |
10952
835604f3c37a
patch 8.0.0365: might free a dict item that wasn't allocated
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
1930 dictitem16_T b_ct_di; /* holds the b:changedtick value in |
835604f3c37a
patch 8.0.0365: might free a dict item that wasn't allocated
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
1931 b_ct_di.di_tv.vval.v_number; |
10889
5780bd3a5a7e
patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents:
10845
diff
changeset
|
1932 incremented for each change, also for undo */ |
10952
835604f3c37a
patch 8.0.0365: might free a dict item that wasn't allocated
Christian Brabandt <cb@256bit.org>
parents:
10889
diff
changeset
|
1933 #define CHANGEDTICK(buf) ((buf)->b_ct_di.di_tv.vval.v_number) |
7 | 1934 |
1935 int b_saving; /* Set to TRUE if we are in the middle of | |
1936 saving the buffer. */ | |
1937 | |
1938 /* | |
1939 * Changes to a buffer require updating of the display. To minimize the | |
1940 * work, remember changes made and update everything at once. | |
1941 */ | |
1942 int b_mod_set; /* TRUE when there are changes since the last | |
1943 time the display was updated */ | |
1944 linenr_T b_mod_top; /* topmost lnum that was changed */ | |
1945 linenr_T b_mod_bot; /* lnum below last changed line, AFTER the | |
1946 change */ | |
1947 long b_mod_xlines; /* number of extra buffer lines inserted; | |
1948 negative when lines were deleted */ | |
1949 | |
1950 wininfo_T *b_wininfo; /* list of last used info for each window */ | |
1951 | |
1952 long b_mtime; /* last change time of original file */ | |
1953 long b_mtime_read; /* last change time when reading */ | |
9387
f094d4085014
commit https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Christian Brabandt <cb@256bit.org>
parents:
9347
diff
changeset
|
1954 off_T b_orig_size; /* size of original file in bytes */ |
7 | 1955 int b_orig_mode; /* mode of original file */ |
9414
1003973c99df
commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents:
9389
diff
changeset
|
1956 #ifdef FEAT_VIMINFO |
1003973c99df
commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents:
9389
diff
changeset
|
1957 time_T b_last_used; /* time when the buffer was last used; used |
1003973c99df
commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents:
9389
diff
changeset
|
1958 * for viminfo */ |
1003973c99df
commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents:
9389
diff
changeset
|
1959 #endif |
7 | 1960 |
1961 pos_T b_namedm[NMARKS]; /* current named marks (mark.c) */ | |
1962 | |
1963 /* These variables are set when VIsual_active becomes FALSE */ | |
692 | 1964 visualinfo_T b_visual; |
5735 | 1965 #ifdef FEAT_EVAL |
692 | 1966 int b_visual_mode_eval; /* b_visual.vi_mode for visualmode() */ |
7 | 1967 #endif |
1968 | |
1969 pos_T b_last_cursor; /* cursor position when last unloading this | |
1970 buffer */ | |
1971 pos_T b_last_insert; /* where Insert mode was left */ | |
1972 pos_T b_last_change; /* position of last change: '. mark */ | |
1973 | |
1974 #ifdef FEAT_JUMPLIST | |
1975 /* | |
1976 * the changelist contains old change positions | |
1977 */ | |
1978 pos_T b_changelist[JUMPLISTSIZE]; | |
1979 int b_changelistlen; /* number of active entries */ | |
1980 int b_new_change; /* set by u_savecommon() */ | |
1981 #endif | |
1982 | |
1983 /* | |
1984 * Character table, only used in charset.c for 'iskeyword' | |
1985 * 32 bytes of 8 bits: 1 bit per character 0-255. | |
1986 */ | |
1987 char_u b_chartab[32]; | |
1988 | |
1989 #ifdef FEAT_LOCALMAP | |
1990 /* Table used for mappings local to a buffer. */ | |
1991 mapblock_T *(b_maphash[256]); | |
1992 | |
1993 /* First abbreviation local to a buffer. */ | |
1994 mapblock_T *b_first_abbr; | |
1995 #endif | |
1996 #ifdef FEAT_USR_CMDS | |
1997 /* User commands local to the buffer. */ | |
1998 garray_T b_ucmds; | |
1999 #endif | |
2000 /* | |
2001 * start and end of an operator, also used for '[ and '] | |
2002 */ | |
2003 pos_T b_op_start; | |
5680 | 2004 pos_T b_op_start_orig; /* used for Insstart_orig */ |
7 | 2005 pos_T b_op_end; |
2006 | |
2007 #ifdef FEAT_VIMINFO | |
2008 int b_marks_read; /* Have we read viminfo marks yet? */ | |
2009 #endif | |
2010 | |
2011 /* | |
2012 * The following only used in undo.c. | |
2013 */ | |
2014 u_header_T *b_u_oldhead; /* pointer to oldest header */ | |
760 | 2015 u_header_T *b_u_newhead; /* pointer to newest header; may not be valid |
2016 if b_u_curhead is not NULL */ | |
7 | 2017 u_header_T *b_u_curhead; /* pointer to current header */ |
2018 int b_u_numhead; /* current number of headers */ | |
2019 int b_u_synced; /* entry lists are synced */ | |
777 | 2020 long b_u_seq_last; /* last used undo sequence number */ |
2281
e41433ea71df
Added ":earlier 1f" and ":later 1f".
Bram Moolenaar <bram@vim.org>
parents:
2280
diff
changeset
|
2021 long b_u_save_nr_last; /* counter for last file write */ |
777 | 2022 long b_u_seq_cur; /* hu_seq of header below which we are now */ |
9347
25c562442f8c
commit https://github.com/vim/vim/commit/f4fba6dcd508cb369ffa6916d9cb3fcf3d7ed548
Christian Brabandt <cb@256bit.org>
parents:
9284
diff
changeset
|
2023 time_T b_u_time_cur; /* uh_time of header below which we are now */ |
2281
e41433ea71df
Added ":earlier 1f" and ":later 1f".
Bram Moolenaar <bram@vim.org>
parents:
2280
diff
changeset
|
2024 long b_u_save_nr_cur; /* file write nr after which we are now */ |
7 | 2025 |
2026 /* | |
2027 * variables for "U" command in undo.c | |
2028 */ | |
2029 char_u *b_u_line_ptr; /* saved line for "U" command */ | |
2030 linenr_T b_u_line_lnum; /* line number of line in u_line */ | |
2031 colnr_T b_u_line_colnr; /* optional column number */ | |
2032 | |
2033 #ifdef FEAT_INS_EXPAND | |
2034 int b_scanned; /* ^N/^P have scanned this buffer */ | |
2035 #endif | |
2036 | |
2037 /* flags for use of ":lmap" and IM control */ | |
2038 long b_p_iminsert; /* input mode for insert */ | |
2039 long b_p_imsearch; /* input mode for search */ | |
2040 #define B_IMODE_USE_INSERT -1 /* Use b_p_iminsert value for search */ | |
2041 #define B_IMODE_NONE 0 /* Input via none */ | |
2042 #define B_IMODE_LMAP 1 /* Input via langmap */ | |
2043 #ifndef USE_IM_CONTROL | |
2044 # define B_IMODE_LAST 1 | |
2045 #else | |
2046 # define B_IMODE_IM 2 /* Input via input method */ | |
2047 # define B_IMODE_LAST 2 | |
2048 #endif | |
2049 | |
2050 #ifdef FEAT_KEYMAP | |
2051 short b_kmap_state; /* using "lmap" mappings */ | |
2052 # define KEYMAP_INIT 1 /* 'keymap' was set, call keymap_init() */ | |
2053 # define KEYMAP_LOADED 2 /* 'keymap' mappings have been loaded */ | |
2054 garray_T b_kmap_ga; /* the keymap table */ | |
2055 #endif | |
2056 | |
2057 /* | |
2058 * Options local to a buffer. | |
2059 * They are here because their value depends on the type of file | |
2060 * or contents of the file being edited. | |
2061 */ | |
2062 int b_p_initialized; /* set when options initialized */ | |
2063 | |
694 | 2064 #ifdef FEAT_EVAL |
2065 int b_p_scriptID[BV_COUNT]; /* SIDs for buffer-local options */ | |
2066 #endif | |
2067 | |
7 | 2068 int b_p_ai; /* 'autoindent' */ |
2069 int b_p_ai_nopaste; /* b_p_ai saved for paste mode */ | |
6243 | 2070 char_u *b_p_bkc; /* 'backupcopy' */ |
2071 unsigned b_bkc_flags; /* flags for 'backupcopy' */ | |
7 | 2072 int b_p_ci; /* 'copyindent' */ |
2073 int b_p_bin; /* 'binary' */ | |
2074 #ifdef FEAT_MBYTE | |
2075 int b_p_bomb; /* 'bomb' */ | |
2076 #endif | |
9201
692e156c7023
commit https://github.com/vim/vim/commit/2f095a4bc4d786e0ac834f48dd18a94fe2d140e3
Christian Brabandt <cb@256bit.org>
parents:
9151
diff
changeset
|
2077 #ifdef FEAT_QUICKFIX |
7 | 2078 char_u *b_p_bh; /* 'bufhidden' */ |
2079 char_u *b_p_bt; /* 'buftype' */ | |
9608
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9562
diff
changeset
|
2080 #define BUF_HAS_QF_ENTRY 1 |
fa64afb99dda
commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents:
9562
diff
changeset
|
2081 #define BUF_HAS_LL_ENTRY 2 |
9201
692e156c7023
commit https://github.com/vim/vim/commit/2f095a4bc4d786e0ac834f48dd18a94fe2d140e3
Christian Brabandt <cb@256bit.org>
parents:
9151
diff
changeset
|
2082 int b_has_qf_entry; |
7 | 2083 #endif |
2084 int b_p_bl; /* 'buflisted' */ | |
2085 #ifdef FEAT_CINDENT | |
2086 int b_p_cin; /* 'cindent' */ | |
2087 char_u *b_p_cino; /* 'cinoptions' */ | |
2088 char_u *b_p_cink; /* 'cinkeys' */ | |
2089 #endif | |
2090 #if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) | |
2091 char_u *b_p_cinw; /* 'cinwords' */ | |
2092 #endif | |
2093 #ifdef FEAT_COMMENTS | |
2094 char_u *b_p_com; /* 'comments' */ | |
2095 #endif | |
2096 #ifdef FEAT_FOLDING | |
2097 char_u *b_p_cms; /* 'commentstring' */ | |
2098 #endif | |
2099 #ifdef FEAT_INS_EXPAND | |
2100 char_u *b_p_cpt; /* 'complete' */ | |
2101 #endif | |
12 | 2102 #ifdef FEAT_COMPL_FUNC |
2103 char_u *b_p_cfu; /* 'completefunc' */ | |
523 | 2104 char_u *b_p_ofu; /* 'omnifunc' */ |
12 | 2105 #endif |
7 | 2106 int b_p_eol; /* 'endofline' */ |
6933 | 2107 int b_p_fixeol; /* 'fixendofline' */ |
7 | 2108 int b_p_et; /* 'expandtab' */ |
2109 int b_p_et_nobin; /* b_p_et saved for binary mode */ | |
7113
83b3261352b3
commit https://github.com/vim/vim/commit/54f018cd5994c3ffcd0740526e56db6934edf1f2
Christian Brabandt <cb@256bit.org>
parents:
6947
diff
changeset
|
2110 int b_p_et_nopaste; /* b_p_et saved for paste mode */ |
7 | 2111 #ifdef FEAT_MBYTE |
2112 char_u *b_p_fenc; /* 'fileencoding' */ | |
2113 #endif | |
2114 char_u *b_p_ff; /* 'fileformat' */ | |
2115 #ifdef FEAT_AUTOCMD | |
2116 char_u *b_p_ft; /* 'filetype' */ | |
2117 #endif | |
2118 char_u *b_p_fo; /* 'formatoptions' */ | |
41 | 2119 char_u *b_p_flp; /* 'formatlistpat' */ |
7 | 2120 int b_p_inf; /* 'infercase' */ |
2121 char_u *b_p_isk; /* 'iskeyword' */ | |
2122 #ifdef FEAT_FIND_ID | |
2123 char_u *b_p_def; /* 'define' local value */ | |
2124 char_u *b_p_inc; /* 'include' */ | |
2125 # ifdef FEAT_EVAL | |
2126 char_u *b_p_inex; /* 'includeexpr' */ | |
681 | 2127 long_u b_p_inex_flags; /* flags for 'includeexpr' */ |
7 | 2128 # endif |
2129 #endif | |
2130 #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) | |
2131 char_u *b_p_inde; /* 'indentexpr' */ | |
681 | 2132 long_u b_p_inde_flags; /* flags for 'indentexpr' */ |
7 | 2133 char_u *b_p_indk; /* 'indentkeys' */ |
2134 #endif | |
10579
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10426
diff
changeset
|
2135 char_u *b_p_fp; /* 'formatprg' */ |
667 | 2136 #if defined(FEAT_EVAL) |
2137 char_u *b_p_fex; /* 'formatexpr' */ | |
681 | 2138 long_u b_p_fex_flags; /* flags for 'formatexpr' */ |
667 | 2139 #endif |
7 | 2140 #ifdef FEAT_CRYPT |
2141 char_u *b_p_key; /* 'key' */ | |
2142 #endif | |
2143 char_u *b_p_kp; /* 'keywordprg' */ | |
2144 #ifdef FEAT_LISP | |
2145 int b_p_lisp; /* 'lisp' */ | |
2146 #endif | |
11063
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
10952
diff
changeset
|
2147 #ifdef FEAT_MBYTE |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
10952
diff
changeset
|
2148 char_u *b_p_menc; /* 'makeencoding' */ |
e71d3bdf3bc3
patch 8.0.0420: text garbled when the system encoding differs from 'encoding'
Christian Brabandt <cb@256bit.org>
parents:
10952
diff
changeset
|
2149 #endif |
7 | 2150 char_u *b_p_mps; /* 'matchpairs' */ |
2151 int b_p_ml; /* 'modeline' */ | |
2152 int b_p_ml_nobin; /* b_p_ml saved for binary mode */ | |
2153 int b_p_ma; /* 'modifiable' */ | |
2154 char_u *b_p_nf; /* 'nrformats' */ | |
2155 int b_p_pi; /* 'preserveindent' */ | |
12 | 2156 #ifdef FEAT_TEXTOBJ |
2157 char_u *b_p_qe; /* 'quoteescape' */ | |
2158 #endif | |
7 | 2159 int b_p_ro; /* 'readonly' */ |
2160 long b_p_sw; /* 'shiftwidth' */ | |
2161 int b_p_sn; /* 'shortname' */ | |
2162 #ifdef FEAT_SMARTINDENT | |
2163 int b_p_si; /* 'smartindent' */ | |
2164 #endif | |
2165 long b_p_sts; /* 'softtabstop' */ | |
2166 long b_p_sts_nopaste; /* b_p_sts saved for paste mode */ | |
2167 #ifdef FEAT_SEARCHPATH | |
2168 char_u *b_p_sua; /* 'suffixesadd' */ | |
2169 #endif | |
2170 int b_p_swf; /* 'swapfile' */ | |
2171 #ifdef FEAT_SYN_HL | |
410 | 2172 long b_p_smc; /* 'synmaxcol' */ |
7 | 2173 char_u *b_p_syn; /* 'syntax' */ |
744 | 2174 #endif |
7 | 2175 long b_p_ts; /* 'tabstop' */ |
2176 int b_p_tx; /* 'textmode' */ | |
2177 long b_p_tw; /* 'textwidth' */ | |
2178 long b_p_tw_nobin; /* b_p_tw saved for binary mode */ | |
2179 long b_p_tw_nopaste; /* b_p_tw saved for paste mode */ | |
2180 long b_p_wm; /* 'wrapmargin' */ | |
2181 long b_p_wm_nobin; /* b_p_wm saved for binary mode */ | |
2182 long b_p_wm_nopaste; /* b_p_wm saved for paste mode */ | |
2183 #ifdef FEAT_KEYMAP | |
2184 char_u *b_p_keymap; /* 'keymap' */ | |
2185 #endif | |
2186 | |
2187 /* local values for options which are normally global */ | |
2188 #ifdef FEAT_QUICKFIX | |
2189 char_u *b_p_gp; /* 'grepprg' local value */ | |
2190 char_u *b_p_mp; /* 'makeprg' local value */ | |
2191 char_u *b_p_efm; /* 'errorformat' local value */ | |
2192 #endif | |
2193 char_u *b_p_ep; /* 'equalprg' local value */ | |
2194 char_u *b_p_path; /* 'path' local value */ | |
2195 int b_p_ar; /* 'autoread' local value */ | |
2196 char_u *b_p_tags; /* 'tags' local value */ | |
7266
6ba7182fb7bd
commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents:
7113
diff
changeset
|
2197 char_u *b_p_tc; /* 'tagcase' local value */ |
6ba7182fb7bd
commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents:
7113
diff
changeset
|
2198 unsigned b_tc_flags; /* flags for 'tagcase' */ |
7 | 2199 #ifdef FEAT_INS_EXPAND |
2200 char_u *b_p_dict; /* 'dictionary' local value */ | |
2201 char_u *b_p_tsr; /* 'thesaurus' local value */ | |
2202 #endif | |
5446 | 2203 long b_p_ul; /* 'undolevels' local value */ |
2214
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2204 #ifdef FEAT_PERSISTENT_UNDO |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2205 int b_p_udf; /* 'undofile' */ |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
2206 #endif |
5712 | 2207 #ifdef FEAT_LISP |
2208 char_u *b_p_lw; /* 'lispwords' local value */ | |
2209 #endif | |
7 | 2210 |
2211 /* end of buffer options */ | |
2212 | |
5438 | 2213 #ifdef FEAT_CINDENT |
2214 /* values set from b_p_cino */ | |
2215 int b_ind_level; | |
2216 int b_ind_open_imag; | |
2217 int b_ind_no_brace; | |
2218 int b_ind_first_open; | |
2219 int b_ind_open_extra; | |
2220 int b_ind_close_extra; | |
2221 int b_ind_open_left_imag; | |
2222 int b_ind_jump_label; | |
2223 int b_ind_case; | |
2224 int b_ind_case_code; | |
2225 int b_ind_case_break; | |
2226 int b_ind_param; | |
2227 int b_ind_func_type; | |
2228 int b_ind_comment; | |
2229 int b_ind_in_comment; | |
2230 int b_ind_in_comment2; | |
2231 int b_ind_cpp_baseclass; | |
2232 int b_ind_continuation; | |
2233 int b_ind_unclosed; | |
2234 int b_ind_unclosed2; | |
2235 int b_ind_unclosed_noignore; | |
2236 int b_ind_unclosed_wrapped; | |
2237 int b_ind_unclosed_whiteok; | |
2238 int b_ind_matching_paren; | |
2239 int b_ind_paren_prev; | |
2240 int b_ind_maxparen; | |
2241 int b_ind_maxcomment; | |
2242 int b_ind_scopedecl; | |
2243 int b_ind_scopedecl_code; | |
2244 int b_ind_java; | |
2245 int b_ind_js; | |
2246 int b_ind_keep_case_label; | |
2247 int b_ind_hash_comment; | |
2248 int b_ind_cpp_namespace; | |
2249 int b_ind_if_for_while; | |
11087
242e0617aa51
patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents:
11063
diff
changeset
|
2250 int b_ind_cpp_extern_c; |
5438 | 2251 #endif |
2252 | |
2707 | 2253 linenr_T b_no_eol_lnum; /* non-zero lnum when last line of next binary |
2254 * write should not have an end-of-line */ | |
2255 | |
7 | 2256 int b_start_eol; /* last line had eol when it was read */ |
2257 int b_start_ffc; /* first char of 'ff' when edit started */ | |
2258 #ifdef FEAT_MBYTE | |
2259 char_u *b_start_fenc; /* 'fileencoding' when edit started or NULL */ | |
613 | 2260 int b_bad_char; /* "++bad=" argument when edit started or 0 */ |
1352 | 2261 int b_start_bomb; /* 'bomb' when it was read */ |
7 | 2262 #endif |
2263 | |
2264 #ifdef FEAT_EVAL | |
133 | 2265 dictitem_T b_bufvar; /* variable for "b:" Dictionary */ |
4287 | 2266 dict_T *b_vars; /* internal variables, local to buffer */ |
7 | 2267 #endif |
2268 | |
790 | 2269 #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) |
2270 char_u *b_p_bexpr; /* 'balloonexpr' local value */ | |
2271 long_u b_p_bexpr_flags;/* flags for 'balloonexpr' */ | |
2272 #endif | |
2360
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2348
diff
changeset
|
2273 #ifdef FEAT_CRYPT |
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2348
diff
changeset
|
2274 char_u *b_p_cm; /* 'cryptmethod' */ |
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2348
diff
changeset
|
2275 #endif |
790 | 2276 |
7 | 2277 /* When a buffer is created, it starts without a swap file. b_may_swap is |
2278 * then set to indicate that a swap file may be opened later. It is reset | |
2279 * if a swap file could not be opened. | |
2280 */ | |
2281 int b_may_swap; | |
2282 int b_did_warn; /* Set to 1 if user has been warned on first | |
2283 change of a read-only file */ | |
625 | 2284 |
2285 /* Two special kinds of buffers: | |
2286 * help buffer - used for help files, won't use a swap file. | |
2287 * spell buffer - used for spell info, never displayed and doesn't have a | |
2288 * file name. | |
2289 */ | |
2290 int b_help; /* TRUE for help file buffer (when set b_p_bt | |
2291 is "help") */ | |
744 | 2292 #ifdef FEAT_SPELL |
625 | 2293 int b_spell; /* TRUE for a spell file buffer, most fields |
2294 are not used! Use the B_SPELL macro to | |
2295 access b_spell without #ifdef. */ | |
2296 #endif | |
7 | 2297 |
2298 int b_shortname; /* this file has an 8.3 file name */ | |
2299 | |
14 | 2300 #ifdef FEAT_MZSCHEME |
502 | 2301 void *b_mzscheme_ref; /* The MzScheme reference to this buffer */ |
14 | 2302 #endif |
2303 | |
7 | 2304 #ifdef FEAT_PERL |
502 | 2305 void *b_perl_private; |
7 | 2306 #endif |
2307 | |
2308 #ifdef FEAT_PYTHON | |
502 | 2309 void *b_python_ref; /* The Python reference to this buffer */ |
7 | 2310 #endif |
2311 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2312 #ifdef FEAT_PYTHON3 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2313 void *b_python3_ref; /* The Python3 reference to this buffer */ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2314 #endif |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2315 |
7 | 2316 #ifdef FEAT_TCL |
502 | 2317 void *b_tcl_ref; |
7 | 2318 #endif |
2319 | |
2320 #ifdef FEAT_RUBY | |
502 | 2321 void *b_ruby_ref; |
7 | 2322 #endif |
2323 | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2324 #if defined(FEAT_SYN_HL) || defined(FEAT_SPELL) |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2325 synblock_T b_s; /* Info related to syntax highlighting. w_s |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2326 * normally points to this, but some windows |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2327 * may use a different synblock_T. */ |
744 | 2328 #endif |
7 | 2329 |
2330 #ifdef FEAT_SIGNS | |
2331 signlist_T *b_signlist; /* list of signs to draw */ | |
6689 | 2332 # ifdef FEAT_NETBEANS_INTG |
2333 int b_has_sign_column; /* Flag that is set when a first sign is | |
2334 * added and remains set until the end of | |
2335 * the netbeans session. */ | |
2336 # endif | |
7 | 2337 #endif |
2338 | |
2339 #ifdef FEAT_NETBEANS_INTG | |
2340 int b_netbeans_file; /* TRUE when buffer is owned by NetBeans */ | |
2341 int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */ | |
2342 #endif | |
8493
caed4b2d305f
commit https://github.com/vim/vim/commit/509ce2a558e7e0c03242e32e844255af52f1c821
Christian Brabandt <cb@256bit.org>
parents:
8491
diff
changeset
|
2343 #ifdef FEAT_JOB_CHANNEL |
8422
5d2c84be23b5
commit https://github.com/vim/vim/commit/99ef06296f3c37490511c03786a2c8672e015c56
Christian Brabandt <cb@256bit.org>
parents:
8386
diff
changeset
|
2344 int b_write_to_channel; /* TRUE when appended lines are written to |
5d2c84be23b5
commit https://github.com/vim/vim/commit/99ef06296f3c37490511c03786a2c8672e015c56
Christian Brabandt <cb@256bit.org>
parents:
8386
diff
changeset
|
2345 * a channel. */ |
5d2c84be23b5
commit https://github.com/vim/vim/commit/99ef06296f3c37490511c03786a2c8672e015c56
Christian Brabandt <cb@256bit.org>
parents:
8386
diff
changeset
|
2346 #endif |
7 | 2347 |
6122 | 2348 #ifdef FEAT_CRYPT |
2349 cryptstate_T *b_cryptstate; /* Encryption state while reading or writing | |
2350 * the file. NULL when not using encryption. */ | |
2351 #endif | |
6482 | 2352 int b_mapped_ctrl_c; /* modes where CTRL-C is mapped */ |
6122 | 2353 |
2354 }; /* file_buffer */ | |
7 | 2355 |
673 | 2356 |
2357 #ifdef FEAT_DIFF | |
2358 /* | |
2359 * Stuff for diff mode. | |
2360 */ | |
9955
f52b263fb3f0
commit https://github.com/vim/vim/commit/015efc32c1add6269099364835ddf85ff257b3c6
Christian Brabandt <cb@256bit.org>
parents:
9941
diff
changeset
|
2361 # define DB_COUNT 8 /* up to eight buffers can be diff'ed */ |
673 | 2362 |
2363 /* | |
2364 * Each diffblock defines where a block of lines starts in each of the buffers | |
2365 * and how many lines it occupies in that buffer. When the lines are missing | |
2366 * in the buffer the df_count[] is zero. This is all counted in | |
2367 * buffer lines. | |
2368 * There is always at least one unchanged line in between the diffs. | |
2369 * Otherwise it would have been included in the diff above or below it. | |
2370 * df_lnum[] + df_count[] is the lnum below the change. When in one buffer | |
2371 * lines have been inserted, in the other buffer df_lnum[] is the line below | |
2372 * the insertion and df_count[] is zero. When appending lines at the end of | |
2373 * the buffer, df_lnum[] is one beyond the end! | |
2374 * This is using a linked list, because the number of differences is expected | |
2375 * to be reasonable small. The list is sorted on lnum. | |
2376 */ | |
2377 typedef struct diffblock_S diff_T; | |
2378 struct diffblock_S | |
2379 { | |
2380 diff_T *df_next; | |
2381 linenr_T df_lnum[DB_COUNT]; /* line number in buffer */ | |
2382 linenr_T df_count[DB_COUNT]; /* nr of inserted/changed lines */ | |
2383 }; | |
2384 #endif | |
2385 | |
1906 | 2386 #define SNAP_HELP_IDX 0 |
2387 #ifdef FEAT_AUTOCMD | |
2388 # define SNAP_AUCMD_IDX 1 | |
2389 # define SNAP_COUNT 2 | |
2390 #else | |
2391 # define SNAP_COUNT 1 | |
2392 #endif | |
2393 | |
673 | 2394 /* |
2395 * Tab pages point to the top frame of each tab page. | |
2396 * Note: Most values are NOT valid for the current tab page! Use "curwin", | |
2397 * "firstwin", etc. for that. "tp_topframe" is always valid and can be | |
2398 * compared against "topframe" to find the current tab page. | |
2399 */ | |
2400 typedef struct tabpage_S tabpage_T; | |
2401 struct tabpage_S | |
2402 { | |
2403 tabpage_T *tp_next; /* next tabpage or NULL */ | |
2404 frame_T *tp_topframe; /* topframe for the windows */ | |
2405 win_T *tp_curwin; /* current window in this Tab page */ | |
2406 win_T *tp_prevwin; /* previous window in this Tab page */ | |
2407 win_T *tp_firstwin; /* first window in this Tab page */ | |
2408 win_T *tp_lastwin; /* last window in this Tab page */ | |
2409 long tp_old_Rows; /* Rows when Tab page was left */ | |
2410 long tp_old_Columns; /* Columns when Tab page was left */ | |
824 | 2411 long tp_ch_used; /* value of 'cmdheight' when frame size |
2412 was set */ | |
790 | 2413 #ifdef FEAT_GUI |
2414 int tp_prev_which_scrollbars[3]; | |
2415 /* previous value of which_scrollbars */ | |
2416 #endif | |
673 | 2417 #ifdef FEAT_DIFF |
2418 diff_T *tp_first_diff; | |
2419 buf_T *(tp_diffbuf[DB_COUNT]); | |
2420 int tp_diff_invalid; /* list of diffs is outdated */ | |
2421 #endif | |
1906 | 2422 frame_T *(tp_snapshot[SNAP_COUNT]); /* window layout snapshots */ |
819 | 2423 #ifdef FEAT_EVAL |
2424 dictitem_T tp_winvar; /* variable for "t:" Dictionary */ | |
4287 | 2425 dict_T *tp_vars; /* internal variables, local to tab page */ |
819 | 2426 #endif |
4401 | 2427 |
2428 #ifdef FEAT_PYTHON | |
2429 void *tp_python_ref; /* The Python value for this tab page */ | |
2430 #endif | |
2431 | |
2432 #ifdef FEAT_PYTHON3 | |
2433 void *tp_python3_ref; /* The Python value for this tab page */ | |
2434 #endif | |
673 | 2435 }; |
2436 | |
7 | 2437 /* |
2438 * Structure to cache info for displayed lines in w_lines[]. | |
2439 * Each logical line has one entry. | |
2440 * The entry tells how the logical line is currently displayed in the window. | |
2441 * This is updated when displaying the window. | |
2442 * When the display is changed (e.g., when clearing the screen) w_lines_valid | |
2443 * is changed to exclude invalid entries. | |
2444 * When making changes to the buffer, wl_valid is reset to indicate wl_size | |
2445 * may not reflect what is actually in the buffer. When wl_valid is FALSE, | |
2446 * the entries can only be used to count the number of displayed lines used. | |
2447 * wl_lnum and wl_lastlnum are invalid too. | |
2448 */ | |
2449 typedef struct w_line | |
2450 { | |
2451 linenr_T wl_lnum; /* buffer line number for logical line */ | |
2452 short_u wl_size; /* height in screen lines */ | |
2453 char wl_valid; /* TRUE values are valid for text in buffer */ | |
2454 #ifdef FEAT_FOLDING | |
2455 char wl_folded; /* TRUE when this is a range of folded lines */ | |
2456 linenr_T wl_lastlnum; /* last buffer line number for logical line */ | |
2457 #endif | |
2458 } wline_T; | |
2459 | |
2460 /* | |
2461 * Windows are kept in a tree of frames. Each frame has a column (FR_COL) | |
2462 * or row (FR_ROW) layout or is a leaf, which has a window. | |
2463 */ | |
667 | 2464 struct frame_S |
7 | 2465 { |
2466 char fr_layout; /* FR_LEAF, FR_COL or FR_ROW */ | |
8643
24b43dd167eb
commit https://github.com/vim/vim/commit/44a2f923c00f1384c9ecde12fb5b4711bc20702e
Christian Brabandt <cb@256bit.org>
parents:
8577
diff
changeset
|
2467 #ifdef FEAT_WINDOWS |
7 | 2468 int fr_width; |
782 | 2469 int fr_newwidth; /* new width used in win_equal_rec() */ |
7 | 2470 #endif |
2471 int fr_height; | |
2472 int fr_newheight; /* new height used in win_equal_rec() */ | |
2473 frame_T *fr_parent; /* containing frame or NULL */ | |
2474 frame_T *fr_next; /* frame right or below in same parent, NULL | |
2475 for first */ | |
2476 frame_T *fr_prev; /* frame left or above in same parent, NULL | |
2477 for last */ | |
2478 /* fr_child and fr_win are mutually exclusive */ | |
2479 frame_T *fr_child; /* first contained frame */ | |
2480 win_T *fr_win; /* window that fills this frame */ | |
2481 }; | |
2482 | |
2483 #define FR_LEAF 0 /* frame is a leaf */ | |
2484 #define FR_ROW 1 /* frame with a row of windows */ | |
2485 #define FR_COL 2 /* frame with a column of windows */ | |
2486 | |
2487 /* | |
1326 | 2488 * Struct used for highlighting 'hlsearch' matches, matches defined by |
2489 * ":match" and matches defined by match functions. | |
2490 * For 'hlsearch' there is one pattern for all windows. For ":match" and the | |
2491 * match functions there is a different pattern for each window. | |
2492 */ | |
2493 typedef struct | |
2494 { | |
2495 regmmatch_T rm; /* points to the regexp program; contains last found | |
2496 match (may continue in next line) */ | |
2497 buf_T *buf; /* the buffer to search for a match */ | |
2498 linenr_T lnum; /* the line to search for a match */ | |
2499 int attr; /* attributes to be used for a match */ | |
2500 int attr_cur; /* attributes currently active in win_line() */ | |
2501 linenr_T first_lnum; /* first lnum to search for multi-line pat */ | |
2502 colnr_T startcol; /* in win_line() points to char where HL starts */ | |
2503 colnr_T endcol; /* in win_line() points to char where HL ends */ | |
9885
4e8b05fa12c6
commit https://github.com/vim/vim/commit/4f416e41243ca151b95d39d81ce23d00b1484755
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
2504 int is_addpos; /* position specified directly by |
4e8b05fa12c6
commit https://github.com/vim/vim/commit/4f416e41243ca151b95d39d81ce23d00b1484755
Christian Brabandt <cb@256bit.org>
parents:
9852
diff
changeset
|
2505 matchaddpos(). TRUE/FALSE */ |
1521 | 2506 #ifdef FEAT_RELTIME |
2507 proftime_T tm; /* for a time limit */ | |
2508 #endif | |
1326 | 2509 } match_T; |
2510 | |
5979 | 2511 /* number of positions supported by matchaddpos() */ |
2512 #define MAXPOSMATCH 8 | |
2513 | |
2514 /* | |
2515 * Same as lpos_T, but with additional field len. | |
2516 */ | |
2517 typedef struct | |
2518 { | |
2519 linenr_T lnum; /* line number */ | |
2520 colnr_T col; /* column number */ | |
2521 int len; /* length: 0 - to the end of line */ | |
2522 } llpos_T; | |
2523 | |
2524 /* | |
2525 * posmatch_T provides an array for storing match items for matchaddpos() | |
2526 * function. | |
2527 */ | |
2528 typedef struct posmatch posmatch_T; | |
2529 struct posmatch | |
2530 { | |
2531 llpos_T pos[MAXPOSMATCH]; /* array of positions */ | |
2532 int cur; /* internal position counter */ | |
2533 linenr_T toplnum; /* top buffer line */ | |
2534 linenr_T botlnum; /* bottom buffer line */ | |
2535 }; | |
2536 | |
1326 | 2537 /* |
2538 * matchitem_T provides a linked list for storing match items for ":match" and | |
2539 * the match functions. | |
2540 */ | |
2541 typedef struct matchitem matchitem_T; | |
2542 struct matchitem | |
2543 { | |
2544 matchitem_T *next; | |
2545 int id; /* match ID */ | |
2546 int priority; /* match priority */ | |
2547 char_u *pattern; /* pattern to highlight */ | |
2548 int hlg_id; /* highlight group ID */ | |
2549 regmmatch_T match; /* regexp program for pattern */ | |
5979 | 2550 posmatch_T pos; /* position matches */ |
1326 | 2551 match_T hl; /* struct for doing the actual highlighting */ |
6947 | 2552 #ifdef FEAT_CONCEAL |
2553 int conceal_char; /* cchar for Conceal highlighting */ | |
2554 #endif | |
1326 | 2555 }; |
2556 | |
2557 /* | |
7 | 2558 * Structure which contains all information that belongs to a window |
2559 * | |
2560 * All row numbers are relative to the start of the window, except w_winrow. | |
2561 */ | |
667 | 2562 struct window_S |
7 | 2563 { |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
8493
diff
changeset
|
2564 int w_id; /* unique window ID */ |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
8493
diff
changeset
|
2565 |
7 | 2566 buf_T *w_buffer; /* buffer we are a window into (used |
2567 often, keep it the first item!) */ | |
2568 | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2569 #if defined(FEAT_SYN_HL) || defined(FEAT_SPELL) |
3312 | 2570 synblock_T *w_s; /* for :ownsyntax */ |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2571 #endif |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2242
diff
changeset
|
2572 |
7 | 2573 #ifdef FEAT_WINDOWS |
2574 win_T *w_prev; /* link to previous window */ | |
2575 win_T *w_next; /* link to next window */ | |
2576 #endif | |
3570 | 2577 #ifdef FEAT_AUTOCMD |
2578 int w_closing; /* window is being closed, don't let | |
2579 autocommands close it too. */ | |
2580 #endif | |
7 | 2581 |
2582 frame_T *w_frame; /* frame containing this window */ | |
2583 | |
2584 pos_T w_cursor; /* cursor position in buffer */ | |
2585 | |
2586 colnr_T w_curswant; /* The column we'd like to be at. This is | |
2587 used to try to stay in the same column | |
2588 for up/down cursor motions. */ | |
2589 | |
2590 int w_set_curswant; /* If set, then update w_curswant the next | |
2591 time through cursupdate() to the | |
2592 current virtual column */ | |
2593 | |
2594 /* | |
7266
6ba7182fb7bd
commit https://github.com/vim/vim/commit/0f6562e9036f889185dff49a75c7fc5ffb28b307
Christian Brabandt <cb@256bit.org>
parents:
7113
diff
changeset
|
2595 * the next seven are used to update the visual part |
7 | 2596 */ |
2597 char w_old_visual_mode; /* last known VIsual_mode */ | |
2598 linenr_T w_old_cursor_lnum; /* last known end of visual part */ | |
2599 colnr_T w_old_cursor_fcol; /* first column for block visual part */ | |
2600 colnr_T w_old_cursor_lcol; /* last column for block visual part */ | |
2601 linenr_T w_old_visual_lnum; /* last known start of visual part */ | |
422 | 2602 colnr_T w_old_visual_col; /* last known start of visual part */ |
7 | 2603 colnr_T w_old_curswant; /* last known value of Curswant */ |
2604 | |
2605 /* | |
1744 | 2606 * "w_topline", "w_leftcol" and "w_skipcol" specify the offsets for |
2607 * displaying the buffer. | |
7 | 2608 */ |
2609 linenr_T w_topline; /* buffer line number of the line at the | |
2610 top of the window */ | |
1744 | 2611 #ifdef FEAT_AUTOCMD |
2612 char w_topline_was_set; /* flag set to TRUE when topline is set, | |
2613 e.g. by winrestview() */ | |
2614 #endif | |
7 | 2615 #ifdef FEAT_DIFF |
2616 int w_topfill; /* number of filler lines above w_topline */ | |
2617 int w_old_topfill; /* w_topfill at last redraw */ | |
2618 int w_botfill; /* TRUE when filler lines are actually | |
2619 below w_topline (at end of file) */ | |
2620 int w_old_botfill; /* w_botfill at last redraw */ | |
2621 #endif | |
2622 colnr_T w_leftcol; /* window column number of the left most | |
2623 character in the window; used when | |
2624 'wrap' is off */ | |
2625 colnr_T w_skipcol; /* starting column when a single line | |
2626 doesn't fit in the window */ | |
2627 | |
2628 /* | |
2629 * Layout of the window in the screen. | |
2630 * May need to add "msg_scrolled" to "w_winrow" in rare situations. | |
2631 */ | |
2632 #ifdef FEAT_WINDOWS | |
2633 int w_winrow; /* first row of window in screen */ | |
2634 #endif | |
2635 int w_height; /* number of rows in window, excluding | |
2636 status/command line(s) */ | |
2637 #ifdef FEAT_WINDOWS | |
2638 int w_status_height; /* number of status lines (0 or 1) */ | |
2639 int w_wincol; /* Leftmost column of window in screen. | |
2640 use W_WINCOL() */ | |
2641 int w_width; /* Width of window, excluding separation. | |
2642 use W_WIDTH() */ | |
2643 int w_vsep_width; /* Number of separator columns (0 or 1). | |
2644 use W_VSEP_WIDTH() */ | |
2645 #endif | |
2646 | |
2647 /* | |
2648 * === start of cached values ==== | |
2649 */ | |
2650 /* | |
2651 * Recomputing is minimized by storing the result of computations. | |
2652 * Use functions in screen.c to check if they are valid and to update. | |
2653 * w_valid is a bitfield of flags, which indicate if specific values are | |
2654 * valid or need to be recomputed. See screen.c for values. | |
2655 */ | |
2656 int w_valid; | |
2657 pos_T w_valid_cursor; /* last known position of w_cursor, used | |
2658 to adjust w_valid */ | |
2659 colnr_T w_valid_leftcol; /* last known w_leftcol */ | |
2660 | |
2661 /* | |
2662 * w_cline_height is the number of physical lines taken by the buffer line | |
2663 * that the cursor is on. We use this to avoid extra calls to plines(). | |
2664 */ | |
2665 int w_cline_height; /* current size of cursor line */ | |
2666 #ifdef FEAT_FOLDING | |
2667 int w_cline_folded; /* cursor line is folded */ | |
2668 #endif | |
2669 | |
2670 int w_cline_row; /* starting row of the cursor line */ | |
2671 | |
2672 colnr_T w_virtcol; /* column number of the cursor in the | |
2673 buffer line, as opposed to the column | |
2674 number we're at on the screen. This | |
2675 makes a difference on lines which span | |
2676 more than one screen line or when | |
2677 w_leftcol is non-zero */ | |
2678 | |
2679 /* | |
2680 * w_wrow and w_wcol specify the cursor position in the window. | |
2681 * This is related to positions in the window, not in the display or | |
2682 * buffer, thus w_wrow is relative to w_winrow. | |
2683 */ | |
2684 int w_wrow, w_wcol; /* cursor position in window */ | |
2685 | |
2686 linenr_T w_botline; /* number of the line below the bottom of | |
9201
692e156c7023
commit https://github.com/vim/vim/commit/2f095a4bc4d786e0ac834f48dd18a94fe2d140e3
Christian Brabandt <cb@256bit.org>
parents:
9151
diff
changeset
|
2687 the window */ |
7 | 2688 int w_empty_rows; /* number of ~ rows in window */ |
2689 #ifdef FEAT_DIFF | |
2690 int w_filler_rows; /* number of filler rows at the end of the | |
2691 window */ | |
2692 #endif | |
2693 | |
2694 /* | |
2695 * Info about the lines currently in the window is remembered to avoid | |
2696 * recomputing it every time. The allocated size of w_lines[] is Rows. | |
2697 * Only the w_lines_valid entries are actually valid. | |
2698 * When the display is up-to-date w_lines[0].wl_lnum is equal to w_topline | |
2699 * and w_lines[w_lines_valid - 1].wl_lnum is equal to w_botline. | |
2700 * Between changing text and updating the display w_lines[] represents | |
2701 * what is currently displayed. wl_valid is reset to indicated this. | |
2702 * This is used for efficient redrawing. | |
2703 */ | |
2704 int w_lines_valid; /* number of valid entries */ | |
2705 wline_T *w_lines; | |
2706 | |
2707 #ifdef FEAT_FOLDING | |
2708 garray_T w_folds; /* array of nested folds */ | |
2709 char w_fold_manual; /* when TRUE: some folds are opened/closed | |
2710 manually */ | |
2711 char w_foldinvalid; /* when TRUE: folding needs to be | |
2712 recomputed */ | |
2713 #endif | |
13 | 2714 #ifdef FEAT_LINEBREAK |
2178
c6f1aa1e9f32
Add 'relativenumber' patch from Markus Heidelberg.
Bram Moolenaar <bram@vim.org>
parents:
2171
diff
changeset
|
2715 int w_nrwidth; /* width of 'number' and 'relativenumber' |
c6f1aa1e9f32
Add 'relativenumber' patch from Markus Heidelberg.
Bram Moolenaar <bram@vim.org>
parents:
2171
diff
changeset
|
2716 column being used */ |
13 | 2717 #endif |
7 | 2718 |
2719 /* | |
2720 * === end of cached values === | |
2721 */ | |
2722 | |
2723 int w_redr_type; /* type of redraw to be performed on win */ | |
2724 int w_upd_rows; /* number of window lines to update when | |
2725 w_redr_type is REDRAW_TOP */ | |
2726 linenr_T w_redraw_top; /* when != 0: first line needing redraw */ | |
2727 linenr_T w_redraw_bot; /* when != 0: last line needing redraw */ | |
2728 #ifdef FEAT_WINDOWS | |
2729 int w_redr_status; /* if TRUE status line must be redrawn */ | |
2730 #endif | |
2731 | |
2732 #ifdef FEAT_CMDL_INFO | |
2733 /* remember what is shown in the ruler for this window (if 'ruler' set) */ | |
2734 pos_T w_ru_cursor; /* cursor position shown in ruler */ | |
2735 colnr_T w_ru_virtcol; /* virtcol shown in ruler */ | |
2736 linenr_T w_ru_topline; /* topline shown in ruler */ | |
2737 linenr_T w_ru_line_count; /* line count used for ruler */ | |
2738 # ifdef FEAT_DIFF | |
2739 int w_ru_topfill; /* topfill shown in ruler */ | |
2740 # endif | |
2741 char w_ru_empty; /* TRUE if ruler shows 0-1 (empty line) */ | |
2742 #endif | |
2743 | |
2744 int w_alt_fnum; /* alternate file (for # and CTRL-^) */ | |
2745 | |
2746 #ifdef FEAT_WINDOWS | |
2747 alist_T *w_alist; /* pointer to arglist for this window */ | |
2748 #endif | |
2749 int w_arg_idx; /* current index in argument list (can be | |
2750 out of range!) */ | |
2751 int w_arg_idx_invalid; /* editing another file than w_arg_idx */ | |
2752 | |
2753 char_u *w_localdir; /* absolute path of local directory or | |
2754 NULL */ | |
2755 /* | |
2756 * Options local to a window. | |
2757 * They are local because they influence the layout of the window or | |
2758 * depend on the window layout. | |
2759 * There are two values: w_onebuf_opt is local to the buffer currently in | |
2760 * this window, w_allbuf_opt is for all buffers in this window. | |
2761 */ | |
2762 winopt_T w_onebuf_opt; | |
2763 winopt_T w_allbuf_opt; | |
2764 | |
681 | 2765 /* A few options have local flags for P_INSECURE. */ |
2766 #ifdef FEAT_STL_OPT | |
2767 long_u w_p_stl_flags; /* flags for 'statusline' */ | |
2768 #endif | |
2769 #ifdef FEAT_EVAL | |
2770 long_u w_p_fde_flags; /* flags for 'foldexpr' */ | |
2771 long_u w_p_fdt_flags; /* flags for 'foldtext' */ | |
2772 #endif | |
2314
233eb4412f5d
Added 'colorcolumn' option. Partly by Gregor Uhlenheuer.
Bram Moolenaar <bram@vim.org>
parents:
2281
diff
changeset
|
2773 #ifdef FEAT_SYN_HL |
233eb4412f5d
Added 'colorcolumn' option. Partly by Gregor Uhlenheuer.
Bram Moolenaar <bram@vim.org>
parents:
2281
diff
changeset
|
2774 int *w_p_cc_cols; /* array of columns to highlight or NULL */ |
233eb4412f5d
Added 'colorcolumn' option. Partly by Gregor Uhlenheuer.
Bram Moolenaar <bram@vim.org>
parents:
2281
diff
changeset
|
2775 #endif |
5995 | 2776 #ifdef FEAT_LINEBREAK |
2777 int w_p_brimin; /* minimum width for breakindent */ | |
2778 int w_p_brishift; /* additional shift for breakindent */ | |
2779 int w_p_brisbr; /* sbr in 'briopt' */ | |
2780 #endif | |
681 | 2781 |
7 | 2782 /* transform a pointer to a "onebuf" option into a "allbuf" option */ |
2783 #define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T)) | |
2784 | |
2785 #ifdef FEAT_SCROLLBIND | |
2786 long w_scbind_pos; | |
2787 #endif | |
2788 | |
2789 #ifdef FEAT_EVAL | |
133 | 2790 dictitem_T w_winvar; /* variable for "w:" Dictionary */ |
4287 | 2791 dict_T *w_vars; /* internal variables, local to window */ |
7 | 2792 #endif |
2793 | |
2794 #if defined(FEAT_RIGHTLEFT) && defined(FEAT_FKMAP) | |
2795 int w_farsi; /* for the window dependent Farsi functions */ | |
2796 #endif | |
2797 | |
2798 /* | |
2799 * The w_prev_pcmark field is used to check whether we really did jump to | |
2800 * a new line after setting the w_pcmark. If not, then we revert to | |
2801 * using the previous w_pcmark. | |
2802 */ | |
2803 pos_T w_pcmark; /* previous context mark */ | |
2804 pos_T w_prev_pcmark; /* previous w_pcmark */ | |
2805 | |
2806 #ifdef FEAT_JUMPLIST | |
2807 /* | |
2808 * the jumplist contains old cursor positions | |
2809 */ | |
2810 xfmark_T w_jumplist[JUMPLISTSIZE]; | |
2811 int w_jumplistlen; /* number of active entries */ | |
2812 int w_jumplistidx; /* current position */ | |
2813 | |
2814 int w_changelistidx; /* current position in b_changelist */ | |
2815 #endif | |
2816 | |
2817 #ifdef FEAT_SEARCH_EXTRA | |
1326 | 2818 matchitem_T *w_match_head; /* head of match list */ |
2819 int w_next_match_id; /* next match ID */ | |
7 | 2820 #endif |
2821 | |
2822 /* | |
2823 * the tagstack grows from 0 upwards: | |
2824 * entry 0: older | |
2825 * entry 1: newer | |
2826 * entry 2: newest | |
2827 */ | |
2828 taggy_T w_tagstack[TAGSTACKSIZE]; /* the tag stack */ | |
1216 | 2829 int w_tagstackidx; /* idx just below active entry */ |
7 | 2830 int w_tagstacklen; /* number of tags on stack */ |
2831 | |
2832 /* | |
2833 * w_fraction is the fractional row of the cursor within the window, from | |
2834 * 0 at the top row to FRACTION_MULT at the last row. | |
2835 * w_prev_fraction_row was the actual cursor row when w_fraction was last | |
2836 * calculated. | |
2837 */ | |
2838 int w_fraction; | |
2839 int w_prev_fraction_row; | |
2840 | |
2841 #ifdef FEAT_GUI | |
2842 scrollbar_T w_scrollbars[2]; /* vert. Scrollbars for this window */ | |
2843 #endif | |
13 | 2844 #ifdef FEAT_LINEBREAK |
2845 linenr_T w_nrwidth_line_count; /* line count when ml_nrwidth_width | |
2846 * was computed. */ | |
6679 | 2847 long w_nuw_cached; /* 'numberwidth' option cached */ |
13 | 2848 int w_nrwidth_width; /* nr of chars to print line count. */ |
2849 #endif | |
7 | 2850 |
644 | 2851 #ifdef FEAT_QUICKFIX |
2852 qf_info_T *w_llist; /* Location list for this window */ | |
2853 /* | |
2854 * Location list reference used in the location list window. | |
2855 * In a non-location list window, w_llist_ref is NULL. | |
2856 */ | |
2857 qf_info_T *w_llist_ref; | |
2858 #endif | |
2859 | |
14 | 2860 |
2861 #ifdef FEAT_MZSCHEME | |
502 | 2862 void *w_mzscheme_ref; /* The MzScheme value for this window */ |
14 | 2863 #endif |
2864 | |
7 | 2865 #ifdef FEAT_PERL |
502 | 2866 void *w_perl_private; |
7 | 2867 #endif |
2868 | |
2869 #ifdef FEAT_PYTHON | |
502 | 2870 void *w_python_ref; /* The Python value for this window */ |
7 | 2871 #endif |
2872 | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2873 #ifdef FEAT_PYTHON3 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2874 void *w_python3_ref; /* The Python value for this window */ |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2875 #endif |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2314
diff
changeset
|
2876 |
7 | 2877 #ifdef FEAT_TCL |
502 | 2878 void *w_tcl_ref; |
7 | 2879 #endif |
2880 | |
2881 #ifdef FEAT_RUBY | |
502 | 2882 void *w_ruby_ref; |
7 | 2883 #endif |
2884 }; | |
2885 | |
2886 /* | |
2887 * Arguments for operators. | |
2888 */ | |
502 | 2889 typedef struct oparg_S |
7 | 2890 { |
2891 int op_type; /* current pending operator type */ | |
2892 int regname; /* register to use for the operator */ | |
2893 int motion_type; /* type of the current cursor motion */ | |
2894 int motion_force; /* force motion type: 'v', 'V' or CTRL-V */ | |
2895 int use_reg_one; /* TRUE if delete uses reg 1 even when not | |
2896 linewise */ | |
2897 int inclusive; /* TRUE if char motion is inclusive (only | |
2898 valid when motion_type is MCHAR */ | |
2899 int end_adjusted; /* backuped b_op_end one char (only used by | |
2900 do_format()) */ | |
2901 pos_T start; /* start of the operator */ | |
2902 pos_T end; /* end of the operator */ | |
2903 pos_T cursor_start; /* cursor position before motion for "gw" */ | |
2904 | |
2905 long line_count; /* number of lines from op_start to op_end | |
2906 (inclusive) */ | |
2907 int empty; /* op_start and op_end the same (only used by | |
2908 do_change()) */ | |
2909 int is_VIsual; /* operator on Visual area */ | |
2910 int block_mode; /* current operator is Visual block mode */ | |
2911 colnr_T start_vcol; /* start col for block mode operator */ | |
2912 colnr_T end_vcol; /* end col for block mode operator */ | |
1692 | 2913 #ifdef FEAT_AUTOCMD |
2914 long prev_opcount; /* ca.opcount saved for K_CURSORHOLD */ | |
2915 long prev_count0; /* ca.count0 saved for K_CURSORHOLD */ | |
2916 #endif | |
7 | 2917 } oparg_T; |
2918 | |
2919 /* | |
2920 * Arguments for Normal mode commands. | |
2921 */ | |
502 | 2922 typedef struct cmdarg_S |
7 | 2923 { |
2924 oparg_T *oap; /* Operator arguments */ | |
2925 int prechar; /* prefix character (optional, always 'g') */ | |
2926 int cmdchar; /* command character */ | |
2927 int nchar; /* next command character (optional) */ | |
2928 #ifdef FEAT_MBYTE | |
2929 int ncharC1; /* first composing character (optional) */ | |
2930 int ncharC2; /* second composing character (optional) */ | |
2931 #endif | |
2932 int extra_char; /* yet another character (optional) */ | |
2933 long opcount; /* count before an operator */ | |
2934 long count0; /* count before command, default 0 */ | |
2935 long count1; /* count before command, default 1 */ | |
2936 int arg; /* extra argument from nv_cmds[] */ | |
2937 int retval; /* return: CA_* values */ | |
2938 char_u *searchbuf; /* return: pointer to search pattern or NULL */ | |
2939 } cmdarg_T; | |
2940 | |
2941 /* values for retval: */ | |
2942 #define CA_COMMAND_BUSY 1 /* skip restarting edit() once */ | |
2943 #define CA_NO_ADJ_OP_END 2 /* don't adjust operator end */ | |
2944 | |
2945 #ifdef CURSOR_SHAPE | |
2946 /* | |
2947 * struct to store values from 'guicursor' and 'mouseshape' | |
2948 */ | |
2949 /* Indexes in shape_table[] */ | |
2950 #define SHAPE_IDX_N 0 /* Normal mode */ | |
2951 #define SHAPE_IDX_V 1 /* Visual mode */ | |
2952 #define SHAPE_IDX_I 2 /* Insert mode */ | |
2953 #define SHAPE_IDX_R 3 /* Replace mode */ | |
2954 #define SHAPE_IDX_C 4 /* Command line Normal mode */ | |
2955 #define SHAPE_IDX_CI 5 /* Command line Insert mode */ | |
2956 #define SHAPE_IDX_CR 6 /* Command line Replace mode */ | |
2957 #define SHAPE_IDX_O 7 /* Operator-pending mode */ | |
2171 | 2958 #define SHAPE_IDX_VE 8 /* Visual mode with 'selection' exclusive */ |
7 | 2959 #define SHAPE_IDX_CLINE 9 /* On command line */ |
2960 #define SHAPE_IDX_STATUS 10 /* A status line */ | |
2961 #define SHAPE_IDX_SDRAG 11 /* dragging a status line */ | |
2962 #define SHAPE_IDX_VSEP 12 /* A vertical separator line */ | |
2963 #define SHAPE_IDX_VDRAG 13 /* dragging a vertical separator line */ | |
2964 #define SHAPE_IDX_MORE 14 /* Hit-return or More */ | |
2965 #define SHAPE_IDX_MOREL 15 /* Hit-return or More in last line */ | |
2966 #define SHAPE_IDX_SM 16 /* showing matching paren */ | |
2967 #define SHAPE_IDX_COUNT 17 | |
2968 | |
2969 #define SHAPE_BLOCK 0 /* block cursor */ | |
2970 #define SHAPE_HOR 1 /* horizontal bar cursor */ | |
2971 #define SHAPE_VER 2 /* vertical bar cursor */ | |
2972 | |
2973 #define MSHAPE_NUMBERED 1000 /* offset for shapes identified by number */ | |
2974 #define MSHAPE_HIDE 1 /* hide mouse pointer */ | |
2975 | |
2976 #define SHAPE_MOUSE 1 /* used for mouse pointer shape */ | |
2977 #define SHAPE_CURSOR 2 /* used for text cursor shape */ | |
2978 | |
2979 typedef struct cursor_entry | |
2980 { | |
2981 int shape; /* one of the SHAPE_ defines */ | |
2982 int mshape; /* one of the MSHAPE defines */ | |
2983 int percentage; /* percentage of cell for bar */ | |
2984 long blinkwait; /* blinking, wait time before blinking starts */ | |
2985 long blinkon; /* blinking, on time */ | |
2986 long blinkoff; /* blinking, off time */ | |
2987 int id; /* highlight group ID */ | |
2988 int id_lm; /* highlight group ID for :lmap mode */ | |
2989 char *name; /* mode name (fixed) */ | |
2990 char used_for; /* SHAPE_MOUSE and/or SHAPE_CURSOR */ | |
2991 } cursorentry_T; | |
2992 #endif /* CURSOR_SHAPE */ | |
2993 | |
2994 #ifdef FEAT_MENU | |
2995 | |
2996 /* Indices into vimmenu_T->strings[] and vimmenu_T->noremap[] for each mode */ | |
2997 #define MENU_INDEX_INVALID -1 | |
2998 #define MENU_INDEX_NORMAL 0 | |
2999 #define MENU_INDEX_VISUAL 1 | |
790 | 3000 #define MENU_INDEX_SELECT 2 |
3001 #define MENU_INDEX_OP_PENDING 3 | |
3002 #define MENU_INDEX_INSERT 4 | |
3003 #define MENU_INDEX_CMDLINE 5 | |
3004 #define MENU_INDEX_TIP 6 | |
3005 #define MENU_MODES 7 | |
7 | 3006 |
3007 /* Menu modes */ | |
3008 #define MENU_NORMAL_MODE (1 << MENU_INDEX_NORMAL) | |
3009 #define MENU_VISUAL_MODE (1 << MENU_INDEX_VISUAL) | |
790 | 3010 #define MENU_SELECT_MODE (1 << MENU_INDEX_SELECT) |
7 | 3011 #define MENU_OP_PENDING_MODE (1 << MENU_INDEX_OP_PENDING) |
3012 #define MENU_INSERT_MODE (1 << MENU_INDEX_INSERT) | |
3013 #define MENU_CMDLINE_MODE (1 << MENU_INDEX_CMDLINE) | |
3014 #define MENU_TIP_MODE (1 << MENU_INDEX_TIP) | |
3015 #define MENU_ALL_MODES ((1 << MENU_INDEX_TIP) - 1) | |
3016 /*note MENU_INDEX_TIP is not a 'real' mode*/ | |
3017 | |
3018 /* Start a menu name with this to not include it on the main menu bar */ | |
3019 #define MNU_HIDDEN_CHAR ']' | |
3020 | |
3021 typedef struct VimMenu vimmenu_T; | |
3022 | |
3023 struct VimMenu | |
3024 { | |
3025 int modes; /* Which modes is this menu visible for? */ | |
3026 int enabled; /* for which modes the menu is enabled */ | |
2150
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3027 char_u *name; /* Name of menu, possibly translated */ |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3028 char_u *dname; /* Displayed Name ("name" without '&') */ |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3029 #ifdef FEAT_MULTI_LANG |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3030 char_u *en_name; /* "name" untranslated, NULL when "name" |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3031 * was not translated */ |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3032 char_u *en_dname; /* "dname" untranslated, NULL when "dname" |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3033 * was not translated */ |
4269a0673478
updated for version 7.2.432
Bram Moolenaar <bram@zimbu.org>
parents:
1965
diff
changeset
|
3034 #endif |
7 | 3035 int mnemonic; /* mnemonic key (after '&') */ |
3036 char_u *actext; /* accelerator text (after TAB) */ | |
3037 int priority; /* Menu order priority */ | |
3038 #ifdef FEAT_GUI | |
7807
1a5d34492798
commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents:
7712
diff
changeset
|
3039 void (*cb)(vimmenu_T *); /* Call-back routine */ |
7 | 3040 #endif |
3041 #ifdef FEAT_TOOLBAR | |
3042 char_u *iconfile; /* name of file for icon or NULL */ | |
3043 int iconidx; /* icon index (-1 if not set) */ | |
3044 int icon_builtin; /* icon names is BuiltIn{nr} */ | |
3045 #endif | |
3046 char_u *strings[MENU_MODES]; /* Mapped string for each mode */ | |
3047 int noremap[MENU_MODES]; /* A REMAP_ flag for each mode */ | |
3048 char silent[MENU_MODES]; /* A silent flag for each mode */ | |
3049 vimmenu_T *children; /* Children of sub-menu */ | |
3050 vimmenu_T *parent; /* Parent of menu */ | |
3051 vimmenu_T *next; /* Next item in menu */ | |
3052 #ifdef FEAT_GUI_X11 | |
3053 Widget id; /* Manage this to enable item */ | |
3054 Widget submenu_id; /* If this is submenu, add children here */ | |
3055 #endif | |
3056 #ifdef FEAT_GUI_GTK | |
3057 GtkWidget *id; /* Manage this to enable item */ | |
3058 GtkWidget *submenu_id; /* If this is submenu, add children here */ | |
8218
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
8212
diff
changeset
|
3059 # if defined(GTK_CHECK_VERSION) && !GTK_CHECK_VERSION(3,4,0) |
7 | 3060 GtkWidget *tearoff_handle; |
8218
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
8212
diff
changeset
|
3061 # endif |
7 | 3062 GtkWidget *label; /* Used by "set wak=" code. */ |
3063 #endif | |
3064 #ifdef FEAT_GUI_MOTIF | |
3065 int sensitive; /* turn button on/off */ | |
50 | 3066 char **xpm; /* pixmap data */ |
161 | 3067 char *xpm_fname; /* file with pixmap data */ |
7 | 3068 #endif |
50 | 3069 #ifdef FEAT_GUI_ATHENA |
7 | 3070 Pixmap image; /* Toolbar image */ |
3071 #endif | |
3072 #ifdef FEAT_BEVAL_TIP | |
3073 BalloonEval *tip; /* tooltip for this menu item */ | |
3074 #endif | |
3075 #ifdef FEAT_GUI_W32 | |
3076 UINT id; /* Id of menu item */ | |
3077 HMENU submenu_id; /* If this is submenu, add children here */ | |
3078 HWND tearoff_handle; /* hWnd of tearoff if created */ | |
3079 #endif | |
3080 #ifdef FEAT_GUI_MAC | |
3081 /* MenuHandle id; */ | |
3082 /* short index; */ /* the item index within the father menu */ | |
3083 short menu_id; /* the menu id to which this item belong */ | |
3084 short submenu_id; /* the menu id of the children (could be | |
2171 | 3085 get through some tricks) */ |
7 | 3086 MenuHandle menu_handle; |
3087 MenuHandle submenu_handle; | |
3088 #endif | |
3089 #ifdef FEAT_GUI_PHOTON | |
3090 PtWidget_t *id; | |
3091 PtWidget_t *submenu_id; | |
3092 #endif | |
3093 }; | |
3094 #else | |
3095 /* For generating prototypes when FEAT_MENU isn't defined. */ | |
3096 typedef int vimmenu_T; | |
3097 | |
3098 #endif /* FEAT_MENU */ | |
3099 | |
3100 /* | |
3101 * Struct to save values in before executing autocommands for a buffer that is | |
934 | 3102 * not the current buffer. Without FEAT_AUTOCMD only "curbuf" is remembered. |
7 | 3103 */ |
3104 typedef struct | |
3105 { | |
1906 | 3106 buf_T *save_curbuf; /* saved curbuf */ |
934 | 3107 #ifdef FEAT_AUTOCMD |
1944 | 3108 int use_aucmd_win; /* using aucmd_win */ |
1906 | 3109 win_T *save_curwin; /* saved curwin */ |
3110 win_T *new_curwin; /* new curwin */ | |
9487
69ed2c9d34a6
commit https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
Christian Brabandt <cb@256bit.org>
parents:
9475
diff
changeset
|
3111 bufref_T new_curbuf; /* new curbuf */ |
1944 | 3112 char_u *globaldir; /* saved value of globaldir */ |
7 | 3113 #endif |
3114 } aco_save_T; | |
3115 | |
3116 /* | |
3117 * Generic option table item, only used for printer at the moment. | |
3118 */ | |
3119 typedef struct | |
3120 { | |
3121 const char *name; | |
3122 int hasnum; | |
3123 long number; | |
3124 char_u *string; /* points into option string */ | |
3125 int strlen; | |
3126 int present; | |
3127 } option_table_T; | |
3128 | |
3129 /* | |
3130 * Structure to hold printing color and font attributes. | |
3131 */ | |
3132 typedef struct | |
3133 { | |
3134 long_u fg_color; | |
3135 long_u bg_color; | |
3136 int bold; | |
3137 int italic; | |
3138 int underline; | |
205 | 3139 int undercurl; |
7 | 3140 } prt_text_attr_T; |
3141 | |
3142 /* | |
3143 * Structure passed back to the generic printer code. | |
3144 */ | |
3145 typedef struct | |
3146 { | |
3147 int n_collated_copies; | |
3148 int n_uncollated_copies; | |
3149 int duplex; | |
3150 int chars_per_line; | |
3151 int lines_per_page; | |
3152 int has_color; | |
3153 prt_text_attr_T number; | |
3154 #ifdef FEAT_SYN_HL | |
3155 int modec; | |
3156 int do_syntax; | |
3157 #endif | |
3158 int user_abort; | |
3159 char_u *jobname; | |
3160 #ifdef FEAT_POSTSCRIPT | |
3161 char_u *outfile; | |
3162 char_u *arguments; | |
3163 #endif | |
3164 } prt_settings_T; | |
3165 | |
3166 #define PRINT_NUMBER_WIDTH 8 | |
659 | 3167 |
3168 /* | |
3169 * Used for popup menu items. | |
3170 */ | |
3171 typedef struct | |
3172 { | |
3173 char_u *pum_text; /* main menu text */ | |
731 | 3174 char_u *pum_kind; /* extra kind text (may be truncated) */ |
659 | 3175 char_u *pum_extra; /* extra menu text (may be truncated) */ |
3176 char_u *pum_info; /* extra info */ | |
3177 } pumitem_T; | |
692 | 3178 |
3179 /* | |
3180 * Structure used for get_tagfname(). | |
3181 */ | |
3182 typedef struct | |
3183 { | |
3184 char_u *tn_tags; /* value of 'tags' when starting */ | |
3185 char_u *tn_np; /* current position in tn_tags */ | |
3186 int tn_did_filefind_init; | |
3187 int tn_hf_idx; | |
3188 void *tn_search_ctx; | |
3189 } tagname_T; | |
3190 | |
786 | 3191 /* |
3192 * Array indexes used for cptext argument of ins_compl_add(). | |
3193 */ | |
3194 #define CPT_ABBR 0 /* "abbr" */ | |
3195 #define CPT_MENU 1 /* "menu" */ | |
3196 #define CPT_KIND 2 /* "kind" */ | |
3197 #define CPT_INFO 3 /* "info" */ | |
3198 #define CPT_COUNT 4 /* Number of entries */ | |
2214
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3199 |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3200 typedef struct { |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3201 UINT32_T total[2]; |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3202 UINT32_T state[8]; |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3203 char_u buffer[64]; |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2184
diff
changeset
|
3204 } context_sha256_T; |
7712
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3205 |
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3206 /* |
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3207 * Structure used for reading in json_decode(). |
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3208 */ |
7883
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3209 struct js_reader |
7712
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3210 { |
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3211 char_u *js_buf; /* text to be decoded */ |
7883
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3212 char_u *js_end; /* NUL in js_buf */ |
7712
bce3b5ddb393
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents:
7687
diff
changeset
|
3213 int js_used; /* bytes used from js_buf */ |
7883
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3214 int (*js_fill)(struct js_reader *); |
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3215 /* function to fill the buffer or NULL; |
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3216 * return TRUE when the buffer was filled */ |
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3217 void *js_cookie; /* can be used by js_fill */ |
8755
7038ec89d1fd
commit https://github.com/vim/vim/commit/46c00a6565b8f1f4b7b1041d03eaceaf6ffc4aee
Christian Brabandt <cb@256bit.org>
parents:
8718
diff
changeset
|
3218 int js_cookie_arg; /* can be used by js_fill */ |
7883
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3219 }; |
98a96e0ca73b
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Christian Brabandt <cb@256bit.org>
parents:
7868
diff
changeset
|
3220 typedef struct js_reader js_read_T; |
8577
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3221 |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3222 typedef struct timer_S timer_T; |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3223 struct timer_S |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3224 { |
10122
3db463d4df25
commit https://github.com/vim/vim/commit/75537a93e985ef32e6c267b06ce93629855dd983
Christian Brabandt <cb@256bit.org>
parents:
10106
diff
changeset
|
3225 long tr_id; |
8577
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3226 #ifdef FEAT_TIMERS |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3227 timer_T *tr_next; |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3228 timer_T *tr_prev; |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3229 proftime_T tr_due; /* when the callback is to be invoked */ |
10122
3db463d4df25
commit https://github.com/vim/vim/commit/75537a93e985ef32e6c267b06ce93629855dd983
Christian Brabandt <cb@256bit.org>
parents:
10106
diff
changeset
|
3230 char tr_firing; /* when TRUE callback is being called */ |
3db463d4df25
commit https://github.com/vim/vim/commit/75537a93e985ef32e6c267b06ce93629855dd983
Christian Brabandt <cb@256bit.org>
parents:
10106
diff
changeset
|
3231 char tr_paused; /* when TRUE callback is not invoked */ |
8577
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3232 int tr_repeat; /* number of times to repeat, -1 forever */ |
9802
4cb5ab124239
commit https://github.com/vim/vim/commit/a8e691d44937fd9d72dcbad2b8c673682277f13d
Christian Brabandt <cb@256bit.org>
parents:
9733
diff
changeset
|
3233 long tr_interval; /* msec */ |
8577
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3234 char_u *tr_callback; /* allocated */ |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3235 partial_T *tr_partial; |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3236 #endif |
63dc856bd13d
commit https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7
Christian Brabandt <cb@256bit.org>
parents:
8540
diff
changeset
|
3237 }; |
9542
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3238 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3239 /* Maximum number of commands from + or -c arguments. */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3240 #define MAX_ARG_CMDS 10 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3241 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3242 /* values for "window_layout" */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3243 #define WIN_HOR 1 /* "-o" horizontally split windows */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3244 #define WIN_VER 2 /* "-O" vertically split windows */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3245 #define WIN_TABS 3 /* "-p" windows on tab pages */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3246 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3247 /* Struct for various parameters passed between main() and other functions. */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3248 typedef struct |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3249 { |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3250 int argc; |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3251 char **argv; |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3252 |
9802
4cb5ab124239
commit https://github.com/vim/vim/commit/a8e691d44937fd9d72dcbad2b8c673682277f13d
Christian Brabandt <cb@256bit.org>
parents:
9733
diff
changeset
|
3253 char_u *fname; /* first file to edit */ |
4cb5ab124239
commit https://github.com/vim/vim/commit/a8e691d44937fd9d72dcbad2b8c673682277f13d
Christian Brabandt <cb@256bit.org>
parents:
9733
diff
changeset
|
3254 |
9542
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3255 int evim_mode; /* started as "evim" */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3256 char_u *use_vimrc; /* vimrc from -u argument */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3257 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3258 int n_commands; /* no. of commands from + or -c */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3259 char_u *commands[MAX_ARG_CMDS]; /* commands from + or -c arg. */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3260 char_u cmds_tofree[MAX_ARG_CMDS]; /* commands that need free() */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3261 int n_pre_commands; /* no. of commands from --cmd */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3262 char_u *pre_commands[MAX_ARG_CMDS]; /* commands from --cmd argument */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3263 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3264 int edit_type; /* type of editing to do */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3265 char_u *tagname; /* tag from -t argument */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3266 #ifdef FEAT_QUICKFIX |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3267 char_u *use_ef; /* 'errorfile' from -q argument */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3268 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3269 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3270 int want_full_screen; |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3271 int not_a_term; /* no warning for missing term? */ |
10404
65e0537a4560
commit https://github.com/vim/vim/commit/2cab0e191055a8145ccd46cd52869fbb9798b971
Christian Brabandt <cb@256bit.org>
parents:
10386
diff
changeset
|
3272 int tty_fail; /* exit if not a tty */ |
9542
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3273 char_u *term; /* specified terminal name */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3274 #ifdef FEAT_CRYPT |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3275 int ask_for_key; /* -x argument */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3276 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3277 int no_swap_file; /* "-n" argument used */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3278 #ifdef FEAT_EVAL |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3279 int use_debug_break_level; |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3280 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3281 #ifdef FEAT_WINDOWS |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3282 int window_count; /* number of windows to use */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3283 int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3284 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3285 |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3286 #ifdef FEAT_CLIENTSERVER |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3287 int serverArg; /* TRUE when argument for a server */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3288 char_u *serverName_arg; /* cmdline arg for server name */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3289 char_u *serverStr; /* remote server command */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3290 char_u *serverStrEnc; /* encoding of serverStr */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3291 char_u *servername; /* allocated name for our server */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3292 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3293 #if !defined(UNIX) |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3294 # define EXPAND_FILENAMES |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3295 int literal; /* don't expand file names */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3296 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3297 #ifdef MSWIN |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3298 int full_path; /* file name argument was full path */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3299 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3300 #ifdef FEAT_DIFF |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3301 int diff_mode; /* start with 'diff' set */ |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3302 #endif |
00ee8d8c2e0c
commit https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f
Christian Brabandt <cb@256bit.org>
parents:
9511
diff
changeset
|
3303 } mparm_T; |
9562
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3304 |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3305 /* |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3306 * Structure returned by get_lval() and used by set_var_lval(). |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3307 * For a plain name: |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3308 * "name" points to the variable name. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3309 * "exp_name" is NULL. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3310 * "tv" is NULL |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3311 * For a magic braces name: |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3312 * "name" points to the expanded variable name. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3313 * "exp_name" is non-NULL, to be freed later. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3314 * "tv" is NULL |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3315 * For an index in a list: |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3316 * "name" points to the (expanded) variable name. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3317 * "exp_name" NULL or non-NULL, to be freed later. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3318 * "tv" points to the (first) list item value |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3319 * "li" points to the (first) list item |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3320 * "range", "n1", "n2" and "empty2" indicate what items are used. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3321 * For an existing Dict item: |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3322 * "name" points to the (expanded) variable name. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3323 * "exp_name" NULL or non-NULL, to be freed later. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3324 * "tv" points to the dict item value |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3325 * "newkey" is NULL |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3326 * For a non-existing Dict item: |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3327 * "name" points to the (expanded) variable name. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3328 * "exp_name" NULL or non-NULL, to be freed later. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3329 * "tv" points to the Dictionary typval_T |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3330 * "newkey" is the key for the new item. |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3331 */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3332 typedef struct lval_S |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3333 { |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3334 char_u *ll_name; /* start of variable name (can be NULL) */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3335 char_u *ll_exp_name; /* NULL or expanded name in allocated memory. */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3336 typval_T *ll_tv; /* Typeval of item being used. If "newkey" |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3337 isn't NULL it's the Dict to which to add |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3338 the item. */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3339 listitem_T *ll_li; /* The list item or NULL. */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3340 list_T *ll_list; /* The list or NULL. */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3341 int ll_range; /* TRUE when a [i:j] range was used */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3342 long ll_n1; /* First index for list */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3343 long ll_n2; /* Second index for list range */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3344 int ll_empty2; /* Second index is empty: [i:] */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3345 dict_T *ll_dict; /* The Dictionary or NULL */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3346 dictitem_T *ll_di; /* The dictitem or NULL */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3347 char_u *ll_newkey; /* New key for Dict in alloc. mem or NULL. */ |
86af4a48c00a
commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents:
9542
diff
changeset
|
3348 } lval_T; |