Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 1 | " Test for 'iminsert' |
| 2 | |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 3 | source view_util.vim |
Bram Moolenaar | e2a3f36 | 2019-12-07 21:40:48 +0100 | [diff] [blame] | 4 | source check.vim |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 5 | import './vim9.vim' as v9 |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 6 | |
| 7 | let s:imactivatefunc_called = 0 |
| 8 | let s:imstatusfunc_called = 0 |
Bram Moolenaar | a3a1246 | 2019-09-07 15:08:38 +0200 | [diff] [blame] | 9 | let s:imstatus_active = 0 |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 10 | |
| 11 | func IM_activatefunc(active) |
| 12 | let s:imactivatefunc_called = 1 |
Bram Moolenaar | 845e0ee | 2020-06-20 16:05:32 +0200 | [diff] [blame] | 13 | let s:imstatus_active = a:active |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 14 | endfunc |
| 15 | |
| 16 | func IM_statusfunc() |
| 17 | let s:imstatusfunc_called = 1 |
Bram Moolenaar | a3a1246 | 2019-09-07 15:08:38 +0200 | [diff] [blame] | 18 | return s:imstatus_active |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 19 | endfunc |
| 20 | |
| 21 | func Test_iminsert2() |
Bram Moolenaar | a3a1246 | 2019-09-07 15:08:38 +0200 | [diff] [blame] | 22 | let s:imactivatefunc_called = 0 |
| 23 | let s:imstatusfunc_called = 0 |
| 24 | |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 25 | set imactivatefunc=IM_activatefunc |
| 26 | set imstatusfunc=IM_statusfunc |
| 27 | set iminsert=2 |
| 28 | normal! i |
| 29 | set iminsert=0 |
| 30 | set imactivatefunc= |
| 31 | set imstatusfunc= |
Bram Moolenaar | 2877d33 | 2017-11-26 14:56:16 +0100 | [diff] [blame] | 32 | |
Bram Moolenaar | c19fd91 | 2020-07-02 20:59:05 +0200 | [diff] [blame] | 33 | let expected = (has('win32') && has('gui_running')) ? 0 : 1 |
Bram Moolenaar | 2877d33 | 2017-11-26 14:56:16 +0100 | [diff] [blame] | 34 | call assert_equal(expected, s:imactivatefunc_called) |
| 35 | call assert_equal(expected, s:imstatusfunc_called) |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 36 | endfunc |
Bram Moolenaar | a3a1246 | 2019-09-07 15:08:38 +0200 | [diff] [blame] | 37 | |
Bram Moolenaar | e2a3f36 | 2019-12-07 21:40:48 +0100 | [diff] [blame] | 38 | func Test_getimstatus() |
| 39 | if has('win32') |
| 40 | CheckFeature multi_byte_ime |
Bram Moolenaar | be7529e | 2020-08-13 21:05:39 +0200 | [diff] [blame] | 41 | else |
Bram Moolenaar | e2a3f36 | 2019-12-07 21:40:48 +0100 | [diff] [blame] | 42 | CheckFeature xim |
| 43 | endif |
Bram Moolenaar | c19fd91 | 2020-07-02 20:59:05 +0200 | [diff] [blame] | 44 | if has('win32') && has('gui_running') |
Bram Moolenaar | a3a1246 | 2019-09-07 15:08:38 +0200 | [diff] [blame] | 45 | set imactivatefunc= |
| 46 | set imstatusfunc= |
| 47 | else |
| 48 | set imactivatefunc=IM_activatefunc |
| 49 | set imstatusfunc=IM_statusfunc |
| 50 | let s:imstatus_active = 0 |
| 51 | endif |
| 52 | |
| 53 | new |
| 54 | set iminsert=2 |
| 55 | call feedkeys("i\<C-R>=getimstatus()\<CR>\<ESC>", 'nx') |
| 56 | call assert_equal('1', getline(1)) |
| 57 | set iminsert=0 |
| 58 | call feedkeys("o\<C-R>=getimstatus()\<CR>\<ESC>", 'nx') |
| 59 | call assert_equal('0', getline(2)) |
| 60 | bw! |
| 61 | |
| 62 | set imactivatefunc= |
| 63 | set imstatusfunc= |
| 64 | endfunc |
Bram Moolenaar | 0546d7d | 2020-03-01 16:53:09 +0100 | [diff] [blame] | 65 | |
Milly | c7e54ef | 2022-05-26 13:16:25 +0100 | [diff] [blame] | 66 | func Test_imactivatefunc_imstatusfunc_callback_no_breaks_foldopen() |
| 67 | CheckScreendump |
| 68 | |
| 69 | let lines =<< trim END |
| 70 | func IM_activatefunc(active) |
| 71 | endfunc |
| 72 | func IM_statusfunc() |
| 73 | return 0 |
| 74 | endfunc |
| 75 | set imactivatefunc=IM_activatefunc |
| 76 | set imstatusfunc=IM_statusfunc |
| 77 | set foldmethod=marker |
| 78 | set foldopen=search |
| 79 | call setline(1, ['{{{', 'abc', '}}}']) |
| 80 | %foldclose |
| 81 | END |
| 82 | call writefile(lines, 'Xscript') |
| 83 | let buf = RunVimInTerminal('-S Xscript', {}) |
| 84 | call term_wait(buf) |
| 85 | call assert_notequal('abc', term_getline(buf, 2)) |
| 86 | call term_sendkeys(buf, "/abc\n") |
| 87 | call term_wait(buf) |
| 88 | call assert_equal('abc', term_getline(buf, 2)) |
| 89 | |
| 90 | " clean up |
| 91 | call StopVimInTerminal(buf) |
| 92 | call delete('Xscript') |
| 93 | endfunc |
| 94 | |
Bram Moolenaar | 1671f44 | 2020-03-10 07:48:13 +0100 | [diff] [blame] | 95 | " Test for using an lmap in insert mode |
| 96 | func Test_lmap_in_insert_mode() |
| 97 | new |
| 98 | call setline(1, 'abc') |
| 99 | lmap { w |
| 100 | set iminsert=1 |
| 101 | call feedkeys('r{', 'xt') |
| 102 | call assert_equal('wbc', getline(1)) |
| 103 | set iminsert=2 |
| 104 | call feedkeys('$r{', 'xt') |
| 105 | call assert_equal('wb{', getline(1)) |
| 106 | call setline(1, 'vim web') |
| 107 | set iminsert=1 |
| 108 | call feedkeys('0f{', 'xt') |
| 109 | call assert_equal(5, col('.')) |
| 110 | set iminsert& |
| 111 | lunmap { |
| 112 | close! |
| 113 | endfunc |
| 114 | |
Bram Moolenaar | 845e0ee | 2020-06-20 16:05:32 +0200 | [diff] [blame] | 115 | " Test for using CTRL-^ to toggle iminsert in insert mode |
| 116 | func Test_iminsert_toggle() |
| 117 | CheckGui |
| 118 | if has('win32') |
| 119 | CheckFeature multi_byte_ime |
Bram Moolenaar | be7529e | 2020-08-13 21:05:39 +0200 | [diff] [blame] | 120 | else |
Bram Moolenaar | 845e0ee | 2020-06-20 16:05:32 +0200 | [diff] [blame] | 121 | CheckFeature xim |
| 122 | endif |
| 123 | if has('gui_running') && !has('win32') |
Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 124 | throw 'Skipped: works only in Win32 GUI version (for some reason)' |
Bram Moolenaar | 845e0ee | 2020-06-20 16:05:32 +0200 | [diff] [blame] | 125 | endif |
| 126 | new |
| 127 | let save_imdisable = &imdisable |
| 128 | let save_iminsert = &iminsert |
| 129 | set noimdisable |
| 130 | set iminsert=0 |
| 131 | exe "normal i\<C-^>" |
| 132 | call assert_equal(2, &iminsert) |
| 133 | exe "normal i\<C-^>" |
| 134 | call assert_equal(0, &iminsert) |
| 135 | let &iminsert = save_iminsert |
| 136 | let &imdisable = save_imdisable |
| 137 | close! |
| 138 | endfunc |
| 139 | |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 140 | " Test for different ways of setting the 'imactivatefunc' and 'imstatusfunc' |
| 141 | " options |
| 142 | func Test_imactivatefunc_imstatusfunc_callback() |
| 143 | CheckNotMSWindows |
| 144 | func IMactivatefunc1(active) |
| 145 | let g:IMactivatefunc_called += 1 |
| 146 | endfunc |
| 147 | func IMstatusfunc1() |
| 148 | let g:IMstatusfunc_called += 1 |
| 149 | return 1 |
| 150 | endfunc |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 151 | set iminsert=2 |
| 152 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 153 | let lines =<< trim END |
| 154 | LET g:IMactivatefunc_called = 0 |
| 155 | LET g:IMstatusfunc_called = 0 |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 156 | |
Yegappan Lakshmanan | 04ef1fb | 2021-12-12 20:08:05 +0000 | [diff] [blame] | 157 | #" Test for using a function name |
| 158 | LET &imactivatefunc = 'g:IMactivatefunc1' |
| 159 | LET &imstatusfunc = 'g:IMstatusfunc1' |
| 160 | normal! i |
| 161 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 162 | #" Test for using a function() |
| 163 | set imactivatefunc=function('g:IMactivatefunc1') |
| 164 | set imstatusfunc=function('g:IMstatusfunc1') |
| 165 | normal! i |
Yegappan Lakshmanan | 6409553 | 2021-12-06 11:03:55 +0000 | [diff] [blame] | 166 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 167 | #" Using a funcref variable to set 'completefunc' |
| 168 | VAR Fn1 = function('g:IMactivatefunc1') |
| 169 | LET &imactivatefunc = Fn1 |
| 170 | VAR Fn2 = function('g:IMstatusfunc1') |
| 171 | LET &imstatusfunc = Fn2 |
| 172 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 173 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 174 | #" Using a string(funcref variable) to set 'completefunc' |
| 175 | LET &imactivatefunc = string(Fn1) |
| 176 | LET &imstatusfunc = string(Fn2) |
| 177 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 178 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 179 | #" Test for using a funcref() |
| 180 | set imactivatefunc=funcref('g:IMactivatefunc1') |
| 181 | set imstatusfunc=funcref('g:IMstatusfunc1') |
| 182 | normal! i |
Yegappan Lakshmanan | 6409553 | 2021-12-06 11:03:55 +0000 | [diff] [blame] | 183 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 184 | #" Using a funcref variable to set 'imactivatefunc' |
| 185 | LET Fn1 = funcref('g:IMactivatefunc1') |
| 186 | LET &imactivatefunc = Fn1 |
| 187 | LET Fn2 = funcref('g:IMstatusfunc1') |
| 188 | LET &imstatusfunc = Fn2 |
| 189 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 190 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 191 | #" Using a string(funcref variable) to set 'imactivatefunc' |
| 192 | LET &imactivatefunc = string(Fn1) |
| 193 | LET &imstatusfunc = string(Fn2) |
| 194 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 195 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 196 | #" Test for using a lambda function |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 197 | VAR optval = "LSTART a LMIDDLE g:IMactivatefunc1(a) LEND" |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 198 | LET optval = substitute(optval, ' ', '\\ ', 'g') |
| 199 | exe "set imactivatefunc=" .. optval |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 200 | LET optval = "LSTART LMIDDLE g:IMstatusfunc1() LEND" |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 201 | LET optval = substitute(optval, ' ', '\\ ', 'g') |
| 202 | exe "set imstatusfunc=" .. optval |
| 203 | normal! i |
Yegappan Lakshmanan | 6409553 | 2021-12-06 11:03:55 +0000 | [diff] [blame] | 204 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 205 | #" Set 'imactivatefunc' and 'imstatusfunc' to a lambda expression |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 206 | LET &imactivatefunc = LSTART a LMIDDLE g:IMactivatefunc1(a) LEND |
| 207 | LET &imstatusfunc = LSTART LMIDDLE g:IMstatusfunc1() LEND |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 208 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 209 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 210 | #" Set 'imactivatefunc' and 'imstatusfunc' to a string(lambda expression) |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 211 | LET &imactivatefunc = 'LSTART a LMIDDLE g:IMactivatefunc1(a) LEND' |
| 212 | LET &imstatusfunc = 'LSTART LMIDDLE g:IMstatusfunc1() LEND' |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 213 | normal! i |
Yegappan Lakshmanan | 6409553 | 2021-12-06 11:03:55 +0000 | [diff] [blame] | 214 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 215 | #" Set 'imactivatefunc' 'imstatusfunc' to a variable with a lambda |
| 216 | #" expression |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 217 | VAR Lambda1 = LSTART a LMIDDLE g:IMactivatefunc1(a) LEND |
| 218 | VAR Lambda2 = LSTART LMIDDLE g:IMstatusfunc1() LEND |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 219 | LET &imactivatefunc = Lambda1 |
| 220 | LET &imstatusfunc = Lambda2 |
| 221 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 222 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 223 | #" Set 'imactivatefunc' 'imstatusfunc' to a string(variable with a lambda |
| 224 | #" expression) |
| 225 | LET &imactivatefunc = string(Lambda1) |
| 226 | LET &imstatusfunc = string(Lambda2) |
| 227 | normal! i |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 228 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 229 | #" Test for clearing the 'completefunc' option |
| 230 | set imactivatefunc='' imstatusfunc='' |
| 231 | set imactivatefunc& imstatusfunc& |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 232 | |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 233 | set imactivatefunc=g:IMactivatefunc1 |
| 234 | set imstatusfunc=g:IMstatusfunc1 |
| 235 | call assert_fails("set imactivatefunc=function('abc')", "E700:") |
| 236 | call assert_fails("set imstatusfunc=function('abc')", "E700:") |
| 237 | call assert_fails("set imactivatefunc=funcref('abc')", "E700:") |
| 238 | call assert_fails("set imstatusfunc=funcref('abc')", "E700:") |
| 239 | call assert_fails("LET &imstatusfunc = function('abc')", "E700:") |
| 240 | call assert_fails("LET &imactivatefunc = function('abc')", "E700:") |
| 241 | normal! i |
| 242 | |
| 243 | #" set 'imactivatefunc' and 'imstatusfunc' to a non-existing function |
| 244 | set imactivatefunc=IMactivatefunc1 |
| 245 | set imstatusfunc=IMstatusfunc1 |
| 246 | call assert_fails("set imactivatefunc=function('NonExistingFunc')", 'E700:') |
| 247 | call assert_fails("set imstatusfunc=function('NonExistingFunc')", 'E700:') |
| 248 | call assert_fails("LET &imactivatefunc = function('NonExistingFunc')", 'E700:') |
| 249 | call assert_fails("LET &imstatusfunc = function('NonExistingFunc')", 'E700:') |
| 250 | normal! i |
| 251 | |
Yegappan Lakshmanan | 04ef1fb | 2021-12-12 20:08:05 +0000 | [diff] [blame] | 252 | call assert_equal(14, g:IMactivatefunc_called) |
| 253 | call assert_equal(28, g:IMstatusfunc_called) |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 254 | END |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 255 | call v9.CheckLegacyAndVim9Success(lines) |
Yegappan Lakshmanan | 6ae8fae | 2021-12-12 16:26:44 +0000 | [diff] [blame] | 256 | |
| 257 | " Using Vim9 lambda expression in legacy context should fail |
| 258 | set imactivatefunc=(a)\ =>\ IMactivatefunc1(a) |
| 259 | set imstatusfunc=IMstatusfunc1 |
| 260 | call assert_fails('normal! i', 'E117:') |
| 261 | set imactivatefunc=IMactivatefunc1 |
| 262 | set imstatusfunc=()\ =>\ IMstatusfunc1(a) |
| 263 | call assert_fails('normal! i', 'E117:') |
| 264 | |
| 265 | " set 'imactivatefunc' and 'imstatusfunc' to a partial with dict. This used |
| 266 | " to cause a crash. |
| 267 | func SetIMFunc() |
| 268 | let params1 = {'activate': function('g:DictActivateFunc')} |
| 269 | let params2 = {'status': function('g:DictStatusFunc')} |
| 270 | let &imactivatefunc = params1.activate |
| 271 | let &imstatusfunc = params2.status |
| 272 | endfunc |
| 273 | func g:DictActivateFunc(_) dict |
| 274 | endfunc |
| 275 | func g:DictStatusFunc(_) dict |
| 276 | endfunc |
| 277 | call SetIMFunc() |
| 278 | new |
| 279 | call SetIMFunc() |
| 280 | bw |
| 281 | call test_garbagecollect_now() |
| 282 | new |
| 283 | set imactivatefunc= |
| 284 | set imstatusfunc= |
| 285 | wincmd w |
| 286 | set imactivatefunc= |
| 287 | set imstatusfunc= |
| 288 | :%bw! |
| 289 | delfunc g:DictActivateFunc |
| 290 | delfunc g:DictStatusFunc |
| 291 | delfunc SetIMFunc |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 292 | |
| 293 | " Vim9 tests |
| 294 | let lines =<< trim END |
| 295 | vim9script |
| 296 | |
| 297 | # Test for using function() |
| 298 | def IMactivatefunc1(active: number): any |
| 299 | g:IMactivatefunc_called += 1 |
| 300 | return 1 |
| 301 | enddef |
| 302 | def IMstatusfunc1(): number |
| 303 | g:IMstatusfunc_called += 1 |
| 304 | return 1 |
| 305 | enddef |
| 306 | g:IMactivatefunc_called = 0 |
| 307 | g:IMstatusfunc_called = 0 |
| 308 | set iminsert=2 |
| 309 | set imactivatefunc=function('IMactivatefunc1') |
| 310 | set imstatusfunc=function('IMstatusfunc1') |
| 311 | normal! i |
| 312 | |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 313 | set iminsert=0 |
| 314 | set imactivatefunc= |
| 315 | set imstatusfunc= |
| 316 | END |
Bram Moolenaar | 62aec93 | 2022-01-29 21:45:34 +0000 | [diff] [blame] | 317 | call v9.CheckScriptSuccess(lines) |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 318 | |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 319 | " cleanup |
Yegappan Lakshmanan | 04ef1fb | 2021-12-12 20:08:05 +0000 | [diff] [blame] | 320 | set iminsert=0 |
| 321 | set imactivatefunc& |
| 322 | set imstatusfunc& |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 323 | delfunc IMactivatefunc1 |
| 324 | delfunc IMstatusfunc1 |
Yegappan Lakshmanan | 04ef1fb | 2021-12-12 20:08:05 +0000 | [diff] [blame] | 325 | unlet g:IMactivatefunc_called g:IMstatusfunc_called |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 326 | %bw! |
| 327 | endfunc |
| 328 | |
Bram Moolenaar | 0546d7d | 2020-03-01 16:53:09 +0100 | [diff] [blame] | 329 | " vim: shiftwidth=2 sts=2 expandtab |