Compare commits

..

98 Commits

Author SHA1 Message Date
Bram Moolenaar
b53da7918c patch 8.2.1334: Github workflow timeout needs tuning
Problem:    Github workflow timeout needs tuning
Solution:   Use a 10 minute timeout. Fail when timing out. (Ken Takata,
            closes #6590)
2020-08-01 12:26:04 +02:00
Bram Moolenaar
af8edbb8dc patch 8.2.1333: Vim9: memory leak when using nested global function
Problem:    Vim9: memory leak when using nested global function.
Solution:   Swap from and to when copying the lines.
2020-08-01 00:03:09 +02:00
Bram Moolenaar
ce6583568f patch 8.2.1332: Vim9: memory leak when using nested global function
Problem:    Vim9: memory leak when using nested global function.
Solution:   Delete the function when deleting the instruction.  Disable test
            that still causes a leak.
2020-07-31 23:47:12 +02:00
Bram Moolenaar
badd8486f7 patch 8.2.1331: Vim9: :echo with two lists doesn't work
Problem:    Vim9: :echo with two lists doesn't work.
Solution:   Do not skip white space before []. (closes #6552)
2020-07-31 22:38:17 +02:00
Bram Moolenaar
3a53ec8bdd patch 8.2.1330: Github workflow takes longer than needed
Problem:    Github workflow takes longer than needed.
Solution:   Do two test runs in parallel instead of sequentially. (Ken Takata,
            closes #6579)
2020-07-31 22:17:32 +02:00
Bram Moolenaar
38ddf333f6 patch 8.2.1329: Vim9: cannot define global function inside :def function
Problem:    Vim9: cannot define global function inside :def function.
Solution:   Assign to global variable instead of local. (closes #6584)
2020-07-31 22:05:04 +02:00
Bram Moolenaar
4d4d1cd5c8 patch 8.2.1328: no space allowed before comma in list
Problem:    No space allowed before comma in list.
Solution:   Legacy Vim script allows it. (closes #6577)
2020-07-30 22:14:33 +02:00
Bram Moolenaar
f4ee528086 patch 8.2.1327: Mac: configure can't find Tcl libraries
Problem:    Mac: configure can't find Tcl libraries.
Solution:   Adjust configure check. (closes #6575)
2020-07-30 20:18:08 +02:00
Bram Moolenaar
9d48956681 patch 8.2.1326: Vim9: skipping over white space after list
Problem:    Vim9: skipping over white space after list.
Solution:   Do not skip white space, a following [] would be misinterpreted.
            (closes #6552)  Fix a few side effects.
2020-07-30 20:08:50 +02:00
Bram Moolenaar
ea2d8d2571 patch 8.2.1325: Vim9: using Vim9 script for autaload not tested
Problem:    Vim9: using Vim9 script for autaload not tested.
Solution:   Add a test.  Update help.
2020-07-29 22:11:05 +02:00
Bram Moolenaar
c7e44a7e4c patch 8.2.1324: Vim9: line break after "=" does not work
Problem:    Vim9: line break after "=" does not work.
Solution:   Also allow for NUL after "=". (closes #6549)
2020-07-29 21:37:43 +02:00
Bram Moolenaar
696ba23149 patch 8.2.1323: Vim9: invalid operators only rejected in :def function
Problem:    Vim9: invalid operators only rejected in :def function.
Solution:   Also reject them at script level. (closes #6564)
2020-07-29 21:20:41 +02:00
Bram Moolenaar
1040956292 patch 8.2.1322: Vim9: method on double quoted string doesn't work
Problem:    Vim9: method on double quoted string doesn't work.
Solution:   Recognize double quoted string. (closes #6562)
2020-07-29 20:00:38 +02:00
Bram Moolenaar
7b7f78f51d patch 8.2.1321: GitHub CI also runs on tag push
Problem:    GitHub CI also runs on tag push.
Solution:   Skip CI on push. (Ken Takata, closes #6571)
2020-07-29 19:29:23 +02:00
Bram Moolenaar
33afa2447b patch 8.2.1320: Vim9: cannot declare some single letter variables
Problem:    Vim9: cannot declare some single letter variables.
Solution:   Do not recognize a colon for a namespace for single letter
            variables. (closes #6547)
2020-07-29 19:18:00 +02:00
Bram Moolenaar
ac7bf8c4bf patch 8.2.1319: status badge for Github CI has wrong link
Problem:    Status badge for Github CI has wrong link.
Solution:   Rename and use the right link
2020-07-29 17:43:55 +02:00
Bram Moolenaar
ed3c7e6339 patch 8.2.1318: no status badge for Github CI
Problem:    No status badge for Github CI.
Solution:   Add a badge.
2020-07-29 17:34:33 +02:00
Bram Moolenaar
f9a343f8bd patch 8.2.1317: MS-Windows tests on AppVeyor are slow
Problem:    MS-Windows tests on AppVeyor are slow.
Solution:   Use GitHub Actions. (Ken Takata, closes #6569)
2020-07-29 16:32:21 +02:00
Bram Moolenaar
b61ef01cce patch 8.2.1316: test 42 is still old style
Problem:    Test 42 is still old style.
Solution:   Turn it into a new style test. (Yegappan Lakshmanan, closes #6561)
2020-07-29 16:08:21 +02:00
Bram Moolenaar
45df2a01a7 patch 8.2.1315: MS-Windows: test log contains escape sequences
Problem:    MS-Windows: test log contains escape sequences.
Solution:   Do not use t_md and t_me but ANSI escape sequences. (Ken Takata,
            closes #6559)
2020-07-29 15:03:01 +02:00
Bram Moolenaar
9898107f54 patch 8.2.1314: Vim9: rule for comment after :function is confusing
Problem:    Vim9: rule for comment after :function is confusing.
Solution:   Allow double quoted comment after :function in vim9script.
            (closes #6556)
2020-07-29 14:40:25 +02:00
Bram Moolenaar
b5ed266037 patch 8.2.1313: Vim9 script: cannot assign to environment variable
Problem:    Vim9 script: cannot assign to environment variable.
Solution:   Recognize environment variable assignment. (closes #6548)
            Also options and registers.
2020-07-28 22:38:37 +02:00
Bram Moolenaar
066b12e36c patch 8.2.1312: MS-Windows: terminal test may fail if dir.exe exists
Problem:    MS-Windows: terminal test may fail if dir.exe exists.
Solution:   Use dir.com. (Ken Takata, closes #6557)
2020-07-28 21:40:27 +02:00
Bram Moolenaar
68e30449a2 patch 8.2.1311: test failures with legacy Vim script
Problem:    Test failures with legacy Vim script.
Solution:   Actually check for Vim9 script.
2020-07-28 21:15:07 +02:00
Bram Moolenaar
bd7f7c123d patch 8.2.1310: configure with Xcode 12 fails to check for tgetent
Problem:    Configure with Xcode 12 fails to check for tgetent.
Solution:   Declare tgetent(). (Ozaki Kiichi, closes #6558)
2020-07-28 21:03:37 +02:00
Bram Moolenaar
461f21242a patch 8.2.1309: build failure with tiny version
Problem:    Build failure with tiny version.
Solution:   Add #ifdef.
2020-07-28 20:25:47 +02:00
Bram Moolenaar
ae616494d7 patch 8.2.1308: Vim9: accidentally using "x" causes Vim to exit
Problem:    Vim9: accidentally using "x" causes Vim to exit.
Solution:   Disallow using ":x" or "xit" in Vim9 script. (closes #6399)
2020-07-28 20:07:27 +02:00
Bram Moolenaar
0aac67a431 patch 8.2.1307: popup window width does not include number of sign columns
Problem:    popup window width does not include number, fold of sign column
            width.
Solution:   Take number, fold and sign column with into account.
2020-07-27 22:40:37 +02:00
Bram Moolenaar
b13ab99908 patch 8.2.1306: checking for first character of dict key is inconsistent
Problem:    Checking for first character of dict key is inconsistent.
Solution:   Add eval_isdictc(). (closes #6546)
2020-07-27 21:43:28 +02:00
Bram Moolenaar
622b3568fa patch 8.2.1305: some tests are still old style
Problem:    Some tests are still old style.
Solution:   Convert tests 52 and 70 to new style. (Yegappan Lakshmanan,
            closes #6544)  Fix error in FinishTesting().
2020-07-27 20:02:41 +02:00
Bram Moolenaar
6ca6ca4889 patch 8.2.1304: debug backtrace isn't tested much
Problem:    Debug backtrace isn't tested much.
Solution:   Add more specific tests. (Ben Jackson, closes #6540)
2020-07-27 19:47:07 +02:00
Bram Moolenaar
6d585f4c5c patch 8.2.1303: calling popup_setoptions() resets 'signcolumn'
Problem:    Calling popup_setoptions() resets 'signcolumn'.
Solution:   Only set 'signcolumn' when creating the popup. (closes #6542)
2020-07-26 22:20:54 +02:00
Bram Moolenaar
01865ade85 patch 8.2.1302: Vim9: varargs arg after optional arg does not work
Problem:    Vim9: varargs arg after optional arg does not work
Solution:   Check for the "..." first. (issue #6507)
2020-07-26 18:33:09 +02:00
Bram Moolenaar
ace6132aa8 patch 8.2.1301: Vim9: varargs argument type not parsed properly
Problem:    Vim9: varargs argument type not parsed properly.
Solution:   Skip over the "...". (issue #6507)
2020-07-26 18:16:58 +02:00
Bram Moolenaar
4fc224ca1c patch 8.2.1300: Vim9: optional argument type not parsed properly
Problem:    Vim9: optional argument type not parsed properly.
Solution:   Skip over the "?". (issue #6507)
2020-07-26 17:56:25 +02:00
Bram Moolenaar
2547aa930b Update runtime files. 2020-07-26 17:00:44 +02:00
Bram Moolenaar
d3bb6a82a5 patch 8.2.1299: compiler warning for using size_t for int and void pointer
Problem:    Compiler warning for using size_t for int and void pointer.
Solution:   Add type casts.
2020-07-26 15:55:25 +02:00
Bram Moolenaar
cb4f69c2fd patch 8.2.1298: compiler warning for unused argument in small version
Problem:    Compiler warning for unused argument in small version.
Solution:   Add UNUSED.
2020-07-26 15:51:06 +02:00
Bram Moolenaar
a5d0423fa1 patch 8.2.1297: when a test fails it's often not easy to see where
Problem:    When a test fails it's often not easy to see what the call stack
            is.
Solution:   Add more entries from the call stack in the exception message.
2020-07-26 15:37:02 +02:00
Bram Moolenaar
d66cdcd43a patch 8.2.1296: some part of using 'smarcase' was not tested
Problem:    Some part of using 'smarcase' was not tested.
Solution:   Add more tests. (Dominique Pellé, closes #6538)
2020-07-26 13:27:16 +02:00
Bram Moolenaar
7d40b8a532 patch 8.2.1295: tests 44 and 99 are old style
Problem:    Tests 44 and 99 are old style.
Solution:   Convert to new style tests. (Yegappan Lakshmanan, closes #6536)
2020-07-26 12:52:59 +02:00
Bram Moolenaar
37394ff752 patch 8.2.1294: Vim9: error when using vim9script in TextYankPost
Problem:    Vim9: error when using vim9script in TextYankPost.
Solution:   Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can
            be used when text is locked. (closes #6529)
2020-07-25 19:38:18 +02:00
Bram Moolenaar
2d6b20d6a9 patch 8.2.1293: Vim9: error when using vim9script in TextYankPost
Problem:    Vim9: error when using vim9script in TextYankPost.
Solution:   Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can
            be used when text is locked. (closes #6529)
2020-07-25 19:30:59 +02:00
Bram Moolenaar
2afc3b4f77 patch 8.2.1292: AIDL filetype not recognized
Problem:    AIDL filetype not recognized.
Solution:   Add filetype detection. (Dominique Pellé, closes #6533)
2020-07-25 16:53:12 +02:00
Bram Moolenaar
24aa48b7a2 patch 8.2.1291: Vim9: type of varargs items is not checked
Problem:    Vim9: type of varargs items is not checked.
Solution:   Check the list item types. (closes #6523)
2020-07-25 16:33:02 +02:00
Bram Moolenaar
925e9fd633 patch 8.2.1290: Vim9: cannot replace a global function
Problem:    Vim9: cannot replace a global function.
Solution:   Allow for "!" on a global function. (closes #6524)  Also fix that
            :delfunc on a :def function only made it empty.
2020-07-25 15:41:11 +02:00
Bram Moolenaar
c841afff6a patch 8.2.1289: crash when using a custom completion function
Problem:    Crash when using a custom completion function.
Solution:   Initialize all of the expand_T. (closes #6532)
2020-07-25 14:11:55 +02:00
Bram Moolenaar
13e12b8a3c patch 8.2.1288: Vim9: cannot use mark in range
Problem:    Vim9: cannot use mark in range.
Solution:   Use the flag that a colon was seen. (closes #6528)
2020-07-24 18:47:22 +02:00
Bram Moolenaar
40f4f7a48c patch 8.2.1287: Vim9: crash when using an imported function
Problem:    Vim9: crash when using an imported function.
Solution:   Add the function type to the imported entry. (closes #6522)
2020-07-23 22:41:43 +02:00
Bram Moolenaar
43e969d3f9 patch 8.2.1286: Vim9: No error when using a type to a window variable
Problem:    Vim9: No error when using a type to a window variable
Solution:   Recognize the syntax and give an error. (closes #6521)
2020-07-23 21:14:43 +02:00
Bram Moolenaar
b8070e3173 patch 8.2.1285: Vim9: argument types are not checked on assignment
Problem:    Vim9: argument types are not checked on assignment.
Solution:   Check function argument types. (issue #6507)
2020-07-23 20:56:04 +02:00
Bram Moolenaar
bfba8651a5 patch 8.2.1284: Vim9: skipping over type includes following white space
Problem:    Vim9: skipping over type includes following white space, leading
            to an error for missing white space.
Solution:   Do not skip over white space after the type.
2020-07-23 20:09:10 +02:00
Bram Moolenaar
637cd7d1c9 patch 8.2.1283: Vim9: error for misplaced -> lacks argument
Problem:    Vim9: error for misplaced -> lacks argument.
Solution:   Use the pointer before it was advanced.
2020-07-23 19:06:23 +02:00
Bram Moolenaar
6c4bfe4b31 patch 8.2.1282: Vim9: crash when using CheckScriptFailure()
Problem:    Vim9: crash when using CheckScriptFailure() in
            Test_vim9script_call_fail_decl().
Solution:   Do not decrement the def_functions len unless the function was
            newly added.
2020-07-23 18:26:30 +02:00
Bram Moolenaar
2d06bfde29 patch 8.2.1281: the "trailing characters" error can be hard to understand
Problem:    The "trailing characters" error can be hard to understand.
Solution:   Add the trailing characters to the message.
2020-07-23 17:16:18 +02:00
Bram Moolenaar
8930caaa1a patch 8.2.1280: Ex command error cannot contain an argument
Problem:    Ex command error cannot contain an argument.
Solution:   Add ex_errmsg() and translate earlier.  Use e_trailing_arg where
            possible.
2020-07-23 16:37:03 +02:00
Bram Moolenaar
8d5f6af5e5 patch 8.2.1279: some tests on Travis have EXITFREE duplicated
Problem:    Some tests on Travis have EXITFREE duplicated.
Solution:   Remove EXITFREE from shadowopt.  Add "shadow" to job name.
2020-07-23 15:50:40 +02:00
Bram Moolenaar
dd1a9af00f patch 8.2.1278: Vim9: line break after "->" only allowed in :def function
Problem:    Vim9: line break after "->" only allowed in :def function.
Solution:   Only allow line break after "->". (closes #6492)
2020-07-23 15:38:03 +02:00
Bram Moolenaar
7a87b4e3fe patch 8.2.1277: tests on Travis do not run with EXITFREE
Problem:    Tests on Travis do not run with EXITFREE.
Solution:   Add EXITFREE to all builds to uncover any mistakes.
2020-07-23 14:59:07 +02:00
Bram Moolenaar
4cc45a3673 patch 8.2.1276: MS-Windows: system test may fail if more.exe is installed
Problem:    MS-Windows: system test may fail if more.exe is installed.
Solution:   Explicitly use more.com. (Taro Muraoka, Ken Takata, closes #6517)
2020-07-23 14:51:02 +02:00
Bram Moolenaar
5a67c37a55 patch 8.2.1275: Vim9: compiler warning for buffer size
Problem:    Vim9: compiler warning for buffer size.
Solution:   Change the offset from 10 to 15. (Dominique Pellé, closes #6518)
2020-07-23 14:39:47 +02:00
Bram Moolenaar
63be3d4ba0 patch 8.2.1274: Vim9: no error for missing white space at script level
Problem:    Vim9: no error for missing white space in assignment at script
            level.
Solution:   Check for white space. (closes #6495)
2020-07-23 13:11:37 +02:00
Bram Moolenaar
c69950ac17 patch 8.2.1273: MS-Windows: terminal test may leave file behind
Problem:    MS-Windows: terminal test may leave file behind.
Solution:   Wait a moment for process to end before deleting the file.
            (Taro Muraoka, closes #6513)
2020-07-22 22:23:40 +02:00
Bram Moolenaar
4cdb13ce81 patch 8.2.1272: Vim9: type not checked if declaration also assigns value
Problem:    Vim9: type not checked if declaration also assigns value.
Solution:   Check the type. (issue #6507)
2020-07-22 21:45:14 +02:00
Bram Moolenaar
0f60e80f9b patch 8.2.1271: Vim9: Error for Funcref function argument type
Problem:    Vim9: Error for Funcref function argument type.
Solution:   Find the actual function type if possible. (issue #6507)
2020-07-22 20:16:11 +02:00
Bram Moolenaar
2f1980f7b7 patch 8.2.1270: Vim9: not skipping over function type declaration
Problem:    Vim9: not skipping over function type declaration with only a
            return type.
Solution:   Skip over the return type. (issue #6507)
2020-07-22 19:30:06 +02:00
Bram Moolenaar
054f14bbe5 patch 8.2.1269: language and locale code spread out
Problem:    Language and locale code spread out.
Solution:   Move relevant code to src/locale.c. (Yegappan Lakshmanan,
            closes #6509)
2020-07-22 19:11:19 +02:00
Bram Moolenaar
e7e4838f25 patch 8.2.1268: Vim9: no error for using double quote comment
Problem:    Vim9: no error for using double quote comment after :func or :def.
Solution:   Only accept double quote when not in Vim9 script and not after
            :def. (closes #6483)
2020-07-22 18:17:08 +02:00
Bram Moolenaar
2690b5aed8 patch 8.2.1267: MS-Windows: tests may fail due to $PROMPT value
Problem:    MS-Windows: tests may fail due to $PROMPT value.
Solution:   Set $PROMPT for testing. (Taro Muraoka, closes #6510)
2020-07-22 18:14:58 +02:00
Bram Moolenaar
bc6fcbe4ce patch 8.2.1266: Makefile preference were accidentally included
Problem:    Makefile preference were accidentally included.
Solution:   Revert the Makefile changes.
2020-07-21 22:34:41 +02:00
Bram Moolenaar
7d5e744162 patch 8.2.1265: crash with EXITFREE when split() fails
Problem:    Crash with EXITFREE when split() fails.
Solution:   Restore 'cpoptions'.
2020-07-21 22:25:51 +02:00
Bram Moolenaar
420952175a patch 8.2.1264: terminal getwinpos() test is a bit flaky
Problem:    Terminal getwinpos() test is a bit flaky.
Solution:   Call getwinpos() a bit later.
2020-07-21 21:48:58 +02:00
Bram Moolenaar
c71f36a889 patch 8.2.1263: Vim9: comperators use 'ignorecase' in Vim9 script
Problem:    Vim9: comperators use 'ignorecase' in Vim9 script.
Solution:   Ignore 'ignorecase'.  Use true and false instead of 1 and 0.
            (closes #6497)
2020-07-21 21:31:00 +02:00
Bram Moolenaar
f868ba8903 patch 8.2.1262: src/ex_cmds.c file is too big
Problem:    src/ex_cmds.c file is too big.
Solution:   Move help related code to src/help.c. (Yegappan Lakshmanan,
            closes #6506)
2020-07-21 21:07:20 +02:00
Bram Moolenaar
c7db57788b patch 8.2.1261: Vim9: common type of function not tested
Problem:    Vim9: common type of function not tested.
Solution:   Add a test.  Fix uncovered problems.
2020-07-21 20:55:50 +02:00
Bram Moolenaar
7591116acf patch 8.2.1260: there is no good test for CursorHold
Problem:    There is no good test for CursorHold.
Solution:   Add a test.  Remove duplicated test. (Yegappan Lakshmanan,
            closes #6503
2020-07-21 19:44:47 +02:00
Bram Moolenaar
f56c95fdad patch 8.2.1259: empty group in 'tabline' may cause using an invalid pointer
Problem:    Empty group in 'tabline' may cause using an invalid pointer.
Solution:   Set the group start position. (closes #6505)
2020-07-21 19:25:18 +02:00
Bram Moolenaar
08815a1d03 patch 8.2.1258: CursorHold does not work well
Problem:    CursorHold does not work well.a (Shane-XB-Qian)
Solution:   Only restore did_cursorhold when using :normal.
2020-07-20 23:10:56 +02:00
Bram Moolenaar
b31be3f909 patch 8.2.1257: Vim9: list unpack doesn't work at the script level
Problem:    Vim9: list unpack doesn't work at the script level.
Solution:   Detect unpack assignment better. (closes #6494)
2020-07-20 22:37:44 +02:00
Bram Moolenaar
7892b953e0 patch 8.2.1256: Vim9: type wrong after getting dict item in lambda
Problem:    Vim9: type wrong after getting dict item in lambda.
Solution:   Set the type to "any" after enforcing dict type. (closes #6491)
2020-07-20 22:09:34 +02:00
Bram Moolenaar
d43906d2e5 patch 8.2.1255: cannot use a lambda with quickfix functions
Problem:    Cannot use a lambda with quickfix functions.
Solution:   Add support for lambda. (Yegappan Lakshmanan, closes #6499)
2020-07-20 21:31:32 +02:00
Bram Moolenaar
470adb827f patch 8.2.1254: MS-Windows: regexp test may fail if 'iskeyword' set wrongly
Problem:    MS-Windows: regexp test may fail if 'iskeyword' set wrongly.
Solution:   Override the 'iskeyword' value. (Taro Muraoka, closes #6502)
2020-07-20 21:21:30 +02:00
Bram Moolenaar
b146e01a7e patch 8.2.1253: CTRL-K in Insert mode gets <CursorHold> inserted
Problem:    CTRL-K in Insert mode gets <CursorHold> inserted. (Roland
            Puntaier)
Solution:   Do not reset did_cursorhold, restore it. (closes #6447)
2020-07-19 23:06:05 +02:00
Bram Moolenaar
54c3fcd852 patch 8.2.1252: ":marks" may show '< and '> mixed up
Problem:    ":marks" may show '< and '> mixed up.
Solution:   Show the mark position as where '< and '> would jump.
2020-07-19 22:09:06 +02:00
Bram Moolenaar
682d0a1546 patch 8.2.1251: Vim9: warning for pointer usage, test failure undetected
Problem:    Vim9: warning for pointer usage, test failure undetected.
Solution:   Fix pointer indirection.  Give error when executing function
            failed for any reason.  Fix instruction names.
2020-07-19 20:48:59 +02:00
Bram Moolenaar
2f8ce0ae8a patch 8.2.1250: Vim9: cannot use the g:, b:, t: and w: namespaces
Problem:    Vim9: cannot use the g:, b:, t: and w: namespaces.
Solution:   Add instructions to push a dict for the namespaces. (closes #6480)
2020-07-19 19:47:35 +02:00
Bram Moolenaar
747f11ad6e patch 8.2.1249: Vim9: disassemble test fails
Problem:    Vim9: disassemble test fails.
Solution:   Change INDEX to LISTINDEX.  Add test for STRINDEX.
2020-07-19 18:38:37 +02:00
Bram Moolenaar
956501594e patch 8.2.1248: Netbeans test is flaky in the GUI
Problem:    Netbeans test is flaky in the GUI.
Solution:   Filter out geometry messages. (Taro Muraoka, closes #6487)
2020-07-19 18:24:32 +02:00
Bram Moolenaar
bf9d8c3765 patch 8.2.1247: Vim9: cannot index a character in a string
Problem:    Vim9: cannot index a character in a string.
Solution:   Add ISN_STRINDEX instruction. (closes #6478)
2020-07-19 17:55:44 +02:00
Bram Moolenaar
b209750b5e patch 8.2.1246: Vim9: comment after assignment doesn't work
Problem:    Vim9: comment after assignment doesn't work.
Solution:   Skip over white space. (closes #6481)
2020-07-19 17:17:02 +02:00
Bram Moolenaar
f398238a37 patch 8.2.1245: build failure in tiny version
Problem:    Build failure in tiny version.
Solution:   Add #ifdef.
2020-07-19 16:32:09 +02:00
Bram Moolenaar
6802cce407 patch 8.2.1244: Vim9: in lambda index assumes a list
Problem:    Vim9: in lambda index assumes a list.
Solution:   Use the value type to decide about list or dict. (closes #6479)
2020-07-19 15:49:49 +02:00
Bram Moolenaar
75783bd84e patch 8.2.1243: Vim9: cannot have a comment line halfway a list
Problem:    Vim9: cannot have a comment or empty line halfway a list at script
            level.
Solution:   Skip more than one line if needed.
2020-07-19 14:41:58 +02:00
Bram Moolenaar
65b9545f44 patch 8.2.1242: Vim9: no error if calling a function with wrong type
Problem:    Vim9: no error if calling a function with wrong argument type.
Solution:   Check types of arguments. (closes #6469)
2020-07-19 14:03:09 +02:00
Bram Moolenaar
6434fc574d patch 8.2.1241: cannot use getbufinfo() as a method
Problem:    Cannot use getbufinfo() as a method.
Solution:   Support using getbufinfo() as a method. (closes #6458)
2020-07-18 22:24:22 +02:00
Bram Moolenaar
10e1d01aaf patch 8.2.1240: GUI tests sometimes fail because of translations
Problem:    GUI tests sometimes fail because of translations.
Solution:   Reload the menus without translation. (Taro Muraoka, closes #6486)
2020-07-18 22:03:11 +02:00
Bram Moolenaar
de2396fc87 patch 8.2.1239: "maxwidth" in 'completepopup' not obeyed
Problem:    "maxwidth" in 'completepopup' not obeyed. (Jay Sitter)
Solution:   Add separate field for value from option. (closes #6470)
2020-07-18 21:40:41 +02:00
Bram Moolenaar
d032f34a51 patch 8.2.1238: Vim9: a few remaining errors not caught by try/catch
Problem:    Vim9: a few remaining errors not caught by try/catch.
Solution:   Do not bail out if an error is inside try/catch.
2020-07-18 18:13:02 +02:00
166 changed files with 6984 additions and 4001 deletions

227
.github/workflows/ci-windows.yaml vendored Normal file
View File

@@ -0,0 +1,227 @@
name: GitHub CI
on:
push:
branches:
- '*'
pull_request:
env:
VCVARSALL: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
# Interfaces
# Lua
LUA_VER: 54
LUA_VER_DOT: '5.4'
LUA_RELEASE: 5.4.0
LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
LUA_DIR: D:\Lua
# Python 2
PYTHON_VER: 27
PYTHON_VER_DOT: '2.7'
# Python 3
PYTHON3_VER: 38
PYTHON3_VER_DOT: '3.8'
# Other dependencies
# winpty
WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
# Escape sequences
COL_RED: "\x1b[31m"
COL_GREEN: "\x1b[32m"
COL_YELLOW: "\x1b[33m"
COL_RESET: "\x1b[m"
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
toolchain: [msvc, mingw]
arch: [x64, x86]
features: [HUGE, NORMAL]
include:
- arch: x64
vcarch: amd64
warch: x64
bits: 64
msystem: MINGW64
cygreg: registry
pyreg: ""
- arch: x86
vcarch: x86
warch: ia32
bits: 32
msystem: MINGW32
cygreg: registry32
pyreg: "-32"
exclude:
- toolchain: msvc
arch: x64
features: NORMAL
- toolchain: mingw
arch: x86
features: NORMAL
steps:
- name: Initalize
id: init
shell: bash
run: |
git config --global core.autocrlf input
python_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON_VER_DOT}/InstallPath/@")
python3_dir=$(cat "/proc/${{ matrix.cygreg }}/HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${PYTHON3_VER_DOT}${{ matrix.pyreg }}/InstallPath/@")
echo "::set-env name=PYTHON_DIR::$python_dir"
echo "::set-env name=PYTHON3_DIR::$python3_dir"
- uses: msys2/setup-msys2@v2
if: matrix.toolchain == 'mingw'
with:
msystem: ${{ matrix.msystem }}
release: false
- uses: actions/checkout@v2
- name: Create a list of download URLs
shell: cmd
run: |
type NUL > urls.txt
echo %LUA_RELEASE%>> urls.txt
echo %WINPTY_URL%>> urls.txt
- name: Cache downloaded files
uses: actions/cache@v2
with:
path: downloads
key: ${{ runner.os }}-${{ matrix.bits }}-${{ hashFiles('urls.txt') }}
- name: Download dependencies
shell: cmd
run: |
path C:\Program Files\7-Zip;%path%
if not exist downloads mkdir downloads
echo %COL_GREEN%Download Lua%COL_RESET%
call :downloadfile %LUA${{ matrix.bits }}_URL% downloads\lua.zip
7z x downloads\lua.zip -o%LUA_DIR% > nul || exit 1
echo %COL_GREEN%Download winpty%COL_RESET%
call :downloadfile %WINPTY_URL% downloads\winpty.zip
7z x -y downloads\winpty.zip -oD:\winpty > nul || exit 1
copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty.dll src\winpty${{ matrix.bits }}.dll
copy /Y D:\winpty\${{ matrix.warch }}\bin\winpty-agent.exe src\
goto :eof
:downloadfile
:: call :downloadfile <URL> <localfile>
if not exist %2 (
curl -f -L %1 -o %2
)
if ERRORLEVEL 1 (
rem Retry once.
curl -f -L %1 -o %2 || exit 1
)
goto :eof
- name: Build (MSVC)
if: matrix.toolchain == 'msvc'
shell: cmd
run: |
call "%VCVARSALL%" ${{ matrix.vcarch }}
cd src
:: Filter out the progress bar from the build log
sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
if "${{ matrix.features }}"=="HUGE" (
nmake -nologo -f Make_mvc2.mak ^
FEATURES=${{ matrix.features }} ^
GUI=yes IME=yes ICONV=yes VIMDLL=yes ^
DYNAMIC_LUA=yes LUA=%LUA_DIR% ^
DYNAMIC_PYTHON=yes PYTHON=%PYTHON_DIR% ^
DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR%
) else (
nmake -nologo -f Make_mvc2.mak ^
FEATURES=${{ matrix.features }} ^
GUI=yes IME=yes ICONV=yes VIMDLL=yes
)
if not exist vim${{ matrix.bits }}.dll (
echo %COL_RED%Build failure.%COL_RESET%
exit 1
)
- name: Build (MinGW)
if: matrix.toolchain == 'mingw'
shell: msys2 {0}
run: |
cd src
if [ "${{ matrix.features }}" = "HUGE" ]; then
mingw32-make -f Make_ming.mak -j2 \
FEATURES=${{ matrix.features }} \
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
DYNAMIC_LUA=yes LUA=${LUA_DIR} \
DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
STATIC_STDCPLUS=yes
else
mingw32-make -f Make_ming.mak -j2 \
FEATURES=${{ matrix.features }} \
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
STATIC_STDCPLUS=yes
fi
# - name: Prepare Artifact
# shell: cmd
# run: |
# mkdir artifacts
# copy src\*vim.exe artifacts
# copy src\vim*.dll artifacts
#
# - name: Upload Artifact
# uses: actions/upload-artifact@v1
# with:
# name: vim${{ matrix.bits }}-${{ matrix.toolchain }}
# path: ./artifacts
- name: Test
shell: cmd
timeout-minutes: 20
run: |
PATH %LUA_DIR%;C:\msys64\${{ matrix.msystem }}\bin;%PATH%;%PYTHON3_DIR%
call "%VCVARSALL%" ${{ matrix.vcarch }}
cd src
echo.
echo %COL_GREEN%vim version:%COL_RESET%
.\vim --version || exit 1
mkdir ..\src2
xcopy testdir ..\src2\testdir\ /E > nul || exit 1
copy evalfunc.c ..\src2 > nul
echo %COL_GREEN%Start testing vim in background.%COL_RESET%
start cmd /c "cd ..\src2\testdir & nmake -nologo -f Make_dos.mak VIMPROG=..\..\src\vim > nul & echo done>done.txt"
echo %COL_GREEN%Test gvim:%COL_RESET%
cd testdir
nmake -nologo -f Make_dos.mak VIMPROG=..\gvim || exit 1
cd ..
echo %COL_GREEN%Wait for vim tests to finish.%COL_RESET%
cd ..\src2\testdir
:: Wait about 10 minutes.
for /L %%i in (1,1,600) do (
if exist done.txt goto exitloop
ping -n 2 localhost > nul
)
set timeout=1
:exitloop
echo %COL_GREEN%Test results of vim:%COL_RESET%
if exist messages type messages
nmake -nologo -f Make_dos.mak report VIMPROG=..\..\src\vim || exit 1
if "%timeout%"=="1" (
echo %COL_RED%Timed out.%COL_RESET%
exit 1
)

View File

@@ -3,21 +3,21 @@ language: c
_anchors:
envs:
- &tiny-nogui
BUILD=yes TEST=test FEATURES=tiny CONFOPT="--disable-gui" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
BUILD=yes TEST=test FEATURES=tiny CONFOPT="--disable-gui" LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &tiny
BUILD=yes TEST=test FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
BUILD=yes TEST=test FEATURES=tiny CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &small
BUILD=yes TEST=test FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
BUILD=yes TEST=test FEATURES=small CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &normal
BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
BUILD=yes TEST=test FEATURES=normal CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &linux-huge
BUILD=yes TEST="scripttests test_libvterm" CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
BUILD=yes TEST="scripttests test_libvterm" CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &osx-huge # macOS build
BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
BUILD=yes TEST=test FEATURES=huge LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &unittests
BUILD=no TEST=unittests CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
BUILD=no TEST=unittests CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
- &asan # ASAN build
SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
@@ -191,13 +191,13 @@ jobs:
compiler: gcc
env: *small
- <<: *linux
name: normal/clang
name: normal+shadow/clang
compiler: clang
env:
- *normal
- *shadowopt
- <<: *linux
name: normal/gcc
name: normal+shadow/gcc
compiler: gcc
env:
- *normal

View File

@@ -9,6 +9,7 @@ SRC_ALL = \
.lgtm.yml \
.travis.yml \
.cirrus.yml \
.github/workflows/ci-windows.yaml \
appveyor.yml \
ci/appveyor.bat \
ci/if_ver*.vim \
@@ -68,6 +69,7 @@ SRC_ALL = \
src/gui_beval.c \
src/hardcopy.c \
src/hashtab.c \
src/help.c \
src/highlight.c \
src/indent.c \
src/insexpand.c \
@@ -75,6 +77,7 @@ SRC_ALL = \
src/json_test.c \
src/kword_test.c \
src/list.c \
src/locale.c \
src/keymap.h \
src/macros.h \
src/main.c \
@@ -240,11 +243,13 @@ SRC_ALL = \
src/proto/gui_beval.pro \
src/proto/hardcopy.pro \
src/proto/hashtab.pro \
src/proto/help.pro \
src/proto/highlight.pro \
src/proto/indent.pro \
src/proto/insexpand.pro \
src/proto/json.pro \
src/proto/list.pro \
src/proto/locale.pro \
src/proto/main.pro \
src/proto/map.pro \
src/proto/mark.pro \

View File

@@ -2,6 +2,7 @@
[![Travis Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim)
[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22)
[![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim)
[![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master)
[![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim)

View File

@@ -5,16 +5,17 @@ skip_tags: true
environment:
matrix:
- FEATURE: HUGE
- FEATURE: NORMAL
# disabled
# - FEATURE: TINY
# - FEATURE: SMALL
# - FEATURE: NORMAL
# - FEATURE: BIG
matrix:
fast_finish: true
before_build:
# Use Windows SDK 7.1 (= MSVC 2010)
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release'
- 'set INCLUDE=%INCLUDE%C:\Program Files (x86)\Windows Kits\8.1\Include\um'
@@ -25,9 +26,9 @@ test_script:
- cd src/testdir
# Testing with MSVC gvim
- path C:\Python35-x64;%PATH%
- nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\gvim
- nmake -f Make_dos.mak VIMPROG=..\gvim
- nmake -f Make_dos.mak clean
# Testing with MingW console version
- nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\vim
# Testing with MSVC console version
- nmake -f Make_dos.mak VIMPROG=..\vim
# vim: sw=2 sts=2 et ts=8 sr

View File

@@ -5,48 +5,32 @@ setlocal ENABLEDELAYEDEXPANSION
cd %APPVEYOR_BUILD_FOLDER%
cd src
echo "Building MinGW 32bit console version"
set PATH=c:\msys64\mingw32\bin;%PATH%
mingw32-make.exe -f Make_ming.mak GUI=no OPTIMIZE=speed IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
.\vim -u NONE -c "redir @a | ver |0put a | wq" ver_ming.txt
:: Save vim.exe before Make clean, moved back below.
copy vim.exe testdir
mingw32-make.exe -f Make_ming.mak clean
:: Build Mingw huge version with python and channel support, or
:: with specified features without python.
echo "Building MinGW 32bit GUI version"
if "%FEATURE%" == "HUGE" (
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed CHANNEL=yes GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35 FEATURES=%FEATURE% || exit 1
) ELSE (
mingw32-make.exe -f Make_ming.mak OPTIMIZE=speed GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
)
.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_ming_gui.txt
:: Filter out the progress bar from the build log
sed -e "s/@<<$/@<< | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
echo "Building MSVC 64bit console Version"
nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
:: The executable is not used
nmake -f Make_mvc2.mak clean
nmake -f Make_mvc2.mak CPU=AMD64 ^
OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^
FEATURES=%FEATURE% || exit 1
:: build MSVC huge version with python and channel support
:: GUI needs to be last, so that testing works
echo "Building MSVC 64bit GUI Version"
if "%FEATURE%" == "HUGE" (
nmake -f Make_mvc2.mak DIRECTX=yes CPU=AMD64 CHANNEL=yes OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 FEATURES=%FEATURE% || exit 1
nmake -f Make_mvc2.mak CPU=AMD64 ^
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 ^
FEATURES=%FEATURE% || exit 1
) ELSE (
nmake -f Make_mvc2.mak CPU=AMD64 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no FEATURES=%FEATURE% || exit 1
nmake -f Make_mvc2.mak CPU=AMD64 ^
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^
FEATURES=%FEATURE% || exit 1
)
.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt
:: Restore vim.exe, tests will run with this.
move /Y testdir\vim.exe .
echo "version output MinGW"
type ver_ming.txt
echo "version output MinGW GUI"
type ver_ming_gui.txt
echo "version output MVC"
echo "version output MSVC console"
.\vim --version
echo "version output MSVC GUI"
type ver_msvc.txt
cd ..

View File

@@ -25,7 +25,7 @@ function decada#Unit_Name () dict " {{{1
" Convert filename into acs unit:
" 1: remove the file extenstion.
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
" 3: remove a trailing '_' (wich denotes a specification)
" 3: remove a trailing '_' (which denotes a specification)
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
endfunction decada#Unit_Name " }}}1

View File

@@ -77,7 +77,7 @@ Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
(without Form-B, Arabic will _NOT_ be usable). It is highly
recommended that users search for so-called 'ISO-10646-1' fonts.
Do an Internet search or check www.arabeyes.org for further
info on where to attain the necessary Arabic fonts.
info on where to obtain the necessary Arabic fonts.
Font Installation
@@ -123,7 +123,7 @@ o Setting the appropriate character Encoding
>
:set encoding=utf-8
<
to your .vimrc file (entering the command manually into you Vim
to your .vimrc file (entering the command manually into your Vim
window is highly discouraged). In short, include ':set
encoding=utf-8' to your .vimrc file.

View File

@@ -1755,7 +1755,7 @@ Some examples:
Automatic formatting *auto-format* *autoformat*
When the 'a' flag is present in 'formatoptions' text is formatted
automatically when inserting text or deleting text. This works nice for
automatically when inserting text or deleting text. This works nicely for
editing text paragraphs. A few hints on how to use this:
- You need to properly define paragraphs. The simplest is paragraphs that are

View File

@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 8.2. Last change: 2020 Apr 23
*cmdline.txt* For Vim version 8.2. Last change: 2020 Jul 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -876,7 +876,7 @@ Also see |`=|.
*:<cword>* *<cword>* *:<cWORD>* *<cWORD>*
*:<cexpr>* *<cexpr>* *:<cfile>* *<cfile>*
*:<afile>* *<afile>* *:<abuf>* *<abuf>*
*:<amatch>* *<amatch>*
*:<amatch>* *<amatch>* *:<stack>* *<stack>*
*:<sfile>* *<sfile>* *:<slnum>* *<slnum>*
*:<sflnum>* *<sflnum>* *E499* *E500*
Note: these are typed literally, they are not special keys!
@@ -903,12 +903,16 @@ Note: these are typed literally, they are not special keys!
events).
<sfile> When executing a ":source" command, is replaced with the
file name of the sourced file. *E498*
When executing a function, is replaced with:
"function {function-name}[{lnum}]"
function call nesting is indicated like this:
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
When executing a function, is replaced with the call stack,
as with <stack> (this is for backwards compatibility, using
<stack> is preferred).
Note that filename-modifiers are useless when <sfile> is
used inside a function.
not used inside a script.
<stack> is replaced with the call stack, using
"function {function-name}[{lnum}]" for a function line
and "script {file-name}[{lnum}]" for a script line, and
".." in between items. E.g.:
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
<slnum> When executing a ":source" command, is replaced with the
line number. *E842*
When executing a function it's the line number relative to

View File

@@ -1,4 +1,4 @@
*digraph.txt* For Vim version 8.2. Last change: 2019 May 05
*digraph.txt* For Vim version 8.2. Last change: 2020 Jul 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -33,6 +33,8 @@ An alternative is using the 'keymap' option.
it is the Unicode character, see |digraph-encoding|.
Example: >
:digr e: 235 a: 228
< You can use `:exe` to enter a hex number: >
:exe 'digr += ' .. 0x2A72
< Avoid defining a digraph with '_' (underscore) as the
first character, it has a special meaning in the
future.

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Jul 09
*eval.txt* For Vim version 8.2. Last change: 2020 Jul 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -94,8 +94,9 @@ the Number. Examples:
Number 0 --> String "0" ~
Number -1 --> String "-1" ~
*octal*
Conversion from a String to a Number is done by converting the first digits to
a number. Hexadecimal "0xf9", Octal "017" or "0o17", and Binary "0b10"
Conversion from a String to a Number only happens in legacy Vim script, not in
Vim9 script. It is done by converting the first digits to a number.
Hexadecimal "0xf9", Octal "017" or "0o17", and Binary "0b10"
numbers are recognized (NOTE: when using |scriptversion-4| octal with a
leading "0" is not recognized). If the String doesn't start with digits, the
result is zero.
@@ -1993,6 +1994,8 @@ v:mouse_col Column number for a mouse click obtained with |getchar()|.
*v:none* *none-variable* *None*
v:none An empty String. Used to put an empty item in JSON. See
|json_encode()|.
This can also be used as a function argument to use the
default value, see |none-function_argument|.
When used as a number this evaluates to zero.
When used as a string this evaluates to "v:none". >
echo v:none
@@ -2831,7 +2834,7 @@ stridx({haystack}, {needle} [, {start}])
string({expr}) String String representation of {expr} value
strlen({expr}) Number length of the String {expr}
strpart({str}, {start} [, {len}])
String {len} characters of {str} at {start}
String {len} bytes of {str} at byte {start}
strptime({format}, {timestring})
Number Convert {timestring} to unix timestamp
strridx({haystack}, {needle} [, {start}])
@@ -4929,8 +4932,11 @@ getbufinfo([{dict}])
<
To get buffer-local options use: >
getbufvar({bufnr}, '&option_name')
<
Can also be used as a |method|: >
GetBufnr()->getbufinfo()
<
*getbufline()*
getbufline({expr}, {lnum} [, {end}])
Return a |List| with the lines starting from {lnum} to {end}
@@ -9180,7 +9186,8 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
the last quickfix list.
quickfixtextfunc
function to get the text to display in the
quickfix window. Refer to
quickfix window. The value can be the name of
a function or a funcref or a lambda. Refer to
|quickfix-window-function| for an explanation
of how to write the function and an example.
title quickfix list title text. See |quickfix-title|
@@ -11705,7 +11712,7 @@ The argument default expressions are evaluated at the time of the function
call, not definition. Thus it is possible to use an expression which is
invalid the moment the function is defined. The expressions are also only
evaluated when arguments are not specified during a call.
*none-function_argument*
You can pass |v:none| to use the default expression. Note that this means you
cannot pass v:none as an ordinary value when an argument has a default
expression.

View File

@@ -312,7 +312,7 @@ can create any of the following: >
$VIM/vimfiles/indent/sqlite.vim
No changes are necessary to the SQLSetType function. It will automatically
pickup the new SQL files and load them when you issue the SQLSetType command.
pick up the new SQL files and load them when you issue the SQLSetType command.
==============================================================================
@@ -519,7 +519,7 @@ beginning with those characters. >
4.3.2 Column Completion: *sql-completion-columns*
The SQL completion plugin can also display a list of columns for particular
tables. The column completion is trigger via <C-C>c.
tables. The column completion is triggered via <C-C>c.
NOTE: The following example uses <Right> to trigger a column list while
the popup window is active.
@@ -727,7 +727,7 @@ your platform (often a case on *nix) you define the following variable in
your |vimrc|: >
let g:omni_sql_no_default_maps = 1
Do no edit ftplugin/sql.vim directly! If you change this file your changes
Do not edit ftplugin/sql.vim directly! If you change this file your changes
will be over written on future updates. Vim has a special directory structure
which allows you to make customizations without changing the files that are
included with the Vim distribution. If you wish to customize the maps

View File

@@ -843,11 +843,10 @@ When modifyOtherKeys is enabled you can map <C-[> and <C-S-{>: >
imap <C-S-{> {{{
Without modifyOtherKeys <C-[> and <C-S-{> are indistinguishable from Esc.
A known side effect effect is that in Insert mode the raw escape sequence is
inserted after the CTRL-V key. This can be used to check whether
modifyOtherKeys is enabled: In Insert mode type CTRL-SHIFT-V CTRL-V, if you
get one byte then modifyOtherKeys is off, if you get <1b>27;5;118~ then it is
on.
A known side effect is that in Insert mode the raw escape sequence is inserted
after the CTRL-V key. This can be used to check whether modifyOtherKeys is
enabled: In Insert mode type CTRL-SHIFT-V CTRL-V, if you get one byte then
modifyOtherKeys is off, if you get <1b>27;5;118~ then it is on.
When the 'esckeys' option is off, then modifyOtherKeys will be disabled in
Insert mode to avoid every key with a modifier causing Insert mode to end.

View File

@@ -128,7 +128,7 @@ There are several ways to enter multi-byte characters:
- For MS-Windows IME can be used. See |IME|.
- For all systems keymaps can be used. See |mbyte-keymap|.
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose
the different input methods or disable them temporarily.
==============================================================================
@@ -141,8 +141,8 @@ in, or just use a certain locale inside Vim.
WHAT IS A LOCALE? *locale*
There are many of languages in the world. And there are different cultures
and environments at least as much as the number of languages. A linguistic
There are many languages in the world. And there are different cultures and
environments at least as many as the number of languages. A linguistic
environment corresponding to an area is called "locale". This includes
information about the used language, the charset, collating order for sorting,
date format, currency format and so on. For Vim only the language and charset
@@ -889,7 +889,7 @@ input_server_name is your |IM-server| name (check your |IM-server|
your_input_style is one of |OverTheSpot|, |OffTheSpot|, |Root|. See
also |xim-input-style|.
*international may not necessary if you use X11R6.
*international may not be necessary if you use X11R6.
*.inputMethod and *.preeditType are optional if you use X11R6.
For example, when you are using kinput2 as |IM-server|, >
@@ -952,7 +952,7 @@ automatically.
This works on not only insert-normal mode, but also search-command input and
replace mode.
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose
the different input methods or disable them temporarily.
WHAT IS IME

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.2. Last change: 2020 Jul 05
*options.txt* For Vim version 8.2. Last change: 2020 Jul 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5913,7 +5913,8 @@ A jump table for the options with a short description can be found at |Q_op|.
customize the information displayed in the quickfix or location window
for each entry in the corresponding quickfix or location list. See
|quickfix-window-function| for an explanation of how to write the
function and an example.
function and an example. The value can be the name of a function or a
lambda.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -7710,7 +7711,6 @@ A jump table for the options with a short description can be found at |Q_op|.
on Amiga: "amiga"
on Haiku: "xterm"
on Mac: "mac-ansi"
on MiNT: "vt52"
on Unix: "ansi"
on VMS: "ansi"
on Win 32: "win32")

View File

@@ -30,8 +30,8 @@ can be changed at compile time.
Because terminal updating under Unix is often slow (e.g. serial line
terminal, shell window in suntools), the 'showcmd' and 'ruler' options
are default off. If you have a fast terminal, try setting them on. You might
also want to set 'ttyfast'.
are off by default. If you have a fast terminal, try setting them on. You
might also want to set 'ttyfast'.
When using Vim in an xterm the mouse clicks can be used by Vim by setting
'mouse' to "a". If there is access to an X-server gui style copy/paste will

View File

@@ -1964,7 +1964,10 @@ The function should return a single line of text to display in the quickfix
window for each entry from start_idx to end_idx. The function can obtain
information about the entries using the |getqflist()| function and specifying
the quickfix list identifier "id". For a location list, getloclist() function
can be used with the 'winid' argument.
can be used with the 'winid' argument. If an empty list is returned, then the
default format is used to display all the entries. If an item in the returned
list is an empty string, then the default format is used to display the
corresponding entry.
If a quickfix or location list specific customization is needed, then the
'quickfixtextfunc' attribute of the list can be set using the |setqflist()| or

View File

@@ -642,7 +642,7 @@ disallowed though.
This assumes you write one or more plugins that you distribute as a package.
If you have two unrelated plugins you would use two packages, so that Vim
users can chose what they include or not. Or you can decide to use one
users can choose what they include or not. Or you can decide to use one
package with optional plugins, and tell the user to add the ones he wants with
`:packadd`.

View File

@@ -69,7 +69,7 @@ o Invocations
+ 'rightleft' ('rl') sets window orientation to right-to-left.
+ 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
allows one to remove a composing character which gets superimposed
on those that proceeded them (some languages require this).
on those that preceded them (some languages require this).
+ 'rightleftcmd' ('rlc') sets the command-line within certain modes
(such as search) to be utilized in right-to-left orientation as well.

View File

@@ -78,7 +78,7 @@ used by popup windows where 'cursorline' is set.
*sign-priority*
Each placed sign is assigned a priority value. When multiple signs are placed
on the same line, the attributes of the sign with the highest priority is used
independent of the sign group. The default priority for a sign is 10. The
independently of the sign group. The default priority for a sign is 10. The
priority is assigned at the time of placing a sign.
When the line on which the sign is placed is deleted, the sign is moved to the

View File

@@ -1937,7 +1937,7 @@ new highlightings for the following groups.:
Debug, DebugSpecial, DebugString, DebugBoolean, DebugType
which are used for the statement itself, special characters used in debug
strings, strings, boolean constants and types (this, super) respectively. I
have opted to chose another background for those statements.
have opted to choose another background for those statements.
Javadoc is a program that takes special comments out of Java program files and
creates HTML pages. The standard configuration will highlight this HTML code

View File

@@ -1979,6 +1979,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:<sfile> cmdline.txt /*:<sfile>*
:<sflnum> cmdline.txt /*:<sflnum>*
:<slnum> cmdline.txt /*:<slnum>*
:<stack> cmdline.txt /*:<stack>*
:= various.txt /*:=*
:> change.txt /*:>*
:? cmdline.txt /*:?*
@@ -3647,6 +3648,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<sfile> cmdline.txt /*<sfile>*
<sflnum> cmdline.txt /*<sflnum>*
<slnum> cmdline.txt /*<slnum>*
<stack> cmdline.txt /*<stack>*
<xCSI> intro.txt /*<xCSI>*
<xDown> term.txt /*<xDown>*
<xEnd> term.txt /*<xEnd>*
@@ -3898,6 +3900,7 @@ E1050 vim9.txt /*E1050*
E107 eval.txt /*E107*
E108 eval.txt /*E108*
E109 eval.txt /*E109*
E1092 vim9.txt /*E1092*
E1094 vim9.txt /*E1094*
E11 cmdline.txt /*E11*
E110 eval.txt /*E110*
@@ -8198,6 +8201,7 @@ no_plugin_maps filetype.txt /*no_plugin_maps*
nocombine syntax.txt /*nocombine*
non-greedy pattern.txt /*non-greedy*
non-zero-arg eval.txt /*non-zero-arg*
none-function_argument eval.txt /*none-function_argument*
none-variable eval.txt /*none-variable*
normal-index index.txt /*normal-index*
not-compatible usr_01.txt /*not-compatible*

View File

@@ -1,4 +1,4 @@
*testing.txt* For Vim version 8.2. Last change: 2020 Jul 09
*testing.txt* For Vim version 8.2. Last change: 2020 Jul 11
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Jul 10
*todo.txt* For Vim version 8.2. Last change: 2020 Jul 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -39,25 +39,36 @@ browser use: https://github.com/vim/vim/issues/1234
-------------------- Known bugs and current work -----------------------
Making everything work:
- in Vim9 script expressions are evaluated differently, not using a type.
e.g. "'' == 0" does not give an error and evaluates to true.
- cannot put # comment after assert() in :def function
- more return types depending on the first argument, like sort().
- more items in https://github.com/vim/vim/issues/6507
- More "goto failed" with check for trylevel.
- memory leak in test_vim9_script
- Check that when sourcing a Vim9 script, only the global items can be used.
- :put with a "=" register argument doesn't work, need to find the expression
and compile it. (#6397)
- should "'text'->method()" work? 't is a range, but 'text isn't.
- At the script level, keep script variables local to the block they are
declared in? Need to remember what variables were declared and delete them
when leaving the block.
- Implement { } block at the script level.
- need to check type when a declaration specifies a type: #6507
let nr: number = 'asdf'
- Make map() give an error if the resulting type is wrong.
Add mapnew() to create a new List/Dict for the result, which can have a
different value type.
- Implement "export {one, two three}".
- ISN_CHECKTYPE could use check_argtype()
- Slice of list: [1, 2, 3][1:2].
- give error for variable name:
let p = function('NoSuchFunc')
- Give runtime error if function argument is wrong.
def Increment(nr: number)
range(3)->Increment()
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd
- Expand `=expr` in :mkspell
- Make "true" and "false" work in vim9script
- Test that a function defined inside a :def function is local to that
function, g: functions can be defined and script-local functions cannot be
defined.
- Support passing v:none to use the default argument value. (#6504)
- make 0 == 'string' fail on the script level, like inside :def.
- Check that when using a user function name without prefix, it does not find
a global function. Prefixing g: is required.
@@ -77,10 +88,6 @@ Making everything work:
- memory leaks in test_vim9_cmd
- When evaluating constants for script variables, some functions could work:
has('asdf'), len('string')
- Support type for ":let"/":const" at script level for Vim9 script.
(Ben Jackson, #5671)
Can we share the code from ex_let_const() between direct execution and
compiling?
- Implement "as Name" in "import Item as Name from ..."
- Disallow unlet for local/script/imported vars
- Make "++nr" work.
@@ -91,6 +98,7 @@ Making everything work:
- eval_expr() call in dbg_parsearg() and debuggy_find()
- has() is compiled as a constant, but some checks are dynamic.
Check for dynamic values, such as "gui_running".
- Implement command modifiers, such as "silent". (#6530)
New syntax and functionality:
Improve error checking:
- "echo Func()" is an error if Func() does not return anything.
@@ -139,11 +147,15 @@ Further improvements:
Popup windows:
- Cursor not updated before a redraw, making it jump. (#5943)
- Add a termcap entry for changing the cursor when it goes under the popup and
back. like t_SI and t_EI (t_SU and t_EU, where "U" means under?)
- With terminal in popup, allow for popup_hide() to temporarily hide it.?
- Fire some autocommand event after a new popup window was created and
positioned? PopupNew? Could be used to set some options or move it out of
the way. (#5737)
However, it may also cause trouble, changing the popup of another plugin.
- Add a way to use popup_menu() synchronously: instead of invoking the
callback, return the choice. (Ben Jackson, #6534)
- Use popup (or popup menu) for command line completion
- When using a popup for the info of a completion menu, and there is not
enough space, let the popup overlap with the menu. (#4544)
@@ -199,6 +211,9 @@ Terminal debugger:
Terminal emulator window:
- No support for underline color, t_8u.
- When in terminal-Normal mode when the job finishes, the cursor jumps to the
end but the window is not updated. This only happens when typing "a".
:term bash -c "for V in {0..5}; do echo $V; sleep 1; done"
- When started with ":terminal ++close" and the shell exits but there is a
background process, the window remains open, because the channel still
exists (and output still shows). Perhaps close the window when an explicit
@@ -238,7 +253,7 @@ Terminal emulator window:
conversions.
Error numbers available:
E489, E610, E611, E653, E856
E610, E611, E653
Remove SPACE_IN_FILENAME ? It is only used for completion.
@@ -269,8 +284,15 @@ autocommands for the buffer lifecycle:
BufIsRenamed (after buffer ID gets another name)
The buffer list and windows are locked, no changes possible
How about removing Atari MiNT support?
src/Make_mint.mak, src/os_mint.h, matches with __MINT__
Make it possible to map (console and GUI): #6457
<C-[> 0x27 or is this <Esc> ?
<C-\> 0x28
<C-]> 0x29
<C-^> 0x30
<C-_> 0x31
Patch for Template string: #4634
Have another look at the implementation.
Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
replace this:
@@ -281,6 +303,13 @@ Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
let res = GetLeftFunc() <=> GetRightFunc() ?< lower ?= equal ?> upper
Patch to make :q work with local arglist. (Christian Brabandt, #6286)
Lua: updating wrong buffer when using newly created, unloaded buffer.
(#6539)
When "+ register is set then "" points to it. If another Vim grabs the "+
register, then "" doesn't contain anything. Make it still follow "+.
(#6435)
Patch to fix drawing error with DirectX. (James Grant, #5688)
Causes flicker on resizing. Workaround from Ken Takata.
How about only setting the attribute when part of the Vim window is offscreen?
@@ -347,6 +376,10 @@ Test loose_clipboard() by selecting text before suspending.
Undo puts cursor in wrong line after "cG<Esc>" undo.
Implement completion for "breakadd". Should expand the second argument, e.g.
"func", and then function names after ":breakadd func". Including
script-local functions.
:unmap <c-n> gives error but does remove the mapping. (Antony Scriven, 2019
Dec 19)
@@ -386,10 +419,6 @@ behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker,
goes to any buffer, and then :bnext skips help buffers, since they are
unlisted. (#4478)
Patch for Template string: #4634
Copies the text twice, not very efficient. Requires a separate implementation
for Vim9 script, compiling the string parts and expressions.
Statusline highlighting error, off by one. (#5599)
":find" with 'path' set to "data*" does not find files, while completion does
@@ -1928,13 +1957,6 @@ Szamotulski, 2012 Nov 8)
Session file creation: 'autochdir' causes trouble. Keep it off until after
loading all files.
MS-Windows resizing problems:
- Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun
20. Uses getWindowRect() instead of GetWindowPlacement()
- Win32: When the taskbar is at the top of the screen creating the tabbar
causes the window to move unnecessarily. (William E. Skeith III, 2012 Jan
12) Patch: 2012 Jan 13 Needs more work (2012 Feb 2)
'iminsert' global value set when using ":setlocal iminsert"? (Wu, 2012 Jun 23)
Patch to append regexp to tag commands to make it possible to select one out

View File

@@ -434,7 +434,7 @@ redefined without changing the search pattern.
/\f\+
The "\f" items stands for file name characters. Thus this matches a sequence
The "\f" item stands for file name characters. Thus this matches a sequence
of characters that can be a file name.
Which characters can be part of a file name depends on the system you are
using. On MS-Windows, the backslash is included, on Unix it is not. This is

View File

@@ -226,7 +226,7 @@ We will use "82" here, which is version 8.2.
This is all you need for the second method. Just launch the executable, and
follow the prompts.
For the first method you must chose one of the binary archives. These are
For the first method you must choose one of the binary archives. These are
available:
gvim82.zip The normal MS-Windows GUI version.

View File

@@ -7882,7 +7882,7 @@ Files: src/buffer.c, src/ex_cmds.c, src/fileio.c, src/globals.h,
Patch 6.1.221
Problem: Changing case may not work properly, depending on the current
locale.
Solution: Add the 'casemap' option to let the user chose how changing case
Solution: Add the 'casemap' option to let the user choose how changing case
is to be done.
Also fix lowering case when an UTF-8 character doesn't keep the
same byte length.

View File

@@ -147,7 +147,7 @@ Se ":help search\-pattern" for tilg
{kommando} fortolkes som en Ex-kommando.
Hvis {kommando} indeholder mellemrum, s<> skal den omsluttes af
dobbelte citationstegn (det afh<66>nger af den skal der bruges).
Eksempel: Vim "+set si" main.c
Eksempel: vim "+set si" main.c
.br
Bem<EFBFBD>rk: Du kan bruge op til 10 "+"- eller "\-c"-kommandoer.
.TP

View File

@@ -147,7 +147,7 @@ Se ":help search\-pattern" for tilgængelige søgemønstre.
{kommando} fortolkes som en Ex-kommando.
Hvis {kommando} indeholder mellemrum, så skal den omsluttes af
dobbelte citationstegn (det afhænger af den skal der bruges).
Eksempel: Vim "+set si" main.c
Eksempel: vim "+set si" main.c
.br
Bemærk: Du kan bruge op til 10 "+"- eller "\-c"-kommandoer.
.TP

View File

@@ -156,7 +156,7 @@ Ex
{commande} est interpr<70>t<EFBFBD>e comme une commande Ex.
Si la {commande} contient des espaces, elle doit <20>tre entour<75>e
de doubles-apostrophes (cela d<>pend du shell utilis<69>).
Exemple : Vim "+set si" main.c
Exemple : vim "+set si" main.c
.br
Note : vous pouvez utiliser jusqu'<27> 10 commandes "+" ou "\-c".
.TP

View File

@@ -156,7 +156,7 @@ Exécute {commande} après la lecture du premier fichier.
{commande} est interprétée comme une commande Ex.
Si la {commande} contient des espaces, elle doit être entourée
de doubles-apostrophes (cela dépend du shell utilisé).
Exemple : Vim "+set si" main.c
Exemple : vim "+set si" main.c
.br
Note : vous pouvez utiliser jusqu'à 10 commandes "+" ou "\-c".
.TP

View File

@@ -150,7 +150,7 @@ primo file
{comando} <20> interpretato come un comando Ex.
Se il {comando} contiene spazi deve essere incluso fra doppi apici
(o altro delimitatore, a seconda della shell che si sta usando).
Esempio: Vim "+set si" main.c
Esempio: vim "+set si" main.c
.br
Note: Si possono avere fino a 10 comandi "+" o "\-c".
.TP

View File

@@ -150,7 +150,7 @@ primo file è stato letto.
{comando} è interpretato come un comando Ex.
Se il {comando} contiene spazi deve essere incluso fra doppi apici
(o altro delimitatore, a seconda della shell che si sta usando).
Esempio: Vim "+set si" main.c
Esempio: vim "+set si" main.c
.br
Note: Si possono avere fino a 10 comandi "+" o "\-c".
.TP

View File

@@ -150,7 +150,7 @@ wzorce wyszukiwania.
{polecenie} jest interpretowane jako polecenie Ex.
Je<EFBFBD>li {poleceni} zawiera bia<69>e znaki musi by<62> umieszczone w podw<64>jnych
cudzys<EFBFBD>owach (zale<6C>y to od u<>ywanej pow<6F>oki).
Przyk<EFBFBD>ad: Vim "+set si" main.c
Przyk<EFBFBD>ad: vim "+set si" main.c
.br
Uwaga: Mo<4D>na u<>y<EFBFBD> do 10 polece<63> "+" lub "\-c".
.TP

View File

@@ -150,7 +150,7 @@ wzorce wyszukiwania.
{polecenie} jest interpretowane jako polecenie Ex.
Jeśli {poleceni} zawiera białe znaki musi być umieszczone w podwójnych
cudzysłowach (zależy to od używanej powłoki).
Przykład: Vim "+set si" main.c
Przykład: vim "+set si" main.c
.br
Uwaga: Można użyć do 10 poleceń "+" lub "\-c".
.TP

View File

@@ -145,7 +145,7 @@ Kullan
{komut} bir Ex komutu olarak i<>letilir.
E<EFBFBD>er {komut} bo<62>luk i<>eriyorsa <20>ift t<>rnak i<>erisine al<61>nmal<61>d<EFBFBD>r (bu
kullan<EFBFBD>lan kabu<62>a ba<62>l<EFBFBD>d<EFBFBD>r).
<EFBFBD>rnek: Vim "+set si" main.c
<EFBFBD>rnek: vim "+set si" main.c
.br
Not: 10 taneye kadar "+" veya "\-c" komutu kullanabilirsiniz.
.TP

View File

@@ -145,7 +145,7 @@ Kullanılabilir arama dizgileri için ":help search\-pattern" yazın.
{komut} bir Ex komutu olarak işletilir.
Eğer {komut} boşluk içeriyorsa çift tırnak içerisine alınmalıdır (bu
kullanılan kabuğa bağlıdır).
Örnek: Vim "+set si" main.c
Örnek: vim "+set si" main.c
.br
Not: 10 taneye kadar "+" veya "\-c" komutu kullanabilirsiniz.
.TP

View File

@@ -146,7 +146,7 @@ See ":help search\-pattern" for the available search patterns.
{command} is interpreted as an Ex command.
If the {command} contains spaces it must be enclosed in double quotes (this
depends on the shell that is used).
Example: Vim "+set si" main.c
Example: vim "+set si" main.c
.br
Note: You can use up to 10 "+" or "\-c" commands.
.TP

View File

@@ -110,7 +110,7 @@ OPTIONS
read. {command} is interpreted as an Ex command. If the
{command} contains spaces it must be enclosed in double
quotes (this depends on the shell that is used). Example:
Vim "+set si" main.c
vim "+set si" main.c
Note: You can use up to 10 "+" or "-c" commands.
-S {file} {file} will be sourced after the first file has been read.

View File

@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Jul 17
*vim9.txt* For Vim version 8.2. Last change: 2020 Jul 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -71,16 +71,17 @@ comments start with #. >
The reason is that a double quote can also be the start of a string. In many
places, especially halfway an expression with a line break, it's hard to tell
what the meaning is. To avoid confusion only # comments are recognized.
This is the same as in shell scripts and Python programs.
what the meaning is, since both a string and a comment can be followed by
arbitrary text. To avoid confusion only # comments are recognized. This is
the same as in shell scripts and Python programs.
In Vi # is a command to list text with numbers. In Vim9 script you can use
`:number` for that. >
101number
101 number
To improve readability there must be a space between a command and the #
that starts a comment. Note that #{ is the start of a dictionary, therefore
it cannot start a comment.
it does not start a comment.
Vim9 functions ~
@@ -93,7 +94,7 @@ The syntax is strict, to enforce code that is easy to read and understand.
Compilation is done when the function is first called, or when the
`:defcompile` command is encountered in the script where the function was
defined.
defined. `:disassemble` also compiles the function.
`:def` has no options like `:function` does: "range", "abort", "dict" or
"closure". A `:def` function always aborts on an error, does not get a range
@@ -104,7 +105,7 @@ be used, type checking will then be done at runtime, like with legacy
functions.
Arguments are accessed by name, without "a:". There is no "a:" dictionary or
"a:000" list.
"a:000" list. Just like any other language.
Variable arguments are defined as the last argument, with a name and have a
list type, similar to Typescript. For example, a list of numbers: >
@@ -117,9 +118,13 @@ Functions and variables are script-local by default ~
*vim9-scopes*
When using `:function` or `:def` to specify a new function at the script level
in a Vim9 script, the function is local to the script, as if "s:" was
prefixed. Using the "s:" prefix is optional.
To define or use a global function or variable the "g:" prefix must be used.
prefixed. Using the "s:" prefix is optional. To define or use a global
function or variable the "g:" prefix must be used. For functions in an
autoload script the "name#" prefix is sufficient. >
def ThisFunction() # script-local
def s:ThisFunction() # script-local
def g:ThatFunction() # global
def scriptname#function() # autoload
When using `:function` or `:def` to specify a new function inside a function,
the function is local to the function. It is not possible to define a
@@ -184,8 +189,9 @@ To intentionally avoid a variable being available later, a block can be used:
echo temp " Error!
An existing variable cannot be assigned to with `:let`, since that implies a
declaration. An exception is global variables: these can be both used with
and without `:let`, because there is no rule about where they are declared.
declaration. Global, window, tab, buffer and Vim variables can only be used
without `:let`, because they are are not really declared, they can also be
deleted with `:unlet`.
Variables cannot shadow previously defined variables.
Variables may shadow Ex commands, rename the variable if needed.
@@ -194,12 +200,19 @@ Global variables and user defined functions must be prefixed with "g:", also
at the script level. >
vim9script
let script_local = 'text'
let g:global = 'value'
g:global = 'value'
let Funcref = g:ThatFunction
Since "&opt = value" is now assigning a value to option "opt", ":&" cannot be
used to repeat a `:substitute` command.
*E1092*
Declaring more than one variable at a time, using the unpack notation, is
currently not supported: >
let [v1, v2] = GetValues() # Error!
That is because the type needs to be inferred from the list item type, which
isn't that easy.
Omitting :call and :eval ~
@@ -208,29 +221,29 @@ Functions can be called without `:call`: >
Using `:call` is still possible, but this is discouraged.
A method call without `eval` is possible, so long as the start is an
identifier or can't be an Ex command. It does NOT work for string constants: >
myList->add(123) " works
g:myList->add(123) " works
[1, 2, 3]->Process() " works
#{a: 1, b: 2}->Process() " works
{'a': 1, 'b': 2}->Process() " works
"foobar"->Process() " does NOT work
("foobar")->Process() " works
'foobar'->Process() " does NOT work
('foobar')->Process() " works
identifier or can't be an Ex command. Examples: >
myList->add(123)
g:myList->add(123)
[1, 2, 3]->Process()
#{a: 1, b: 2}->Process()
{'a': 1, 'b': 2}->Process()
"foobar"->Process()
("foobar")->Process()
'foobar'->Process()
('foobar')->Process()
In case there is ambiguity between a function name and an Ex command, use ":"
to make clear you want to use the Ex command. For example, there is both the
`:substitute` command and the `substitute()` function. When the line starts
with `substitute(` this will use the function, prepend a colon to use the
command instead: >
In rare case there is ambiguity between a function name and an Ex command, use
":" to make clear you want to use the Ex command. For example, there is both
the `:substitute` command and the `substitute()` function. When the line
starts with `substitute(` this will use the function. Prepend a colon to use
the command instead: >
:substitute(pattern (replacement (
Note that while variables need to be defined before they can be used,
functions can be called before being defined. This is required to be able
have cyclic dependencies between functions. It is slightly less efficient,
since the function has to be looked up by name. And a typo in the function
name will only be found when the call is executed.
name will only be found when the function is called.
Omitting function() ~
@@ -277,10 +290,14 @@ possible just before or after the operator. For example: >
? PosFunc(arg)
: NegFunc(arg)
For a method call using "->" and a member using a dot, a line break is allowed
before it: >
let result = GetBuilder()
->BuilderSetWidth(333)
->BuilderSetHeight(777)
->BuilderBuild()
let result = MyDict
.member
< *E1050*
To make it possible for the operator at the start of the line to be
@@ -335,9 +352,10 @@ No curly braces expansion ~
|curly-braces-names| cannot be used.
No :append, :change or :insert ~
No :xit, :append, :change or :insert ~
These commands are too quickly confused with local variable names.
These commands are too easily confused with local variable names. Instead of
`:x` or `:xit` you can use `:exit`.
Comparators ~
@@ -486,19 +504,20 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
When the caller omits an argument the {value} is used.
The function will be compiled into instructions when
called, or when `:defcompile` is used. Syntax and
type errors will be produced at that time.
called, or when `:disassemble` or `:defcompile` is
used. Syntax and type errors will be produced at that
time.
NOTE: It is possible to nest `:def` inside another
`:def`, but it is not possible to nest `:def` inside
`:function`, for backwards compatibility.
It is possible to nest `:def` inside another `:def` or
`:function` up to about 50 levels deep.
[!] is used as with `:function`. Note that in Vim9
script script-local functions cannot be deleted or
redefined later in the same script.
*:enddef*
:enddef End of a function defined with `:def`.
:enddef End of a function defined with `:def`. It should be on
a line by its own.
If the script the function is defined in is Vim9 script, then script-local
@@ -559,7 +578,7 @@ Not supported yet:
tuple<a: {type}, b: {type}, ...>
These types can be used in declarations, but no value will have this type:
{type}|{type}
{type}|{type} {not implemented yet}
void
any
@@ -661,19 +680,15 @@ The original value of 'cpoptions' is restored at the end of the script.
Export ~
*:export* *:exp*
Exporting one item can be written as: >
Exporting an item can be written as: >
export const EXPORTED_CONST = 1234
export let someValue = ...
export def MyFunc() ...
export class MyClass ...
As this suggests, only constants, variables, `:def` functions and classes can
be exported.
be exported. {classes are not implemented yet}
Alternatively, an export statement can be used to export several already
defined (otherwise script-local) items: >
export {EXPORTED_CONST, someValue, MyFunc, MyClass}
<
*E1042*
`:export` can only be used in Vim9 script, at the script level.

View File

@@ -88,6 +88,9 @@ endif
" AHDL
au BufNewFile,BufRead *.tdf setf ahdl
" AIDL
au BufNewFile,BufRead *.aidl setf aidl
" AMPL
au BufNewFile,BufRead *.run setf ampl

View File

@@ -1,12 +1,17 @@
" Vim filetype plugin file
" Language: C++
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Jan 15
" Last Change: 2020 Jul 26
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Behaves just like C
" Behaves mostly just like C
runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim
" C++ uses templates with <things>
" Disabled, because it gives an error for typing an unmatched ">".
" set matchpairs+=<:>
" let b:undo_ftplugin ..= ' | setl matchpairs<'

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Diff
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Jul 27
" Last Change: 2020 Jul 18
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -13,3 +13,6 @@ let b:undo_ftplugin = "setl modeline<"
" Don't use modelines in a diff, they apply to the diffed file
setlocal nomodeline
" If there are comments they start with #
let &commentstring = "# %s"

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Jul 06
" Last Change: 2020 Jul 26
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -83,7 +83,7 @@ endif
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words =
\ '\<\%(fu\%[nction]\|def\)\>:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' .
\ '\<\%(fu\%[nction]\|def\)\>[^(]:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' .
\ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
\ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
\ '{:},' .

View File

@@ -1,7 +1,7 @@
" Vim indent file
" Language: Vim script
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Oct 31
" Last Change: 2020 Jul 19
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -11,6 +11,7 @@ let b:did_indent = 1
setlocal indentexpr=GetVimIndent()
setlocal indentkeys+==end,=},=else,=cat,=fina,=END,0\\,0=\"\\\
setlocal indentkeys-=0#
let b:undo_indent = "setl indentkeys< indentexpr<"

View File

@@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
" Last Change: 2020 Jun 12
" Last Change: 2020 Jul 12
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with

23
runtime/syntax/aidl.vim Normal file
View File

@@ -0,0 +1,23 @@
" Vim syntax file
" Language: aidl (Android Interface Definition Language)
" https://developer.android.com/guide/components/aidl
" Maintainer: Dominique Pelle <dominique.pelle@tomtom.com>
" LastChange: 2020/07/25
" Quit when a syntax file was already loaded.
if exists("b:current_syntax")
finish
endif
source <sfile>:p:h/java.vim
syn keyword aidlParamDir in out inout
syn keyword aidlKeyword oneway parcelable
" Needed for the 'in', 'out', 'inout' keywords to be highlighted.
syn cluster javaTop add=aidlParamDir
hi def link aidlParamDir StorageClass
hi def link aidlKeyword Keyword
let b:current_syntax = "aidl"

View File

@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Last Change: Jun 07, 2020
" Version: 118
" Last Change: Jun 29, 2020
" Version: 119
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
@@ -147,6 +147,11 @@ if exists("g:tex_nospell") && g:tex_nospell
else
let s:tex_nospell = 0
endif
if exists("g:tex_matchcheck")
let s:tex_matchcheck= g:tex_matchcheck
else
let s:tex_matchcheck= '[({[]'
endif
if exists("g:tex_excludematcher")
let s:tex_excludematcher= g:tex_excludematcher
else
@@ -205,27 +210,41 @@ if !exists("g:tex_no_math")
endif
endif
" Try to flag {} and () mismatches: {{{1
" Try to flag {}, [], and () mismatches: {{{1
if s:tex_fast =~# 'm'
if !s:tex_no_error
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell
syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup,texError
syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup,texError,@NoSpell
if s:tex_matchcheck =~ '{'
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError
syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup,texError
endif
if s:tex_matchcheck =~ '\['
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell
syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup,texError,@NoSpell
endif
else
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup
syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup
syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup
if s:tex_matchcheck =~ '{'
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup
syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup
endif
if s:tex_matchcheck =~ '\['
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup
syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup
endif
endif
if !s:tex_nospell
syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell
else
syn region texParen start="(" end=")" transparent contains=@texMatchGroup
if s:tex_matchcheck =~ '('
if !s:tex_nospell
syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell
else
syn region texParen start="(" end=")" transparent contains=@texMatchGroup
endif
endif
endif
if !s:tex_no_error
syn match texError "[}\])]"
if s:tex_matchcheck =~ '('
syn match texError "[}\]]"
else
syn match texError "[}\])]"
endif
endif
if s:tex_fast =~# 'M'
if !exists("g:tex_no_math")
@@ -756,7 +775,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['ldots' , '…'],
\ ['le' , '≤'],
\ ['left|' , '|'],
\ ['left\|' , '‖'],
\ ['left\\|' , '‖'],
\ ['left(' , '('],
\ ['left\[' , '['],
\ ['left\\{' , '{'],

View File

@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 8.0 script
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: Jun 01, 20200
" Version: 8.0-37
" Last Change: July 15, 2020
" Version: 8.0-41
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Automatically generated keyword lists: {{{1
@@ -29,14 +29,14 @@ syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimStdPlugin contained Arguments Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellredir shiftwidth showmatch signcolumn smarttab sp spf srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shellslash shm showmode siso smc spc spl ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltemp shortmess showtabline sj smd spell splitbelow ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shelltype shortname shq slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxescape showbreak si sm so spellfile spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shellxquote showcmd sidescroll smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
syn keyword vimOption contained altkeymap arabicshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftround showfulltag sidescrolloff smartindent sol spellsuggest sr stal sua swf syntax tagcase tb tenc termwinsize tfu title toolbar tsr ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions
syn keyword vimOption contained acd ambw arshape background ballooneval bex bl brk buftype cf cinkeys cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr go guifontset helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemodel mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess showtabline sj smd spell spl srr startofline suffixes switchbuf ta tagfunc tbi term termwintype tgc titlelen toolbariconsize ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan
syn keyword vimOption contained ai anti autochdir backspace balloonevalterm bexpr bo browsedir casemap cfu cino cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd gp guifontwide helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname shq slm sn spellcapcheck splitbelow ss statusline suffixesadd sws tabline taglength tbidi termbidi terse tgst titleold top ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
syn keyword vimOption contained akm antialias autoindent backup balloonexpr bg bomb bs cb ch cinoptions cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault grepformat guiheadroom hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak si sm so spellfile splitright ssl stl sw sxe tabpagemax tagrelative tbis termencoding textauto thesaurus titlestring tpm ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
syn keyword vimOption contained al ar autoread backupcopy bdir bh breakat bsdir cc charconvert cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepprg guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescroll smartcase softtabstop spelllang spo ssop stmp swapfile sxq tabstop tags tbs termguicolors textmode tildeop tl tr tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
syn keyword vimOption contained aleph arab autowrite backupdir bdlay bin breakindent bsk ccv ci cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn gtl guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag sidescrolloff smartindent sol spelloptions spr st sts swapsync syn tag tagstack tc termwinkey textwidth timeout tm ts ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
syn keyword vimOption contained allowrevins arabic autowriteall backupext belloff binary breakindentopt bt cd cin clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtt guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch signcolumn smarttab sp spellsuggest sps sta su swb synmaxcol tagbsearch tal tcldll termwinscroll tf timeoutlen to tsl ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
syn keyword vimOption contained altkeymap arabicshape aw backupskip beval bk bri bufhidden cdpath cindent cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw guicursor guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode siso smc spc spf sr stal sua swf syntax tagcase tb tenc termwinsize tfu title toolbar tsr ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
syn keyword vimOption contained ambiwidth ari awa balloondelay bevalterm bkc briopt buflisted cedit cink cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guifont helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm
" vimOptions: These are the turn-off setting variants {{{2
syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobevalterm nobk nobreakindent nocf nocindent nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noemo noeol noesckeys noexpandtab nofic nofixeol nofoldenable nogd nohid nohkmap nohls noicon noimc noimdisable noinfercase nojoinspaces nolangremap nolinebreak nolnr nolrm nomacatsui noml nomod nomodelineexpr nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscrollbind noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
@@ -66,8 +66,8 @@ syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beauti
" AutoCmd Events {{{2
syn case ignore
syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextYankPost User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre
syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextYankPost User VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave WinNew
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre BufWinEnter
" Highlight commonly used Groupnames {{{2
syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
@@ -78,11 +78,11 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eval exists feedkeys findfile fnamemodify foldtextresult get getchar getcmdtype getenv getftype getmarklist getqflist gettabwinvar getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchaddpos matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prop_add prop_type_add pum_getpos rand reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setline setreg sha256 sign_getplaced sign_unplace sort sound_stop srand strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower trunc uniq wildmenumode win_execute win_gotoid winlayout winrestview winwidth
syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete echoraw eventhandler exp filereadable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getimstatus getmatches getreg gettagstack getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matcharg matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_clear prop_type_change pumvisible range reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcharsearch setloclist settabvar shellescape sign_jump sign_unplacelist sound_clear spellbadword state strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper type values winbufnr win_findbuf winheight winline winsaveview wordcount
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline empty executable expand filewritable floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getjumplist getmousepos getregtype getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapset matchdelete max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_setcallback prop_find prop_type_delete py3eval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcmdpos setmatches settabwinvar shiftwidth sign_place simplify soundfold spellsuggest str2float strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile virtcol wincol win_getid win_id2tabwin winnr win_screenpos writefile
syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype environ execute expandcmd filter fmod foldlevel function getbufvar getcmdline getcurpos getfsize getline getpid gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval match matchend menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setenv setpos settagstack sign_define sign_placelist sin sound_playevent split str2list strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree visualmode windowsversion win_gettype win_id2win winrestcmd win_splitmove xor
syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler escape exepath extend finddir fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getloclist getpos gettabvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map matchadd matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setprompt prop_remove prop_type_list pyxeval readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playfile sqrt str2nr strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall
syn keyword vimFuncName contained abs appendbufline asin assert_fails assert_notmatch balloon_gettext bufadd bufname byteidx char2nr ch_evalexpr ch_log ch_readraw cindent complete_check cosh deepcopy diff_hlID eval exists feedkeys findfile fnameescape foldtext garbagecollect getchangelist getcmdpos getcwd getftime getloclist getpos gettabinfo getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval match matchend menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setinterrupt prop_list prop_type_get pyeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setenv setpos settagstack sign_define sign_placelist sin sound_playevent split str2list strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undotree wildmenumode win_execute win_gotoid winlayout winrestview winwidth
syn keyword vimFuncName contained acos argc assert_beeps assert_false assert_report balloon_show bufexists bufnr byteidxcomp ch_canread ch_evalraw ch_logfile ch_sendexpr clearmatches complete_info count delete echoraw eventhandler exp filereadable flatten fnamemodify foldtextresult get getchar getcmdtype getenv getftype getmarklist getqflist gettabvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map matchadd matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setprompt prop_remove prop_type_list pyxeval readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playfile sqrt str2nr strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim uniq winbufnr win_findbuf winheight winline winsaveview wordcount
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true balloon_split buflisted bufwinid call ch_close ch_getbufnr ch_open ch_sendraw col confirm cscope_connection deletebufline empty executable expand filewritable float2nr foldclosed foreground getbufinfo getcharmod getcmdwintype getfontname getimstatus getmatches getreg gettabwinvar getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchaddpos matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prop_add prop_type_add pum_getpos rand reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setline setreg sha256 sign_getplaced sign_unplace sort sound_stop srand strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc values wincol win_getid win_id2tabwin winnr win_screenpos writefile
syn keyword vimFuncName contained and arglistid assert_equalfile assert_match atan browse bufload bufwinnr ceil ch_close_in ch_getjob ch_read ch_setoptions complete copy cursor did_filetype environ execute expandcmd filter floor foldclosedend funcref getbufline getcharsearch getcompletion getfperm getjumplist getmousepos getreginfo gettagstack getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matcharg matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_clear prop_type_change pumvisible range reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcharsearch setloclist settabvar shellescape sign_jump sign_unplacelist sound_clear spellbadword state strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower type virtcol windowsversion win_gettype win_id2win winrestcmd win_splitmove xor
syn keyword vimFuncName contained append argv assert_exception assert_notequal atan2 browsedir bufloaded byte2line changenr chdir ch_info ch_readblob ch_status complete_add cos debugbreak diff_filler escape exepath extend finddir fmod foldlevel function getbufvar getcmdline getcurpos getfsize getline getpid getregtype getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapset matchdelete max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_setcallback prop_find prop_type_delete py3eval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcmdpos setmatches settabwinvar shiftwidth sign_place simplify soundfold spellsuggest str2float strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper undofile visualmode
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
@@ -295,6 +295,7 @@ syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentS
syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString
syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"'
" Vim9 comments - TODO: might be highlighted while they don't work
syn match vim9Comment excludenl +^#[^{].*$+ contains=@vimCommentGroup,vimCommentString
syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString
syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString
syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString
@@ -453,6 +454,9 @@ syn case match
syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute
syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
" User Command Highlighting: {{{2
syn match vimUsrCmd '^\s*\zs\u\w*.*$'
" Errors And Warnings: {{{2
" ====================
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
@@ -598,7 +602,7 @@ syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
syn match vimHiGuiRgb contained "#\x\{6}"
" Highlighting: hi group key=arg ... {{{2
syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation
syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation
syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
syn match vimHiKeyError contained "\i\+="he=e-1
@@ -607,6 +611,7 @@ syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
@@ -629,7 +634,7 @@ syn match vimCtrlChar "[- -]"
" Beginners - Patterns that involve ^ {{{2
" =========
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
syn match vimContinue "^\s*\\"
syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
@@ -877,6 +882,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimError Error
hi def link vimFBVar vimVar
hi def link vimFgBgAttrib vimHiAttrib
hi def link vimHiCtermul vimHiTerm
hi def link vimFold Folded
hi def link vimFTCmd vimCommand
hi def link vimFTOption vimSynType

View File

@@ -7,7 +7,7 @@
fasonita por priskribi sufi<66>ajn komandojn, por ke vi kapablu uzi Vim
kun sufi<66>a facileco.
La tempo bezonata por plenumi la kurson estas 25-30 minutoj, kaj dependas
La tempo bezonata por plenumi la kurson estas 30 minutoj, kaj dependas
de kiom da tempo estas uzata por eksperimenti.
ATENTU:
@@ -100,7 +100,7 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo.
1. Movu la kursoron al la unua suba linio markita per --->.
2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan
signon post kie la teksto estas enmetenda.
signon anta<EFBFBD> kie la teksto estas enmetenda.
3. Premu i kaj tajpu la bezonatajn aldonojn.
@@ -200,7 +200,7 @@ Nun da
1. Premu <ESK> por certigi, ke vi estas en normala re<72>imo.
2. Movu la kursoron al la linio markita per --->.
2. Movu la kursoron al la suba linio markita per --->.
3. Movu la kursoron al la komenco de vorto, kiu forvi<76>endas.
@@ -225,7 +225,7 @@ Nun da
1. Premu <ESK> por certigi, ke vi estas en normala re<72>imo.
2. Movu la kursoron sur la suban linion markita per --->.
2. Movu la kursoron al la suba linio markita per --->.
3. Movu la kursoron <20>e la fino de la <20>usta linio (POST la unua . ).
@@ -296,10 +296,10 @@ RIMARKO: Premo de nur la movo en Normala re
1. Movu la kursoron <20>e la unua MAJUSKLA vorto en la linio markita per --->.
2. Tajpu d2w por forvi<76>i la du MAJUSKLAJN vortojn
2. Tajpu d2w por forvi<76>i la du MAJUSKLAJN vortojn.
3. Ripetu pa<70>ojn 1 <20>is 2 per malsama nombro por forvi<76>i la sinsekvajn
MAJUSKLAJN vortojn per unu komando
MAJUSKLAJN vortojn per unu komando.
---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita.
@@ -379,7 +379,7 @@ RIMARKO: Premo de nur la movo en Normala re
** Tajpu p por meti tekston forvi<76>itan anta<74>e post la kursoro. **
1. Movu la kursoron <20>e la unua ---> suba linio.
1. Movu la kursoron <20>e la unua suba linio markita per --->.
2. Tajpu dd por forvi<76>i la linion kaj konservi <20>in ene de re<72>istro de Vim.
@@ -652,7 +652,7 @@ RIMARKO: Se vi volus eliri el Vim kaj restartigi
la dosiero estus precize same kiel kopio de la instruilo kiam vi
konservis <20>in.
5. Nun forvi<76>u la dosieron tajpante (WINDOWS): :!del TESTO
5. Nun forvi<76>u la dosieron tajpante (VINDOZO): :!del TESTO
a<> (UNIKSO): :!rm TESTO
@@ -713,7 +713,7 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple,
1. :!komando plenumas eksteran komandon.
Iuj utilaj ekzemploj estas:
(WINDOWS) (UNIKSO)
(VINDOZO) (UNIKSO)
:!dir :!ls - listigas dosierujon
:!del DOSIERNOMO :!rm DOSIERNOMO - forvi<76>as la dosieron DOSIERNOMO
@@ -808,7 +808,7 @@ RIMARKO: Anstata
** Uzu la y operatoron por kopii tekston, kaj p por alglui <20>in **
1. Iru al la linio markita per ---> sube kaj poziciu la kursoron post "a)".
1. Iru al la suba linio markita per ---> kaj poziciu la kursoron post "a)".
2. Komencu la Viduman re<72>imon per v kaj movu la kursoron tuj anta<74> "unua".
@@ -914,7 +914,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser
1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo:
:e ~/.vimrc por Unikso
:e $VIM/_vimrc por Windows
:e $VIM/_vimrc por Vindozo
2. Nun legu la enhavon de la ekzempla "vimrc"
:r $VIMRUNTIME/vimrc_example.vim
@@ -945,7 +945,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser
6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI
7. Premu <TAB>. Vim kompletigos la nomon (se <20>i estas unika)
7. Premu d<TAB>. Vim kompletigos la nomon (se <20>i estas unika)
RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj
<TAB>. Estas aparte utila por :help .
@@ -986,6 +986,6 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj
Esperantigita fare de Dominique Pell<6C>, 2008-04-01
Retpo<70>to: dominique.pelle@gmail.com
Lasta <20>an<61>o: 2018-12-02
Lasta <20>an<61>o: 2020-07-19
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -7,7 +7,7 @@
fasonita por priskribi sufiĉajn komandojn, por ke vi kapablu uzi Vim
kun sufiĉa facileco.
La tempo bezonata por plenumi la kurson estas 25-30 minutoj, kaj dependas
La tempo bezonata por plenumi la kurson estas 30 minutoj, kaj dependas
de kiom da tempo estas uzata por eksperimenti.
ATENTU:
@@ -100,7 +100,7 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo.
1. Movu la kursoron al la unua suba linio markita per --->.
2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan
signon post kie la teksto estas enmetenda.
signon antaŭ kie la teksto estas enmetenda.
3. Premu i kaj tajpu la bezonatajn aldonojn.
@@ -200,7 +200,7 @@ Nun daŭrigu al la leciono 2.
1. Premu <ESK> por certigi, ke vi estas en normala reĝimo.
2. Movu la kursoron al la linio markita per --->.
2. Movu la kursoron al la suba linio markita per --->.
3. Movu la kursoron al la komenco de vorto, kiu forviŝendas.
@@ -225,7 +225,7 @@ Nun daŭrigu al la leciono 2.
1. Premu <ESK> por certigi, ke vi estas en normala reĝimo.
2. Movu la kursoron sur la suban linion markita per --->.
2. Movu la kursoron al la suba linio markita per --->.
3. Movu la kursoron ĉe la fino de la ĝusta linio (POST la unua . ).
@@ -296,10 +296,10 @@ RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos
1. Movu la kursoron ĉe la unua MAJUSKLA vorto en la linio markita per --->.
2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn
2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn.
3. Ripetu paŝojn 1 ĝis 2 per malsama nombro por forviŝi la sinsekvajn
MAJUSKLAJN vortojn per unu komando
MAJUSKLAJN vortojn per unu komando.
---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita.
@@ -379,7 +379,7 @@ RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos
** Tajpu p por meti tekston forviŝitan antaŭe post la kursoro. **
1. Movu la kursoron ĉe la unua ---> suba linio.
1. Movu la kursoron ĉe la unua suba linio markita per --->.
2. Tajpu dd por forviŝi la linion kaj konservi ĝin ene de reĝistro de Vim.
@@ -652,7 +652,7 @@ RIMARKO: Se vi volus eliri el Vim kaj restartigi ĝin denove per vim TESTO,
la dosiero estus precize same kiel kopio de la instruilo kiam vi
konservis ĝin.
5. Nun forviŝu la dosieron tajpante (WINDOWS): :!del TESTO
5. Nun forviŝu la dosieron tajpante (VINDOZO): :!del TESTO
aŭ (UNIKSO): :!rm TESTO
@@ -713,7 +713,7 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple,
1. :!komando plenumas eksteran komandon.
Iuj utilaj ekzemploj estas:
(WINDOWS) (UNIKSO)
(VINDOZO) (UNIKSO)
:!dir :!ls - listigas dosierujon
:!del DOSIERNOMO :!rm DOSIERNOMO - forviŝas la dosieron DOSIERNOMO
@@ -808,7 +808,7 @@ RIMARKO: Anstataŭiga reĝimo estas same kiel Enmeta reĝimo, sed ĉiu signo
** Uzu la y operatoron por kopii tekston, kaj p por alglui ĝin **
1. Iru al la linio markita per ---> sube kaj poziciu la kursoron post "a)".
1. Iru al la suba linio markita per ---> kaj poziciu la kursoron post "a)".
2. Komencu la Viduman reĝimon per v kaj movu la kursoron tuj antaŭ "unua".
@@ -914,7 +914,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c
1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo:
:e ~/.vimrc por Unikso
:e $VIM/_vimrc por Windows
:e $VIM/_vimrc por Vindozo
2. Nun legu la enhavon de la ekzempla "vimrc"
:r $VIMRUNTIME/vimrc_example.vim
@@ -945,7 +945,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c
6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI
7. Premu <TAB>. Vim kompletigos la nomon (se ĝi estas unika)
7. Premu d<TAB>. Vim kompletigos la nomon (se ĝi estas unika)
RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj
<TAB>. Estas aparte utila por :help .
@@ -986,6 +986,6 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj
Esperantigita fare de Dominique Pellé, 2008-04-01
Retpoŝto: dominique.pelle@gmail.com
Lasta ŝanĝo: 2018-12-02
Lasta ŝanĝo: 2020-07-19
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -744,12 +744,14 @@ OBJ = \
$(OUTDIR)/gui_xim.o \
$(OUTDIR)/hardcopy.o \
$(OUTDIR)/hashtab.o \
$(OUTDIR)/help.o \
$(OUTDIR)/highlight.o \
$(OUTDIR)/if_cscope.o \
$(OUTDIR)/indent.o \
$(OUTDIR)/insexpand.o \
$(OUTDIR)/json.o \
$(OUTDIR)/list.o \
$(OUTDIR)/locale.o \
$(OUTDIR)/main.o \
$(OUTDIR)/map.o \
$(OUTDIR)/mark.o \

View File

@@ -64,11 +64,13 @@ SRC = arabic.c \
gui_xim.c \
hardcopy.c \
hashtab.c \
help.c \
highlight.c \
indent.c \
insexpand.c \
json.c \
list.c \
locale.c \
main.c \
map.c \
mark.c \

View File

@@ -766,12 +766,14 @@ OBJ = \
$(OUTDIR)\gui_xim.obj \
$(OUTDIR)\hardcopy.obj \
$(OUTDIR)\hashtab.obj \
$(OUTDIR)\help.obj \
$(OUTDIR)\highlight.obj \
$(OBJDIR)\if_cscope.obj \
$(OUTDIR)\indent.obj \
$(OUTDIR)\insexpand.obj \
$(OUTDIR)\json.obj \
$(OUTDIR)\list.obj \
$(OUTDIR)\locale.obj \
$(OUTDIR)\main.obj \
$(OUTDIR)\map.obj \
$(OUTDIR)\mark.obj \
@@ -1608,6 +1610,8 @@ $(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL) version.h
$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
$(OUTDIR)/help.obj: $(OUTDIR) help.c $(INCL)
$(OUTDIR)/highlight.obj: $(OUTDIR) highlight.c $(INCL)
$(OUTDIR)/indent.obj: $(OUTDIR) indent.c $(INCL)
@@ -1666,6 +1670,8 @@ $(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL)
$(OUTDIR)/list.obj: $(OUTDIR) list.c $(INCL)
$(OUTDIR)/locale.obj: $(OUTDIR) locale.c $(INCL)
$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL) $(CUI_INCL)
$(OUTDIR)/map.obj: $(OUTDIR) map.c $(INCL)
@@ -1930,11 +1936,13 @@ proto.h: \
proto/gui_xim.pro \
proto/hardcopy.pro \
proto/hashtab.pro \
proto/help.pro \
proto/highlight.pro \
proto/indent.pro \
proto/insexpand.pro \
proto/json.pro \
proto/list.pro \
proto/locale.pro \
proto/main.pro \
proto/map.pro \
proto/mark.pro \

View File

@@ -337,6 +337,7 @@ SRC = \
gui_xim.c \
hardcopy.c \
hashtab.c \
help.c \
highlight.c \
if_cscope.c \
if_xcmdsrv.c \
@@ -344,6 +345,7 @@ SRC = \
insexpand.c \
json.c \
list.c \
locale.c \
main.c \
map.c \
mark.c \
@@ -450,6 +452,7 @@ OBJ = \
gui_xim.obj \
hardcopy.obj \
hashtab.obj \
help.obj \
highlight.obj \
if_cscope.obj \
if_mzsch.obj \
@@ -458,6 +461,7 @@ OBJ = \
insexpand.obj \
json.obj \
list.obj \
locale.obj \
main.obj \
map.obj \
mark.obj \
@@ -834,6 +838,10 @@ hashtab.obj : hashtab.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
globals.h
help.obj : help.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
globals.h
highlight.obj : highlight.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
@@ -859,6 +867,10 @@ list.obj : list.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \
globals.h
locale.obj : locale.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \
globals.h
main.obj : main.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \
[.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h \

View File

@@ -1639,6 +1639,7 @@ BASIC_SRC = \
gui_xim.c \
hardcopy.c \
hashtab.c \
help.c \
highlight.c \
if_cscope.c \
if_xcmdsrv.c \
@@ -1646,6 +1647,7 @@ BASIC_SRC = \
insexpand.c \
json.c \
list.c \
locale.c \
main.c \
map.c \
mark.c \
@@ -1790,12 +1792,14 @@ OBJ_COMMON = \
objects/gui_xim.o \
objects/hardcopy.o \
objects/hashtab.o \
objects/help.o \
objects/highlight.o \
objects/if_cscope.o \
objects/if_xcmdsrv.o \
objects/indent.o \
objects/insexpand.o \
objects/list.o \
objects/locale.o \
objects/map.o \
objects/mark.o \
objects/match.o \
@@ -1958,6 +1962,7 @@ PRO_AUTO = \
gui_beval.pro \
hardcopy.pro \
hashtab.pro \
help.pro \
highlight.pro \
if_cscope.pro \
if_lua.pro \
@@ -1970,6 +1975,7 @@ PRO_AUTO = \
insexpand.pro \
json.pro \
list.pro \
locale.pro \
main.pro \
map.pro \
mark.pro \
@@ -2304,11 +2310,7 @@ test_libvterm:
# Run individual OLD style test.
# These do not depend on the executable, compile it when needed.
test1 \
test42 test44 test49 \
test52 test59 \
test70 \
test99:
test1 test49 test59:
cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
# Run individual NEW style test.
@@ -3264,6 +3266,9 @@ objects/hardcopy.o: hardcopy.c
objects/hashtab.o: hashtab.c
$(CCC) -o $@ hashtab.c
objects/help.o: help.c
$(CCC) -o $@ help.c
objects/gui.o: gui.c
$(CCC) -o $@ gui.c
@@ -3372,6 +3377,9 @@ objects/kword_test.o: kword_test.c
objects/list.o: list.c
$(CCC) -o $@ list.c
objects/locale.o: locale.c
$(CCC) -o $@ locale.c
objects/main.o: main.c
$(CCC) -o $@ main.c
@@ -3930,6 +3938,10 @@ objects/hashtab.o: hashtab.c vim.h protodef.h auto/config.h feature.h os_unix.h
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/help.o: help.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/highlight.o: highlight.c vim.h protodef.h auto/config.h feature.h \
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
@@ -3958,6 +3970,10 @@ objects/list.o: list.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/locale.o: locale.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/main.o: main.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \

View File

@@ -48,9 +48,11 @@ filepath.c | dealing with file names and paths
findfile.c | search for files in 'path'
fold.c | folding
getchar.c | getting characters and key mapping
help.c | vim help related functions
highlight.c | syntax highlighting
indent.c | text indentation
insexpand.c | Insert mode completion
locale.c | locale/language handling
map.c | mapping and abbreviations
mark.c | marks
match.c | highlight matching

7
src/auto/configure vendored
View File

@@ -7417,7 +7417,7 @@ $as_echo_n "checking for location of Tcl include... " >&6; }
if test "x$MACOS_X" != "xyes"; then
tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
else
tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /System/Library/Frameworks/Tcl.framework/Headers `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework/Versions/Current/Headers"
fi
TCL_INC=
for try in $tclinc; do
@@ -7440,7 +7440,8 @@ $as_echo_n "checking for location of tclConfig.sh script... " >&6; }
tclcnf=`echo $tclinc | sed s/include/lib/g`
tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
else
tclcnf="/System/Library/Frameworks/Tcl.framework"
tclcnf=`echo $tclinc | sed s/include/lib/g`
tclcnf="$tclcnf /System/Library/Frameworks/Tcl.framework `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework"
fi
for try in $tclcnf; do
if test -f "$try/tclConfig.sh"; then
@@ -12106,7 +12107,7 @@ if test "x$olibs" = "x$LIBS"; then
$as_echo_n "checking for tgetent()... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int tgetent(char *, const char *);
int
main ()
{

View File

@@ -1188,7 +1188,7 @@ do_bufdel(
if (addr_count == 2)
{
if (*arg) // both range and argument is not allowed
return _(e_trailing);
return ex_errmsg(e_trailing_arg, arg);
bnr = start_bnr;
}
else // addr_count == 1
@@ -4229,12 +4229,19 @@ build_stl_str_hl(
}
if (n == curitem && group_start_userhl == group_end_userhl)
{
// empty group
p = t;
l = 0;
// do not use the highlighting from the removed group
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
{
// do not use the highlighting from the removed group
if (item[n].type == Highlight)
item[n].type = Empty;
// adjust the start position of TabPage to the next
// item position
if (item[n].type == TabPage)
item[n].start = p;
}
}
}
if (l > item[groupitem[groupdepth]].maxwid)

View File

@@ -1101,27 +1101,6 @@ channel_open(
return channel;
}
/*
* Copy callback from "src" to "dest", incrementing the refcounts.
*/
static void
copy_callback(callback_T *dest, callback_T *src)
{
dest->cb_partial = src->cb_partial;
if (dest->cb_partial != NULL)
{
dest->cb_name = src->cb_name;
dest->cb_free_name = FALSE;
++dest->cb_partial->pt_refcount;
}
else
{
dest->cb_name = vim_strsave(src->cb_name);
dest->cb_free_name = TRUE;
func_ref(src->cb_name);
}
}
static void
free_set_callback(callback_T *cbp, callback_T *callback)
{

View File

@@ -494,18 +494,9 @@ ExpandOne(
void
ExpandInit(expand_T *xp)
{
xp->xp_pattern = NULL;
xp->xp_pattern_len = 0;
CLEAR_POINTER(xp);
xp->xp_backslash = XP_BS_NONE;
#ifndef BACKSLASH_IN_FILENAME
xp->xp_shell = FALSE;
#endif
xp->xp_numfiles = -1;
xp->xp_files = NULL;
#if defined(FEAT_EVAL)
xp->xp_arg = NULL;
#endif
xp->xp_line = NULL;
}
/*
@@ -1887,62 +1878,6 @@ expand_cmdline(
return EXPAND_OK;
}
#ifdef FEAT_MULTI_LANG
/*
* Cleanup matches for help tags:
* Remove "@ab" if the top of 'helplang' is "ab" and the language of the first
* tag matches it. Otherwise remove "@en" if "en" is the only language.
*/
static void
cleanup_help_tags(int num_file, char_u **file)
{
int i, j;
int len;
char_u buf[4];
char_u *p = buf;
if (p_hlg[0] != NUL && (p_hlg[0] != 'e' || p_hlg[1] != 'n'))
{
*p++ = '@';
*p++ = p_hlg[0];
*p++ = p_hlg[1];
}
*p = NUL;
for (i = 0; i < num_file; ++i)
{
len = (int)STRLEN(file[i]) - 3;
if (len <= 0)
continue;
if (STRCMP(file[i] + len, "@en") == 0)
{
// Sorting on priority means the same item in another language may
// be anywhere. Search all items for a match up to the "@en".
for (j = 0; j < num_file; ++j)
if (j != i && (int)STRLEN(file[j]) == len + 3
&& STRNCMP(file[i], file[j], len + 1) == 0)
break;
if (j == num_file)
// item only exists with @en, remove it
file[i][len] = NUL;
}
}
if (*buf != NUL)
for (i = 0; i < num_file; ++i)
{
len = (int)STRLEN(file[i]) - 3;
if (len <= 0)
continue;
if (STRCMP(file[i] + len, buf) == 0)
{
// remove the default language
file[i][len] = NUL;
}
}
}
#endif
/*
* Function given to ExpandGeneric() to obtain the possible arguments of the
* ":behave {mswin,xterm}" command.
@@ -2481,7 +2416,7 @@ expand_shellcmd(
# if defined(FEAT_EVAL)
/*
* Call "user_expand_func()" to invoke a user defined Vim script function and
* return the result (either a string or a List).
* return the result (either a string, a List or NULL).
*/
static void *
call_user_expand_func(

View File

@@ -705,7 +705,7 @@ ex_history(exarg_T *eap)
else
{
*end = i;
emsg(_(e_trailing));
semsg(_(e_trailing_arg), arg);
return;
}
}
@@ -717,7 +717,7 @@ ex_history(exarg_T *eap)
end = arg;
if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
{
emsg(_(e_trailing));
semsg(_(e_trailing_arg), end);
return;
}

View File

@@ -1820,8 +1820,10 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then
if test "x$MACOS_X" != "xyes"; then
tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
else
dnl For all macOS, use the value from TCL in case use of, say, homebrew
dnl For Mac OS X 10.3, use the OS-provided framework location
tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
dnl For Mac OS X 10.14, the OS-provided framework location doesn't contain the headers, so also check the Xcode SDK
tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /System/Library/Frameworks/Tcl.framework/Headers `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework/Versions/Current/Headers"
fi
TCL_INC=
for try in $tclinc; do
@@ -1841,8 +1843,11 @@ if test "$enable_tclinterp" = "yes" -o "$enable_tclinterp" = "dynamic"; then
tclcnf=`echo $tclinc | sed s/include/lib/g`
tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
else
dnl For all macOS, use the value from TCL in case use of, say, homebrew
dnl For Mac OS X 10.3, use the OS-provided framework location
tclcnf="/System/Library/Frameworks/Tcl.framework"
dnl For Mac OS X 10.14, the OS-provided framework location doesn't contain the headers, so also check the Xcode SDK
tclcnf=`echo $tclinc | sed s/include/lib/g`
tclcnf="$tclcnf /System/Library/Frameworks/Tcl.framework `xcrun --show-sdk-path`/System/Library/Frameworks/Tcl.framework"
fi
for try in $tclcnf; do
if test -f "$try/tclConfig.sh"; then
@@ -3510,7 +3515,7 @@ fi
if test "x$olibs" = "x$LIBS"; then
AC_MSG_CHECKING([for tgetent()])
AC_TRY_LINK([],
AC_TRY_LINK([int tgetent(char *, const char *);],
[char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");],
AC_MSG_RESULT(yes),
AC_MSG_ERROR([NOT FOUND!

View File

@@ -105,7 +105,7 @@ do_debug(char_u *cmd)
vim_free(debug_newval);
debug_newval = NULL;
}
sname = estack_sfile();
sname = estack_sfile(FALSE);
if (sname != NULL)
msg((char *)sname);
vim_free(sname);
@@ -344,7 +344,7 @@ do_checkbacktracelevel(void)
}
else
{
char_u *sname = estack_sfile();
char_u *sname = estack_sfile(FALSE);
int max = get_maxbacktrace_level(sname);
if (debug_backtrace_level > max)
@@ -365,7 +365,7 @@ do_showbacktrace(char_u *cmd)
int i = 0;
int max;
sname = estack_sfile();
sname = estack_sfile(FALSE);
max = get_maxbacktrace_level(sname);
if (sname != NULL)
{

View File

@@ -838,6 +838,10 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
: eval1(arg, &tvkey, evalarg)) == FAIL) // recursive!
goto failret;
// the colon should come right after the key, but this wasn't checked
// previously, so only require it in Vim9 script.
if (!vim9script)
*arg = skipwhite(*arg);
if (**arg != ':')
{
if (evaluate)
@@ -891,7 +895,10 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
}
clear_tv(&tvkey);
// the comma must come after the value
// the comma should come right after the value, but this wasn't checked
// previously, so only require it in Vim9 script.
if (!vim9script)
*arg = skipwhite(*arg);
had_comma = **arg == ',';
if (had_comma)
{

View File

@@ -797,7 +797,7 @@ get_lval(
if (unlet && !VIM_ISWHITE(*p) && !ends_excmd(*p)
&& *p != '[' && *p != '.')
{
emsg(_(e_trailing));
semsg(_(e_trailing_arg), p);
return NULL;
}
@@ -1270,7 +1270,12 @@ set_var_lval(
}
}
else
{
if (lp->ll_type != NULL
&& check_typval_type(lp->ll_type, rettv) == FAIL)
return;
set_var_const(lp->ll_name, lp->ll_type, rettv, copy, flags);
}
*endp = cc;
}
else if (var_check_lock(lp->ll_newkey == NULL
@@ -1908,27 +1913,28 @@ eval_func(
char_u *
eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext)
{
char_u *p = skipwhite(arg);
*getnext = FALSE;
if (in_vim9script()
&& evalarg != NULL
&& (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL)
&& (*arg == NUL || (VIM_ISWHITE(arg[-1])
&& *arg == '#' && arg[1] != '{')))
&& (*p == NUL || (VIM_ISWHITE(p[-1]) && vim9_comment_start(p))))
{
char_u *p;
char_u *next;
if (evalarg->eval_cookie != NULL)
p = getline_peek(evalarg->eval_getline, evalarg->eval_cookie);
next = getline_peek(evalarg->eval_getline, evalarg->eval_cookie);
else
p = peek_next_line_from_context(evalarg->eval_cctx);
next = peek_next_line_from_context(evalarg->eval_cctx);
if (p != NULL)
if (next != NULL)
{
*getnext = TRUE;
return skipwhite(p);
return skipwhite(next);
}
}
return arg;
return p;
}
/*
@@ -2034,6 +2040,7 @@ eval0(
p = skipwhite(arg);
ret = eval1(&p, rettv, evalarg);
p = skipwhite(p);
if (ret == FAIL || !ends_excmd2(arg, p))
{
@@ -2102,6 +2109,8 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
if (getnext)
*arg = eval_next_line(evalarg_used);
else
*arg = p;
result = FALSE;
if (evaluate)
@@ -2137,6 +2146,8 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
}
if (getnext)
*arg = eval_next_line(evalarg_used);
else
*arg = p;
/*
* Get the third variable. Recursive!
@@ -2229,6 +2240,8 @@ eval2(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
if (getnext)
*arg = eval_next_line(evalarg_used);
else
*arg = p;
/*
* Get the second variable.
@@ -2344,6 +2357,8 @@ eval3(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
if (getnext)
*arg = eval_next_line(evalarg_used);
else
*arg = p;
/*
* Get the second variable.
@@ -2413,13 +2428,11 @@ eval3(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
static int
eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
typval_T var2;
char_u *p;
int getnext;
int i;
exptype_T type = EXPR_UNKNOWN;
int len = 2;
int ic;
int type_is = FALSE;
/*
* Get the first variable.
@@ -2428,53 +2441,27 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
return FAIL;
p = eval_next_non_blank(*arg, evalarg, &getnext);
switch (p[0])
{
case '=': if (p[1] == '=')
type = EXPR_EQUAL;
else if (p[1] == '~')
type = EXPR_MATCH;
break;
case '!': if (p[1] == '=')
type = EXPR_NEQUAL;
else if (p[1] == '~')
type = EXPR_NOMATCH;
break;
case '>': if (p[1] != '=')
{
type = EXPR_GREATER;
len = 1;
}
else
type = EXPR_GEQUAL;
break;
case '<': if (p[1] != '=')
{
type = EXPR_SMALLER;
len = 1;
}
else
type = EXPR_SEQUAL;
break;
case 'i': if (p[1] == 's')
{
if (p[2] == 'n' && p[3] == 'o' && p[4] == 't')
len = 5;
i = p[len];
if (!isalnum(i) && i != '_')
type = len == 2 ? EXPR_IS : EXPR_ISNOT;
}
break;
}
type = get_compare_type(p, &len, &type_is);
/*
* If there is a comparative operator, use it.
*/
if (type != EXPR_UNKNOWN)
{
typval_T var2;
int ic;
int vim9script = in_vim9script();
if (getnext)
*arg = eval_next_line(evalarg);
if (vim9script && type_is && (p[len] == '?' || p[len] == '#'))
{
semsg(_(e_invexpr2), p);
clear_tv(rettv);
return FAIL;
}
// extra question mark appended: ignore case
if (p[len] == '?')
{
@@ -2487,9 +2474,9 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
ic = FALSE;
++len;
}
// nothing appended: use 'ignorecase'
// nothing appended: use 'ignorecase' if not in Vim script
else
ic = p_ic;
ic = vim9script ? FALSE : p_ic;
/*
* Get the second variable.
@@ -2504,8 +2491,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
int ret;
if (in_vim9script() && check_compare_types(
type, rettv, &var2) == FAIL)
if (vim9script && check_compare_types(type, rettv, &var2) == FAIL)
{
ret = FAIL;
clear_tv(rettv);
@@ -2599,6 +2585,8 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
if (getnext)
*arg = eval_next_line(evalarg);
else
*arg = p;
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
if ((op != '+' || (rettv->v_type != VAR_LIST
&& rettv->v_type != VAR_BLOB))
@@ -2780,6 +2768,7 @@ eval6(
int evaluate;
int getnext;
typval_T var2;
char_u *p;
int op;
varnumber_T n1, n2;
#ifdef FEAT_FLOAT
@@ -2787,12 +2776,15 @@ eval6(
#endif
int error;
op = *eval_next_non_blank(*arg, evalarg, &getnext);
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
if (op != '*' && op != '/' && op != '%')
break;
if (getnext)
*arg = eval_next_line(evalarg);
else
*arg = p;
#ifdef FEAT_FLOAT
f1 = 0;
@@ -3139,8 +3131,6 @@ eval7(
vim_free(alias);
}
*arg = skipwhite(*arg);
// Handle following '[', '(' and '.' for expr[expr], expr.name,
// expr(expr), expr->name(expr)
if (ret == OK)
@@ -3458,7 +3448,7 @@ eval_index(
* dict.name
*/
key = *arg + 1;
for (len = 0; ASCII_ISALNUM(key[len]) || key[len] == '_'; ++len)
for (len = 0; eval_isdictc(key[len]); ++len)
;
if (len == 0)
return FAIL;
@@ -4990,7 +4980,8 @@ find_name_end(
for (p = arg; *p != NUL
&& (eval_isnamec(*p)
|| (*p == '{' && !vim9script)
|| ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.'))
|| ((flags & FNE_INCL_BR) && (*p == '['
|| (*p == '.' && eval_isdictc(p[1]))))
|| mb_nest != 0
|| br_nest != 0); MB_PTR_ADV(p))
{
@@ -5121,7 +5112,7 @@ make_expanded_name(
int
eval_isnamec(int c)
{
return (ASCII_ISALNUM(c) || c == '_' || c == ':' || c == AUTOLOAD_CHAR);
return ASCII_ISALNUM(c) || c == '_' || c == ':' || c == AUTOLOAD_CHAR;
}
/*
@@ -5131,7 +5122,17 @@ eval_isnamec(int c)
int
eval_isnamec1(int c)
{
return (ASCII_ISALPHA(c) || c == '_');
return ASCII_ISALPHA(c) || c == '_';
}
/*
* Return TRUE if character "c" can be used as the first character of a
* dictionary key.
*/
int
eval_isdictc(int c)
{
return ASCII_ISALNUM(c) || c == '_';
}
/*
@@ -5164,9 +5165,8 @@ handle_subscript(
// the next line then consume the line break.
p = eval_next_non_blank(*arg, evalarg, &getnext);
if (getnext
&& ((rettv->v_type == VAR_DICT && *p == '.'
&& ASCII_ISALPHA(p[1]))
|| (*p == '-' && p[1] == '>'
&& ((rettv->v_type == VAR_DICT && *p == '.' && eval_isdictc(p[1]))
|| (p[0] == '-' && p[1] == '>'
&& (p[2] == '{' || ASCII_ISALPHA(p[2])))))
{
*arg = eval_next_line(evalarg);
@@ -5192,8 +5192,9 @@ handle_subscript(
dict_unref(selfdict);
selfdict = NULL;
}
else if (**arg == '-' && (*arg)[1] == '>')
else if (p[0] == '-' && p[1] == '>')
{
*arg = p;
if (ret == OK)
{
if ((*arg)[2] == '{')

View File

@@ -611,7 +611,7 @@ static funcentry_T global_functions[] =
{"function", 1, 3, FEARG_1, ret_f_function, f_function},
{"garbagecollect", 0, 1, 0, ret_void, f_garbagecollect},
{"get", 2, 3, FEARG_1, ret_any, f_get},
{"getbufinfo", 0, 1, 0, ret_list_dict_any, f_getbufinfo},
{"getbufinfo", 0, 1, FEARG_1, ret_list_dict_any, f_getbufinfo},
{"getbufline", 2, 3, FEARG_1, ret_list_string, f_getbufline},
{"getbufvar", 2, 3, FEARG_1, ret_any, f_getbufvar},
{"getchangelist", 0, 1, FEARG_1, ret_list_any, f_getchangelist},
@@ -2141,7 +2141,7 @@ f_eval(typval_T *argvars, typval_T *rettv)
rettv->vval.v_number = 0;
}
else if (*s != NUL)
emsg(_(e_trailing));
semsg(_(e_trailing_arg), s);
}
/*
@@ -5113,7 +5113,7 @@ f_islocked(typval_T *argvars, typval_T *rettv)
if (end != NULL && lv.ll_name != NULL)
{
if (*end != NUL)
emsg(_(e_trailing));
semsg(_(e_trailing_arg), end);
else
{
if (lv.ll_tv == NULL)
@@ -7859,9 +7859,9 @@ f_split(typval_T *argvars, typval_T *rettv)
pat = (char_u *)"[\\x01- ]\\+";
if (rettv_list_alloc(rettv) == FAIL)
return;
goto theend;
if (typeerr)
return;
goto theend;
regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
if (regmatch.regprog != NULL)
@@ -7898,6 +7898,7 @@ f_split(typval_T *argvars, typval_T *rettv)
vim_regfree(regmatch.regprog);
}
theend:
p_cpo = save_cpo;
}

View File

@@ -592,7 +592,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get)
p = skiptowhite(marker);
if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
{
emsg(_(e_trailing));
semsg(_(e_trailing_arg), p);
return NULL;
}
*p = NUL;
@@ -698,12 +698,13 @@ ex_let(exarg_T *eap)
int i;
int var_count = 0;
int semicolon = 0;
char_u op[2];
char_u op[4];
char_u *argend;
int first = TRUE;
int concat;
int has_assign;
int flags = eap->cmdidx == CMD_const ? LET_IS_CONST : 0;
int vim9script = in_vim9script();
// detect Vim9 assignment without ":let" or ":const"
if (eap->arg == eap->cmd)
@@ -725,11 +726,11 @@ ex_let(exarg_T *eap)
// ":let" without "=": list variables
if (*arg == '[')
emsg(_(e_invarg));
else if (expr[0] == '.')
emsg(_("E985: .= is not supported with script version 2"));
else if (expr[0] == '.' && expr[1] == '=')
emsg(_("E985: .= is not supported with script version >= 2"));
else if (!ends_excmd2(eap->cmd, arg))
{
if (in_vim9script())
if (vim9script)
{
// Vim9 declaration ":let var: type"
arg = vim9_declare_scriptvar(eap, arg);
@@ -775,6 +776,7 @@ ex_let(exarg_T *eap)
else
{
evalarg_T evalarg;
int len = 1;
rettv.v_type = VAR_UNKNOWN;
i = FAIL;
@@ -787,13 +789,25 @@ ex_let(exarg_T *eap)
if (vim_strchr((char_u *)"+-*/%.", *expr) != NULL)
{
op[0] = *expr; // +=, -=, *=, /=, %= or .=
++len;
if (expr[0] == '.' && expr[1] == '.') // ..=
{
++expr;
++len;
}
}
expr = skipwhite(expr + 2);
expr += 2;
}
else
expr = skipwhite(expr + 1);
++expr;
if (vim9script && (!VIM_ISWHITE(*argend)
|| !IS_WHITE_OR_NUL(*expr)))
{
vim_strncpy(op, expr - len, len);
semsg(_(e_white_both), op);
i = FAIL;
}
if (eap->skip)
++emsg_skip;
@@ -804,6 +818,7 @@ ex_let(exarg_T *eap)
evalarg.eval_getline = eap->getline;
evalarg.eval_cookie = eap->cookie;
}
expr = skipwhite_and_linebreak(expr, &evalarg);
i = eval0(expr, &rettv, eap, &evalarg);
if (eap->skip)
--emsg_skip;
@@ -817,7 +832,7 @@ ex_let(exarg_T *eap)
else if (i != FAIL)
{
(void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
flags, op);
flags, op);
clear_tv(&rettv);
}
}
@@ -999,7 +1014,7 @@ skip_var_one(char_u *arg, int include_type)
if (end == arg + 2 && end[-1] == ':')
--end;
if (*end == ':')
end = skip_type(skipwhite(end + 1));
end = skip_type(skipwhite(end + 1), FALSE);
}
return end;
}
@@ -1099,7 +1114,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
{
emsg_severe = TRUE;
emsg(_(e_trailing));
semsg(_(e_trailing_arg), arg);
break;
}
}
@@ -1475,7 +1490,7 @@ ex_unletlock(
if (name_end != NULL)
{
emsg_severe = TRUE;
emsg(_(e_trailing));
semsg(_(e_trailing_arg), name_end);
}
if (!(eap->skip || error))
clear_lval(&lv);
@@ -3417,9 +3432,9 @@ var_redir_start(char_u *name, int append)
clear_lval(redir_lval);
if (redir_endp != NULL && *redir_endp != NUL)
// Trailing characters are present after the variable name
emsg(_(e_trailing));
semsg(_(e_trailing_arg), redir_endp);
else
emsg(_(e_invarg));
semsg(_(e_invarg2), name);
redir_endp = NULL; // don't store a value, only cleanup
var_redir_stop();
return FAIL;
@@ -3848,6 +3863,27 @@ set_callback(callback_T *dest, callback_T *src)
dest->cb_partial = src->cb_partial;
}
/*
* Copy callback from "src" to "dest", incrementing the refcounts.
*/
void
copy_callback(callback_T *dest, callback_T *src)
{
dest->cb_partial = src->cb_partial;
if (dest->cb_partial != NULL)
{
dest->cb_name = src->cb_name;
dest->cb_free_name = FALSE;
++dest->cb_partial->pt_refcount;
}
else
{
dest->cb_name = vim_strsave(src->cb_name);
dest->cb_free_name = TRUE;
func_ref(src->cb_name);
}
}
/*
* Unref/free "callback" returned by get_callback() or set_callback().
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -996,505 +996,3 @@ ex_checktime(exarg_T *eap)
}
no_check_timestamps = save_no_check_timestamps;
}
#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& (defined(FEAT_EVAL) || defined(FEAT_MULTI_LANG))
# define HAVE_GET_LOCALE_VAL
static char_u *
get_locale_val(int what)
{
char_u *loc;
// Obtain the locale value from the libraries.
loc = (char_u *)setlocale(what, NULL);
# ifdef MSWIN
if (loc != NULL)
{
char_u *p;
// setocale() returns something like "LC_COLLATE=<name>;LC_..." when
// one of the values (e.g., LC_CTYPE) differs.
p = vim_strchr(loc, '=');
if (p != NULL)
{
loc = ++p;
while (*p != NUL) // remove trailing newline
{
if (*p < ' ' || *p == ';')
{
*p = NUL;
break;
}
++p;
}
}
}
# endif
return loc;
}
#endif
#ifdef MSWIN
/*
* On MS-Windows locale names are strings like "German_Germany.1252", but
* gettext expects "de". Try to translate one into another here for a few
* supported languages.
*/
static char_u *
gettext_lang(char_u *name)
{
int i;
static char *(mtable[]) = {
"afrikaans", "af",
"czech", "cs",
"dutch", "nl",
"german", "de",
"english_united kingdom", "en_GB",
"spanish", "es",
"french", "fr",
"italian", "it",
"japanese", "ja",
"korean", "ko",
"norwegian", "no",
"polish", "pl",
"russian", "ru",
"slovak", "sk",
"swedish", "sv",
"ukrainian", "uk",
"chinese_china", "zh_CN",
"chinese_taiwan", "zh_TW",
NULL};
for (i = 0; mtable[i] != NULL; i += 2)
if (STRNICMP(mtable[i], name, STRLEN(mtable[i])) == 0)
return (char_u *)mtable[i + 1];
return name;
}
#endif
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
/*
* Return TRUE when "lang" starts with a valid language name.
* Rejects NULL, empty string, "C", "C.UTF-8" and others.
*/
static int
is_valid_mess_lang(char_u *lang)
{
return lang != NULL && ASCII_ISALPHA(lang[0]) && ASCII_ISALPHA(lang[1]);
}
/*
* Obtain the current messages language. Used to set the default for
* 'helplang'. May return NULL or an empty string.
*/
char_u *
get_mess_lang(void)
{
char_u *p;
# ifdef HAVE_GET_LOCALE_VAL
# if defined(LC_MESSAGES)
p = get_locale_val(LC_MESSAGES);
# else
// This is necessary for Win32, where LC_MESSAGES is not defined and $LANG
// may be set to the LCID number. LC_COLLATE is the best guess, LC_TIME
// and LC_MONETARY may be set differently for a Japanese working in the
// US.
p = get_locale_val(LC_COLLATE);
# endif
# else
p = mch_getenv((char_u *)"LC_ALL");
if (!is_valid_mess_lang(p))
{
p = mch_getenv((char_u *)"LC_MESSAGES");
if (!is_valid_mess_lang(p))
p = mch_getenv((char_u *)"LANG");
}
# endif
# ifdef MSWIN
p = gettext_lang(p);
# endif
return is_valid_mess_lang(p) ? p : NULL;
}
#endif
// Complicated #if; matches with where get_mess_env() is used below.
#if (defined(FEAT_EVAL) && !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& defined(LC_MESSAGES))) \
|| ((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& !defined(LC_MESSAGES))
/*
* Get the language used for messages from the environment.
*/
static char_u *
get_mess_env(void)
{
char_u *p;
p = mch_getenv((char_u *)"LC_ALL");
if (p == NULL || *p == NUL)
{
p = mch_getenv((char_u *)"LC_MESSAGES");
if (p == NULL || *p == NUL)
{
p = mch_getenv((char_u *)"LANG");
if (p != NULL && VIM_ISDIGIT(*p))
p = NULL; // ignore something like "1043"
# ifdef HAVE_GET_LOCALE_VAL
if (p == NULL || *p == NUL)
p = get_locale_val(LC_CTYPE);
# endif
}
}
return p;
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Set the "v:lang" variable according to the current locale setting.
* Also do "v:lc_time"and "v:ctype".
*/
void
set_lang_var(void)
{
char_u *loc;
# ifdef HAVE_GET_LOCALE_VAL
loc = get_locale_val(LC_CTYPE);
# else
// setlocale() not supported: use the default value
loc = (char_u *)"C";
# endif
set_vim_var_string(VV_CTYPE, loc, -1);
// When LC_MESSAGES isn't defined use the value from $LC_MESSAGES, fall
// back to LC_CTYPE if it's empty.
# if defined(HAVE_GET_LOCALE_VAL) && defined(LC_MESSAGES)
loc = get_locale_val(LC_MESSAGES);
# else
loc = get_mess_env();
# endif
set_vim_var_string(VV_LANG, loc, -1);
# ifdef HAVE_GET_LOCALE_VAL
loc = get_locale_val(LC_TIME);
# endif
set_vim_var_string(VV_LC_TIME, loc, -1);
# ifdef HAVE_GET_LOCALE_VAL
loc = get_locale_val(LC_COLLATE);
# else
// setlocale() not supported: use the default value
loc = (char_u *)"C";
# endif
set_vim_var_string(VV_COLLATE, loc, -1);
}
#endif
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
/*
* ":language": Set the language (locale).
*/
void
ex_language(exarg_T *eap)
{
char *loc;
char_u *p;
char_u *name;
int what = LC_ALL;
char *whatstr = "";
# ifdef LC_MESSAGES
# define VIM_LC_MESSAGES LC_MESSAGES
# else
# define VIM_LC_MESSAGES 6789
# endif
name = eap->arg;
// Check for "messages {name}", "ctype {name}" or "time {name}" argument.
// Allow abbreviation, but require at least 3 characters to avoid
// confusion with a two letter language name "me" or "ct".
p = skiptowhite(eap->arg);
if ((*p == NUL || VIM_ISWHITE(*p)) && p - eap->arg >= 3)
{
if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0)
{
what = VIM_LC_MESSAGES;
name = skipwhite(p);
whatstr = "messages ";
}
else if (STRNICMP(eap->arg, "ctype", p - eap->arg) == 0)
{
what = LC_CTYPE;
name = skipwhite(p);
whatstr = "ctype ";
}
else if (STRNICMP(eap->arg, "time", p - eap->arg) == 0)
{
what = LC_TIME;
name = skipwhite(p);
whatstr = "time ";
}
else if (STRNICMP(eap->arg, "collate", p - eap->arg) == 0)
{
what = LC_COLLATE;
name = skipwhite(p);
whatstr = "collate ";
}
}
if (*name == NUL)
{
# ifndef LC_MESSAGES
if (what == VIM_LC_MESSAGES)
p = get_mess_env();
else
# endif
p = (char_u *)setlocale(what, NULL);
if (p == NULL || *p == NUL)
p = (char_u *)"Unknown";
smsg(_("Current %slanguage: \"%s\""), whatstr, p);
}
else
{
# ifndef LC_MESSAGES
if (what == VIM_LC_MESSAGES)
loc = "";
else
# endif
{
loc = setlocale(what, (char *)name);
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
// Make sure strtod() uses a decimal point, not a comma.
setlocale(LC_NUMERIC, "C");
# endif
}
if (loc == NULL)
semsg(_("E197: Cannot set language to \"%s\""), name);
else
{
# ifdef HAVE_NL_MSG_CAT_CNTR
// Need to do this for GNU gettext, otherwise cached translations
// will be used again.
extern int _nl_msg_cat_cntr;
++_nl_msg_cat_cntr;
# endif
// Reset $LC_ALL, otherwise it would overrule everything.
vim_setenv((char_u *)"LC_ALL", (char_u *)"");
if (what != LC_TIME && what != LC_COLLATE)
{
// Tell gettext() what to translate to. It apparently doesn't
// use the currently effective locale. Also do this when
// FEAT_GETTEXT isn't defined, so that shell commands use this
// value.
if (what == LC_ALL)
{
vim_setenv((char_u *)"LANG", name);
// Clear $LANGUAGE because GNU gettext uses it.
vim_setenv((char_u *)"LANGUAGE", (char_u *)"");
# ifdef MSWIN
// Apparently MS-Windows printf() may cause a crash when
// we give it 8-bit text while it's expecting text in the
// current locale. This call avoids that.
setlocale(LC_CTYPE, "C");
# endif
}
if (what != LC_CTYPE)
{
char_u *mname;
# ifdef MSWIN
mname = gettext_lang(name);
# else
mname = name;
# endif
vim_setenv((char_u *)"LC_MESSAGES", mname);
# ifdef FEAT_MULTI_LANG
set_helplang_default(mname);
# endif
}
}
# ifdef FEAT_EVAL
// Set v:lang, v:lc_time, v:collate and v:ctype to the final result.
set_lang_var();
# endif
# ifdef FEAT_TITLE
maketitle();
# endif
}
}
}
static char_u **locales = NULL; // Array of all available locales
static int did_init_locales = FALSE;
/*
* Return an array of strings for all available locales + NULL for the
* last element. Return NULL in case of error.
*/
static char_u **
find_locales(void)
{
garray_T locales_ga;
char_u *loc;
char_u *locale_list;
# ifdef MSWIN
size_t len = 0;
# endif
// Find all available locales by running command "locale -a". If this
// doesn't work we won't have completion.
# ifndef MSWIN
locale_list = get_cmd_output((char_u *)"locale -a",
NULL, SHELL_SILENT, NULL);
# else
// Find all available locales by examining the directories in
// $VIMRUNTIME/lang/
{
int options = WILD_SILENT|WILD_USE_NL|WILD_KEEP_ALL;
expand_T xpc;
char_u *p;
ExpandInit(&xpc);
xpc.xp_context = EXPAND_DIRECTORIES;
locale_list = ExpandOne(&xpc, (char_u *)"$VIMRUNTIME/lang/*",
NULL, options, WILD_ALL);
ExpandCleanup(&xpc);
if (locale_list == NULL)
// Add a dummy input, that will be skipped lated but we need to
// have something in locale_list so that the C locale is added at
// the end.
locale_list = vim_strsave((char_u *)".\n");
p = locale_list;
// find the last directory delimiter
while (p != NULL && *p != NUL)
{
if (*p == '\n')
break;
if (*p == '\\')
len = p - locale_list;
p++;
}
}
# endif
if (locale_list == NULL)
return NULL;
ga_init2(&locales_ga, sizeof(char_u *), 20);
// Transform locale_list string where each locale is separated by "\n"
// into an array of locale strings.
loc = (char_u *)strtok((char *)locale_list, "\n");
while (loc != NULL)
{
int ignore = FALSE;
# ifdef MSWIN
if (len > 0)
loc += len + 1;
// skip locales with a dot (which indicates the charset)
if (vim_strchr(loc, '.') != NULL)
ignore = TRUE;
# endif
if (!ignore)
{
if (ga_grow(&locales_ga, 1) == FAIL)
break;
loc = vim_strsave(loc);
if (loc == NULL)
break;
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] = loc;
}
loc = (char_u *)strtok(NULL, "\n");
}
# ifdef MSWIN
// Add the C locale
if (ga_grow(&locales_ga, 1) == OK)
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] =
vim_strsave((char_u *)"C");
# endif
vim_free(locale_list);
if (ga_grow(&locales_ga, 1) == FAIL)
{
ga_clear(&locales_ga);
return NULL;
}
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
return (char_u **)locales_ga.ga_data;
}
/*
* Lazy initialization of all available locales.
*/
static void
init_locales(void)
{
if (!did_init_locales)
{
did_init_locales = TRUE;
locales = find_locales();
}
}
# if defined(EXITFREE) || defined(PROTO)
void
free_locales(void)
{
int i;
if (locales != NULL)
{
for (i = 0; locales[i] != NULL; i++)
vim_free(locales[i]);
VIM_CLEAR(locales);
}
}
# endif
/*
* Function given to ExpandGeneric() to obtain the possible arguments of the
* ":language" command.
*/
char_u *
get_lang_arg(expand_T *xp UNUSED, int idx)
{
if (idx == 0)
return (char_u *)"messages";
if (idx == 1)
return (char_u *)"ctype";
if (idx == 2)
return (char_u *)"time";
if (idx == 3)
return (char_u *)"collate";
init_locales();
if (locales == NULL)
return NULL;
return locales[idx - 4];
}
/*
* Function given to ExpandGeneric() to obtain the available locales.
*/
char_u *
get_locales(expand_T *xp UNUSED, int idx)
{
init_locales();
if (locales == NULL)
return NULL;
return locales[idx];
}
#endif

View File

@@ -1710,7 +1710,7 @@ do_one_cmd(
char_u *cmd;
int starts_with_colon = FALSE;
#ifdef FEAT_EVAL
int starts_with_quote;
int may_have_range;
int vim9script = in_vim9script();
#endif
@@ -1773,8 +1773,9 @@ do_one_cmd(
*/
cmd = ea.cmd;
#ifdef FEAT_EVAL
starts_with_quote = vim9script && *ea.cmd == '\'';
if (!starts_with_quote)
// In Vim9 script a colon is required before the range.
may_have_range = !vim9script || starts_with_colon;
if (may_have_range)
#endif
ea.cmd = skip_range(ea.cmd, NULL);
if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
@@ -1783,7 +1784,10 @@ do_one_cmd(
#ifdef FEAT_EVAL
if (vim9script && !starts_with_colon)
{
if (ea.cmd > cmd)
if (ea.cmd == cmd + 1 && *cmd == '$')
// should be "$VAR = val"
--ea.cmd;
else if (ea.cmd > cmd)
{
emsg(_(e_colon_required));
goto doend;
@@ -1876,7 +1880,7 @@ do_one_cmd(
ea.cmd = cmd;
#ifdef FEAT_EVAL
if (!starts_with_quote)
if (may_have_range)
#endif
if (parse_cmd_address(&ea, &errormsg, FALSE) == FAIL)
goto doend;
@@ -2061,12 +2065,22 @@ do_one_cmd(
goto doend;
}
if (text_locked() && !(ea.argt & EX_CMDWIN)
&& !IS_USER_CMDIDX(ea.cmdidx))
if (!IS_USER_CMDIDX(ea.cmdidx))
{
// Command not allowed when editing the command line.
errormsg = _(get_text_locked_msg());
goto doend;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN))
{
// Command not allowed in the command line window
errormsg = _(e_cmdwin);
goto doend;
}
#endif
if (text_locked() && !(ea.argt & EX_LOCK_OK))
{
// Command not allowed when text is locked
errormsg = _(get_text_locked_msg());
goto doend;
}
}
// Disallow editing another buffer when "curbuf_lock" is set.
@@ -2396,7 +2410,7 @@ do_one_cmd(
&& *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & EX_TRLBAR) == 0))
{
// no arguments allowed but there is something
errormsg = _(e_trailing);
errormsg = ex_errmsg(e_trailing_arg, ea.arg);
goto doend;
}
@@ -2570,7 +2584,7 @@ do_one_cmd(
ea.errmsg = NULL;
(cmdnames[ea.cmdidx].cmd_func)(&ea);
if (ea.errmsg != NULL)
errormsg = _(ea.errmsg);
errormsg = ea.errmsg;
}
#ifdef FEAT_EVAL
@@ -2648,6 +2662,20 @@ doend:
#pragma optimize( "", on )
#endif
static char ex_error_buf[MSG_BUF_LEN];
/*
* Return an error message with argument included.
* Uses a static buffer, only the last error will be kept.
* "msg" will be translated, caller should use N_().
*/
char *
ex_errmsg(char *msg, char_u *arg)
{
vim_snprintf(ex_error_buf, MSG_BUF_LEN, _(msg), arg);
return ex_error_buf;
}
/*
* Parse and skip over command modifiers:
* - update eap->cmd
@@ -3243,61 +3271,90 @@ find_ex_command(
* "lvar = value", "lvar(arg)", "[1, 2 3]->Func()"
*/
p = eap->cmd;
if (lookup != NULL && (vim_strchr((char_u *)"{('[", *p) != NULL
|| ((p = to_name_const_end(eap->cmd)) > eap->cmd
&& *p != NUL)))
if (lookup != NULL)
{
int oplen;
int heredoc;
// Skip over first char for "&opt = val", "$ENV = val" and "@r = val".
char_u *pskip = (*eap->cmd == '&' || *eap->cmd == '$'
|| *eap->cmd == '@') ? eap->cmd + 1 : eap->cmd;
if (
// "(..." is an expression.
// "funcname(" is always a function call.
*p == '('
|| (p == eap->cmd
? (
// "{..." is an dict expression.
*eap->cmd == '{'
// "'string'->func()" is an expression.
|| *eap->cmd == '\''
// "g:varname" is an expression.
|| eap->cmd[1] == ':'
)
: (
// "varname[]" is an expression.
*p == '['
// "varname->func()" is an expression.
|| (*p == '-' && p[1] == '>')
// "varname.expr" is an expression.
|| (*p == '.' && ASCII_ISALPHA(p[1]))
)))
if (vim_strchr((char_u *)"{('[\"", *p) != NULL
|| ((p = to_name_const_end(pskip)) > eap->cmd && *p != NUL))
{
eap->cmdidx = CMD_eval;
return eap->cmd;
}
int oplen;
int heredoc;
// "[...]->Method()" is a list expression, but "[a, b] = Func()" is
// an assignment.
// If there is no line break inside the "[...]" then "p" is advanced to
// after the "]" by to_name_const_end(): check if a "=" follows.
// If "[...]" has a line break "p" still points at the "[" and it can't
// be an assignment.
if (*eap->cmd == '[' && (p == eap->cmd || *skipwhite(p) != '='))
{
eap->cmdidx = CMD_eval;
return eap->cmd;
}
// Recognize an assignment if we recognize the variable name:
// "g:var = expr"
// "var = expr" where "var" is a local var name.
oplen = assignment_len(skipwhite(p), &heredoc);
if (oplen > 0)
{
if (((p - eap->cmd) > 2 && eap->cmd[1] == ':')
|| lookup(eap->cmd, p - eap->cmd, cctx) != NULL)
if (
// "(..." is an expression.
// "funcname(" is always a function call.
*p == '('
|| (p == eap->cmd
? (
// "{..." is an dict expression.
*eap->cmd == '{'
// "'string'->func()" is an expression.
|| *eap->cmd == '\''
// '"string"->func()' is an expression.
|| *eap->cmd == '"'
// "g:varname" is an expression.
|| eap->cmd[1] == ':'
)
: (
// "varname[]" is an expression.
*p == '['
// "varname->func()" is an expression.
|| (*p == '-' && p[1] == '>')
// "varname.expr" is an expression.
|| (*p == '.' && ASCII_ISALPHA(p[1]))
)))
{
eap->cmdidx = CMD_let;
eap->cmdidx = CMD_eval;
return eap->cmd;
}
// "[...]->Method()" is a list expression, but "[a, b] = Func()" is
// an assignment.
// If there is no line break inside the "[...]" then "p" is
// advanced to after the "]" by to_name_const_end(): check if a "="
// follows.
// If "[...]" has a line break "p" still points at the "[" and it
// can't be an assignment.
if (*eap->cmd == '[')
{
p = to_name_const_end(eap->cmd);
if (p == eap->cmd || *skipwhite(p) != '=')
{
eap->cmdidx = CMD_eval;
return eap->cmd;
}
if (p > eap->cmd && *skipwhite(p) == '=')
{
eap->cmdidx = CMD_let;
return eap->cmd;
}
}
// Recognize an assignment if we recognize the variable name:
// "g:var = expr"
// "var = expr" where "var" is a local var name.
oplen = assignment_len(skipwhite(p), &heredoc);
if (oplen > 0)
{
if (((p - eap->cmd) > 2 && eap->cmd[1] == ':')
|| *eap->cmd == '&'
|| *eap->cmd == '$'
|| *eap->cmd == '@'
|| lookup(eap->cmd, p - eap->cmd, cctx) != NULL)
{
eap->cmdidx = CMD_let;
return eap->cmd;
}
}
// Recognize using a type for a w:, b:, t: or g: variable:
// "w:varname: number = 123".
if (eap->cmd[1] == ':' && *p == ':')
{
eap->cmdidx = CMD_eval;
return eap->cmd;
}
}
@@ -3980,7 +4037,8 @@ get_flags(exarg_T *eap)
ex_ni(exarg_T *eap)
{
if (!eap->skip)
eap->errmsg = N_("E319: Sorry, the command is not available in this version");
eap->errmsg =
_("E319: Sorry, the command is not available in this version");
}
#ifdef HAVE_EX_SCRIPT_NI
@@ -4738,7 +4796,7 @@ ex_autocmd(exarg_T *eap)
if (secure)
{
secure = 2;
eap->errmsg = e_curdir;
eap->errmsg = _(e_curdir);
}
else if (eap->cmdidx == CMD_autocmd)
do_autocmd(eap->arg, eap->forceit);
@@ -4789,7 +4847,7 @@ ex_buffer(exarg_T *eap)
if (ERROR_IF_ANY_POPUP_WINDOW)
return;
if (*eap->arg)
eap->errmsg = e_trailing;
eap->errmsg = ex_errmsg(e_trailing_arg, eap->arg);
else
{
if (eap->addr_count == 0) // default is current buffer
@@ -5356,7 +5414,7 @@ get_tabpage_arg(exarg_T *eap)
|| tab_number > LAST_TAB_NR)
{
// No numbers as argument.
eap->errmsg = e_invarg;
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
goto theend;
}
}
@@ -5368,7 +5426,7 @@ get_tabpage_arg(exarg_T *eap)
|| tab_number == 0)
{
// No numbers as argument.
eap->errmsg = e_invarg;
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
goto theend;
}
tab_number = tab_number * relative + tabpage_index(curtab);
@@ -5376,13 +5434,13 @@ get_tabpage_arg(exarg_T *eap)
--tab_number;
}
if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR)
eap->errmsg = e_invarg;
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
}
else if (eap->addr_count > 0)
{
if (unaccept_arg0 && eap->line2 == 0)
{
eap->errmsg = e_invrange;
eap->errmsg = _(e_invrange);
tab_number = 0;
}
else
@@ -5392,7 +5450,7 @@ get_tabpage_arg(exarg_T *eap)
{
--tab_number;
if (tab_number < unaccept_arg0)
eap->errmsg = e_invarg;
eap->errmsg = _(e_invrange);
}
}
}
@@ -5644,6 +5702,10 @@ ex_stop(exarg_T *eap)
static void
ex_exit(exarg_T *eap)
{
#ifdef FEAT_EVAL
if (not_in_vim9(eap) == FAIL)
return;
#endif
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
@@ -5905,7 +5967,7 @@ ex_recover(exarg_T *eap)
static void
ex_wrongmodifier(exarg_T *eap)
{
eap->errmsg = e_invcmd;
eap->errmsg = _(e_invcmd);
}
/*
@@ -6088,7 +6150,7 @@ ex_tabnext(exarg_T *eap)
|| tab_number == 0)
{
// No numbers as argument.
eap->errmsg = e_invarg;
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
return;
}
}
@@ -6101,7 +6163,7 @@ ex_tabnext(exarg_T *eap)
tab_number = eap->line2;
if (tab_number < 1)
{
eap->errmsg = e_invrange;
eap->errmsg = _(e_invrange);
return;
}
}
@@ -6489,7 +6551,7 @@ do_exedit(
static void
ex_nogui(exarg_T *eap)
{
eap->errmsg = e_nogvim;
eap->errmsg = _(e_nogvim);
}
#endif
@@ -7701,7 +7763,7 @@ ex_mark(exarg_T *eap)
if (*eap->arg == NUL) // No argument?
emsg(_(e_argreq));
else if (eap->arg[1] != NUL) // more than one character?
emsg(_(e_trailing));
semsg(_(e_trailing_arg), eap->arg);
else
{
pos = curwin->w_cursor; // save curwin->w_cursor
@@ -8065,7 +8127,7 @@ ex_findpat(exarg_T *eap)
// Check for trailing illegal characters
if (!ends_excmd2(eap->arg, p))
eap->errmsg = e_trailing;
eap->errmsg = ex_errmsg(e_trailing_arg, p);
else
eap->nextcmd = check_nextcmd(p);
}
@@ -8226,8 +8288,10 @@ find_cmdline_var(char_u *src, int *usedlen)
#define SPEC_SFILE (SPEC_CFILE + 1)
"<slnum>", // ":so" file line number
#define SPEC_SLNUM (SPEC_SFILE + 1)
"<stack>", // call stack
#define SPEC_STACK (SPEC_SLNUM + 1)
"<afile>", // autocommand file name
#define SPEC_AFILE (SPEC_SLNUM + 1)
#define SPEC_AFILE (SPEC_STACK + 1)
"<abuf>", // autocommand buffer number
#define SPEC_ABUF (SPEC_AFILE + 1)
"<amatch>", // autocommand match name
@@ -8478,10 +8542,13 @@ eval_vars(
break;
case SPEC_SFILE: // file name for ":so" command
result = estack_sfile();
case SPEC_STACK: // call stack
result = estack_sfile(spec_idx == SPEC_SFILE);
if (result == NULL)
{
*errormsg = _("E498: no :source file name to substitute for \"<sfile>\"");
*errormsg = spec_idx == SPEC_SFILE
? _("E498: no :source file name to substitute for \"<sfile>\"")
: _("E489: no call stack to substitute for \"<stack>\"");
return NULL;
}
resultbuf = result; // remember allocated string

View File

@@ -290,7 +290,7 @@ cause_errthrow(
// Get the source name and lnum now, it may change before
// reaching do_errthrow().
elem->sfile = estack_sfile();
elem->sfile = estack_sfile(FALSE);
elem->slnum = SOURCING_LNUM;
}
}
@@ -549,7 +549,7 @@ throw_exception(void *value, except_type_T type, char_u *cmdname)
}
else
{
excp->throw_name = estack_sfile();
excp->throw_name = estack_sfile(FALSE);
if (excp->throw_name == NULL)
excp->throw_name = vim_strsave((char_u *)"");
if (excp->throw_name == NULL)
@@ -917,7 +917,7 @@ ex_if(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = N_("E579: :if nesting too deep");
eap->errmsg = _("E579: :if nesting too deep");
else
{
++cstack->cs_idx;
@@ -953,7 +953,7 @@ ex_endif(exarg_T *eap)
if (eap->cstack->cs_idx < 0
|| (eap->cstack->cs_flags[eap->cstack->cs_idx]
& (CSF_WHILE | CSF_FOR | CSF_TRY)))
eap->errmsg = N_(e_endif_without_if);
eap->errmsg = _(e_endif_without_if);
else
{
/*
@@ -997,20 +997,20 @@ ex_else(exarg_T *eap)
{
if (eap->cmdidx == CMD_else)
{
eap->errmsg = N_(e_else_without_if);
eap->errmsg = _(e_else_without_if);
return;
}
eap->errmsg = N_(e_elseif_without_if);
eap->errmsg = _(e_elseif_without_if);
skip = TRUE;
}
else if (cstack->cs_flags[cstack->cs_idx] & CSF_ELSE)
{
if (eap->cmdidx == CMD_else)
{
eap->errmsg = N_("E583: multiple :else");
eap->errmsg = _("E583: multiple :else");
return;
}
eap->errmsg = N_("E584: :elseif after :else");
eap->errmsg = _("E584: :elseif after :else");
skip = TRUE;
}
@@ -1076,7 +1076,7 @@ ex_while(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = N_("E585: :while/:for nesting too deep");
eap->errmsg = _("E585: :while/:for nesting too deep");
else
{
/*
@@ -1186,7 +1186,7 @@ ex_continue(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = N_(e_continue);
eap->errmsg = _(e_continue);
else
{
// Try to find the matching ":while". This might stop at a try
@@ -1224,7 +1224,7 @@ ex_break(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = N_(e_break);
eap->errmsg = _(e_break);
else
{
// Inactivate conditionals until the matching ":while" or a try
@@ -1264,7 +1264,7 @@ ex_endwhile(exarg_T *eap)
}
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = err;
eap->errmsg = _(err);
else
{
fl = cstack->cs_flags[cstack->cs_idx];
@@ -1280,9 +1280,9 @@ ex_endwhile(exarg_T *eap)
if (!(fl & (CSF_WHILE | CSF_FOR)))
{
if (!(fl & CSF_TRY))
eap->errmsg = e_endif;
eap->errmsg = _(e_endif);
else if (fl & CSF_FINALLY)
eap->errmsg = e_endtry;
eap->errmsg = _(e_endtry);
// Try to find the matching ":while" and report what's missing.
for (idx = cstack->cs_idx; idx > 0; --idx)
{
@@ -1291,7 +1291,7 @@ ex_endwhile(exarg_T *eap)
{
// Give up at a try conditional not in its finally clause.
// Ignore the ":endwhile"/":endfor".
eap->errmsg = err;
eap->errmsg = _(err);
return;
}
if (fl & csf)
@@ -1447,7 +1447,7 @@ ex_try(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = N_("E601: :try nesting too deep");
eap->errmsg = _("E601: :try nesting too deep");
else
{
++cstack->cs_idx;
@@ -1526,7 +1526,7 @@ ex_catch(exarg_T *eap)
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
{
eap->errmsg = e_catch;
eap->errmsg = _(e_catch);
give_up = TRUE;
}
else
@@ -1545,7 +1545,7 @@ ex_catch(exarg_T *eap)
{
// Give up for a ":catch" after ":finally" and ignore it.
// Just parse.
eap->errmsg = N_("E604: :catch after :finally");
eap->errmsg = _("E604: :catch after :finally");
give_up = TRUE;
}
else
@@ -1588,7 +1588,7 @@ ex_catch(exarg_T *eap)
if (end != NULL && *end != NUL
&& !ends_excmd2(end, skipwhite(end + 1)))
{
emsg(_(e_trailing));
semsg(_(e_trailing_arg), end);
return;
}
@@ -1685,7 +1685,7 @@ ex_finally(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = e_finally;
eap->errmsg = _(e_finally);
else
{
if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
@@ -1705,7 +1705,7 @@ ex_finally(exarg_T *eap)
if (cstack->cs_flags[idx] & CSF_FINALLY)
{
// Give up for a multiple ":finally" and ignore it.
eap->errmsg = e_finally_dup;
eap->errmsg = _(e_finally_dup);
return;
}
rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR,
@@ -1814,7 +1814,7 @@ ex_endtry(exarg_T *eap)
cstack_T *cstack = eap->cstack;
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = e_no_endtry;
eap->errmsg = _(e_no_endtry);
else
{
/*
@@ -2276,10 +2276,10 @@ cleanup_conditionals(
get_end_emsg(cstack_T *cstack)
{
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
return e_endwhile;
return _(e_endwhile);
if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR)
return e_endfor;
return e_endif;
return _(e_endfor);
return _(e_endif);
}

View File

@@ -1730,6 +1730,7 @@ EXTERN char e_longname[] INIT(= N_("E75: Name too long"));
EXTERN char e_toomsbra[] INIT(= N_("E76: Too many ["));
EXTERN char e_toomany[] INIT(= N_("E77: Too many file names"));
EXTERN char e_trailing[] INIT(= N_("E488: Trailing characters"));
EXTERN char e_trailing_arg[] INIT(= N_("E488: Trailing characters: %s"));
EXTERN char e_umark[] INIT(= N_("E78: Unknown mark"));
EXTERN char e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
EXTERN char e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));

1295
src/help.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1086,7 +1086,7 @@ json_decode_all(js_read_T *reader, typval_T *res, int options)
json_skip_white(reader);
if (reader->js_buf[reader->js_used] != NUL)
{
emsg(_(e_trailing));
semsg(_(e_trailing_arg), reader->js_buf + reader->js_used);
return FAIL;
}
return OK;

View File

@@ -1194,12 +1194,15 @@ eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
else
clear_tv(&tv);
}
// Legacy Vim script allowed a space before the comma.
if (!vim9script)
*arg = skipwhite(*arg);
// the comma must come after the value
had_comma = **arg == ',';
if (had_comma)
{
if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
if (vim9script && !IS_WHITE_OR_NUL((*arg)[1]))
{
semsg(_(e_white_after), ",");
goto failret;
@@ -1231,7 +1234,7 @@ failret:
return FAIL;
}
*arg = skipwhite(*arg + 1);
*arg += 1;
if (evaluate)
rettv_list_set(rettv, l);

564
src/locale.c Normal file
View File

@@ -0,0 +1,564 @@
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* locale.c: functions for language/locale configuration
*/
#include "vim.h"
#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& (defined(FEAT_EVAL) || defined(FEAT_MULTI_LANG))
# define HAVE_GET_LOCALE_VAL
static char_u *
get_locale_val(int what)
{
char_u *loc;
// Obtain the locale value from the libraries.
loc = (char_u *)setlocale(what, NULL);
# ifdef MSWIN
if (loc != NULL)
{
char_u *p;
// setocale() returns something like "LC_COLLATE=<name>;LC_..." when
// one of the values (e.g., LC_CTYPE) differs.
p = vim_strchr(loc, '=');
if (p != NULL)
{
loc = ++p;
while (*p != NUL) // remove trailing newline
{
if (*p < ' ' || *p == ';')
{
*p = NUL;
break;
}
++p;
}
}
}
# endif
return loc;
}
#endif
#ifdef MSWIN
/*
* On MS-Windows locale names are strings like "German_Germany.1252", but
* gettext expects "de". Try to translate one into another here for a few
* supported languages.
*/
static char_u *
gettext_lang(char_u *name)
{
int i;
static char *(mtable[]) = {
"afrikaans", "af",
"czech", "cs",
"dutch", "nl",
"german", "de",
"english_united kingdom", "en_GB",
"spanish", "es",
"french", "fr",
"italian", "it",
"japanese", "ja",
"korean", "ko",
"norwegian", "no",
"polish", "pl",
"russian", "ru",
"slovak", "sk",
"swedish", "sv",
"ukrainian", "uk",
"chinese_china", "zh_CN",
"chinese_taiwan", "zh_TW",
NULL};
for (i = 0; mtable[i] != NULL; i += 2)
if (STRNICMP(mtable[i], name, STRLEN(mtable[i])) == 0)
return (char_u *)mtable[i + 1];
return name;
}
#endif
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
/*
* Return TRUE when "lang" starts with a valid language name.
* Rejects NULL, empty string, "C", "C.UTF-8" and others.
*/
static int
is_valid_mess_lang(char_u *lang)
{
return lang != NULL && ASCII_ISALPHA(lang[0]) && ASCII_ISALPHA(lang[1]);
}
/*
* Obtain the current messages language. Used to set the default for
* 'helplang'. May return NULL or an empty string.
*/
char_u *
get_mess_lang(void)
{
char_u *p;
# ifdef HAVE_GET_LOCALE_VAL
# if defined(LC_MESSAGES)
p = get_locale_val(LC_MESSAGES);
# else
// This is necessary for Win32, where LC_MESSAGES is not defined and $LANG
// may be set to the LCID number. LC_COLLATE is the best guess, LC_TIME
// and LC_MONETARY may be set differently for a Japanese working in the
// US.
p = get_locale_val(LC_COLLATE);
# endif
# else
p = mch_getenv((char_u *)"LC_ALL");
if (!is_valid_mess_lang(p))
{
p = mch_getenv((char_u *)"LC_MESSAGES");
if (!is_valid_mess_lang(p))
p = mch_getenv((char_u *)"LANG");
}
# endif
# ifdef MSWIN
p = gettext_lang(p);
# endif
return is_valid_mess_lang(p) ? p : NULL;
}
#endif
// Complicated #if; matches with where get_mess_env() is used below.
#if (defined(FEAT_EVAL) && !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& defined(LC_MESSAGES))) \
|| ((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& !defined(LC_MESSAGES))
/*
* Get the language used for messages from the environment.
*/
static char_u *
get_mess_env(void)
{
char_u *p;
p = mch_getenv((char_u *)"LC_ALL");
if (p == NULL || *p == NUL)
{
p = mch_getenv((char_u *)"LC_MESSAGES");
if (p == NULL || *p == NUL)
{
p = mch_getenv((char_u *)"LANG");
if (p != NULL && VIM_ISDIGIT(*p))
p = NULL; // ignore something like "1043"
# ifdef HAVE_GET_LOCALE_VAL
if (p == NULL || *p == NUL)
p = get_locale_val(LC_CTYPE);
# endif
}
}
return p;
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Set the "v:lang" variable according to the current locale setting.
* Also do "v:lc_time"and "v:ctype".
*/
void
set_lang_var(void)
{
char_u *loc;
# ifdef HAVE_GET_LOCALE_VAL
loc = get_locale_val(LC_CTYPE);
# else
// setlocale() not supported: use the default value
loc = (char_u *)"C";
# endif
set_vim_var_string(VV_CTYPE, loc, -1);
// When LC_MESSAGES isn't defined use the value from $LC_MESSAGES, fall
// back to LC_CTYPE if it's empty.
# if defined(HAVE_GET_LOCALE_VAL) && defined(LC_MESSAGES)
loc = get_locale_val(LC_MESSAGES);
# else
loc = get_mess_env();
# endif
set_vim_var_string(VV_LANG, loc, -1);
# ifdef HAVE_GET_LOCALE_VAL
loc = get_locale_val(LC_TIME);
# endif
set_vim_var_string(VV_LC_TIME, loc, -1);
# ifdef HAVE_GET_LOCALE_VAL
loc = get_locale_val(LC_COLLATE);
# else
// setlocale() not supported: use the default value
loc = (char_u *)"C";
# endif
set_vim_var_string(VV_COLLATE, loc, -1);
}
#endif
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
/*
* Setup to use the current locale (for ctype() and many other things).
*/
void
init_locale(void)
{
setlocale(LC_ALL, "");
# ifdef FEAT_GUI_GTK
// Tell Gtk not to change our locale settings.
gtk_disable_setlocale();
# endif
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
// Make sure strtod() uses a decimal point, not a comma.
setlocale(LC_NUMERIC, "C");
# endif
# ifdef MSWIN
// Apparently MS-Windows printf() may cause a crash when we give it 8-bit
// text while it's expecting text in the current locale. This call avoids
// that.
setlocale(LC_CTYPE, "C");
# endif
# ifdef FEAT_GETTEXT
{
int mustfree = FALSE;
char_u *p;
# ifdef DYNAMIC_GETTEXT
// Initialize the gettext library
dyn_libintl_init();
# endif
// expand_env() doesn't work yet, because g_chartab[] is not
// initialized yet, call vim_getenv() directly
p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (p != NULL && *p != NUL)
{
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p);
bindtextdomain(VIMPACKAGE, (char *)NameBuff);
}
if (mustfree)
vim_free(p);
textdomain(VIMPACKAGE);
}
# endif
}
/*
* ":language": Set the language (locale).
*/
void
ex_language(exarg_T *eap)
{
char *loc;
char_u *p;
char_u *name;
int what = LC_ALL;
char *whatstr = "";
# ifdef LC_MESSAGES
# define VIM_LC_MESSAGES LC_MESSAGES
# else
# define VIM_LC_MESSAGES 6789
# endif
name = eap->arg;
// Check for "messages {name}", "ctype {name}" or "time {name}" argument.
// Allow abbreviation, but require at least 3 characters to avoid
// confusion with a two letter language name "me" or "ct".
p = skiptowhite(eap->arg);
if ((*p == NUL || VIM_ISWHITE(*p)) && p - eap->arg >= 3)
{
if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0)
{
what = VIM_LC_MESSAGES;
name = skipwhite(p);
whatstr = "messages ";
}
else if (STRNICMP(eap->arg, "ctype", p - eap->arg) == 0)
{
what = LC_CTYPE;
name = skipwhite(p);
whatstr = "ctype ";
}
else if (STRNICMP(eap->arg, "time", p - eap->arg) == 0)
{
what = LC_TIME;
name = skipwhite(p);
whatstr = "time ";
}
else if (STRNICMP(eap->arg, "collate", p - eap->arg) == 0)
{
what = LC_COLLATE;
name = skipwhite(p);
whatstr = "collate ";
}
}
if (*name == NUL)
{
# ifndef LC_MESSAGES
if (what == VIM_LC_MESSAGES)
p = get_mess_env();
else
# endif
p = (char_u *)setlocale(what, NULL);
if (p == NULL || *p == NUL)
p = (char_u *)"Unknown";
smsg(_("Current %slanguage: \"%s\""), whatstr, p);
}
else
{
# ifndef LC_MESSAGES
if (what == VIM_LC_MESSAGES)
loc = "";
else
# endif
{
loc = setlocale(what, (char *)name);
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
// Make sure strtod() uses a decimal point, not a comma.
setlocale(LC_NUMERIC, "C");
# endif
}
if (loc == NULL)
semsg(_("E197: Cannot set language to \"%s\""), name);
else
{
# ifdef HAVE_NL_MSG_CAT_CNTR
// Need to do this for GNU gettext, otherwise cached translations
// will be used again.
extern int _nl_msg_cat_cntr;
++_nl_msg_cat_cntr;
# endif
// Reset $LC_ALL, otherwise it would overrule everything.
vim_setenv((char_u *)"LC_ALL", (char_u *)"");
if (what != LC_TIME && what != LC_COLLATE)
{
// Tell gettext() what to translate to. It apparently doesn't
// use the currently effective locale. Also do this when
// FEAT_GETTEXT isn't defined, so that shell commands use this
// value.
if (what == LC_ALL)
{
vim_setenv((char_u *)"LANG", name);
// Clear $LANGUAGE because GNU gettext uses it.
vim_setenv((char_u *)"LANGUAGE", (char_u *)"");
# ifdef MSWIN
// Apparently MS-Windows printf() may cause a crash when
// we give it 8-bit text while it's expecting text in the
// current locale. This call avoids that.
setlocale(LC_CTYPE, "C");
# endif
}
if (what != LC_CTYPE)
{
char_u *mname;
# ifdef MSWIN
mname = gettext_lang(name);
# else
mname = name;
# endif
vim_setenv((char_u *)"LC_MESSAGES", mname);
# ifdef FEAT_MULTI_LANG
set_helplang_default(mname);
# endif
}
}
# ifdef FEAT_EVAL
// Set v:lang, v:lc_time, v:collate and v:ctype to the final result.
set_lang_var();
# endif
# ifdef FEAT_TITLE
maketitle();
# endif
}
}
}
static char_u **locales = NULL; // Array of all available locales
static int did_init_locales = FALSE;
/*
* Return an array of strings for all available locales + NULL for the
* last element. Return NULL in case of error.
*/
static char_u **
find_locales(void)
{
garray_T locales_ga;
char_u *loc;
char_u *locale_list;
# ifdef MSWIN
size_t len = 0;
# endif
// Find all available locales by running command "locale -a". If this
// doesn't work we won't have completion.
# ifndef MSWIN
locale_list = get_cmd_output((char_u *)"locale -a",
NULL, SHELL_SILENT, NULL);
# else
// Find all available locales by examining the directories in
// $VIMRUNTIME/lang/
{
int options = WILD_SILENT|WILD_USE_NL|WILD_KEEP_ALL;
expand_T xpc;
char_u *p;
ExpandInit(&xpc);
xpc.xp_context = EXPAND_DIRECTORIES;
locale_list = ExpandOne(&xpc, (char_u *)"$VIMRUNTIME/lang/*",
NULL, options, WILD_ALL);
ExpandCleanup(&xpc);
if (locale_list == NULL)
// Add a dummy input, that will be skipped lated but we need to
// have something in locale_list so that the C locale is added at
// the end.
locale_list = vim_strsave((char_u *)".\n");
p = locale_list;
// find the last directory delimiter
while (p != NULL && *p != NUL)
{
if (*p == '\n')
break;
if (*p == '\\')
len = p - locale_list;
p++;
}
}
# endif
if (locale_list == NULL)
return NULL;
ga_init2(&locales_ga, sizeof(char_u *), 20);
// Transform locale_list string where each locale is separated by "\n"
// into an array of locale strings.
loc = (char_u *)strtok((char *)locale_list, "\n");
while (loc != NULL)
{
int ignore = FALSE;
# ifdef MSWIN
if (len > 0)
loc += len + 1;
// skip locales with a dot (which indicates the charset)
if (vim_strchr(loc, '.') != NULL)
ignore = TRUE;
# endif
if (!ignore)
{
if (ga_grow(&locales_ga, 1) == FAIL)
break;
loc = vim_strsave(loc);
if (loc == NULL)
break;
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] = loc;
}
loc = (char_u *)strtok(NULL, "\n");
}
# ifdef MSWIN
// Add the C locale
if (ga_grow(&locales_ga, 1) == OK)
((char_u **)locales_ga.ga_data)[locales_ga.ga_len++] =
vim_strsave((char_u *)"C");
# endif
vim_free(locale_list);
if (ga_grow(&locales_ga, 1) == FAIL)
{
ga_clear(&locales_ga);
return NULL;
}
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
return (char_u **)locales_ga.ga_data;
}
/*
* Lazy initialization of all available locales.
*/
static void
init_locales(void)
{
if (!did_init_locales)
{
did_init_locales = TRUE;
locales = find_locales();
}
}
# if defined(EXITFREE) || defined(PROTO)
void
free_locales(void)
{
int i;
if (locales != NULL)
{
for (i = 0; locales[i] != NULL; i++)
vim_free(locales[i]);
VIM_CLEAR(locales);
}
}
# endif
/*
* Function given to ExpandGeneric() to obtain the possible arguments of the
* ":language" command.
*/
char_u *
get_lang_arg(expand_T *xp UNUSED, int idx)
{
if (idx == 0)
return (char_u *)"messages";
if (idx == 1)
return (char_u *)"ctype";
if (idx == 2)
return (char_u *)"time";
if (idx == 3)
return (char_u *)"collate";
init_locales();
if (locales == NULL)
return NULL;
return locales[idx - 4];
}
/*
* Function given to ExpandGeneric() to obtain the available locales.
*/
char_u *
get_locales(expand_T *xp UNUSED, int idx)
{
init_locales();
if (locales == NULL)
return NULL;
return locales[idx];
}
#endif

View File

@@ -34,9 +34,6 @@
static int file_owned(char *fname);
#endif
static void mainerr(int, char_u *);
# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
static void init_locale(void);
# endif
static void early_arg_scan(mparm_T *parmp);
#ifndef NO_VIM_MAIN
static void usage(void);
@@ -1716,56 +1713,6 @@ getout(int exitval)
mch_exit(exitval);
}
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
/*
* Setup to use the current locale (for ctype() and many other things).
*/
static void
init_locale(void)
{
setlocale(LC_ALL, "");
# ifdef FEAT_GUI_GTK
// Tell Gtk not to change our locale settings.
gtk_disable_setlocale();
# endif
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
// Make sure strtod() uses a decimal point, not a comma.
setlocale(LC_NUMERIC, "C");
# endif
# ifdef MSWIN
// Apparently MS-Windows printf() may cause a crash when we give it 8-bit
// text while it's expecting text in the current locale. This call avoids
// that.
setlocale(LC_CTYPE, "C");
# endif
# ifdef FEAT_GETTEXT
{
int mustfree = FALSE;
char_u *p;
# ifdef DYNAMIC_GETTEXT
// Initialize the gettext library
dyn_libintl_init();
# endif
// expand_env() doesn't work yet, because g_chartab[] is not
// initialized yet, call vim_getenv() directly
p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (p != NULL && *p != NUL)
{
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p);
bindtextdomain(VIMPACKAGE, (char *)NameBuff);
}
if (mustfree)
vim_free(p);
textdomain(VIMPACKAGE);
}
# endif
}
#endif
/*
* Get the name of the display, before gui_prepare() removes it from
* argv[]. Used for the xterm-clipboard display.

View File

@@ -704,6 +704,7 @@ ex_marks(exarg_T *eap)
char_u *arg = eap->arg;
int i;
char_u *name;
pos_T *posp, *startp, *endp;
if (arg != NULL && *arg == NUL)
arg = NULL;
@@ -731,8 +732,17 @@ ex_marks(exarg_T *eap)
show_one_mark(']', arg, &curbuf->b_op_end, NULL, TRUE);
show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE);
show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE);
show_one_mark('<', arg, &curbuf->b_visual.vi_start, NULL, TRUE);
show_one_mark('>', arg, &curbuf->b_visual.vi_end, NULL, TRUE);
// Show the marks as where they will jump to.
startp = &curbuf->b_visual.vi_start;
endp = &curbuf->b_visual.vi_end;
if ((LT_POS(*startp, *endp) || endp->lnum == 0) && startp->lnum != 0)
posp = startp;
else
posp = endp;
show_one_mark('<', arg, posp, NULL, TRUE);
show_one_mark('>', arg, posp == startp ? endp : startp, NULL, TRUE);
show_one_mark(-1, arg, NULL, NULL, FALSE);
}

View File

@@ -1329,7 +1329,7 @@ ex_match(exarg_T *eap)
if (*end != NUL && !ends_excmd2(end, skipwhite(end + 1)))
{
vim_free(g);
eap->errmsg = e_trailing;
eap->errmsg = ex_errmsg(e_trailing_arg, end);
return;
}
if (*end != *p)

View File

@@ -289,7 +289,7 @@ ex_menu(
}
else if (*map_to != NUL && (unmenu || enable != MAYBE))
{
emsg(_(e_trailing));
semsg(_(e_trailing_arg), map_to);
goto theend;
}
#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))

View File

@@ -461,7 +461,7 @@ get_emsg_source(void)
if (SOURCING_NAME != NULL && other_sourcing_name())
{
char_u *sname = estack_sfile();
char_u *sname = estack_sfile(FALSE);
char_u *tofree = sname;
if (sname == NULL)

View File

@@ -2027,6 +2027,41 @@ ga_clear_strings(garray_T *gap)
ga_clear(gap);
}
/*
* Copy a growing array that contains a list of strings.
*/
int
ga_copy_strings(garray_T *from, garray_T *to)
{
int i;
ga_init2(to, sizeof(char_u *), 1);
if (ga_grow(to, from->ga_len) == FAIL)
return FAIL;
for (i = 0; i < from->ga_len; ++i)
{
char_u *orig = ((char_u **)from->ga_data)[i];
char_u *copy;
if (orig == NULL)
copy = NULL;
else
{
copy = vim_strsave(orig);
if (copy == NULL)
{
to->ga_len = i;
ga_clear_strings(to);
return FAIL;
}
}
((char_u **)to->ga_data)[i] = copy;
}
to->ga_len = from->ga_len;
return OK;
}
/*
* Initialize a growing array. Don't forget to set ga_itemsize and
* ga_growsize! Or use ga_init2().

View File

@@ -499,6 +499,7 @@ normal_cmd(
#ifdef FEAT_EVAL
int set_prevcount = FALSE;
#endif
int save_did_cursorhold = did_cursorhold;
CLEAR_FIELD(ca); // also resets ca.retval
ca.oap = oap;
@@ -1025,7 +1026,12 @@ getcount:
out_flush();
#endif
if (ca.cmdchar != K_IGNORE)
did_cursorhold = FALSE;
{
if (ex_normal_busy)
did_cursorhold = save_did_cursorhold;
else
did_cursorhold = FALSE;
}
State = NORMAL;

View File

@@ -2255,6 +2255,14 @@ did_set_string_option(
# endif
#endif
#ifdef FEAT_QUICKFIX
else if (varp == &p_qftf)
{
if (qf_process_qftf_option() == FALSE)
errmsg = e_invarg;
}
#endif
// Options that are a list of flags.
else
{

File diff suppressed because it is too large Load Diff

View File

@@ -642,6 +642,7 @@ pum_position_info_popup(win_T *wp)
int col = pum_col + pum_width + pum_scrollbar + 1;
int row = pum_row;
int botpos = POPPOS_BOTLEFT;
int used_maxwidth_opt = FALSE;
wp->w_popup_pos = POPPOS_TOPLEFT;
if (Columns - col < 20 && Columns - col < pum_col)
@@ -654,6 +655,12 @@ pum_position_info_popup(win_T *wp)
else
wp->w_maxwidth = Columns - col + 1;
wp->w_maxwidth -= popup_extra_width(wp);
if (wp->w_maxwidth_opt > 0 && wp->w_maxwidth > wp->w_maxwidth_opt)
{
// option value overrules computed value
wp->w_maxwidth = wp->w_maxwidth_opt;
used_maxwidth_opt = TRUE;
}
row -= popup_top_extra(wp);
if (wp->w_popup_flags & POPF_INFO_MENU)
@@ -673,7 +680,7 @@ pum_position_info_popup(win_T *wp)
row += pum_selected - pum_first + 1;
wp->w_popup_flags &= ~POPF_HIDDEN;
if (wp->w_maxwidth < 10)
if (wp->w_maxwidth < 10 && !used_maxwidth_opt)
// The popup is not going to fit or will overlap with the cursor
// position, hide the popup.
wp->w_popup_flags |= POPF_HIDDEN;

View File

@@ -740,8 +740,6 @@ apply_general_options(win_T *wp, dict_T *dict)
set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
str, OPT_FREE|OPT_LOCAL, 0);
set_string_option_direct_in_win(wp, (char_u *)"signcolumn", -1,
(char_u *)"no", OPT_FREE|OPT_LOCAL, 0);
set_padding_border(dict, wp->w_popup_padding, "padding", 999);
set_padding_border(dict, wp->w_popup_border, "border", 1);
@@ -946,6 +944,10 @@ apply_options(win_T *wp, dict_T *dict)
int nr;
apply_move_options(wp, dict);
set_string_option_direct_in_win(wp, (char_u *)"signcolumn", -1,
(char_u *)"no", OPT_FREE|OPT_LOCAL, 0);
apply_general_options(wp, dict);
nr = dict_get_number(dict, (char_u *)"hidden");
@@ -1109,6 +1111,7 @@ popup_adjust_position(win_T *wp)
int wrapped = 0;
int maxwidth;
int used_maxwidth = FALSE;
int margin_width = 0;
int maxspace;
int center_vert = FALSE;
int center_hor = FALSE;
@@ -1247,6 +1250,19 @@ popup_adjust_position(win_T *wp)
allow_adjust_left = FALSE;
maxwidth = wp->w_maxwidth;
}
if (wp->w_p_nu || wp->w_p_rnu)
margin_width = number_width(wp) + 1;
#ifdef FEAT_FOLDING
margin_width += wp->w_p_fdc;
#endif
#ifdef FEAT_SIGNS
if (signcolumn_on(wp))
margin_width += 2;
#endif
if (margin_width >= maxwidth)
margin_width = maxwidth - 1;
minwidth = wp->w_minwidth;
minheight = wp->w_minheight;
#ifdef FEAT_TERMINAL
@@ -1287,6 +1303,7 @@ popup_adjust_position(win_T *wp)
// Count Tabs for what they are worth and compute the length based on
// the maximum width (matters when 'showbreak' is set).
// "margin_width" is added to "len" where it matters.
if (wp->w_width < maxwidth)
wp->w_width = maxwidth;
len = win_linetabsize(wp, ml_get_buf(wp->w_buffer, lnum, FALSE),
@@ -1295,21 +1312,21 @@ popup_adjust_position(win_T *wp)
if (wp->w_p_wrap)
{
while (len > maxwidth)
while (len + margin_width > maxwidth)
{
++wrapped;
len -= maxwidth;
len -= maxwidth - margin_width;
wp->w_width = maxwidth;
used_maxwidth = TRUE;
}
}
else if (len > maxwidth
else if (len + margin_width > maxwidth
&& allow_adjust_left
&& (wp->w_popup_pos == POPPOS_TOPLEFT
|| wp->w_popup_pos == POPPOS_BOTLEFT))
{
// adjust leftwise to fit text on screen
int shift_by = len - maxwidth;
int shift_by = len + margin_width - maxwidth;
if (shift_by > wp->w_wincol)
{
@@ -1323,9 +1340,9 @@ popup_adjust_position(win_T *wp)
maxwidth += shift_by;
wp->w_width = maxwidth;
}
if (wp->w_width < len)
if (wp->w_width < len + margin_width)
{
wp->w_width = len;
wp->w_width = len + margin_width;
if (wp->w_maxwidth > 0 && wp->w_width > wp->w_maxwidth)
wp->w_width = wp->w_maxwidth;
}
@@ -1620,6 +1637,7 @@ parse_popup_option(win_T *wp, int is_preview)
if (is_preview)
wp->w_minwidth = x;
wp->w_maxwidth = x;
wp->w_maxwidth_opt = x;
}
}
else if (STRNCMP(s, "highlight:", 10) == 0)

View File

@@ -95,11 +95,13 @@ extern int _stricoll(char *a, char *b);
# include "gui_xim.pro"
# include "hardcopy.pro"
# include "hashtab.pro"
# include "help.pro"
# include "highlight.pro"
# include "indent.pro"
# include "insexpand.pro"
# include "json.pro"
# include "list.pro"
# include "locale.pro"
# include "blob.pro"
# include "main.pro"
# include "map.pro"

View File

@@ -58,6 +58,7 @@ int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose);
char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags);
int eval_isnamec(int c);
int eval_isnamec1(int c);
int eval_isdictc(int c);
int handle_subscript(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int verbose);
int item_copy(typval_T *from, typval_T *to, int deep, int copyID);
void echo_one(typval_T *rettv, int with_space, int *atstart, int *needclr);

View File

@@ -88,5 +88,6 @@ void f_setbufvar(typval_T *argvars, typval_T *rettv);
callback_T get_callback(typval_T *arg);
void put_callback(callback_T *cb, typval_T *tv);
void set_callback(callback_T *dest, callback_T *src);
void copy_callback(callback_T *dest, callback_T *src);
void free_callback(callback_T *callback);
/* vim: set ft=c : */

View File

@@ -35,15 +35,6 @@ char_u *get_old_sub(void);
void set_old_sub(char_u *val);
void free_old_sub(void);
int prepare_tagpreview(int undo_sync, int use_previewpopup, use_popup_T use_popup);
void ex_help(exarg_T *eap);
void ex_helpclose(exarg_T *eap);
char_u *check_help_lang(char_u *arg);
int help_heuristic(char_u *matched_string, int offset, int wrong_case);
int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_lang);
void fix_help_buffer(void);
void ex_exusage(exarg_T *eap);
void ex_viusage(exarg_T *eap);
void ex_helptags(exarg_T *eap);
void ex_smile(exarg_T *eap);
void ex_drop(exarg_T *eap);
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);

View File

@@ -15,10 +15,4 @@ void ex_pyxfile(exarg_T *eap);
void ex_pyx(exarg_T *eap);
void ex_pyxdo(exarg_T *eap);
void ex_checktime(exarg_T *eap);
char_u *get_mess_lang(void);
void set_lang_var(void);
void ex_language(exarg_T *eap);
void free_locales(void);
char_u *get_lang_arg(expand_T *xp, int idx);
char_u *get_locales(expand_T *xp, int idx);
/* vim: set ft=c : */

View File

@@ -5,6 +5,7 @@ int do_cmdline(char_u *cmdline, char_u *(*fgetline)(int, void *, int, int), void
int getline_equal(char_u *(*fgetline)(int, void *, int, int), void *cookie, char_u *(*func)(int, void *, int, int));
void *getline_cookie(char_u *(*fgetline)(int, void *, int, int), void *cookie);
char_u *getline_peek(char_u *(*fgetline)(int, void *, int, int), void *cookie);
char *ex_errmsg(char *msg, char_u *arg);
int parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only);
void undo_cmdmod(exarg_T *eap, int save_msg_scroll);
int parse_cmd_address(exarg_T *eap, char **errormsg, int silent);

14
src/proto/help.pro Normal file
View File

@@ -0,0 +1,14 @@
/* help.c */
void ex_help(exarg_T *eap);
void ex_helpclose(exarg_T *eap);
char_u *check_help_lang(char_u *arg);
int help_heuristic(char_u *matched_string, int offset, int wrong_case);
int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_lang);
void cleanup_help_tags(int num_file, char_u **file);
void prepare_help_buffer(void);
void fix_help_buffer(void);
void ex_exusage(exarg_T *eap);
void ex_viusage(exarg_T *eap);
void ex_helptags(exarg_T *eap);
/* vim: set ft=c : */

9
src/proto/locale.pro Normal file
View File

@@ -0,0 +1,9 @@
/* locale.c */
char_u *get_mess_lang(void);
void set_lang_var(void);
void init_locale(void);
void ex_language(exarg_T *eap);
void free_locales(void);
char_u *get_lang_arg(expand_T *xp, int idx);
char_u *get_locales(expand_T *xp, int idx);
/* vim: set ft=c : */

View File

@@ -56,6 +56,7 @@ char_u *vim_strrchr(char_u *string, int c);
int vim_isspace(int x);
void ga_clear(garray_T *gap);
void ga_clear_strings(garray_T *gap);
int ga_copy_strings(garray_T *from, garray_T *to);
void ga_init(garray_T *gap);
void ga_init2(garray_T *gap, int itemsize, int growsize);
int ga_grow(garray_T *gap, int n);

View File

@@ -15,6 +15,7 @@ void ex_cclose(exarg_T *eap);
void ex_copen(exarg_T *eap);
void ex_cbottom(exarg_T *eap);
linenr_T qf_current_entry(win_T *wp);
int qf_process_qftf_option(void);
int grep_internal(cmdidx_T cmdidx);
void ex_make(exarg_T *eap);
int qf_get_size(exarg_T *eap);

Some files were not shown because too many files have changed in this diff Show More