Compare commits

...

357 Commits

Author SHA1 Message Date
Christian Brabandt
cf3c1ca276 patch 9.0.1387: scrollbar test sporadically fails
Problem:    Scrollbar test sporadically fails.
Solution:   Mark the scrollbar test as flaky. (Christian Brabandt,
            closes #12113)
2023-03-06 15:29:29 +00:00
zeertzjq
30585e03a7 patch 9.0.1386: options test fails with some window width
Problem:    Options test fails with some window width.
Solution:   Adjust what text the test checks with. (closes #12111)
2023-03-06 08:10:04 +00:00
zeertzjq
f86dea8119 patch 9.0.1385: g'Esc is considered an error
Problem:    g'Esc is considered an error.
Solution:   Make g'Esc silently abandon the command. (closes #12110)
2023-03-05 21:15:06 +00:00
Philip H
b0b6b8b07e patch 9.0.1384: setting HOMEBREW_NO_AUTO_UPDATE is not needed with version 4
Problem:    Setting HOMEBREW_NO_AUTO_UPDATE is not needed with Homebew version
            4.
Solution:   Remove setting HOMEBREW_NO_AUTO_UPDATE. (closes #12008)
2023-03-05 20:56:34 +00:00
Bram Moolenaar
4390d872b6 patch 9.0.1383: xxd: combination of little endian and cols fails
Problem:    xxd: combination of little endian and cols fails. (Aapo
            Rantalainen)
Solution:   Round up the space taken by the hex output. (closes #12097)
2023-03-05 20:17:39 +00:00
Bram Moolenaar
c142d6513e patch 9.0.1382: failing test for strptime() doesn't show returned value
Problem:    Failing test for strptime() doesn't show returned value.
Solution:   Use assert_equal() instead of assert_true().
2023-03-05 19:27:49 +00:00
=?UTF-8?q?Ola=20S=C3=B6der?=
d8742476d1 patch 9.0.1381: ACCESS_ names have a conflict with on some systems
Problem:    ACCESS_ names have a conflict with on some systems.
Solution:   Rename by prepending VIM_. (Ola Söder, closes #12105)
2023-03-05 13:12:32 +00:00
Bram Moolenaar
5fb78c3fa5 patch 9.0.1380: CTRL-X on 2**64 subtracts two
Problem:    CTRL-X on 2**64 subtracts two. (James McCoy)
Solution:   Correct computation for large number. (closes #12103)
2023-03-04 20:47:39 +00:00
Yegappan Lakshmanan
5284b23e14 patch 9.0.1379: functions for handling options are not ordered
Problem:    Functions for handling options are not ordered.
Solution:   Put functions in alphabetical order. (Yegappan Lakshmanan,
            closes #12101)
2023-03-04 19:57:32 +00:00
Bram Moolenaar
c99cbf8f28 patch 9.0.1378: illegal memory access when using virtual editing
Problem:    Illegal memory access when using virtual editing.
Solution:   Make sure "startspaces" is not negative.
2023-03-04 14:13:10 +00:00
Bram Moolenaar
5c6a3c9bad patch 9.0.1377: job_status() may return "dead" if the process parent changed
Problem:    job_status() may return "dead" if the process parent changed.
Solution:   Call mch_process_running() to check if the job is still alive.
2023-03-04 13:23:26 +00:00
Bram Moolenaar
1c73b65229 patch 9.0.1376: accessing invalid memory with put in Visual block mode
Problem:    Accessing invalid memory with put in Visual block mode.
Solution:   Adjust the cursor column if needed.
2023-03-03 21:11:52 +00:00
Ernie Rael
f77a7f704f patch 9.0.1375: crash when getting member of obj of unknown class
Problem:    Crash when getting member of obj of unknown class.
Solution:   Check for NULL class and give an error message. (Ernie Rael,
            closes #12096)
2023-03-03 15:05:30 +00:00
Yegappan Lakshmanan
c727b19e9f patch 9.0.1374: function for setting options not used consistently
Problem:    Function for setting options not used consistently.
Solution:   Use a function for 'encoding' and terminal options. (Yegappan
            Lakshmanan, closes #12099)
2023-03-03 12:26:15 +00:00
h-east
194555c001 patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'
Problem:    Wrong text displayed when using both 'linebreak' and 'list'.
Solution:   Only set "c_extra" to NUL when "p_extra" is not empty. (Hirohito
            Higashi, closes #12065)
2023-03-02 18:49:09 +00:00
James McCoy
db1887ce40 patch 9.0.1372: test for 'toolbariconsize' may fail
Problem:    Test for 'toolbariconsize' may fail.
Solution:   Only test 'toolbariconsize' when it is supported. (James McCoy,
            closes #12095)
2023-03-02 18:36:33 +00:00
zeertzjq
440d4cb55b patch 9.0.1371: ballooneval interferes with Insert completion
Problem:    Ballooneval interferes with Insert completion.
Solution:   Ignore mouse-move events when completing. (closes #12094,
            closes #12092)
2023-03-02 17:51:32 +00:00
Bram Moolenaar
c3f971f289 patch 9.0.1370: crash when using a NULL object
Problem:    Crash when using a NULL object. (Ernie Rael)
Solution:   Check for NULL and give an error message. (closes #12083)
2023-03-02 17:38:33 +00:00
Yegappan Lakshmanan
c6ff21e876 patch 9.0.1369: still some "else if" constructs for setting options
Problem:    Still some "else if" constructs for setting options.
Solution:   Add a few more functions for handling options. (Yegappan
            Lakshmanan, closes #12090)
2023-03-02 14:46:48 +00:00
Amaan Qureshi
4ed914b18a patch 9.0.1368: Bass files are not recognized
Problem:    Bass files are not recognized.
Solution:   Add patterns for Bass files. (Amaan Qureshi, closes #12088)
2023-03-02 12:51:18 +00:00
Bram Moolenaar
e0f8691969 patch 9.0.1367: divide by zero in zero-width window
Problem:    Divide by zero in zero-width window.
Solution:   Check the width is positive.
2023-03-01 17:55:31 +00:00
Yegappan Lakshmanan
ad60898aa4 patch 9.0.1366: functions for setting options are in random order
Problem:    Functions for setting options are in random order.
Solution:   Sort functions alphabetically. (Yegappan Lakshmanan,
            closes #12082)
2023-03-01 12:44:06 +00:00
zeertzjq
f0300fc7b8 patch 9.0.1365: dead test code
Problem:    Dead test code.
Solution:   Remove code that depends on Farsi, which has been removed.
            (closes #12084)
2023-02-28 16:02:35 +00:00
Yee Cheng Chin
da77693b17 patch 9.0.1364: build error with older Mac OS
Problem:    Build error with older Mac OS.
Solution:   Adjust #ifdef. (Yee Cheng Chin, closes #12074)
2023-02-28 15:51:23 +00:00
Bram Moolenaar
3f45d67a15 patch 9.0.1363: crash when :def function has :break in skipped block
Problem:    Crash when :def function has :break in skipped block. (Ernie Rael)
Solution:   Don't generate a jump for a skipped :break. (closes #12077)
2023-02-27 22:06:51 +00:00
Bram Moolenaar
99ad3a8bb9 patch 9.0.1362: ml_get error when going to another tab
Problem:    ml_get error when going to another tab. (Daniel J. Perry)
Solution:   Do not call update_topline() if "curwin" is invalid.
            (closes #11907)
2023-02-27 17:18:01 +00:00
Bram Moolenaar
dd60c365cd Update runtime files 2023-02-27 15:49:53 +00:00
zeertzjq
341f3876b3 patch 9.0.1361: extendnew() not sufficiently tested
Problem:    extendnew() not sufficiently tested.
Solution:   Add a few more test cases for extendnew(). (closes #12075)
2023-02-27 14:59:57 +00:00
Amaan Qureshi
80c5b2c0f7 patch 9.0.1360: Cue files are not recognized
Problem:    Cue files are not recognized.
Solution:   Add patterns for Cue files. (Amaan Qureshi, closes #12067)
2023-02-27 14:32:08 +00:00
Yegappan Lakshmanan
5da901bb68 patch 9.0.1359: too many "else if" statements in handling options
Problem:    Too many "else if" statements in handling options.
Solution:   Add more functions for handling option changes. (Yegappan
            Lakshmanan, closes #12060)
2023-02-27 12:47:47 +00:00
Bram Moolenaar
30a8447715 patch 9.0.1358: compilation error with some compilers
Problem:    Compilation error with some compilers.
Solution:   Avoid using "class" as member name.
2023-02-27 08:07:14 +00:00
Bram Moolenaar
c4e1b86cb0 patch 9.0.1357: using null_object results in an internal error
Problem:    Using null_object results in an internal error. (Ernie Rael)
Solution:   Add instructions for pushing an object and class. (closes #12044)
2023-02-26 18:58:23 +00:00
zeertzjq
4f026ea9f1 patch 9.0.1356: cannot cancel "gr" with Esc
Problem:    Cannot cancel "gr" with Esc.
Solution:   Make "gr<Esc>" do nothing. (closes #12064)
2023-02-26 14:47:24 +00:00
Bram Moolenaar
83ae6150bf patch 9.0.1355: no error when declaring a class twice
Problem:    No error when declaring a class twice. (Ernie Rael)
Solution:   Pass different flags when declaring the class. (closes #12057)
2023-02-25 19:59:31 +00:00
Bram Moolenaar
d6a4ea3aa0 patch 9.0.1354: "gr CTRL-G" stays in virtual replace mode
Problem:    "gr CTRL-G" stays in virtual replace mode. (Pierre Ganty)
Solution:   Prepend CTRL-V before control characters. (closes #12045)
2023-02-25 14:24:44 +00:00
Yegappan Lakshmanan
6d611de58c patch 9.0.1353: too many "else if" statements to handle option values
Problem:    Too many "else if" statements to handle option values.
Solution:   Add more functions to handle option value changes. (Yegappan
            Lakshmanan, closes #12058)
2023-02-25 11:59:33 +00:00
K.Takata
a63fd82328 patch 9.0.1352: "ignore" files are outdated
Problem:    "ignore" files are outdated.
Solution:   Update "ignore" files. (Ken Takata, closes #12056)
2023-02-24 17:16:41 +00:00
Amaan Qureshi
def5521752 patch 9.0.1351: Dhall files are not recognized
Problem:    Dhall files are not recognized.
Solution:   Add patterns for Dhall files. (Amaan Qureshi, closes #12052)
2023-02-24 16:01:54 +00:00
Amaan Qureshi
c2254764bc patch 9.0.1350: CPON files are not recognized
Problem:    CPON files are not recognized.
Solution:   Add patterns for CPON files. (Amaan Qureshi, closes #12053)
2023-02-24 12:08:45 +00:00
Bram Moolenaar
3ddb1182b7 patch 9.0.1349: "gr" with a count fails
Problem:    "gr" with a count fails.
Solution:   Break out of the loop only after using the count.
2023-02-23 22:14:37 +00:00
Amaan Qureshi
44e08c1cf8 patch 9.0.1348: Un-grammar files are not recognized
Problem:    Un-grammar files are not recognized.
Solution:   Add patterns for Un-grammar files. (Amaan Qureshi, closes #12034)
2023-02-23 20:31:08 +00:00
Bram Moolenaar
2824d1ee32 patch 9.0.1347: "gr CTRL-O" stays in Insert mode
Problem:    "gr CTRL-O" stays in Insert mode. (Pierre Ganty)
Solution:   Do not set restart_edit when "cmdchar" is 'v'. (closes #12045)
2023-02-23 20:13:04 +00:00
Amaan Qureshi
ca06b30073 patch 9.0.1346: Starlark files are not recognized
Problem:    Starlark files are not recognized.
Solution:   Add patterns for Starlark files. (Amaan Qureshi, closes #12049)
2023-02-23 15:38:49 +00:00
Yegappan Lakshmanan
8ad862a1f9 patch 9.0.1345: too many "else if" statements for handling options
Problem:    Too many "else if" statements for handling options.
Solution:   Add more functions to handle options. (Yegappan Lakshmanan,
            closes #12051)
2023-02-23 15:05:22 +00:00
Bram Moolenaar
a8f0835a6b patch 9.0.1344: check for OSC escape sequence doesn't work
Problem:    Check for OSC escape sequence doesn't work.
Solution:   Fix typo in index.
2023-02-23 13:54:01 +00:00
Johan Mattsson
3451789f58 patch 9.0.1343: check for OSC escape sequence doesn't work
Problem:    Check for OSC escape sequence doesn't work.
Solution:   Move square bracket to the right place. (Johan Mattsson,
            closes #12048)
2023-02-23 12:46:04 +00:00
zhihaoy
3e2d5385ed patch 9.0.1342: MS-Windows: linking may fail with space in directory name
Problem:    MS-Windows: linking may fail with space in directory name.
Solution:   Add quotes. (closes #12050)
2023-02-23 12:36:22 +00:00
K.Takata
4ee083e7f9 patch 9.0.1341: build error with mzscheme but without GUI
Problem:    Build error with mzscheme but without GUI.
Solution:   Adjust #ifdefs. (Ken Takata, closes #12042)  Also fix function
            argument.
2023-02-22 13:14:36 +00:00
Bram Moolenaar
666cb9c530 patch 9.0.1340: Coverity warns for using NULL pointer
Problem:    Coverity warns for using NULL pointer.
Solution:   Check that lhs_type is not NULL.
2023-02-22 12:35:17 +00:00
Bram Moolenaar
38f1ab31fa patch 9.0.1339: no test for :disassemble with class function
Problem:    No test for :disassemble with class function.
Solution:   Add a test.
2023-02-21 20:09:46 +00:00
Bram Moolenaar
99a7c0d89c patch 9.0.1338: :defcompile and :disassemble can't find class method
Problem:    :defcompile and :disassemble can't find class method. (Ernie Rael)
Solution:   Make a class name and class.method name work. (closes #11984)
2023-02-21 19:55:14 +00:00
Amaan Qureshi
cfce5cf542 patch 9.0.1337: yuck files are not recognized
Problem:    Yuck files are not recognized.
Solution:   Add a filetype pattern for yuck files. (Amaan Qureshi,
            closes #12033)
2023-02-21 15:18:50 +00:00
Yegappan Lakshmanan
a23a11b5bf patch 9.0.1336: functions without arguments are not always declared properly
Problem:    Functions without arguments are not always declared properly.
Solution:   Use "(void)" instead of "()". (Yegappan Lakshmanan, closes #12031)
2023-02-21 14:27:41 +00:00
h-east
d950984489 patch 9.0.1335: no test for bad use of spaces in help files
Problem:    No test for bad use of spaces in help files.
Solution:   Add checks for use of spaces in help files.  Ignore intentional
            spaces. (Hirohito Higashi, closes #11952)
2023-02-21 13:33:17 +00:00
Bram Moolenaar
b1e32ac0c9 patch 9.0.1334: using tt_member for the class leads to mistakes
Problem:    Using tt_member for the class leads to mistakes.
Solution:   Add a separate tt_class field.
2023-02-21 12:38:51 +00:00
Bram Moolenaar
938ae280c7 Update runtime files. 2023-02-20 20:44:55 +00:00
Bram Moolenaar
6b066c6d8f patch 9.0.1333: when redo'ing twice <ScriptCmd> may not get the script ID
Problem:    When redo'ing twice <ScriptCmd> may not get the script ID.
Solution:   When "last_used_map" map is not set use "last_used_sid".
            (closes #11930)
2023-02-20 18:44:33 +00:00
zeertzjq
b444ee761a patch 9.0.1332: crash when using buffer-local user command in cmdline window
Problem:    Crash when using buffer-local user command in cmdline window.
            (Karl Yngve Lervåg)
Solution:   Use the right buffer to find the user command. (closes #12030,
            closes #12029)
2023-02-20 15:25:13 +00:00
Pavel Mayorov
e1121b1394 patch 9.0.1331: illegal memory access when using :ball in Visual mode
Problem:    Illegal memory access when using :ball in Visual mode.
Solution:   Stop Visual mode when using :ball. (Pavel Mayorov, closes #11923)
2023-02-20 14:35:20 +00:00
Yegappan Lakshmanan
af93691b53 patch 9.0.1330: handling new value of an option has a long "else if" chain
Problem:    Handling new value of an option has a long "else if" chain.
Solution:   Use a function pointer. (Yegappan Lakshmanan, closes #12015)
2023-02-20 12:16:39 +00:00
zeertzjq
997b8a015c patch 9.0.1329: completion of map includes simplified ones
Problem:    Completion of map includes simplified ones.
Solution:   Do not complete simplified mappings. (closes #12013)
2023-02-19 21:00:31 +00:00
Bram Moolenaar
5b9f57262f patch 9.0.1328: error when using "none" for GUI color is confusing
Problem:    Error when using "none" for GUI color is confusing.
Solution:   Mention that the name should perhaps be "NONE". (closes #1400)
2023-02-19 20:49:38 +00:00
Bram Moolenaar
ea62cee85e patch 9.0.1327: cursor in wrong position below line with virtual text below
Problem:    Cursor in wrong position below line with virtual text below ending
            in multi-byte character.
Solution:   When checking for last character take care of multi-byte
            character.
2023-02-19 18:36:41 +00:00
Bram Moolenaar
a572b936ce patch 9.0.1326: relative line number not updated with virtual text above
Problem:    Relative line number not updated with virtual text above.
Solution:   Adjust the row for the line number for virtual text above.
            (closes #12004)
2023-02-19 14:34:37 +00:00
Bram Moolenaar
f53e065bce patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text above
Problem:    'colorcolumn' highlight wrong with virtual text above.
Solution:   Adjust column of 'colorcolumn' for text propertly. (closes #12004)
2023-02-19 14:16:02 +00:00
Luuk van Baal
441a7a9448 patch 9.0.1324: "gj" and "gk" do not move correctly over a closed fold
Problem:    "gj" and "gk" do not move correctly over a closed fold.
Solution:   Use the same code as used for "j"/"k" to go to the next/previous
            line. (Luuk van Baal, closes #12007)
2023-02-18 20:15:44 +00:00
Bram Moolenaar
3e1ac1443a patch 9.0.1323: build failure with +eval feature
Problem:    Build failure with +eval feature.
Solution:   Add missing part for using funcerror_T.
2023-02-18 19:49:32 +00:00
Bram Moolenaar
2c1c803c7e patch 9.0.1322: crash when indexing "any" which is an object
Problem:    Crash when indexing "any" which is an object.
Solution:   Check the index is a number.  Do not check the member type of an
            object.  (closes #12019)
2023-02-18 18:38:37 +00:00
Bram Moolenaar
d114975b9b patch 9.0.1321: vimscript test fails where using {expr} syntax
Problem:    vimscript test fails where using {expr} syntax.
Solution:   Only return FCERR_FAILED in call_user_func() for Vim9 script.
2023-02-18 15:31:53 +00:00
Bram Moolenaar
0917e86763 patch 9.0.1320: checking the type of a null object causes a crash
Problem:    Checking the type of a null object causes a crash.
Solution:   Don't try to get the class of a null object. (closes #12005)
            Handle error from calling a user function better.
2023-02-18 14:42:44 +00:00
Matthias Queitsch
9de960ace0 patch 9.0.1319: PRQL files are not recognized
Problem:    PRQL files are not recognized.
Solution:   Add a filetype pattern for PRQL files. (Matthias Queitsch,
            closes #12018)
2023-02-18 12:04:37 +00:00
Bram Moolenaar
f2017f255d patch 9.0.1318: code style test fails
Problem:    Code style test fails.
Solution:   Remove trailing white space.
2023-02-17 21:29:57 +00:00
Bram Moolenaar
552bdca781 patch 9.0.1317: crash when using an unset object variable
Problem:    Crash when using an unset object variable.
Solution:   Give an error instead. (closes #12005)
2023-02-17 21:08:50 +00:00
Christopher Plewright
eea0a00811 patch 9.0.1316: MS-Windows: vimfiles dir created with admin group
Problem:    MS-Windows: vimfiles dir created with admin group.
Solution:   Use ShellExecAsUser to create the vimfiles directory. (Christopher
            Plewright, Ken Takata, closes #12000, closes #11888)
2023-02-17 20:04:51 +00:00
zeertzjq
c3a26c6bff patch 9.0.1315: escaping for completion of map command not properly tested
Problem:    Escaping for completion of map command not properly tested.
Solution:   Add a few test cases. (closes #12009)
2023-02-17 16:40:20 +00:00
cero1988
1d87e11a1e patch 9.0.1314: :messages behavior depends on 'fileformat' of current buffer
Problem:    :messages behavior depends on 'fileformat' of current buffer.
Solution:   Pass the buffer pointer to where it is used. (Mirko Ceroni,
            closes #11995)
2023-02-16 15:03:12 +00:00
K.Takata
ce3189d56e patch 9.0.1313: some settings use the current codepage instead of 'encoding'
Problem:    Some settings use the current codepage instead of 'encoding'.
Solution:   Adjust how options are initialized. (Ken Takata, closes #11992)
2023-02-15 19:13:43 +00:00
Luuk van Baal
bc3dc298b3 patch 9.0.1312: Cursor position wrong when splitting window in insert mode
Problem:    Cursor position wrong when splitting window in insert mode.
Solution:   Pass the actual mode to win_fix_cursor(). (Luuk van Baal,
            closes #11999,
2023-02-15 16:45:27 +00:00
Bram Moolenaar
339e114d70 patch 9.0.1311: Coverity warns for using a NULL pointer
Problem:    Coverity warns for using a NULL pointer.
Solution:   Use "empty_option" instead of NULL.
2023-02-15 14:26:25 +00:00
Bram Moolenaar
fdbd14e892 patch 9.0.1310: 'splitkeep' test has failures
Problem:    'splitkeep' test has failures.
Solution:   Adjust expected cursor line position.
2023-02-14 21:56:42 +00:00
Bram Moolenaar
1d6539cf36 patch 9.0.1309: scrolling two lines with even line count and 'scrolloff' set
Problem:    Scrolling two lines with even line count and 'scrolloff' set.
Solution:   Adjust how the topline is computed. (closes #10545)
2023-02-14 17:41:20 +00:00
Yegappan Lakshmanan
1a6476428f patch 9.0.1308: the code for setting options is too complicated
Problem:    The code for setting options is too complicated.
Solution:   Refactor the code for setting options. (Yegappan Lakshmanan,
            closes #11989)
2023-02-14 13:07:18 +00:00
Yegappan Lakshmanan
32ff96ef01 patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Problem:    Setting 'formatoptions' with :let doesn't check for errors.
Solution:   Pass "errbuf" to set_string_option(). (Yegappan Lakshmanan,
            closes #11974, closes #11972)
2023-02-13 16:10:04 +00:00
Bram Moolenaar
5ceb8157bc patch 9.0.1306: no regression test for solved problem of #11959
Problem:    No regression test for solved problem of #11959.
Solution:   Add a test, also with 'list' set. (closes #11959)
2023-02-12 18:11:21 +00:00
Bram Moolenaar
55a27d8ea7 patch 9.0.1305: cursor in wrong line with virtual text above
Problem:    Cursor in wrong line with virtual text above.
Solution:   Count extra line for text property above/below. (closes #11959)
2023-02-12 18:03:57 +00:00
Bram Moolenaar
234c3fab28 patch 9.0.1304: "$" for 'list' option displayed in wrong position
Problem:    "$" for 'list' option displayed in wrong position when there are
            text properties.
Solution:   Adjust logic for order of displayed items. (closes #11959)
2023-02-12 14:42:15 +00:00
qsmodo
094b8473ed patch 9.0.1303: Motif: scrollbar width/height wrong when maximized
Problem:    Motif: scrollbar width/height wrong when maximized.
Solution:   Set the width/height when creating the scrollbar. (closes #11946)
2023-02-11 19:12:57 +00:00
Bram Moolenaar
aab2ead008 patch 9.0.1302: on a Belgian keyboard CTRL-] does not work
Problem:    On a Belgian keyboard CTRL-] does not work.
Solution:   Translate CTRL-$ into CTRL-]. (closes #11831)
2023-02-11 16:15:50 +00:00
Bram Moolenaar
9d9a20ee87 patch 9.0.1301: virtual text below empty line not displayed
Problem:    Virtual text below empty line not displayed.
Solution:   Adjust flags and computations. (closes #11959)
2023-02-11 13:49:01 +00:00
Yegappan Lakshmanan
3ec78f973f patch 9.0.1300: 'statusline' only supports one "%=" item
Problem:    'statusline' only supports one "%=" item.
Solution:   Add support for multiple "%=" items. (TJ DeVries, Yegappan
            Lakshmanan, closes #11970, closes #11965)
2023-02-11 11:15:25 +00:00
zeertzjq
412e0e4ed9 patch 9.0.1299: change for triggering incsearch not sufficiently tested
Problem:    Change for triggering incsearch not sufficiently tested.
Solution:   Add a test case.  Simplify the code. (closes #11971)
2023-02-11 10:34:07 +00:00
K.Takata
c4b7dec382 patch 9.0.1298: inserting register on the cmdline does not trigger incsearch
Problem:    Inserting a register on the command line does not trigger
            incsearch or update hlsearch.
Solution:   Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate
            and handle it correctly. (Ken Takata, closes #11960)
2023-02-10 21:38:44 +00:00
WuerfelDev
962d916435 patch 9.0.1297: wrong value for $LC_CTYPE makes the environ test fail
Problem:    Wrong value for $LC_CTYPE makes the environ test fail.
Solution:   Unset $LC_CTYPE when running tests. (closes #11963)
2023-02-10 20:49:08 +00:00
Bram Moolenaar
094cf9f4d5 patch 9.0.1296: calling an object method with arguments does not work
Problem:    Calling an object method with arguments does not work. (Ernie
            Rael)
Solution:   Take the argument count into account when looking up the object.
            (closes #11911)
2023-02-10 15:52:25 +00:00
Yegappan Lakshmanan
6c41bedeed patch 9.0.1295: the option initialization function is too long
Problem:    The option initialization function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes #11966)
2023-02-10 14:50:31 +00:00
Yegappan Lakshmanan
80b817b749 patch 9.0.1294: the set_bool_option() function is too long
Problem:    The set_bool_option() function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes #11964)
2023-02-09 22:08:52 +00:00
Yegappan Lakshmanan
0caaf1e465 patch 9.0.1293: the set_num_option() is too long
Problem:    The set_num_option() is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes #11954)
2023-02-09 12:23:17 +00:00
Bram Moolenaar
313e4724c3 patch 9.0.1292: :defer may call the wrong method for an object
Problem:    :defer may call the wrong method for an object. (Ernie Rael)
Solution:   When en object is from a class that extends or implements, figure
            out the method to call at runtime. (closes #11910)
2023-02-08 20:55:27 +00:00
Amaan Qureshi
6642982bea patch 9.0.1291: Move language files are not recognized
Problem:    Move language files are not recognized.
Solution:   Recognize Move language files. (Amaan Qureshi, closes #11947)
2023-02-07 19:37:32 +00:00
zeertzjq
af9e28a5b8 patch 9.0.1290: CTRL-N and -P on cmdline don't trigger CmdlineChanged
Problem:    CTRL-N and -P on cmdline don't trigger CmdlineChanged.
Solution:   Jump to cmdline_changed instead of cmdline_not_changed.
            (closes #11956)
2023-02-06 20:58:09 +00:00
Philip H
43e234e8b4 patch 9.0.1289: a newer version of clang can be used for CI
Problem:    A newer version of clang can be used for CI.
Solution:   Switch from clang-15 to clang-16. (closes #11577)
2023-02-06 20:22:48 +00:00
Amaan Qureshi
91deac4539 patch 9.0.1288: FunC files are not recognized
Problem:    FunC files are not recognized.
Solution:   Recognize FunC files. (Amaan Qureshi, closes #11949)
2023-02-06 19:32:07 +00:00
Bram Moolenaar
0261e3978e patch 9.0.1287: with the Kitty key protocl Esc with NumLock cannot be mapped
Problem:    With the Kitty key protocl Esc with NumLock cannot be mapped.
Solution:   Also use K_ESC when there is a modifier. (closes #11811)
2023-02-06 17:46:37 +00:00
Bram Moolenaar
546933f497 patch 9.0.1286: Coverity warns for using a NULL pointer
Problem:    Coverity warns for using a NULL pointer.
Solution:   Bail out whan "varp" is NULL.
2023-02-06 16:40:49 +00:00
Bram Moolenaar
a9a6b0323e patch 9.0.1285: various small problems
Problem:    Various small problems.
Solution:   Adjust white space and comments.
2023-02-05 18:00:42 +00:00
Bram Moolenaar
40b4872966 patch 9.0.1284: compiler warnings for uninitialized variables
Problem:    Compiler warnings for uninitialized variables. (Tony Mechelynck)
Solution:   Add variable initializations.
2023-02-05 17:04:50 +00:00
Yegappan Lakshmanan
c72078b631 patch 9.0.1283: the code for setting options is too complicated
Problem:    The code for setting options is too complicated.
Solution:   Refactor the do_set() function. (Yegappan Lakshmanan, Lewis
            Russell, closes #11945)
2023-02-05 16:02:35 +00:00
Amaan Qureshi
c8ef30bc2e patch 9.0.1282: Ron files are not recognized
Problem:    Ron files are not recognized.
Solution:   Recognize Ron files. (Amaan Qureshi, closes #11948)
2023-02-05 14:47:46 +00:00
Janez Podhostnik
cb626a4692 patch 9.0.1281: Cadence files are not recognized
Problem:    Cadence files are not recognized.
Solution:   Recognize Cadence files. (Janez Podhostnik, closes #11951)
2023-02-05 13:01:40 +00:00
Bram Moolenaar
7a1bdaecf2 patch 9.0.1280: inssufficient testing for what 9.0.1265 fixes
Problem:    Inssufficient testing for what 9.0.1265 fixes.
Solution:   Add a couple of test cases. (issue #11885)
2023-02-04 15:45:27 +00:00
Bram Moolenaar
61fdbfa1e3 patch 9.0.1279: display shows lines scrolled down erroneously
Problem:    Display shows lines scrolled down erroneously. (Yishai Lerner)
Solution:   Do not change "wl_lnum" at index zero. (closes #11938)
2023-02-04 13:57:55 +00:00
Amaan Qureshi
4ad8ae8465 patch 9.0.1278: go.work.sum files are not recognized
Problem:    go.work.sum files are not recognized.
Solution:   Recognize go.work.sum files as the gosum filetype. (Amaan Qureshi,
            closes #11940)
2023-02-04 12:12:36 +00:00
zeertzjq
49f0524fb5 patch 9.0.1277: cursor may move with autocmd in Visual mode
Problem:    Cursor may move with autocmd in Visual mode.
Solution:   Restore "VIsual_active" before calling check_cursor().
            (closes #11939)
2023-02-04 10:58:34 +00:00
Bram Moolenaar
4be18e77ff patch 9.0.1276: some mappings with Meta and Shift do not work
Problem:    Some mappings with Meta and Shift do not work.
Solution:   Apply the Shift modifier to the key. (issue #11913)
2023-02-03 12:28:07 +00:00
Yegappan Lakshmanan
78012f55fa patch 9.0.1275: the code for setting options is too complicated
Problem:    The code for setting options is too complicated.
Solution:   Refactor the do_set() function. (Yegappan Lakshmanan, Lewis
            Russell, closes #11932)
2023-02-02 16:34:11 +00:00
Bram Moolenaar
be4e01637e Update runtime files. 2023-02-02 13:59:48 +00:00
Amaan Qureshi
685bf83b73 patch 9.0.1274: FIRRTL files are not recognized
Problem:    FIRRTL files are not recognized.
Solution:   Add a pattern for FIRRTL files. (Amaan Qureshi, closes #11931)
2023-02-02 13:30:13 +00:00
Bram Moolenaar
8f531662e2 patch 9.0.1273: "1v" may select block with wrong size
Problem:    "1v" may select block with wrong size. (Evgeni Chasnovski)
Solution:   Compute "curswant" in the right line. (closes #11925)
2023-02-01 17:33:18 +00:00
zeertzjq
e8d4ae0d11 patch 9.0.1272: typo in pattern for filetype detection
Problem:    Typo in pattern for filetype detection.
Solution:   Fix the typo. (closes #11924)
2023-02-01 15:31:23 +00:00
zeertzjq
1b438a8228 patch 9.0.1271: using sizeof() and subtract array size is tricky
Problem:    Using sizeof() and subtract array size is tricky.
Solution:   Use offsetof() instead. (closes #11926)
2023-02-01 13:11:15 +00:00
zeertzjq
a7d36b7320 patch 9.0.1270: crash when using search stat in narrow screen
Problem:    Crash when using search stat in narrow screen.
Solution:   Check length of message. (closes #11921)
2023-01-31 21:13:38 +00:00
Bram Moolenaar
b40c1de384 patch 9.0.1269: channel test often fails on Mac OS
Problem:    Channel test often fails on Mac OS.
Solution:   Increase the wait time from one to 15 milliseconds. (D. Ben
            Knoble, closes #11894)
2023-01-31 21:01:08 +00:00
Mark Skelton
9c51798a1f patch 9.0.1268: .clangd and .stylelintrc files don't get a filetype
Problem:    .clangd and .stylelintrc files don't get a filetype.
Solution:   Use yaml for .clangd and json for .stylelintrc files. (Mark
            Skelton, closes #11916)
2023-01-31 18:57:17 +00:00
Yegappan Lakshmanan
d6e4c75af2 patch 9.0.1267: the did_set_string_option function is too long
Problem:    The did_set_string_option function is too long.
Solution:   Further cleanup of handling string options.  (Yegappan Lakshmanan,
            Lewis Russell, closes #11920)
2023-01-31 13:25:58 +00:00
Bram Moolenaar
ce93d162da patch 9.0.1266: error for space before ": type" is inconsistent
Problem:    Error for space before ": type" is inconsistent.
Solution:   Give E1059 in more places. (closes #11868)
2023-01-30 21:12:34 +00:00
Bram Moolenaar
b8bebd0cd7 patch 9.0.1265: using an interface method may give a compilation error
Problem:    Using an interface method may give a compilation error.
Solution:   Do not try to compile the body of a method of an interface.
            (closes #11885)
2023-01-30 20:24:23 +00:00
Bram Moolenaar
eb45ad25ab patch 9.0.1264: Motif: compiler warning for unused argument
Problem:    Motif: compiler warning for unused argument.
Solution:   Add "UNUSED".
2023-01-30 19:26:24 +00:00
Amaan Qureshi
907349a743 patch 9.0.1263: KDL files are not recognized
Problem:    KDL files are not recognized.
Solution:   Add a pattern for KDL files. (Amaan Qureshi, closes #11898)
2023-01-30 15:19:57 +00:00
Yegappan Lakshmanan
f2e30d0c44 patch 9.0.1262: the did_set_string_option function is too long
Problem:    The did_set_string_option function is too long.
Solution:   Split off functionality to individual functions.  (Yegappan
            Lakshmanan, Lewis Russell, closes #11904)
2023-01-30 13:04:42 +00:00
Amaan Qureshi
2a99fe6c41 patch 9.0.1261: Elsa files are not recognized
Problem:    Elsa files are not recognized.
Solution:   Add a pattern for Elsa files. (Amaan Qureshi, closes #11908)
2023-01-29 17:50:14 +00:00
Bram Moolenaar
836137d89a patch 9.0.1260: Coverity warns for possible NULL pointer usage
Problem:    Coverity warns for possible NULL pointer usage.
Solution:   Change the condition.
2023-01-29 14:11:24 +00:00
Bram Moolenaar
492324e588 patch 9.0.1259: diffmode test fails
Problem:    Diffmode test fails.
Solution:   Adjust expected result for adjusted indenting.
2023-01-28 20:57:59 +00:00
Bram Moolenaar
755bf2b3d2 patch 9.0.1258: code style test fails
Problem:    Code style test fails.
Solution:   Adjust test files.
2023-01-28 19:38:49 +00:00
Bram Moolenaar
94722c5107 patch 9.0.1257: code style is not check in test scripts
Problem:    Code style is not check in test scripts.
Solution:   Add basic code style check for test files.
2023-01-28 19:19:03 +00:00
ObserverOfTime
04e4f1d985 patch 9.0.1256: NetworkManager connection files are not recognized
Problem:    NetworkManager connection files are not recognized.
Solution:   Add a pattern for NetworkManager connection files. (closes #11893)
2023-01-28 18:05:40 +00:00
Bram Moolenaar
8fe5b9c8c1 patch 9.0.1255: changing 'virtualedit' does not have immediate effect
Problem:    Changing 'virtualedit' does not have immediate effect.
Solution:   Correct how is checked for a changed value. (closes #11878)
2023-01-28 16:37:37 +00:00
Bram Moolenaar
d0200c8631 patch 9.0.1254: calling a method on an interface does not work
Problem:    Calling a method on an interface does not work.
Solution:   At runtime figure out what method to call. (closes #11901)
2023-01-28 15:19:40 +00:00
Philip H
192e24d974 patch 9.0.1253: CI adds repository unnecessarily
Problem:    CI adds repository unnecessarily.
Solution:   Remove the line from the workflow. (closes #11900)
2023-01-28 10:43:50 +00:00
Christopher Plewright
f75a2cb3c7 patch 9.0.1252: MS-Windows: scrollback cropped off on Vim exit
Problem:    MS-Windows: scrollback cropped off on Vim exit.
Solution:   Don't call SetConsoleScreenBufferInfoEx when using the alternate
            screen buffer. (Christopher Plewright, closes #11882)
2023-01-28 10:28:09 +00:00
Yegappan Lakshmanan
fadc02a2a5 patch 9.0.1251: checking returned value of ga_grow() is inconsistent
Problem:    Checking returned value of ga_grow() is inconsistent.
Solution:   Check for FAIL instaed of "not OK". (Yegappan Lakshmanan,
            closes #11897)
2023-01-27 21:03:12 +00:00
Bram Moolenaar
8dbab1d8ce patch 9.0.1250: cannot use an object method with :defer
Problem:    Cannot use an object method with :defer. (Ernie Rael)
Solution:   Find the object method and generate code to call it.
            (closes #11886)
2023-01-27 20:14:02 +00:00
Bram Moolenaar
657aea7fc4 patch 9.0.1249: cannot export an abstract class
Problem:    Cannot export an abstract class. (Ernie Rael)
Solution:   Add the EX_EXPORT flag to :abstract. (closes #11884)
2023-01-27 13:16:19 +00:00
Bram Moolenaar
53f54e49b7 patch 9.0.1248: cannot export an interface
Problem:    Cannot export an interface. (Ernie Rael)
Solution:   Add the EX_EXPORT flag to :interface. (closes #11884)
2023-01-26 20:36:56 +00:00
Bram Moolenaar
870219c58c patch 9.0.1247: divide by zero with 'smoothscroll' set and a narrow window
Problem:    Divide by zero with 'smoothscroll' set and a narrow window.
Solution:   Bail out when the window is too narrow.
2023-01-26 14:14:43 +00:00
Yegappan Lakshmanan
142ed77898 patch 9.0.1246: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11887)
2023-01-26 12:00:00 +00:00
Yegappan Lakshmanan
032713f829 patch 9.0.1245: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11879)
2023-01-25 21:05:38 +00:00
Bram Moolenaar
0f843ef091 patch 9.0.1244: cursor displayed in wrong position when leaving Insert mode
Problem:    Cursor briefly displayed in a wrong position when pressing Esc in
            Insert mode after autoindent was used.
Solution:   Do not adjust the cursor position for assumed deleted white space
            if text is following.  (closes #11877)
2023-01-25 17:34:41 +00:00
zeertzjq
01d4efe2e8 patch 9.0.1243: :setglobal cannot use script-local function for "expr" option
Problem:    :setglobal cannot use script-local function for "expr" option.
Solution:   Use the pointer to the option value properly. (closes #11883)
2023-01-25 15:31:28 +00:00
zeertzjq
b0d45ec67f patch 9.0.1242: code for :runtime completion is not consistent
Problem:    Code for :runtime completion is not consistent.
Solution:   Make code for cmdline expansion more consistent. (closes #11875)
2023-01-25 15:04:22 +00:00
Bram Moolenaar
b582010350 patch 9.0.1241: Coverity warns for not checking function return value
Problem:    Coverity warns for not checking function return value.
Solution:   Explicitly ignore the return value.
2023-01-25 12:27:13 +00:00
Bram Moolenaar
62a6923470 patch 9.0.1240: cannot access a private object member in a lambda
Problem:    Cannot access a private object member in a lambda defined inside
            the class.
Solution:   Go up the context stack to find the class. (closes #11866)
2023-01-24 15:07:04 +00:00
Bram Moolenaar
b149d22796 patch 9.0.1239: cannot have a line break before an object member access
Problem:    Cannot have a line break before an object member access.
Solution:   Check for "." in next line. (closes #11864)
2023-01-24 13:03:37 +00:00
zeertzjq
5c8771bc5a patch 9.0.1238: :runtime completion can be further improved
Problem:    :runtime completion can be further improved.
Solution:   Also complete the {where} argument values and adjust the
            completion for that. (closes #11874)
2023-01-24 12:34:03 +00:00
Yegappan Lakshmanan
6ec6666047 patch 9.0.1237: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11858)
2023-01-23 20:46:21 +00:00
zeertzjq
9cbf791995 patch 9.0.1236: code in same_leader() can be simplified
Problem:    Code in same_leader() can be simplified.
Solution:   Simplify code that is executed only once. (closes #11867)
2023-01-23 16:57:08 +00:00
Christopher Plewright
dc7179f9a4 patch 9.0.1235: MS-Windows console: not flushing termguicolors
Problem:    MS-Windows console: not flushing termguicolors.
Solution:   Flush termguicolors. (Christopher Plewright, closes #11871)
2023-01-23 12:33:23 +00:00
Bram Moolenaar
ebfec1c531 patch 9.0.1234: the code style has to be checked manually
Problem:    The code style has to be checked manually.
Solution:   Add basic code style checks in a test.  Fix or avoid uncovered
            problems.
2023-01-22 21:14:53 +00:00
Bram Moolenaar
3d79f0a430 patch 9.0.1233: search() loops forever if "skip" is TRUE for all matches
Problem:    search() loops forever if "skip" is TRUE for all matches.
Solution:   Keep the position of the first match.
2023-01-22 20:14:26 +00:00
Christopher Plewright
d343c60df4 patch 9.0.1232: ColorTable saving and restoring does not work properly
Problem:    ColorTable saving and restoring does not work properly.
Solution:   Restore ColorTable[16] usage. (Christopher Plewright,
            closes #11836)
2023-01-22 18:58:30 +00:00
zeertzjq
3770f4c9cd patch 9.0.1231: completion of :runtime does not handle {where} argument
Problem:    Completion of :runtime does not handle {where} argument.
Solution:   Parse the {where} argument. (closes #11863)
2023-01-22 18:38:51 +00:00
Amaan Qureshi
f3da4c8427 patch 9.0.1230: Apache thrift files are not recognized
Problem:    Apache thrift files are not recognized.
Solution:   Add a pattern for thrift files. (Amaan Qureshi, closes #11859)
2023-01-22 18:16:44 +00:00
Amaan Qureshi
040e795e8d patch 9.0.1229: Cap'n Proto files are not recognized
Problem:    Cap'n Proto files are not recognized.
Solution:   Add a pattern and the "capnp" filetype. (Amaan Qureshi,
            closes #11862)
2023-01-22 13:10:39 +00:00
zeertzjq
145a6afe3a patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Problem:    Fuzzy menu completion is only tested in the GUI.
Solution:   Make fuzzy menu completion test work without GUI.
            (closes #11861)
2023-01-22 12:41:55 +00:00
root
a6759381a5 patch 9.0.1227: no cmdline completion for :runtime
Problem:    No cmdline completion for :runtime.
Solution:   Add completion for :runtime. (closes #11853, closes #11447)
            Improve the resulting matches.
2023-01-21 21:56:06 +00:00
Bram Moolenaar
51b2fc2ef5 patch 9.0.1226: spurious empty line when using text properties
Problem:    Spurious empty line when using text propertie and virtual text.
Solution:   Do not set "text_prop_follows" when the other text property is not
            virtual text. (closes #11846)
2023-01-21 15:54:59 +00:00
Bram Moolenaar
11977f9175 patch 9.0.1225: reading past the end of a line when formatting text
Problem:    Reading past the end of a line when formatting text.
Solution:   Check for not going over the end of the line.
2023-01-21 13:09:19 +00:00
Bram Moolenaar
47bba53bdb patch 9.0.1224: cannot call a :def function with a number for float argument
Problem:    Cannot call a :def function with a number for a float argument.
Solution:   Accept a number as well, convert it to a float.
2023-01-20 18:49:46 +00:00
K.Takata
7193323b77 patch 9.0.1223: cannot use setcellwidths() below 0x100
Problem:    Cannot use setcellwidths() below 0x100.
Solution:   Also accept characters between 0x80 and 0x100. (Ken Takata,
            closes #11834)
2023-01-20 16:00:55 +00:00
Yegappan Lakshmanan
e446a017ff patch 9.0.1222: terminal tests are flaky on MacOS
Problem:    Terminal tests are flaky on MacOS.
Solution:   Add TermWait() calls. (Yegappan Lakshmanan, closes #11852)
2023-01-19 17:49:58 +00:00
Yegappan Lakshmanan
f97a295cca patch 9.0.1221: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11833)
2023-01-18 18:17:48 +00:00
Bram Moolenaar
4aecaa168e patch 9.0.1220: termcap/terminfo entries do not indicate possible modifiers
Problem:    Termcap/terminfo entries do not indicate where modifiers might
            appear.
Solution:   Add ";*" for function keys where modifiers are likely to be used.
2023-01-18 17:20:25 +00:00
Zdenek Dohnal
4219698603 patch 9.0.1219: handling of FORTIFY_SOURCE flags doesn't match Fedora usage
Problem:    Handling of FORTIFY_SOURCE flags doesn't match Fedora usage.
Solution:   Adjust the "sed" patterns. (Zdenek Dohnal, closes #11847)
2023-01-18 16:09:51 +00:00
Kota Kato
90c2353365 patch 9.0.1218: completion includes functions that don't work
Problem:    Completion includes functions that don't work.
Solution:   Skip functions that are not implemented. (Kota Kato,
            closes #11845)
2023-01-18 15:27:38 +00:00
Bram Moolenaar
486fc25a29 patch 9.0.1217: using an object member in a closure doesn't work
Problem:    Using an object member in a closure doesn't work.
Solution:   Initialize lv_loop_depth. (closes #11840)
2023-01-18 14:51:07 +00:00
Bram Moolenaar
64f1c4152e patch 9.0.1216: Coverity warns for ignoring return value
Problem:    Coverity warns for ignoring return value.
Solution:   Break out of loop if function fails.
2023-01-18 12:45:30 +00:00
zeertzjq
0ef9a5c094 patch 9.0.1215: using isalpha() adds dependency on current locale
Problem:    Using isalpha() adds dependency on current locale.
Solution:   Do not use isalpha() for recognizing a URL or the end of an Ex
            command. (closes #11835)
2023-01-17 21:38:25 +00:00
Dominique Pelle
541c87c808 patch 9.0.1214: file left behind after running tests
Problem:    File left behind after running tests.
Solution:   Delete the file. (Dominique Pellé, closes #11839)
2023-01-17 21:20:44 +00:00
Brandon Simmons
da3dd7d857 patch 9.0.1213: adding a line below the last one does not expand fold
Problem:    Adding a line below the last one does not expand fold.
Solution:   Do not skip mark_adjust() when adding lines below the last one.
            (Brandon Simmons, closes #11832, closes #10698)
2023-01-17 19:48:07 +00:00
Kota Kato
66bb9ae70f patch 9.0.1212: cannot read back what setcellwidths() has done
Problem:    Cannot read back what setcellwidths() has done.
Solution:   Add getcellwidths(). (Kota Kato, closes #11837)
2023-01-17 18:31:56 +00:00
Bram Moolenaar
f7d1c6e188 patch 9.0.1211: storing value in interface member does not always work
Problem:    Storing value in interface member does not always work.
Solution:   Convert the index on the interface to the index on the object.
2023-01-16 20:47:57 +00:00
Bram Moolenaar
b391e1f805 patch 9.0.1210: compiler complains about declaration after label
Problem:    Compiler complains about declaration after label.
Solution:   Move declaration to beginning of block (John Marriott)
2023-01-16 19:51:03 +00:00
Bram Moolenaar
29ac5df37b patch 9.0.1209: getting interface member does not always work
Problem:    Getting interface member does not always work.
Solution:   Convert the index on the interface to the index on the object.
            (closes #11825)
2023-01-16 19:43:47 +00:00
Yegappan Lakshmanan
a41e221935 patch 9.0.1208: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11819)
2023-01-16 18:19:05 +00:00
Bram Moolenaar
450c7a97d1 patch 9.0.1207: error when object type is expected but getting "any"
Problem:    Error when object type is expected but getting "any".
Solution:   When actual type is "any" use a runtime type check.
            (closes #11826)
2023-01-16 16:39:37 +00:00
Christopher Plewright
5a57a5e209 patch 9.0.1206: testing with Python on AppVeyor does not work properly
Problem:    Testing with Python on AppVeyor does not work properly.
Solution:   Fix typo.  Move most lines to the .bat file. (Christopher
            Plewright, closes #11828)
2023-01-16 13:01:28 +00:00
Bram Moolenaar
ae3205aa55 patch 9.0.1205: crash when handling class that extends another class
Problem:    Crash when handling class that extends another class with more
            than one object members.
Solution:   Correct pointer computations. (closes #11824)
2023-01-15 20:49:00 +00:00
Bram Moolenaar
912bfee710 patch 9.0.1204: expression compiled the wrong way after using an object
Problem:    Expression compiled the wrong way after using an object.
Solution:   Generate constants before getting the type.
2023-01-15 20:18:55 +00:00
Bram Moolenaar
32517c4c14 patch 9.0.1203: return type of values() is always list<any>
Problem:    Return type of values() is always list<any>.
Solution:   Use the member type if possible. (issue #11822)
2023-01-15 18:17:12 +00:00
Bram Moolenaar
f450804e14 patch 9.0.1202: crash when iterating over list of objects
Problem:    Crash when iterating over list of objects.
Solution:   Do not make a copy of tt_member for object or class.
            (closes #11823)
2023-01-15 16:54:57 +00:00
Bram Moolenaar
4cae845ce3 patch 9.0.1201: assignment with operator doesn't work in object method
Problem:    Assignment with operator doesn't work in object method.
Solution:   Handle loading the object member. (closes #11820)  Add a few more
            tests.
2023-01-15 15:51:48 +00:00
Christopher Plewright
474f226582 patch 9.0.1200: AppVeyor builds with an old Python version
Problem:    AppVeyor builds with an old Python version.
Solution:   Switch from Python 3.8 to 3.11. (Christopher Plewright,
            closes #11814)
2023-01-15 13:23:20 +00:00
Bram Moolenaar
584b853ee0 patch 9.0.1199: crash when using kitty and using a mapping with <Esc>
Problem:    Crash when using kitty and using a mapping with <Esc>.
Solution:   Do not try setting did_simplify when it is NULL. (closes #11817)
2023-01-14 21:07:07 +00:00
Bram Moolenaar
24a8d06d7f patch 9.0.1198: abstract class not supported yet
Problem:    Abstract class not supported yet.
Solution:   Implement abstract class and add tests.
2023-01-14 13:12:06 +00:00
zeertzjq
034c350207 patch 9.0.1197: dump file missing from patch
Problem:    Dump file missing from patch.
Solution:   Add missing dump file.
2023-01-14 12:41:17 +00:00
Yegappan Lakshmanan
e857598896 patch 9.0.1196: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11813)
2023-01-14 12:32:28 +00:00
zeertzjq
378e6c03f9 patch 9.0.1195: restoring KeyTyped when building statusline not tested
Problem:    Restoring KeyTyped when building statusline not tested.
Solution:   Add a test.  Clean up and fix other tests. (closes #11815)
2023-01-14 11:46:49 +00:00
Bram Moolenaar
b40a2fb3b3 patch 9.0.1194: compiler warning for comparing pointer with int
Problem:    Compiler warning for comparing pointer with int.
Solution:   Change NULL to zero.
2023-01-13 19:18:38 +00:00
Bram Moolenaar
32030a9f3b patch 9.0.1193: cannot map <Esc> when using the Kitty key protocol
Problem:    Cannot map <Esc> when using the Kitty key protocol.
Solution:   Add a non-simplified mapping for K_ESC. (closes #11811)
2023-01-13 18:46:57 +00:00
Bram Moolenaar
d40f00cb43 patch 9.0.1192: no error when class function argument shadows a member
Problem:    No error when class function argument shadows a member.
Solution:   Check for shadowing.
2023-01-13 17:36:49 +00:00
Keith Smiley
3213952966 patch 9.0.1191: some Bazel files are not recognized
Problem:    Some Bazel files are not recognized.
Solution:   Add an extra Bazel pattern. (Keith Smily, closes #11807)
2023-01-13 15:35:17 +00:00
Christopher Plewright
60908c4922 patch 9.0.1190: AppVeyor runs much slower with MSVC 2022
Problem:    AppVeyor runs much slower with MSVC 2022.
Solution:   Go back to MSVC 2015. (Christopher Plewright, closes #11810)
2023-01-13 15:28:14 +00:00
Bram Moolenaar
232bdaaca9 patch 9.0.1189: invalid memory access with folding and using "L"
Problem:    Invalid memory access with folding and using "L".
Solution:   Prevent the cursor from moving to line zero.
2023-01-13 14:17:58 +00:00
Bram Moolenaar
c0c2c26265 patch 9.0.1188: return value of type() for class and object unclear
Problem:    Return value of type() for class and object unclear.
Solution:   Add v:t_object and v:t_class.
2023-01-12 21:08:53 +00:00
Bram Moolenaar
3ce33b120c patch 9.0.1187: test for using imported class fails
Problem:    Test for using imported class fails.
Solution:   Skip over rest of type.
2023-01-12 20:39:09 +00:00
Bram Moolenaar
4059400993 patch 9.0.1186: imported class does not work when used twice in a line
Problem:    Imported class does not work when used twice in a line.
Solution:   Fix the type parsing.
2023-01-12 20:04:51 +00:00
Bram Moolenaar
a86655af84 patch 9.0.1185: using class from imported script not tested
Problem:    Using class from imported script not tested.
Solution:   Add tests.  Implement what is missing.
2023-01-12 17:06:27 +00:00
Bram Moolenaar
a94bd9d939 patch 9.0.1184: interface of an object is not recognized when checking type
Problem:    Interface of an object is not recognized when checking type.
Solution:   Use the interface implemented by an object.
2023-01-12 15:01:32 +00:00
Yegappan Lakshmanan
0233bdfa2b patch 9.0.1183: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11805)
2023-01-12 12:33:30 +00:00
Amaan Q
043d7b2c84 patch 9.0.1182: go checksum files are not recognized
Problem:    go checksum files are not recognized.
Solution:   Add the name of go checksum files. (Amaan Qureshi, closes #11803)
2023-01-11 21:24:26 +00:00
Bram Moolenaar
6481accd40 patch 9.0.1181: class inheritance and typing insufficiently tested
Problem:    Class inheritance and typing insufficiently tested.
Solution:   Add more tests.  Implement missing behavior.
2023-01-11 21:14:17 +00:00
Bram Moolenaar
bcbfaf32e0 patch 9.0.1180: compiler warnings without the +job feature
Problem:    Compiler warnings without the +job feature.
Solution:   Adjust #ifdefs. (John Marriott)
2023-01-11 19:11:15 +00:00
Bram Moolenaar
6aa0937fb8 patch 9.0.1179: not all errors around inheritance are tested
Problem:    Not all errors around inheritance are tested.
Solution:   Add more tests.  Fix uncovered problems.
2023-01-11 17:59:38 +00:00
Bram Moolenaar
58b40092e6 patch 9.0.1178: a child class cannot override functions from a base class
Problem:    A child class cannot override functions from a base class.
Solution:   Allow overriding and implement "super".
2023-01-11 15:59:05 +00:00
Christopher Plewright
ad15a39fdb patch 9.0.1177: AppVeyor uses some older tools
Problem:    AppVeyor uses some older tools.
Solution:   Switch to Visual Studio 2022 and Python 3.11. (Christopher
            Plewright, closes #11793)
2023-01-11 12:49:22 +00:00
Chris Kipp
f68cddabff patch 9.0.1176: smithy files are not recognized
Problem:    smithy files are not recognized.
Solution:   Add a pattern for Smithy files. (Chris Kipp, closes #11804)
2023-01-11 12:20:10 +00:00
Yegappan Lakshmanan
ea125393af patch 9.0.1175: the set_ref_in_item() function is too long
Problem:    The set_ref_in_item() function is too long.
Solution:   Use a separate function for more complicated types. (Yegappan
            Lakshmanan, closes #11802)
2023-01-11 11:46:17 +00:00
Amaan Q
9a9432d3a2 patch 9.0.1174: smali files are not recognized
Problem:    Smali files are not recognized.
Solution:   Add a pattern for Smali files. (Amaan Qureshi, closes #11801)
2023-01-10 19:58:35 +00:00
Bram Moolenaar
a47c0fb4ad patch 9.0.1173: compiler warning for unused variable on non-Unix systems
Problem:    Compiler warning for unused variable on non-Unix systems.
Solution:   Move #ifdef. (John Marriott)
2023-01-10 19:17:11 +00:00
Bram Moolenaar
79c11e399b patch 9.0.1172: when 'selection' is "exclusive" then "1v" is one char short
Problem:    When 'selection' is "exclusive" then "1v" is one char short.
Solution:   Add one character when 'selection' is "exclusive. (closes #11791)
2023-01-10 17:29:29 +00:00
Yasuhiro Matsumoto
2bc849ff81 patch 9.0.1171: screen is not redrawn after using setcellwidths()
Problem:    Screen is not redrawn after using setcellwidths().
Solution:   Redraw the screen when the cell widths have changed. (Yasuhiro
            Matsumoto, closes #11800)
2023-01-10 16:03:08 +00:00
mert
523f22d577 patch 9.0.1170: LGTM badge no longer works
Problem:    LGTM badge no longer works.
Solution:   Remove the LGTM badge. (closes #11799)
2023-01-10 14:06:06 +00:00
Christopher Plewright
566f76e656 patch 9.0.1169: some key+modifier tests fail on some AppVeyor images
Problem:    Some key+modifier tests fail on some AppVeyor images.
Solution:   Adjust the tests for key movements and fix the revealed bugs.
            (Christopher Plewright, closes #11798)
2023-01-10 13:43:04 +00:00
Bram Moolenaar
06cd14d0bf patch 9.0.1168: code to enable/disable mouse is not from terminfo/termcap
Problem:    Code to enable/disable mouse is not from terminfo/termcap.
Solution:   Request the "XM" entry and use it to set 'ttymouse' if possible.
2023-01-10 12:37:38 +00:00
Bram Moolenaar
1b5f03ec9c Update runtime files 2023-01-09 20:12:45 +00:00
Gregory Anders
d41262ed06 patch 9.0.1167: EditorConfig files do not have their own filetype
Problem:    EditorConfig files do not have their own filetype.
Solution:   Add the "editorconfig" filetype. (Gregory Anders, closes #11779)
2023-01-09 20:08:00 +00:00
Yegappan Lakshmanan
1cfb14aa97 patch 9.0.1166: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11792)
2023-01-09 19:04:23 +00:00
James McCoy
765d82a657 patch 9.0.1165: tests using IPv6 sometimes fail
Problem:    Tests using IPv6 sometimes fail.
Solution:   Use getaddrinfo() and use try/catch. (James McCoy,
            closes #11783)
2023-01-09 16:25:59 +00:00
h-east
01c5f2addf patch 9.0.1164: evaluating string expression advances function line
Problem:    Evaluating string expression advances function line.
Solution:   Disable function lines while parsing a string expression.
            (Hirohito Higashi, closes #11796)
2023-01-09 15:10:40 +00:00
Mike Williams
dda3053121 patch 9.0.1163: compiler warning for implicit size_t/int conversion
Problem:    Compiler warning for implicit size_t/int conversion.
Solution:   Add a type cast. (Mike Williams, closes #11795)
2023-01-09 14:18:13 +00:00
Zdenek Dohnal
870cd76283 patch 9.0.1162: configure does not handle all FORTIFY_SOURCE variants
Problem:    Configure does not handle all FORTIFY_SOURCE variants.
Solution:   Also handle Fedora's default FORTIFY_SOURCE flags. (Zdenek Dohnal,
            closes #11794)
2023-01-09 13:18:08 +00:00
Bram Moolenaar
c8ab30a349 patch 9.0.1161: Coverity warns for using strcpy()
Problem:    Coverity warns for using strcpy().
Solution:   Call a function to set the function name.
2023-01-09 11:35:47 +00:00
Bram Moolenaar
e01e5215f9 patch 9.0.1160: ASAN error for ufunc_T allocated with wrong size
Problem:    ASAN error for ufunc_T allocated with wrong size.
Solution:   Make sure the size can always fit the struct.
2023-01-08 20:31:18 +00:00
Bram Moolenaar
8367716a6e patch 9.0.1159: extends argument for class not implemented yet
Problem:    Extends argument for class not implemented yet.
Solution:   Basic implementation of "extends".
2023-01-08 19:54:10 +00:00
Yegappan Lakshmanan
7f8b2559a3 patch 9.0.1158: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11787)
2023-01-08 13:44:24 +00:00
Bram Moolenaar
df8f947359 patch 9.0.1157: "implements" only handles one interface name
Problem:    "implements" only handles one interface name.
Solution:   Handle a comma separated list of names.  Check for duplicate
            names.
2023-01-07 14:51:03 +00:00
Bram Moolenaar
0cb3ca9f7a patch 9.0.1156: tests fail because of a different error message
Problem:    Tests fail because of a different error message.
Solution:   Don't give an error if a type name can't be found.
2023-01-07 13:07:11 +00:00
Bram Moolenaar
eca2c5fff6 patch 9.0.1155: cannot use a class as a type
Problem:    Cannot use a class as a type.
Solution:   Accept a class and interface name as a type.
2023-01-07 12:08:41 +00:00
Bram Moolenaar
2c01131c2a patch 9.0.1154: Coverity warns for dead code
Problem:    Coverity warns for dead code.
Solution:   Remove condition that is always true.
2023-01-07 10:51:30 +00:00
Bram Moolenaar
7d4d87ba89 patch 9.0.1153: build error with some compilers
Problem:    Build error with some compilers.
Solution:   Clear pointer the right way.
2023-01-06 18:59:08 +00:00
Bram Moolenaar
94674f2223 patch 9.0.1152: class "implements" argument not implemented
Problem:    Class "implements" argument not implemented.
Solution:   Implement "implements" argument.  Add basic checks for when a
            class implements an interface.
2023-01-06 18:42:20 +00:00
Bram Moolenaar
5bcd29b84e patch 9.0.1151: build failure
Problem:    Build failure.
Solution:   Add missing part of :interface change.
2023-01-05 20:14:43 +00:00
Bram Moolenaar
554d031302 patch 9.0.1150: :interface is not implemented yet
Problem:    :interface is not implemented yet.
Solution:   Implement the basics of :interface.
2023-01-05 19:59:18 +00:00
Bram Moolenaar
cf760d50dc patch 9.0.1149: class members may be garbage collected
Problem:    Class members may be garbage collected.
Solution:   Mark class members as being in use.
2023-01-05 13:16:04 +00:00
Bram Moolenaar
2468add0b8 patch 9.0.1148: cmdline test fails in the GUI
Problem:    Cmdline test fails in the GUI.
Solution:   Skip the test when running in the GUI.
2023-01-04 18:59:57 +00:00
Bram Moolenaar
3259ff3b3b patch 9.0.1147: cannot access a class member in a compiled function
Problem:    Cannot access a class member in a compiled function.
Solution:   Implement looking up a class member.
2023-01-04 18:54:09 +00:00
Christopher Plewright
c8b204952f patch 9.0.1146: MS-Windows: various special keys/modifiers are not mappable
Problem:    MS-Windows: various special keys and modifiers are not mappable.
Solution:   Adjust the handling of keys with modifiers. (Christian Plewright,
            closes #11768)
2023-01-04 18:06:00 +00:00
Bram Moolenaar
3ac1d97a1d patch 9.0.1145: invalid memory access with recursive substitute expression
Problem:    Invalid memory access with recursive substitute expression.
Solution:   Check the return value of vim_regsub().
2023-01-04 17:17:54 +00:00
Bram Moolenaar
c32949b077 patch 9.0.1144: reading beyond text
Problem:    Reading beyond text.
Solution:   Add strlen_maxlen() and use it.
2023-01-04 15:56:51 +00:00
Bram Moolenaar
7b17eb4b06 patch 9.0.1143: invalid memory access with bad 'statusline' value
Problem:    Invalid memory access with bad 'statusline' value.
Solution:   Avoid going over the NUL at the end.
2023-01-04 14:31:49 +00:00
Bram Moolenaar
f057171d8b patch 9.0.1142: crash and/or memory leak when redefining function
Problem:    Crash and/or memory leak when redefining function after error.
Solution:   Clear pointer after making a copy.  Clear arrays on failure.
            (closes #11774)
2023-01-04 13:16:20 +00:00
Alexey Radkov
aaa16b0918 patch 9.0.1141: 'cursorcolumn' and 'colorcolumn' wrong after concealing
Problem:    'cursorcolumn' and 'colorcolumn' wrong after concealing and
            wrapping line.
Solution:   Reset "wlv.vcol_off" after each screen line. (Alexey Radkov,
            closes #11777)
2023-01-04 11:15:30 +00:00
Bram Moolenaar
574950dfb1 patch 9.0.1140: cannot call an object method in a compiled function
Problem:    Cannot call an object method in a compiled function.
Solution:   Compile the instructins to invoke an object method.
2023-01-03 19:08:50 +00:00
Bram Moolenaar
46ab925937 patch 9.0.1139: cannot create a new object in a compiled function
Problem:    Cannot create a new object in a compiled function.
Solution:   Compile the instructins to create a new object.
2023-01-03 14:01:21 +00:00
Bram Moolenaar
36818a9daa patch 9.0.1138: crash when expecting varargs but it is something else
Problem:    Crash when expecting varargs but it is something else.
Solution:   Only use the member when the type is a list. (closes #11774)
2023-01-03 12:33:26 +00:00
zeertzjq
ea720aea85 patch 9.0.1137: some conditions are always false
Problem:    Some conditions are always false.
Solution:   Remove the useless conditions. (closes #11776)
2023-01-03 10:54:09 +00:00
Bram Moolenaar
e83c133eb9 patch 9.0.1136: memory leak when getting class member type from expr
Problem:    Memory leak when getting class member type from expr.
Solution:   Clear the expression result.
2023-01-02 21:04:04 +00:00
Bram Moolenaar
03ff0c6681 patch 9.0.1135: missing function argument
Problem:    Missing function argument.
Solution:   Add ignore case flag.
2023-01-02 20:38:01 +00:00
Bram Moolenaar
bcf31ec36b patch 9.0.1134: comparing objects uses identity instead of equality
Problem:    Comparing objects uses identity instead of equality.
Solution:   Compare the object values.
2023-01-02 20:32:24 +00:00
Bram Moolenaar
a9fa8c58fb patch 9.0.1133: error message names do not match the items
Problem:    Error message names do not match the items.
Solution:   Add "_str" when the text contains "%s".
2023-01-02 18:10:04 +00:00
Yegappan Lakshmanan
dc4daa3a39 patch 9.0.1132: code is indented more than needed
Problem:    Code is indented more than needed.
Solution:   Use an early return to reduce indentation. (Yegappan Lakshmanan,
            closes #11769)
2023-01-02 16:54:53 +00:00
Bram Moolenaar
a2942c7468 patch 9.0.1131: build failure without the +eval feature
Problem:    Build failure without the +eval feature.
Solution:   Move code inside #ifdef.
2023-01-02 13:41:49 +00:00
Bram Moolenaar
39c82ea656 patch 9.0.1130: unexpected output when autoloading a script
Problem:    Unexpected output when autoloading a script for an interactive
            operation.
Solution:   Reset "KeyTyped" while loading a script and when handling a nested
            function. (closes #11773)
2023-01-02 13:08:01 +00:00
Bram Moolenaar
7bdcba08bb patch 9.0.1129: sporadic Test_range() failure
Problem:    Sporadic Test_range() failure.
Solution:   Clear typeahead.  Move to a separate function. (issue #22771)
2023-01-02 11:59:26 +00:00
Bram Moolenaar
993dbc33a8 patch 9.0.1128: build failure
Problem:    Build failure.
Solution:   Add type cast.  Add missing error messages.
2023-01-01 20:31:30 +00:00
Bram Moolenaar
6acf757c6a patch 9.0.1127: no error if function argument shadows class member
Problem:    No error if function argument shadows class member.
Solution:   Give an error for shadowing a class member.
2023-01-01 19:53:30 +00:00
Bram Moolenaar
fc966c19f8 patch 9.0.1126: bracketed paste can be enabled when it is not recognized
Problem:    Bracketed paste can be enabled when pasted text is not recognized.
Solution:   Output t_BE only when t_PS and t_PE are set.
2023-01-01 18:04:33 +00:00
Bram Moolenaar
ec8b74f7ab patch 9.0.1125: memory leak when using class functions
Problem:    Memory leak when using class functions.
Solution:   Clear and free the array with class functions.
2023-01-01 14:11:27 +00:00
Bram Moolenaar
1aeb3eb092 patch 9.0.1124: virtual text at a column position is truncated
Problem:    Virtual text at a column position is truncated at the window edge.
            (Yegappan Lakshmanan)
Solution:   Do not truncated virtual text that is placed at a column.
2023-01-01 14:04:51 +00:00
Bram Moolenaar
6bafdd41cb patch 9.0.1123: class function not implemented yet
Problem:    Class function not implemented yet.
Solution:   Implement defining and calling a class function.
2023-01-01 12:58:33 +00:00
Bram Moolenaar
9f2d97efe2 patch 9.0.1122: class member access is not fully tested yet
Problem:    Class member access is not fully tested yet.
Solution:   Add more tests.
2022-12-31 19:01:02 +00:00
Bram Moolenaar
f1dcd14fc5 Update runtime files 2022-12-31 15:30:45 +00:00
Bram Moolenaar
db4d88c2ad patch 9.0.1121: cursor positioning and display problems with 'smoothscroll'
Problem:    Cursor positioning and display problems with 'smoothscroll' and
            using "zt", "zb" or "zz".
Solution:   Adjust computations and conditions. (Yee Cheng Chin,
            closes #11764)
2022-12-31 15:13:22 +00:00
smjonas
c55e8f2c6f patch 9.0.1120: tex filetype detection not sufficiently tested
Problem:    Tex filetype detection not sufficiently tested.
Solution:   Add more test cases for "tex" detection. (Jonas Strittmatter,
            closes #11765)
2022-12-31 14:46:53 +00:00
Bram Moolenaar
0d89d8ae89 patch 9.0.1119: type of arguments not checked when calling a partial
Problem:    Type of arguments not checked when calling a partial.
Solution:   Give an error for a wrong argument type. (closes #11753)
2022-12-31 14:01:24 +00:00
James McCoy
dbe6ef1036 patch 9.0.1118: sporadic test failures when using a terminal window
Problem:    Sporadic test failures when using a terminal window.
Solution:   Adjust waiting times. (James McCoy, closes #11763)
2022-12-31 11:44:57 +00:00
Bram Moolenaar
7b8db111e8 patch 9.0.1117: terminfo entries for bracketed paste are not used
Problem:    Terminfo entries for bracketed paste are not used.
Solution:   Use the newly added terminfo entries for bracketed paste.
            Correct mixup of output strings and key codes.
2022-12-30 21:10:25 +00:00
Bram Moolenaar
770713794a patch 9.0.1116: compiler may complain about an unused function
Problem:    Compiler may complain about an unused function.
Solution:   Add #ifdef. (John Marriott)
2022-12-30 19:54:53 +00:00
Yegappan Lakshmanan
ed0c1d5d4b patch 9.0.1115: code is indented more than needed
Problem:    Code is indented more than needed.
Solution:   Use an early return to reduce indenting. (Yegappan Lakshmanan,
            closes #11758)
2022-12-30 18:07:46 +00:00
Philip H
ef91ae4557 patch 9.0.1114: CI does not use the latest Python version
Problem:    CI does not use the latest Python version.
Solution:   Switch from Python 3.10 to 3.11. (closes #11761)
2022-12-30 17:41:17 +00:00
Christian Brabandt
0a657124a5 patch 9.0.1113: users cannot easily try out a PR
Problem:    Users cannot easily try out a PR.
Solution:   Add an "artifacts" section to the AppVeyor CI config. (Christian
            Brabandt, closes #11762)
2022-12-30 17:28:12 +00:00
Christopher Plewright
7b0afc1d76 patch 9.0.1112: test_mswin_event() can hang
Problem:    test_mswin_event() can hang.
Solution:   Add the "execute" argument to process events right away.
            (Christopher Plewright, closes #11760)
2022-12-30 16:54:58 +00:00
Bram Moolenaar
96dd34e534 patch 9.0.1111: termcap entries for RGB colors are not set automatically
Problem:    Termcap entries for RGB colors are not set automatically.
Solution:   Always set the termcap entries when +termguicolors is enabled.
2022-12-30 11:16:00 +00:00
Evan Miller
254480736f patch 9.0.1110: build fails on Mac OS X 10.4/10.5
Problem:    Build fails on Mac OS X 10.4/10.5 .
Solution:   Check if the dispatch/dispatch.h header exists. (Evan Miller,
            closes #11746)
2022-12-30 10:42:23 +00:00
Bram Moolenaar
c4b3f6477c patch 9.0.1109: leaking allocated type
Problem:    Leaking allocated type.
Solution:   Reset the "static" flag in the allocated type copy.
2022-12-30 10:36:34 +00:00
Bram Moolenaar
c6951a76a5 patch 9.0.1108: type error when using "any" type and adding to float
Problem:    Type error when using "any" type and adding a number to a float.
Solution:   Accept both a number and a float. (closes #11753)
2022-12-29 20:56:24 +00:00
Bram Moolenaar
73ade49c4b patch 9.0.1107: float constant not recognized as float
Problem:    Float constant not recognized as float.
Solution:   Check the vartype instead of comparing with t_float.
            (closes #11754)
2022-12-27 20:54:41 +00:00
KodeToad
09ce0b8e11 patch 9.0.1106: not all postfix files are recognized
Problem:    Not all postfix files are recognized.
Solution:   Recognize main.cf.proto files. (closes #11732)
2022-12-27 20:17:19 +00:00
Yegappan Lakshmanan
87c1cbbe98 patch 9.0.1105: code is indented too much
Problem:    Code is indented too much.
Solution:   Use an early return. (Yegappan Lakshmanan, closes #11756)
2022-12-27 19:54:52 +00:00
Bram Moolenaar
56310d38d8 patch 9.0.1104: invalid memory access when checking function argument types
Problem:    Invalid memory access when checking function argument types.
Solution:   Do not check beyond the number of arguments. (closes #11755)
2022-12-27 17:25:05 +00:00
David McDonald
b9a1edfc54 patch 9.0.1103: jq files are not recognized
Problem:    jq files are not recognized.
Solution:   Add detection of Jq files. (David McDonald, closes #11743)
2022-12-26 15:35:18 +00:00
K.Takata
a7fbaa43b7 patch 9.0.1102: complicated use of #ifdef
Problem:    Complicated use of #ifdef.
Solution:   Simplify #ifdef use. (Ken Takata, closes #11745)
2022-12-26 14:46:51 +00:00
Bram Moolenaar
b536540ab3 patch 9.0.1101: unused global variable
Problem:    Unused global variable.
Solution:   Remove the variable. (closes #11752)
2022-12-26 14:37:44 +00:00
Bram Moolenaar
d0883faac6 patch 9.0.1100: a hashtab with many removed items is not cleaned up
Problem:    A hashtab with many removed items is not cleaned up.
Solution:   Re-hash a hashtab even when the size didn't change if too many
            items were removed.
2022-12-26 13:51:26 +00:00
Bram Moolenaar
81b7ecc5cb patch 9.0.1099: trying to resize a hashtab may cause a problem
Problem:    Trying to resize a hashtab may cause a problem.
Solution:   Do not try to resize a hashtab before adding an item.
2022-12-26 13:08:06 +00:00
Yegappan Lakshmanan
465de3a57b patch 9.0.1098: code uses too much indent
Problem:    Code uses too much indent.
Solution:   Use an early return. (Yegappan Lakshmanan, closes #11747)
2022-12-26 12:50:04 +00:00
Bram Moolenaar
b3d614369f patch 9.0.1097: tests are failing
Problem:    Tests are failing.
Solution:   Do clean up a hashtab when at the initial size.
2022-12-25 21:32:09 +00:00
Bram Moolenaar
71d53e7c57 patch 9.0.1096: reallocating hashtab when the size didn't change
Problem:    Reallocating hashtab when the size didn't change.
Solution:   Bail out when the hashtab is already the desired size.
2022-12-25 20:46:13 +00:00
Bram Moolenaar
6ef5471afa patch 9.0.1095: using freed memory when declaration fails
Problem:    Using freed memory when declaration fails. (Yegappan Lakshmanan)
Solution:   After unreferencing an object set the reference to NULL.
2022-12-25 19:31:36 +00:00
Bram Moolenaar
9b99411b93 patch 9.0.1094: compiler warning when HAS_MESSAGE_WINDOW is not defined
Problem:    Compiler warning when HAS_MESSAGE_WINDOW is not defined.
Solution:   Add UNUSED.
2022-12-25 15:59:25 +00:00
Bram Moolenaar
590162cae0 patch 9.0.1093: using freed memory of object member
Problem:    Using freed memory of object member. (Yegappan Lakshmanan)
Solution:   Make a copy of the object member when getting it.
2022-12-24 21:24:06 +00:00
Rob Pilling
e86190e7c1 patch 9.0.1092: search error message doesn't show used pattern
Problem:    Search error message doesn't show used pattern.
Solution:   Pass the actually used pattern to where the error message is
            given. (Rob Pilling, closes #11742)
2022-12-23 19:06:04 +00:00
Bram Moolenaar
f54cedd676 patch 9.0.1091: assignment to non-existing member causes a crash
Problem:    Assignment to non-existing member causes a crash. (Yegappan
            Lakshmanan)
Solution:   Give an error message and bail out when a member cannot be found.
2022-12-23 17:56:27 +00:00
mgramigna
c9207d5d79 patch 9.0.1090: FHIR Shorthand files are not recognized
Problem:    FHIR Shorthand files are not recognized.
Solution:   Add a pattern to detect FSH files. (Matthew Gramigna,
            closes #11738)
2022-12-23 13:18:44 +00:00
Luuk van Baal
c53e7904b9 patch 9.0.1089: unnessary assignment
Problem:    unnessary assignment
Solution:   Remove the assignment. (Luuk van Baal, closes #1136)
2022-12-23 12:17:33 +00:00
Bram Moolenaar
9fca133eb7 patch 9.0.1088: clang warns for unused variable
Problem:    Clang warns for unused variable.
Solution:   Adjust #ifdef. (John Marriott)
2022-12-22 21:06:41 +00:00
James McCoy
ff3d537704 patch 9.0.1087: autocommand test sometimes fails
Problem:    Autocommand test sometimes fails.
Solution:   Add a short delay. (James McCoy, closes #11737)
2022-12-22 18:30:24 +00:00
Christopher Plewright
c8b126d70d patch 9.0.1086: display wrong in Windows terminal after exiting Vim
Problem:    Display wrong in Windows terminal after exiting Vim.
Solution:   Apply screen restore fix for Windows 11 also to Windows 10 builds.
            (Christopher Plewright, closes #11713, closes #11706)
2022-12-22 13:45:23 +00:00
Bram Moolenaar
9b8a365d01 patch 9.0.1085: compiler warns for uninitialized variable
Problem:    Compiler warns for uninitialized variable.
Solution:   Initialize the variable.  Remove unused function. (John Marriott)
2022-12-20 20:47:28 +00:00
Christopher Plewright
20b795e0eb patch 9.0.1084: code handling low level MS-Windows events cannot be tested
Problem:    Code handling low level MS-Windows events cannot be tested.
Solution:   Add test_mswin_event() and tests using it. (Christopher Plewright,
            closes #11622)
2022-12-20 20:01:58 +00:00
Bram Moolenaar
418b547881 patch 9.0.1083: empty and comment lines in a class cause an error
Problem:    Empty and comment lines in a class cause an error.
Solution:   Skip empty and comment lines. (closes #11734)
2022-12-20 13:38:22 +00:00
kylo252
104b2ff4d0 patch 9.0.1082: some jsonc files are not recognized
Problem:    Some jsonc files are not recognized.
Solution:   Add patterns for jsonc and move some from json to jsonc.
            (closes #11711)
2022-12-19 20:42:49 +00:00
Bram Moolenaar
34820944ed patch 9.0.1081: using "->" with split lines does not always work
Problem:    Using "->" with split lines does not always work.
Solution:   Avoid trying to get another line. (closes #11723)
2022-12-19 20:28:38 +00:00
Bram Moolenaar
afa3f1cc72 patch 9.0.1080: the "kitty" terminfo entry is not widespread
Problem:    The "kitty" terminfo entry is not widespread, resulting in the
            kitty terminal not working properly.
Solution:   Go back to using "xterm-kitty" and avoid the problems it causes in
            another way.
2022-12-19 18:56:48 +00:00
zeertzjq
33e543038b patch 9.0.1079: leaking memory when defining a user command fails
Problem:    Leaking memory when defining a user command fails.
Solution:   Free "compl_arg" when needed. (closes #11726)
2022-12-19 16:49:27 +00:00
zeertzjq
07146ad1d3 patch 9.0.1078: with the +vartabs feature indent folding may use wrong 'ts'
Problem:    With the +vartabs feature indent folding may use wrong 'tabstop'.
Solution:   Use the "buf" argument instead of "curbuf".
2022-12-19 15:51:44 +00:00
Bram Moolenaar
4ce1f99a2d patch 9.0.1077: can add text property with negative ID before virtual text
Problem:    Can add text property with negative ID before virtual text
            property.
Solution:   Remember that a text property with a negative ID was used and give
            an appropriate error message. (closes #11725)
            Fix index computation.
2022-12-19 13:31:06 +00:00
Bram Moolenaar
8efdcee02e patch 9.0.1076: ASAN complains about NULL argument
Problem:    ASAN complains about NULL argument.
Solution:   Skip memmove() when there is nothing to move.
2022-12-19 12:18:09 +00:00
Bram Moolenaar
c336ae3ce6 patch 9.0.1075: build fails if compiler doesn't allow declaration after case
Problem:    build fails if the compiler doesn't allow for a declaration right
            after "case".
Solution:   Add a block.
2022-12-18 22:01:42 +00:00
Bram Moolenaar
d505d17885 patch 9.0.1074: class members are not supported yet
Problem:    Class members are not supported yet.
Solution:   Add initial support for class members.
2022-12-18 21:42:55 +00:00
Bram Moolenaar
731d00770d patch 9.0.1073: using "xterm-kitty" for 'term' causes problems
Problem:    Using "xterm-kitty" for 'term' causes problems.
Solution:   Remove the "xterm-" part when 'term' is set from $TERM.  Detect a
            few kitty-specific properties based on the version response
            instead of the terminal name.
2022-12-18 17:47:18 +00:00
zeertzjq
ba2d191932 patch 9.0.1072: screenpos() column result in fold may be too small
Problem:    screenpos() column result in fold may be too small.
Solution:   Add space of 'number', sign column, etc. (closes #11715)
2022-12-18 12:28:59 +00:00
dundargoc
b5328b46a7 patch 9.0.1071: Codecov action version is too specific
Problem:    Codecov action version is too specific.
Solution:   Only use "v3" to automatically use the latest stable version.
            (closes #11720)
2022-12-17 15:47:45 +00:00
Bram Moolenaar
b26461715b patch 9.0.1070: reading beyond array size
Problem:    Reading beyond array size.
Solution:   Only use name[0] and name[1], do not use "name" as a string.
2022-12-17 15:35:43 +00:00
Bram Moolenaar
417e88bb75 patch 9.0.1069: diff mode highlight fails for special characters
Problem:    Diff mode highlight fails for special characters.
Solution:   Adjust condition for setting "diff_hlf".
2022-12-17 15:03:02 +00:00
Bram Moolenaar
8d754fada8 patch 9.0.1068: no information about whether request term codes has an effect
Problem:    No information about whether requesting term codes has an effect.
Solution:   Add ch_log() calls to report the effect of term code responses.
            Avoid deleting an entry and then adding back the same one.
2022-12-17 13:49:16 +00:00
Bram Moolenaar
d097af7779 patch 9.0.1067: in diff mode virtual text is highlighted incorrectly
Problem:    In diff mode virtual text is highlighted incorrectly. (Rick Howe)
Solution:   Do not use diff attributes for virtual text. (closes #11714)
2022-12-17 11:33:00 +00:00
zeertzjq
67f3094397 patch 9.0.1066: test function name is wrong
Problem:    Test function name is wrong.
Solution:   Rename to what is actually being tested. (closes #11712)
2022-12-17 10:40:15 +00:00
Bram Moolenaar
9d1184cd1d patch 9.0.1065: a shell command switching screens may still have a problem
Problem:    A shell command switching screens may still have a problem with
            the kitty keyboard protocol.
Solution:   Disable the kitty keyboard protocol both in the current and the
            alternate screen, if there are indications it might be needed.
            (issue #11705)  Also fix naming.
2022-12-16 18:33:20 +00:00
Christian Brabandt
9aee8ec400 patch 9.0.1064: code for making 'shortmess' temporarily empty is repeated
Problem:    Code for making 'shortmess' temporarily empty is repeated.
Solution:   Add functions for making 'shortmess' empty and restoring it.
            (Christian Brabandt, closes #11709)
2022-12-16 16:41:23 +00:00
Bram Moolenaar
4ab1f4a32f patch 9.0.1063: when using Kitty a shell command may mess up the key state
Problem:    When using Kitty a shell command may mess up the key protocol
            state.
Solution:   Output t_te before t_TE.  If t_te switches between the main and
            the alternate screen then deactivating the key protocol by t_TE
            should happen after switching screen. (issue #11705)
2022-12-16 13:08:36 +00:00
zeertzjq
4cd45f1408 patch 9.0.1062: some test function names do not match what they are doing
Problem:    Some test function names do not match what they are doing.
Solution:   Leave out user data for the test that is called "NoUserData".
            (closes #11703)
2022-12-15 13:48:30 +00:00
Luuk van Baal
ba936f6f4e patch 9.0.1061: cannot display 'showcmd' somewhere else
Problem:    Cannot display 'showcmd' somewhere else.
Solution:   Add the 'showcmdloc' option. (Luuk van Baal, closes #11684)
2022-12-15 13:15:39 +00:00
Bram Moolenaar
3d473ee1a6 patch 9.0.1060: private and public object members are not implemented yet
problem:    Private and public object members are not implemented yet.
Solution:   Implement private and public object members.
2022-12-14 20:59:32 +00:00
Bram Moolenaar
f94178db8d patch 9.0.1059: build failure with some compilers
Problem:    Build failure with some compilers that can't handle a
            declaration directly after a "case" statement.
Solution:   Add a block to put the declarations in.
2022-12-14 17:50:00 +00:00
Bram Moolenaar
91c9d6d772 patch 9.0.1058: string value of class and object do not have information
Problem:    String value of class and object do not have useful information.
Solution:   Add the class name and for the object the member values.
2022-12-14 17:30:37 +00:00
Chris Kipp
70ef3f546b patch 9.0.1057: conflict between supercollider and scala filetype detection
Problem:    Conflict between supercollider and scala filetype detection.
Solution:   Do not check for "Class : Method", it can appear in both
            filetypes. (Chris Kipp, closes #11699)
2022-12-14 16:42:15 +00:00
Bram Moolenaar
eb53350c02 patch 9.0.1056: leaking memory when disassembling an object method
Problem:    Leaking memory when disassembling an object method.
Solution:   Free the typval of the class.
2022-12-14 15:06:11 +00:00
Bram Moolenaar
f593fc891c patch 9.0.1055: Coverity warns for using uninitialized memory
Problem:    Coverity warns for using uninitialized memory.
Solution:   Clear the "lhs" field earlier.
2022-12-14 13:50:02 +00:00
Bram Moolenaar
74e1274edf patch 9.0.1054: object member can't get type from initializer
Problem:    Object member can't get type from initializer.
Solution:   If there is no type specified try to use the type of the
            initializer.  Check for a valid type.
2022-12-13 21:14:28 +00:00
Bram Moolenaar
65b0d16768 patch 9.0.1053: default constructor arguments are not optional
Problem:    Default constructor arguments are not optional.
Solution:   Use "= v:none" to make constructor arguments optional.
2022-12-13 18:43:22 +00:00
Bram Moolenaar
692fe0889c patch 9.0.1052: using freed memory on exit when EXITFREE is defined
Problem:    Using freed memory on exit when EXITFREE is defined.
Solution:   Make a deep copy of the type.  Make sure TTFLAG_STATIC is not set
            in the copy.
2022-12-13 13:42:37 +00:00
Rob Pilling
cb94c91070 patch 9.0.1051: after a failed CTRL-W ] next command splits window
Problem:    After a failed CTRL-W ] next command splits window.
Solution:   Reset postponed_split. (Rob Pilling, closes #11698)
2022-12-13 12:26:09 +00:00
Bram Moolenaar
6342e2c5a6 patch 9.0.1050: using freed memory when assigning to variable twice
Problem:    Using freed memory when assigning to variable twice.
Solution:   Make copy of the list type. (closes #11691)
2022-12-12 18:56:32 +00:00
Bram Moolenaar
67578e5bcf patch 9.0.1049: crash when opening a very small terminal window
Problem:    Crash when opening a very small terminal window.
Solution:   Instead of crashing fix the cursor position. (closes #11697)
2022-12-12 13:47:44 +00:00
zeertzjq
b7acea1806 patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Problem:    With "screenline" in 'culopt' cursorline highlight is wrong.
Solution:   Apply the priority logic also when "screenline is in 'culopt'.
            (closes #11696)
2022-12-12 13:20:43 +00:00
Bram Moolenaar
7db29e4b5c Update runtime files 2022-12-11 15:53:04 +00:00
Bram Moolenaar
79336e19cb patch 9.0.1047: matchparen is slow
Problem:    Matchparen is slow.
Solution:   Actually use the position where the match started, not the
            position where the search started. (closes #11644)
2022-12-11 14:18:31 +00:00
Bram Moolenaar
3ea8a1b129 patch 9.0.1046: class method disassemble test fails on MS-Windows
Problem:    Class method disassemble test fails on MS-Windows.
Solution:   Do not match with a specific size.
2022-12-10 19:03:51 +00:00
Bram Moolenaar
7ce7daf6cd patch 9.0.1045: in a class object members cannot be initialized
Problem:    In a class object members cannot be initialized.
Solution:   Support initializing object members. Make "dissassemble" work on
            an object method.
2022-12-10 18:42:12 +00:00
Bram Moolenaar
6c87bbb4e4 patch 9.0.1044: setting window height using Python may cause errors
Problem:    Setting window height using Python may cause errors.
Solution:   When setting "curwin" also set "curbuf". (closes #11687)
2022-12-10 11:17:11 +00:00
zeertzjq
c51a376265 patch 9.0.1043: macro has confusing name and is duplicated
Problem:    Macro has confusing name and is duplicated.
Solution:   Use one macro with an understandable name. (closes #11686)
2022-12-10 10:22:29 +00:00
Bram Moolenaar
4ae0057308 patch 9.0.1042: ASAN gives false alarm about array access.
Problem:    ASAN gives false alarm about array access.
Solution:   Use an intermediate pointer.
2022-12-09 22:49:23 +00:00
Bram Moolenaar
ffdaca9e6f patch 9.0.1041: cannot define a method in a class
Problem:    Cannot define a method in a class.
Solution:   Implement defining an object method.  Make calling an object
            method work.
2022-12-09 21:41:48 +00:00
Bram Moolenaar
148bcd3610 patch 9.0.1040: test for <Cmd> mapping with CmdlineChanged fails
Problem:    Test for <Cmd> mapping with CmdlineChanged fails.
Solution:   Put back the check for the cmdline length not changing.
2022-12-09 12:41:32 +00:00
Bram Moolenaar
bb393d8259 patch 9.0.1039: using a <Cmd> mapping CmdlineChanged may be triggered twice
Problem:    Using a <Cmd> mapping CmdlineChanged may be triggered twice.
Solution:   Count the number of times CmdlineChanged is triggered and avoid
            doing it twice. (closes #116820
2022-12-09 12:21:50 +00:00
zeertzjq
ffa4e9b43a patch 9.0.1038: function name does not match what it is used for
Problem:    Function name does not match what it is used for.
Solution:   Include the modifier in the name. (closes #11679)
2022-12-09 11:36:36 +00:00
Bram Moolenaar
98aeb2100c patch 9.0.1037: lalloc(0) error for a class without members
Problem:    lalloc(0) error for a class without members.
Solution:   Don't allocate room for members if there aren't any.
            Don't create the class if there was an error.
2022-12-08 22:09:14 +00:00
491 changed files with 34132 additions and 18259 deletions

View File

@@ -1,10 +1,31 @@
version: "{build}" version: "{build}"
image: Visual Studio 2015
skip_tags: true skip_tags: true
environment: environment:
matrix: matrix:
- FEATURE: HUGE - FEATURE: HUGE
# Alternate environments, not used right now. 2022 is a lot slower.
#
# - job_name: VS-2015
# appveyor_build_worker_image: Visual Studio 2015
# FEATURE: HUGE
# - job_name: VS-2017
# appveyor_build_worker_image: Visual Studio 2017
# FEATURE: HUGE
# - job_name: VS-2019
# appveyor_build_worker_image: Visual Studio 2019
# FEATURE: HUGE
# - job_name: VS-2022
# appveyor_build_worker_image: Visual Studio 2022
# FEATURE: HUGE
# disabled # disabled
# - FEATURE: TINY # - FEATURE: TINY
# - FEATURE: NORMAL # - FEATURE: NORMAL
@@ -14,19 +35,19 @@ matrix:
fast_finish: true fast_finish: true
before_build: before_build:
# Use Visual Studio 2015 compiler tools (default is 2012) - call ver
- '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64' - ci\appveyor.bat install
build_script: build_script:
- ci/appveyor.bat - ci\appveyor.bat build
test_script: test_script:
- cd src/testdir - ci\appveyor.bat test
# Testing with MSVC gvim
- path C:\Python35-x64;%PATH% artifacts:
- nmake -f Make_mvc.mak VIMPROG=..\gvim - path: src/vim.exe
- nmake -f Make_mvc.mak clean name: vim
# Testing with MSVC console version - path: src/gvim.exe
- nmake -f Make_mvc.mak VIMPROG=..\vim name: gvim
# vim: sw=2 sts=2 et ts=8 sr # vim: sw=2 sts=2 et ts=8 sr

7
.github/CODEOWNERS vendored
View File

@@ -51,6 +51,7 @@ runtime/compiler/dartanalyser.vim @dkearns
runtime/compiler/dartdevc.vim @dkearns runtime/compiler/dartdevc.vim @dkearns
runtime/compiler/dartdoc.vim @dkearns runtime/compiler/dartdoc.vim @dkearns
runtime/compiler/dartfmt.vim @dkearns runtime/compiler/dartfmt.vim @dkearns
runtime/compiler/dotnet.vim @nickspoons
runtime/compiler/eruby.vim @dkearns runtime/compiler/eruby.vim @dkearns
runtime/compiler/fbc.vim @dkearns runtime/compiler/fbc.vim @dkearns
runtime/compiler/gawk.vim @dkearns runtime/compiler/gawk.vim @dkearns
@@ -181,6 +182,7 @@ runtime/ftplugin/python.vim @tpict
runtime/ftplugin/qb64.vim @dkearns runtime/ftplugin/qb64.vim @dkearns
runtime/ftplugin/r.vim @jalvesaq runtime/ftplugin/r.vim @jalvesaq
runtime/ftplugin/racket.vim @benknoble runtime/ftplugin/racket.vim @benknoble
runtime/ftplugin/readline.vim @dkearns
runtime/ftplugin/rhelp.vim @jalvesaq runtime/ftplugin/rhelp.vim @jalvesaq
runtime/ftplugin/rmd.vim @jalvesaq runtime/ftplugin/rmd.vim @jalvesaq
runtime/ftplugin/rnoweb.vim @jalvesaq runtime/ftplugin/rnoweb.vim @jalvesaq
@@ -297,6 +299,7 @@ runtime/plugin/tarPlugin.vim @cecamp
runtime/plugin/vimballPlugin.vim @cecamp runtime/plugin/vimballPlugin.vim @cecamp
runtime/plugin/zipPlugin.vim @cecamp runtime/plugin/zipPlugin.vim @cecamp
runtime/plugin/manpager.vim @Konfekt runtime/plugin/manpager.vim @Konfekt
runtime/syntax/shared/hgcommitDiff.vim @vegerot
runtime/syntax/abaqus.vim @costerwi runtime/syntax/abaqus.vim @costerwi
runtime/syntax/aidl.vim @dpelle runtime/syntax/aidl.vim @dpelle
runtime/syntax/amiga.vim @cecamp runtime/syntax/amiga.vim @cecamp
@@ -331,6 +334,7 @@ runtime/syntax/dot.vim @mmottl
runtime/syntax/doxygen.vim @frogonwheels runtime/syntax/doxygen.vim @frogonwheels
runtime/syntax/dtd.vim @chrisbra runtime/syntax/dtd.vim @chrisbra
runtime/syntax/dts.vim @zonque runtime/syntax/dts.vim @zonque
runtime/syntax/editorconfig.vim @gpanders
runtime/syntax/eiffel.vim @jocelyn runtime/syntax/eiffel.vim @jocelyn
runtime/syntax/elmfilt.vim @cecamp runtime/syntax/elmfilt.vim @cecamp
runtime/syntax/erlang.vim @hcs42 runtime/syntax/erlang.vim @hcs42
@@ -371,6 +375,7 @@ runtime/syntax/indent.vim @dkearns
runtime/syntax/j.vim @glts runtime/syntax/j.vim @glts
runtime/syntax/jargon.vim @h3xx runtime/syntax/jargon.vim @h3xx
runtime/syntax/java.vim @fleiner runtime/syntax/java.vim @fleiner
runtime/syntax/javascript.vim @fleiner
runtime/syntax/jsonc.vim @izhakjakov runtime/syntax/jsonc.vim @izhakjakov
runtime/syntax/julia.vim @carlobaldassi runtime/syntax/julia.vim @carlobaldassi
runtime/syntax/kconfig.vim @chrisbra runtime/syntax/kconfig.vim @chrisbra
@@ -394,6 +399,7 @@ runtime/syntax/n1ql.vim @pr3d4t0r
runtime/syntax/netrw.vim @cecamp runtime/syntax/netrw.vim @cecamp
runtime/syntax/nginx.vim @chr4 runtime/syntax/nginx.vim @chr4
runtime/syntax/ninja.vim @nico runtime/syntax/ninja.vim @nico
runtime/syntax/nix.vim @equill
runtime/syntax/nroff.vim @jmarshall runtime/syntax/nroff.vim @jmarshall
runtime/syntax/nsis.vim @k-takata runtime/syntax/nsis.vim @k-takata
runtime/syntax/openvpn.vim @ObserverOfTime runtime/syntax/openvpn.vim @ObserverOfTime
@@ -464,6 +470,7 @@ runtime/syntax/vdf.vim @ObserverOfTime
runtime/syntax/vim.vim @cecamp runtime/syntax/vim.vim @cecamp
runtime/syntax/vroom.vim @dbarnett runtime/syntax/vroom.vim @dbarnett
runtime/syntax/wast.vim @rhysd runtime/syntax/wast.vim @rhysd
runtime/syntax/wdl.vim @zenmatic
runtime/syntax/wget.vim @dkearns runtime/syntax/wget.vim @dkearns
runtime/syntax/wget2.vim @dkearns runtime/syntax/wget2.vim @dkearns
runtime/syntax/xbl.vim @dkearns runtime/syntax/xbl.vim @dkearns

View File

@@ -96,22 +96,21 @@ jobs:
- name: Install gcc-11 - name: Install gcc-11
if: matrix.compiler == 'gcc' if: matrix.compiler == 'gcc'
run: | run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install -y gcc-11 sudo apt install -y gcc-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
sudo update-alternatives --set gcc /usr/bin/gcc-11 sudo update-alternatives --set gcc /usr/bin/gcc-11
- name: Install clang-15 - name: Install clang-16
if: matrix.compiler == 'clang' if: matrix.compiler == 'clang'
run: | run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
. /etc/lsb-release . /etc/lsb-release
sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-15 main" sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-16 main"
sudo apt install -y clang-15 llvm-15 sudo apt install -y clang-16 llvm-16
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100
sudo update-alternatives --set clang /usr/bin/clang-15 sudo update-alternatives --set clang /usr/bin/clang-16
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-15 100 sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-16 100
sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-15 100 sudo update-alternatives --install /usr/bin/asan_symbolize asan_symbolize /usr/bin/asan_symbolize-16 100
- name: Set up environment - name: Set up environment
run: | run: |
@@ -254,7 +253,7 @@ jobs:
- name: Codecov - name: Codecov
if: matrix.coverage if: matrix.coverage
uses: codecov/codecov-action@v3.1.1 uses: codecov/codecov-action@v3
with: with:
flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }} flags: linux,${{ matrix.features }}-${{ matrix.compiler }}-${{ matrix.extra }}
@@ -300,8 +299,6 @@ jobs:
- name: Install packages - name: Install packages
if: matrix.features == 'huge' if: matrix.features == 'huge'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: | run: |
brew install lua brew install lua
echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
@@ -373,8 +370,8 @@ jobs:
PYTHON_VER_DOT: '2.7' PYTHON_VER_DOT: '2.7'
PYTHON_DIR: 'C:\Python27' PYTHON_DIR: 'C:\Python27'
# Python 3 # Python 3
PYTHON3_VER: 310 PYTHON3_VER: 311
PYTHON3_VER_DOT: '3.10' PYTHON3_VER_DOT: '3.11'
# Other dependencies # Other dependencies
# winpty # winpty
WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
@@ -613,7 +610,7 @@ jobs:
- name: Codecov - name: Codecov
if: matrix.coverage if: matrix.coverage
uses: codecov/codecov-action@v3.1.1 uses: codecov/codecov-action@v3
with: with:
directory: src directory: src
flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }} flags: windows,${{ matrix.toolchain }}-${{ matrix.arch }}-${{ matrix.features }}

1
.gitignore vendored
View File

@@ -68,6 +68,7 @@ src/tags
/GPATH /GPATH
/GTAGS /GTAGS
/GRTAGS /GRTAGS
nsis/tags
# Generated by "make test" # Generated by "make test"
src/po/*.ck src/po/*.ck

View File

@@ -7,9 +7,9 @@ src/xxd/xxd
src/auto/if_perl.c src/auto/if_perl.c
src/auto/gui_gtk_gresources.c src/auto/gui_gtk_gresources.c
src/auto/gui_gtk_gresources.h src/auto/gui_gtk_gresources.h
src/auto/os_haiku.rdef
src/objects/.dirstamp src/objects/.dirstamp
src/objects src/objects
src/tags
src/types.vim src/types.vim
# We do need src/auto/configure. # We do need src/auto/configure.
@@ -46,12 +46,15 @@ gvimext.lib
gvim.lib gvim.lib
runtime/doc/uganda.nsis.txt runtime/doc/uganda.nsis.txt
nsis/icons/* nsis/icons/*
/vim90/
.vscode/
# NetBeans # NetBeans
nbproject/* nbproject/*
# Mac OSX # Mac OSX
src/xxd/xxd.dSYM src/xxd/xxd.dSYM
.DS_Store
# All platforms # All platforms
*.rej *.rej
@@ -62,6 +65,12 @@ src/xxd/xxd.dSYM
*.pyc *.pyc
*.log *.log
src/po/vim.pot src/po/vim.pot
src/tags
/tags
/GPATH
/GTAGS
/GRTAGS
nsis/tags
# Generated by "make test" # Generated by "make test"
src/po/*.ck src/po/*.ck
@@ -78,14 +87,16 @@ src/testdir/dostmp/*
src/testdir/messages src/testdir/messages
src/testdir/viminfo src/testdir/viminfo
src/testdir/opt_test.vim src/testdir/opt_test.vim
src/testdir/failed
src/testdir/starttime
runtime/indent/testdir/*.out runtime/indent/testdir/*.out
runtime/indent/testdir/*.fail
src/memfile_test src/memfile_test
src/json_test src/json_test
src/message_test src/message_test
src/kword_test src/kword_test
# Generated by "make install" # Generated by "make install"
runtime/doc/tags
runtime/doc/doctags runtime/doc/doctags
# Generated by "make shadow". The directory names could be anything but we # Generated by "make shadow". The directory names could be anything but we
@@ -95,5 +106,10 @@ src/shadow-*
src/runtime src/runtime
src/pixmaps src/pixmaps
# other possible files build by tools # other files possibly created by tools
src/cscope.out src/cscope.out
# Linter/language server files
/.cache/clangd/
/.ccls-cache/
/compile_commands.json

View File

@@ -1,6 +1,6 @@
[![Vim Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org) [![Vim Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
[![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) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![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) [![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp) [![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) [![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) [![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html) [![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) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![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) [![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) [![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) [![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
<sub>For translations of this README see the end.</sub> <sub>For translations of this README see the end.</sub>
@@ -101,7 +101,7 @@ for details (do `:help uganda` inside Vim).
Summary of the license: There are no restrictions on using or distributing an Summary of the license: There are no restrictions on using or distributing an
unmodified copy of Vim. Parts of Vim may also be distributed, but the license unmodified copy of Vim. Parts of Vim may also be distributed, but the license
text must always be included. For modified versions a few restrictions apply. text must always be included. For modified versions, a few restrictions apply.
The license is GPL compatible, you may compile Vim with GPL libraries and The license is GPL compatible, you may compile Vim with GPL libraries and
distribute it. distribute it.
@@ -122,7 +122,7 @@ For the most recent information about sponsoring look on the Vim web site:
## Contributing ## ## Contributing ##
If you would like to help making Vim better, see the If you would like to help make Vim better, see the
[CONTRIBUTING.md](/CONTRIBUTING.md) file. [CONTRIBUTING.md](/CONTRIBUTING.md) file.

View File

@@ -84,7 +84,7 @@ encouraged to make a donation to help orphans in Uganda. Please read the file
Summary of the license: There are no restrictions on using or distributing an Summary of the license: There are no restrictions on using or distributing an
unmodified copy of Vim. Parts of Vim may also be distributed, but the license unmodified copy of Vim. Parts of Vim may also be distributed, but the license
text must always be included. For modified versions a few restrictions apply. text must always be included. For modified versions, a few restrictions apply.
The license is GPL compatible, you may compile Vim with GPL libraries and The license is GPL compatible, you may compile Vim with GPL libraries and
distribute it. distribute it.
@@ -106,7 +106,7 @@ For the most recent information about sponsoring look on the Vim web site:
CONTRIBUTING CONTRIBUTING
If you would like to help making Vim better, see the CONTRIBUTING.md file. If you would like to help make Vim better, see the CONTRIBUTING.md file.
INFORMATION INFORMATION

View File

@@ -2,18 +2,17 @@
# What is Vim9? # What is Vim9?
This is an experimental side of [Vim](https://github.com/vim/vim). This is a new syntax for Vim script that was introduced with Vim 9.0.
It explores ways of making Vim script faster and better. It intends making Vim script faster and better.
WARNING: The Vim9 script features are still under development, anything can
break!
# Why Vim9? # Why Vim9?
## 1. FASTER VIM SCRIPT ## 1. FASTER VIM SCRIPT
The third item on the poll results of 2018, after popup windows and text The third item on the poll results of 2018, after popup windows and text
properties, is faster Vim script. So how do we do that? properties, both of which have been implemented, is faster Vim script.
So how do we do that?
I have been throwing some ideas around, and soon came to the conclusion I have been throwing some ideas around, and soon came to the conclusion
that the current way functions are called and executed, with that the current way functions are called and executed, with
@@ -53,7 +52,7 @@ we can gain, and also that Vim script can be faster than builtin
interfaces. interfaces.
LuaJit is much faster at Lua-only instructions. In practice the script would LuaJit is much faster at Lua-only instructions. In practice the script would
not do something useless as counting but change the text. For example, not do something useless counting, but change the text. For example,
reindent all the lines: reindent all the lines:
``` vim ``` vim

View File

@@ -1,9 +1,54 @@
@echo off @echo off
:: Batch file for building/testing Vim on AppVeyor :: Batch file for building/testing Vim on AppVeyor
set target=%1
setlocal ENABLEDELAYEDEXPANSION setlocal ENABLEDELAYEDEXPANSION
cd %APPVEYOR_BUILD_FOLDER% cd %APPVEYOR_BUILD_FOLDER%
:: Python3
set PYTHON3_VER=311
set PYTHON3_RELEASE=3.11.1
set PYTHON3_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/python-%PYTHON3_RELEASE%-amd64.exe
set PYTHON3_DIR=C:\python%PYTHON3_VER%-x64
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if exist "%VSWHERE%" (
for /f "usebackq delims=" %%i in (
`"%VSWHERE%" -products * -latest -property installationPath`
) do (
set "VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
)
if not exist "%VCVARSALL%" (
set "VCVARSALL=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
)
call "%VCVARSALL%" x64
goto %target%
echo Unknown build target.
exit 1
:: ----------------------------------------------------------------------------
:install
@echo on
if not exist downloads mkdir downloads
:: Python 3
if not exist %PYTHON3_DIR% (
call :downloadfile %PYTHON3_URL% downloads\python3.exe
cmd /c start /wait downloads\python3.exe /quiet TargetDir=%PYTHON3_DIR% ^
Include_pip=0 Include_tcltk=0 Include_test=0 Include_tools=0 ^
AssociateFiles=0 Shortcuts=0 Include_doc=0 Include_launcher=0 ^
InstallLauncherAllUsers=0
)
@echo off
goto :eof
:: ----------------------------------------------------------------------------
:build
cd src cd src
echo "Building MSVC 64bit console Version" echo "Building MSVC 64bit console Version"
@@ -22,7 +67,7 @@ if "%FEATURE%" == "HUGE" (
nmake -f Make_mvc.mak CPU=AMD64 ^ nmake -f Make_mvc.mak CPU=AMD64 ^
OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^ OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^ PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 ^ PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
FEATURES=%FEATURE% FEATURES=%FEATURE%
) ELSE ( ) ELSE (
nmake -f Make_mvc.mak CPU=AMD64 ^ nmake -f Make_mvc.mak CPU=AMD64 ^
@@ -39,4 +84,31 @@ echo "version output MSVC console"
.\vim --version || exit 1 .\vim --version || exit 1
echo "version output MSVC GUI" echo "version output MSVC GUI"
type ver_msvc.txt || exit 1 type ver_msvc.txt || exit 1
cd ..
goto :eof
:: ----------------------------------------------------------------------------
:test
@echo on
cd src/testdir
:: Testing with MSVC gvim
path %PYTHON3_DIR%;%PATH%
nmake -f Make_mvc.mak VIMPROG=..\gvim
nmake -f Make_mvc.mak clean
:: Testing with MSVC console version
nmake -f Make_mvc.mak VIMPROG=..\vim
@echo off
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

View File

@@ -29,12 +29,12 @@ To build the installable .exe:
4. Get a "diff.exe" program. If you skip this the built-in diff will always 4. Get a "diff.exe" program. If you skip this the built-in diff will always
be used (which is fine for most users). If you do have your own be used (which is fine for most users). If you do have your own
"diff.exe" put it in the "../.." directory (above the "vim82" directory, "diff.exe" put it in the "../.." directory (above the "vim90" directory,
it's the same for all Vim versions). it's the same for all Vim versions).
You can find one in previous Vim versions or in this archive: You can find one in previous Vim versions or in this archive:
http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz
5 Also put winpty32.dll and winpty-agent.exe in "../.." (above the "vim82" 5 Also put winpty32.dll and winpty-agent.exe in "../.." (above the "vim90"
directory). This is required for the terminal window. directory). This is required for the terminal window.
6. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have 6. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have

View File

@@ -228,6 +228,28 @@ FunctionEnd
!insertmacro GetParent "" !insertmacro GetParent ""
!insertmacro GetParent "un." !insertmacro GetParent "un."
# Get home directory
!macro GetHomeDir un
Function ${un}GetHomeDir
Push $0
Push $1
ReadEnvStr $0 "HOME"
${If} $0 == ""
ReadEnvStr $0 "HOMEDRIVE"
ReadEnvStr $1 "HOMEPATH"
StrCpy $0 "$0$1"
${If} $0 == ""
ReadEnvStr $0 "USERPROFILE"
${EndIf}
${EndIf}
Pop $1
Exch $0 # put $0 on top of stack, restore $0 to original value
FunctionEnd
!macroend
!insertmacro GetHomeDir ""
!insertmacro GetHomeDir "un."
# Check if Vim is already installed. # Check if Vim is already installed.
# return: Installed directory. If not found, it will be empty. # return: Installed directory. If not found, it will be empty.
Function CheckOldVim Function CheckOldVim
@@ -520,7 +542,8 @@ SectionGroup $(str_group_plugin) id_group_plugin
Section "$(str_section_plugin_home)" id_section_pluginhome Section "$(str_section_plugin_home)" id_section_pluginhome
SectionIn 1 3 SectionIn 1 3
StrCpy $1 "$1 -create-directories home" # use ShellExecAsUser below instead
# StrCpy $1 "$1 -create-directories home"
SectionEnd SectionEnd
Section "$(str_section_plugin_vim)" id_section_pluginvim Section "$(str_section_plugin_vim)" id_section_pluginvim
@@ -594,6 +617,13 @@ Section -call_install_exe
DetailPrint "$(str_msg_registering)" DetailPrint "$(str_msg_registering)"
nsExec::Exec "$0\install.exe $1" nsExec::Exec "$0\install.exe $1"
Pop $3 Pop $3
${If} ${SectionIsSelected} ${id_section_pluginhome}
ReadEnvStr $3 "COMSPEC"
Call GetHomeDir
Pop $4
ShellExecAsUser::ShellExecAsUser "" "$3" '/c "cd /d "$4" & mkdir vimfiles & cd vimfiles & mkdir colors compiler doc ftdetect ftplugin indent keymap plugin syntax"' SW_HIDE
${EndIf}
SectionEnd SectionEnd
########################################################## ##########################################################
@@ -1042,15 +1072,8 @@ SectionEnd
SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin
Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home
# get the home dir # get the home dir
ReadEnvStr $0 "HOME" Call un.GetHomeDir
${If} $0 == "" Pop $0
ReadEnvStr $0 "HOMEDRIVE"
ReadEnvStr $1 "HOMEPATH"
StrCpy $0 "$0$1"
${If} $0 == ""
ReadEnvStr $0 "USERPROFILE"
${EndIf}
${EndIf}
${If} $0 != "" ${If} $0 != ""
!insertmacro RemoveVimfiles $0 !insertmacro RemoveVimfiles $0

View File

@@ -3,7 +3,7 @@ vim9script
# Vim functions for file type detection # Vim functions for file type detection
# #
# Maintainer: Bram Moolenaar <Bram@vim.org> # Maintainer: Bram Moolenaar <Bram@vim.org>
# Last Change: 2022 Nov 24 # Last Change: 2022 Dec 14
# These functions are moved here from runtime/filetype.vim to make startup # These functions are moved here from runtime/filetype.vim to make startup
# faster. # faster.
@@ -810,10 +810,13 @@ export def SQL()
enddef enddef
# This function checks the first 25 lines of file extension "sc" to resolve # This function checks the first 25 lines of file extension "sc" to resolve
# detection between scala and SuperCollider # detection between scala and SuperCollider.
# NOTE: We don't check for 'Class : Method', as this can easily be confused
# with valid Scala like `val x : Int = 3`. So we instead only rely on
# checks that can't be confused.
export def FTsc() export def FTsc()
for lnum in range(1, min([line("$"), 25])) for lnum in range(1, min([line("$"), 25]))
if getline(lnum) =~# '[A-Za-z0-9]*\s:\s[A-Za-z0-9]\|var\s<\|classvar\s<\|\^this.*\||\w*|\|+\s\w*\s{\|\*ar\s' if getline(lnum) =~# 'var\s<\|classvar\s<\|\^this.*\||\w\+|\|+\s\w*\s{\|\*ar\s'
setf supercollider setf supercollider
return return
endif endif

View File

@@ -2,12 +2,12 @@ vim9script
# Language: Vim script # Language: Vim script
# Maintainer: github user lacygoill # Maintainer: github user lacygoill
# Last Change: 2022 Oct 15 # Last Change: 2023 Feb 01
# NOTE: Whenever you change the code, make sure the tests are still passing: # NOTE: Whenever you change the code, make sure the tests are still passing:
# #
# $ cd runtime/indent/ # $ cd runtime/indent/
# $ make clean; make test || vimdiff testdir/vim.{fail,ok} # $ make clean; make test || vimdiff testdir/vim.{ok,fail}
# Config {{{1 # Config {{{1
@@ -112,6 +112,10 @@ const DICT_KEY: string = '^\s*\%('
.. '\)' .. '\)'
.. ':\%(\s\|$\)' .. ':\%(\s\|$\)'
# NOT_A_DICT_KEY {{{3
const NOT_A_DICT_KEY: string = ':\@!'
# END_OF_COMMAND {{{3 # END_OF_COMMAND {{{3
const END_OF_COMMAND: string = $'\s*\%($\|||\@!\|{INLINE_COMMENT}\)' const END_OF_COMMAND: string = $'\s*\%($\|||\@!\|{INLINE_COMMENT}\)'
@@ -144,19 +148,43 @@ const HEREDOC_OPERATOR: string = '\s=<<\s\@=\%(\s\+\%(trim\|eval\)\)\{,2}'
# #
# But sometimes, it can be too costly and cause `E363` to be given. # But sometimes, it can be too costly and cause `E363` to be given.
const PATTERN_DELIMITER: string = '[-+*/%]\%(=\s\)\@!' const PATTERN_DELIMITER: string = '[-+*/%]\%(=\s\)\@!'
# QUOTE {{{3
const QUOTE: string = '["'']'
# }}}2 # }}}2
# Syntaxes {{{2 # Syntaxes {{{2
# ASSIGNS_HEREDOC {{{3 # BLOCKS {{{3
const ASSIGNS_HEREDOC: string = $'^\%({COMMENT}\)\@!.*\%({HEREDOC_OPERATOR}\)\s\+\zs[A-Z]\+{END_OF_LINE}' const BLOCKS: list<list<string>> = [
['if', 'el\%[se]', 'elseif\=', 'en\%[dif]'],
['for', 'endfor\='],
['wh\%[ile]', 'endw\%[hile]'],
['try', 'cat\%[ch]', 'fina\|finally\=', 'endt\%[ry]'],
['def', 'enddef'],
['fu\%[nction](\@!', 'endf\%[unction]'],
['class', 'endclass'],
['interface', 'endinterface'],
['enum', 'endenum'],
['aug\%[roup]\%(\s\+[eE][nN][dD]\)\@!\s\+\S\+', 'aug\%[roup]\s\+[eE][nN][dD]'],
]
# CD_COMMAND {{{3 # MODIFIERS {{{3
const CD_COMMAND: string = $'\<[lt]\=cd!\=\s\+-{END_OF_COMMAND}' # some keywords can be prefixed by modifiers (e.g. `def` can be prefixed by `export`)
const MODIFIERS: dict<string> = {
def: ['export', 'static'],
class: ['export', 'abstract', 'export abstract'],
interface: ['export'],
}
# ...
# class: ['export', 'abstract', 'export abstract'],
# ...
# →
# ...
# class: '\%(export\|abstract\|export\s\+abstract\)\s\+',
# ...
->map((_, mods: list<string>): string =>
'\%(' .. mods
->join('\|')
->substitute('\s\+', '\\s\\+', 'g')
.. '\)' .. '\s\+')
# HIGHER_ORDER_COMMAND {{{3 # HIGHER_ORDER_COMMAND {{{3
@@ -174,56 +202,102 @@ patterns =<< trim eval END
g\%[lobal]!\={PATTERN_DELIMITER}.* g\%[lobal]!\={PATTERN_DELIMITER}.*
v\%[global]!\={PATTERN_DELIMITER}.* v\%[global]!\={PATTERN_DELIMITER}.*
END END
const HIGHER_ORDER_COMMAND: string = $'\%(^\|{BAR_SEPARATION}\)\s*\<\%(' .. patterns->join('\|') .. '\):\@!'
# MAPPING_COMMAND {{{3 const HIGHER_ORDER_COMMAND: string = $'\%(^\|{BAR_SEPARATION}\)\s*\<\%({patterns->join('\|')}\){NOT_A_DICT_KEY}'
const MAPPING_COMMAND: string = '\%(\<sil\%[ent]!\=\s\+\)\=\<[nvxsoilct]\=\%(nore\|un\)map!\=\s' # START_MIDDLE_END {{{3
# NORMAL_COMMAND {{{3 # Let's derive this constant from `BLOCKS`:
#
# [['if', 'el\%[se]', 'elseif\=', 'en\%[dif]'],
# ['for', 'endfor\='],
# ...,
# [...]]
# →
# {
# 'for': ['for', '', 'endfor\='],
# 'endfor': ['for', '', 'endfor\='],
# 'if': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
# 'else': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
# 'elseif': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
# 'endif': ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
# ...
# }
var START_MIDDLE_END: dict<list<string>>
const NORMAL_COMMAND: string = '\<norm\%[al]!\=\s*\S\+$' def Unshorten(kwd: string): string
return BlockStartKeyword(kwd)
enddef
# PLUS_MINUS_COMMAND {{{3 def BlockStartKeyword(line: string): string
var kwd: string = line->matchstr('\l\+')
return fullcommand(kwd, false)
enddef
# In legacy, the `:+` and `:-` commands are not required to be preceded by a colon. {
# As a result, when `+` or `-` is alone on a line, there is ambiguity. for kwds: list<string> in BLOCKS
# It might be an operator or a command. var [start: string, middle: string, end: string] = [kwds[0], '', kwds[-1]]
# To not break the indentation in legacy scripts, we might need to consider such if MODIFIERS->has_key(start->Unshorten())
# lines as commands. start = $'\%({MODIFIERS[start]}\)\={start}'
const PLUS_MINUS_COMMAND: string = '^\s*[+-]\s*$' endif
if kwds->len() > 2
middle = kwds[1 : -2]->join('\|')
endif
for kwd: string in kwds
START_MIDDLE_END->extend({[kwd->Unshorten()]: [start, middle, end]})
endfor
endfor
}
START_MIDDLE_END = START_MIDDLE_END
->map((_, kwds: list<string>) =>
kwds->map((_, kwd: string) => kwd == ''
? ''
: $'\%(^\|{BAR_SEPARATION}\|\<sil\%[ent]\|{HIGHER_ORDER_COMMAND}\)\s*'
.. $'\<\%({kwd}\)\>\%(\s*{OPERATOR}\)\@!'))
lockvar! START_MIDDLE_END
# ENDS_BLOCK {{{3 # ENDS_BLOCK {{{3
const ENDS_BLOCK: string = '^\s*\%(' const ENDS_BLOCK: string = '^\s*\%('
.. 'en\%[dif]' .. BLOCKS
.. '\|' .. 'endfor\=' ->copy()
.. '\|' .. 'endw\%[hile]' ->map((_, kwds: list<string>): string => kwds[-1])
.. '\|' .. 'endt\%[ry]' ->join('\|')
.. '\|' .. 'enddef'
.. '\|' .. 'endf\%[unction]'
.. '\|' .. 'aug\%[roup]\s\+[eE][nN][dD]'
.. '\|' .. CLOSING_BRACKET .. '\|' .. CLOSING_BRACKET
.. $'\){END_OF_COMMAND}' .. $'\){END_OF_COMMAND}'
# ENDS_BLOCK_OR_CLAUSE {{{3 # ENDS_BLOCK_OR_CLAUSE {{{3
patterns =<< trim END patterns = BLOCKS
en\%[dif] ->copy()
el\%[se] ->map((_, kwds: list<string>) => kwds[1 :])
endfor\= ->flattennew()
endw\%[hile] # `catch` and `elseif` need to be handled as special cases
endt\%[ry] ->filter((_, pat: string): bool => pat->Unshorten() !~ '^\%(catch\|elseif\)\>')
fina\|finally\=
enddef
endf\%[unction]
aug\%[roup]\s\+[eE][nN][dD]
END
const ENDS_BLOCK_OR_CLAUSE: string = '^\s*\%(' .. patterns->join('\|') .. $'\){END_OF_COMMAND}' const ENDS_BLOCK_OR_CLAUSE: string = '^\s*\%(' .. patterns->join('\|') .. $'\){END_OF_COMMAND}'
.. $'\|^\s*cat\%[ch]\%(\s\+\({PATTERN_DELIMITER}\).*\1\)\={END_OF_COMMAND}' .. $'\|^\s*cat\%[ch]\%(\s\+\({PATTERN_DELIMITER}\).*\1\)\={END_OF_COMMAND}'
.. $'\|^\s*elseif\=\>\%({OPERATOR}\)\@!' .. $'\|^\s*elseif\=\>\%({OPERATOR}\)\@!'
# STARTS_NAMED_BLOCK {{{3
patterns = []
{
for kwds: list<string> in BLOCKS
for kwd: string in kwds[0 : -2]
if MODIFIERS->has_key(kwd->Unshorten())
patterns += [$'\%({MODIFIERS[kwd]}\)\={kwd}']
else
patterns += [kwd]
endif
endfor
endfor
}
const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>{NOT_A_DICT_KEY}'
# STARTS_CURLY_BLOCK {{{3 # STARTS_CURLY_BLOCK {{{3
# TODO: `{` alone on a line is not necessarily the start of a block. # TODO: `{` alone on a line is not necessarily the start of a block.
@@ -236,70 +310,57 @@ const STARTS_CURLY_BLOCK: string = '\%('
.. '\|' .. $'^\%(\s*\|.*{BAR_SEPARATION}\s*\)\%(com\%[mand]\|au\%[tocmd]\).*\zs\s{{' .. '\|' .. $'^\%(\s*\|.*{BAR_SEPARATION}\s*\)\%(com\%[mand]\|au\%[tocmd]\).*\zs\s{{'
.. '\)' .. END_OF_COMMAND .. '\)' .. END_OF_COMMAND
# STARTS_NAMED_BLOCK {{{3
# All of these will be used at the start of a line (or after a bar).
# NOTE: Don't replace `\%x28` with `(`.{{{
#
# Otherwise, the paren would be unbalanced which might cause syntax highlighting
# issues much later in the code of the current script (sometimes, the syntax
# highlighting plugin fails to correctly recognize a heredoc which is far away
# and/or not displayed because inside a fold).
# }}}
patterns =<< trim END
if
el\%[se]
elseif\=
for
wh\%[ile]
try
cat\%[ch]
fina\|finally\=
fu\%[nction]\%x28\@!
\%(export\s\+\)\=def
aug\%[roup]\%(\s\+[eE][nN][dD]\)\@!\s\+\S\+
END
const STARTS_NAMED_BLOCK: string = '^\s*\%(sil\%[ent]\s\+\)\=\%(' .. patterns->join('\|') .. '\)\>:\@!'
# STARTS_FUNCTION {{{3 # STARTS_FUNCTION {{{3
const STARTS_FUNCTION: string = '^\s*\%(export\s\+\)\=def\>:\@!' const STARTS_FUNCTION: string = $'^\s*\%({MODIFIERS.def}\)\=def\>{NOT_A_DICT_KEY}'
# ENDS_FUNCTION {{{3 # ENDS_FUNCTION {{{3
const ENDS_FUNCTION: string = $'^\s*enddef\>:\@!{END_OF_COMMAND}' const ENDS_FUNCTION: string = $'^\s*enddef\>{END_OF_COMMAND}'
# START_MIDDLE_END {{{3 # ASSIGNS_HEREDOC {{{3
const START_MIDDLE_END: dict<list<string>> = { const ASSIGNS_HEREDOC: string = $'^\%({COMMENT}\)\@!.*\%({HEREDOC_OPERATOR}\)\s\+\zs[A-Z]\+{END_OF_LINE}'
if: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
else: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'], # PLUS_MINUS_COMMAND {{{3
elseif: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'],
endif: ['if', 'el\%[se]\|elseif\=', 'en\%[dif]'], # In legacy, the `:+` and `:-` commands are not required to be preceded by a colon.
for: ['for', '', 'endfor\='], # As a result, when `+` or `-` is alone on a line, there is ambiguity.
endfor: ['for', '', 'endfor\='], # It might be an operator or a command.
while: ['wh\%[ile]', '', 'endw\%[hile]'], # To not break the indentation in legacy scripts, we might need to consider such
endwhile: ['wh\%[ile]', '', 'endw\%[hile]'], # lines as commands.
try: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'], const PLUS_MINUS_COMMAND: string = '^\s*[+-]\s*$'
catch: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'],
finally: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'], # TRICKY_COMMANDS {{{3
endtry: ['try', 'cat\%[ch]\|fina\|finally\=', 'endt\%[ry]'],
def: ['\%(export\s\+\)\=def', '', 'enddef'], # Some commands are tricky because they accept an argument which can be
enddef: ['\%(export\s\+\)\=def', '', 'enddef'], # conflated with an operator. Examples:
function: ['fu\%[nction]', '', 'endf\%[unction]'], #
endfunction: ['fu\%[nction]', '', 'endf\%[unction]'], # argdelete *
augroup: ['aug\%[roup]\%(\s\+[eE][nN][dD]\)\@!\s\+\S\+', '', 'aug\%[roup]\s\+[eE][nN][dD]'], # cd -
}->map((_, kwds: list<string>) => # normal! ==
kwds->map((_, kwd: string) => kwd == '' # nunmap <buffer> (
? '' #
: $'\%(^\|{BAR_SEPARATION}\|\<sil\%[ent]\|{HIGHER_ORDER_COMMAND}\)\s*' # TODO: Other commands might accept operators as argument. Handle them too.
.. $'\%({printf('\C\<\%%(%s\)\>:\@!\%%(\s*%s\)\@!', kwd, OPERATOR)}\)')) patterns =<< trim eval END
{'\'}<argd\%[elete]\s\+\*\s*$
\<[lt]\=cd!\=\s\+-\s*$
\<norm\%[al]!\=\s*\S\+$
\%(\<sil\%[ent]!\=\s\+\)\=\<[nvxsoilct]\=\%(nore\|un\)map!\=\s
{PLUS_MINUS_COMMAND}
END
const TRICKY_COMMANDS: string = patterns->join('\|')
# }}}2 # }}}2
# EOL {{{2 # EOL {{{2
# OPENING_BRACKET_AT_EOL {{{3 # OPENING_BRACKET_AT_EOL {{{3
const OPENING_BRACKET_AT_EOL: string = OPENING_BRACKET .. END_OF_VIM9_LINE const OPENING_BRACKET_AT_EOL: string = OPENING_BRACKET .. END_OF_VIM9_LINE
# CLOSING_BRACKET_AT_EOL {{{3
const CLOSING_BRACKET_AT_EOL: string = CLOSING_BRACKET .. END_OF_VIM9_LINE
# COMMA_AT_EOL {{{3 # COMMA_AT_EOL {{{3
const COMMA_AT_EOL: string = $',{END_OF_VIM9_LINE}' const COMMA_AT_EOL: string = $',{END_OF_VIM9_LINE}'
@@ -387,6 +448,7 @@ export def Expr(lnum = v:lnum): number # {{{2
endif endif
if line_A->AtStartOf('FuncHeader') if line_A->AtStartOf('FuncHeader')
&& !IsInInterface()
line_A.lnum->CacheFuncHeader() line_A.lnum->CacheFuncHeader()
elseif line_A.lnum->IsInside('FuncHeader') elseif line_A.lnum->IsInside('FuncHeader')
return b:vimindent.startindent + 2 * shiftwidth() return b:vimindent.startindent + 2 * shiftwidth()
@@ -425,6 +487,7 @@ export def Expr(lnum = v:lnum): number # {{{2
if line_A.text->ContinuesBelowBracketBlock(line_B, past_bracket_block) if line_A.text->ContinuesBelowBracketBlock(line_B, past_bracket_block)
&& line_A.text !~ CLOSING_BRACKET_AT_SOL && line_A.text !~ CLOSING_BRACKET_AT_SOL
return past_bracket_block.startindent return past_bracket_block.startindent
+ (past_bracket_block.startline =~ STARTS_NAMED_BLOCK ? 2 * shiftwidth() : 0)
endif endif
# Problem: If we press `==` on the line right below the start of a multiline # Problem: If we press `==` on the line right below the start of a multiline
@@ -433,6 +496,18 @@ export def Expr(lnum = v:lnum): number # {{{2
if line_B->EndsWithLambdaArrow() if line_B->EndsWithLambdaArrow()
return Indent(line_B.lnum) + shiftwidth() + IndentMoreInBracketBlock() return Indent(line_B.lnum) + shiftwidth() + IndentMoreInBracketBlock()
endif endif
# FIXME: Similar issue here:
#
# var x = []
# ->filter((_, _) =>
# true)
# ->items()
#
# Press `==` on last line.
# Expected: The `->items()` line is indented like `->filter(...)`.
# Actual: It's indented like `true)`.
# Is it worth fixing? `=ip` gives the correct indentation, because then the
# cache is used.
# Don't move this block before the heredoc one.{{{ # Don't move this block before the heredoc one.{{{
# #
@@ -531,8 +606,13 @@ def Offset( # {{{2
line_B: dict<any>, line_B: dict<any>,
): number ): number
if line_B->AtStartOf('FuncHeader')
&& IsInInterface()
return 0
# increase indentation inside a block # increase indentation inside a block
if line_B.text =~ STARTS_NAMED_BLOCK || line_B->EndsWithCurlyBlock() elseif line_B.text =~ STARTS_NAMED_BLOCK
|| line_B->EndsWithCurlyBlock()
# But don't indent if the line starting the block also closes it. # But don't indent if the line starting the block also closes it.
if line_B->AlsoClosesBlock() if line_B->AlsoClosesBlock()
return 0 return 0
@@ -802,11 +882,6 @@ def Indent(lnum: number): number # {{{3
return indent(lnum) return indent(lnum)
enddef enddef
def BlockStartKeyword(line: string): string # {{{3
var kwd: string = line->matchstr('\l\+')
return fullcommand(kwd, false)
enddef
def MatchingOpenBracket(line: dict<any>): number # {{{3 def MatchingOpenBracket(line: dict<any>): number # {{{3
var end: string = line.text->matchstr(CLOSING_BRACKET) var end: string = line.text->matchstr(CLOSING_BRACKET)
var start: string = {']': '[', '}': '{', ')': '('}[end] var start: string = {']': '[', '}': '{', ')': '('}[end]
@@ -903,7 +978,8 @@ def SearchPair( # {{{3
if end == '[' || end == ']' if end == '[' || end == ']'
e = e->escape('[]') e = e->escape('[]')
endif endif
return searchpair(s, middle, e, flags, (): bool => InCommentOrString(), stopline, TIMEOUT) return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e,
flags, (): bool => InCommentOrString(), stopline, TIMEOUT)
enddef enddef
def SearchPairStart( # {{{3 def SearchPairStart( # {{{3
@@ -1011,6 +1087,10 @@ def IsInThisBlock(line_A: dict<any>, lnum: number): bool # {{{3
return line_A.lnum <= end return line_A.lnum <= end
enddef enddef
def IsInInterface(): bool # {{{3
return SearchPair('interface', '', 'endinterface', 'nW') > 0
enddef
def IsFirstLineOfCommand(line_1: dict<any>, line_2: dict<any>): bool # {{{3 def IsFirstLineOfCommand(line_1: dict<any>, line_2: dict<any>): bool # {{{3
if line_1.text->Is_IN_KeywordForLoop(line_2.text) if line_1.text->Is_IN_KeywordForLoop(line_2.text)
return false return false
@@ -1041,13 +1121,8 @@ def Is_IN_KeywordForLoop(line_1: string, line_2: string): bool # {{{3
enddef enddef
def InCommentOrString(): bool # {{{3 def InCommentOrString(): bool # {{{3
for synID: number in synstack('.', col('.')) return synstack('.', col('.'))
if synIDattr(synID, 'name') =~ '\ccomment\|string\|heredoc' ->indexof((_, id: number): bool => synIDattr(id, 'name') =~ '\ccomment\|string\|heredoc') >= 0
return true
endif
endfor
return false
enddef enddef
def AlsoClosesBlock(line_B: dict<any>): bool # {{{3 def AlsoClosesBlock(line_B: dict<any>): bool # {{{3
@@ -1091,6 +1166,10 @@ def EndsWithOpeningBracket(line: dict<any>): bool # {{{3
return NonCommentedMatch(line, OPENING_BRACKET_AT_EOL) return NonCommentedMatch(line, OPENING_BRACKET_AT_EOL)
enddef enddef
def EndsWithClosingBracket(line: dict<any>): bool # {{{3
return NonCommentedMatch(line, CLOSING_BRACKET_AT_EOL)
enddef
def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3 def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
# Could happen if there is no code above us, and we're not on the 1st line. # Could happen if there is no code above us, and we're not on the 1st line.
# In that case, `PrevCodeLine()` returns `{lnum: 0, line: ''}`. # In that case, `PrevCodeLine()` returns `{lnum: 0, line: ''}`.
@@ -1098,16 +1177,6 @@ def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
return false return false
endif endif
if line.text =~ PLUS_MINUS_COMMAND
return false
endif
# In `argdelete *`, `*` is not a multiplication operator.
# TODO: Other commands can accept `*` as an argument. Handle them too.
if line.text =~ '\<argd\%[elete]\s\+\*\s*$'
return false
endif
# Technically, that's wrong. A line might start with a range and end with a # Technically, that's wrong. A line might start with a range and end with a
# line continuation symbol. But it's unlikely. And it's useful to assume the # line continuation symbol. But it's unlikely. And it's useful to assume the
# opposite because it prevents us from conflating a mark with an operator or # opposite because it prevents us from conflating a mark with an operator or
@@ -1174,24 +1243,7 @@ def NonCommentedMatch(line: dict<any>, pat: string): bool # {{{3
return false return false
endif endif
# `:help cd-` if line.text =~ TRICKY_COMMANDS
if line.text =~ CD_COMMAND
return false
endif
# At the end of a mapping, any character might appear; e.g. a paren:
#
# nunmap <buffer> (
#
# Don't conflate this with a line continuation symbol.
if line.text =~ MAPPING_COMMAND
return false
endif
# not a comparison operator
# vv
# normal! ==
if line.text =~ NORMAL_COMMAND
return false return false
endif endif

View File

@@ -22,8 +22,7 @@ let s:maxoff = 50 " maximum number of lines to look backwards for ()
function s:SearchBracket(fromlnum, flags) function s:SearchBracket(fromlnum, flags)
return searchpairpos('[[({]', '', '[])}]', a:flags, return searchpairpos('[[({]', '', '[])}]', a:flags,
\ {-> synstack('.', col('.')) \ {-> synstack('.', col('.'))
\ ->map({_, id -> id->synIDattr('name')}) \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0},
\ ->match('\%(Comment\|Todo\|String\)$') >= 0},
\ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout) \ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout)
endfunction endfunction
@@ -157,15 +156,13 @@ function python#GetIndent(lnum, ...)
" the start of the comment. synID() is slow, a linear search would take " the start of the comment. synID() is slow, a linear search would take
" too long on a long line. " too long on a long line.
if synstack(plnum, pline_len) if synstack(plnum, pline_len)
\ ->map({_, id -> id->synIDattr('name')}) \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\)$'}) >= 0
\ ->match('\%(Comment\|Todo\)$') >= 0
let min = 1 let min = 1
let max = pline_len let max = pline_len
while min < max while min < max
let col = (min + max) / 2 let col = (min + max) / 2
if synstack(plnum, col) if synstack(plnum, col)
\ ->map({_, id -> id->synIDattr('name')}) \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\)$'}) >= 0
\ ->match('\%(Comment\|Todo\)$') >= 0
let max = col let max = col
else else
let min = col + 1 let min = col + 1

View File

@@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin. " Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com> " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2019 Aug 16 " Last Change: 2023 Jan 01
" "
" Additional contributors: " Additional contributors:
" "
@@ -351,63 +351,65 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
let s:old_magic = &magic let s:old_magic = &magic
set magic set magic
if s:settings.use_xhtml
if s:settings.encoding != ""
let xml_line = "<?xml version=\"1.0\" encoding=\"" . s:settings.encoding . "\"?>"
else
let xml_line = "<?xml version=\"1.0\"?>"
endif
let tag_close = ' />'
endif
let style = [s:settings.use_xhtml ? "" : '-->']
let body_line = ''
let html = [] let html = []
let s:html5 = 0 if !s:settings.no_doc
if s:settings.use_xhtml if s:settings.use_xhtml
call add(html, xml_line) if s:settings.encoding != ""
endif let xml_line = "<?xml version=\"1.0\" encoding=\"" . s:settings.encoding . "\"?>"
if s:settings.use_xhtml else
call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">") let xml_line = "<?xml version=\"1.0\"?>"
call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">') endif
elseif s:settings.use_css && !s:settings.no_pre let tag_close = ' />'
call add(html, "<!DOCTYPE html>")
call add(html, '<html>')
let s:html5 = 1
else
call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"')
call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">')
call add(html, '<html>')
endif
call add(html, '<head>')
" include encoding as close to the top as possible, but only if not already
" contained in XML information
if s:settings.encoding != "" && !s:settings.use_xhtml
if s:html5
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
else
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
endif endif
let style = [s:settings.use_xhtml ? "" : '-->']
let body_line = ''
let s:html5 = 0
if s:settings.use_xhtml
call add(html, xml_line)
endif
if s:settings.use_xhtml
call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">")
call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">')
elseif s:settings.use_css && !s:settings.no_pre
call add(html, "<!DOCTYPE html>")
call add(html, '<html>')
let s:html5 = 1
else
call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"')
call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">')
call add(html, '<html>')
endif
call add(html, '<head>')
" include encoding as close to the top as possible, but only if not already
" contained in XML information
if s:settings.encoding != "" && !s:settings.use_xhtml
if s:html5
call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close)
else
call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close)
endif
endif
call add(html, '<title>diff</title>')
call add(html, '<meta name="Generator" content="Vim/'.v:version/100.'.'.v:version%100.'"'.tag_close)
call add(html, '<meta name="plugin-version" content="'.g:loaded_2html_plugin.'"'.tag_close)
call add(html, '<meta name="settings" content="'.
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
\ ',prevent_copy='.s:settings.prevent_copy.
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
\ '"'.tag_close)
call add(html, '<meta name="colorscheme" content="'.
\ (exists('g:colors_name')
\ ? g:colors_name
\ : 'none'). '"'.tag_close)
call add(html, '</head>')
let body_line_num = len(html)
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
endif endif
call add(html, '<title>diff</title>')
call add(html, '<meta name="Generator" content="Vim/'.v:version/100.'.'.v:version%100.'"'.tag_close)
call add(html, '<meta name="plugin-version" content="'.g:loaded_2html_plugin.'"'.tag_close)
call add(html, '<meta name="settings" content="'.
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
\ ',prevent_copy='.s:settings.prevent_copy.
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
\ '"'.tag_close)
call add(html, '<meta name="colorscheme" content="'.
\ (exists('g:colors_name')
\ ? g:colors_name
\ : 'none'). '"'.tag_close)
call add(html, '</head>')
let body_line_num = len(html)
call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>')
call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>") call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>")
call add(html, '<tr>') call add(html, '<tr>')
@@ -430,47 +432,53 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" When not using CSS or when using xhtml, the <body> line can be important. " When not using CSS or when using xhtml, the <body> line can be important.
" Assume it will be the same for all buffers and grab it from the first " Assume it will be the same for all buffers and grab it from the first
" buffer. Similarly, need to grab the body end line as well. " buffer. Similarly, need to grab the body end line as well.
if body_line == '' if !s:settings.no_doc
if body_line == ''
1
call search('<body')
let body_line = getline('.')
$
call search('</body>', 'b')
let s:body_end_line = getline('.')
endif
" Grab the style information. Some of this will be duplicated so only insert
" it if it's not already there. {{{
1 1
call search('<body') let style_start = search('^<style\( type="text/css"\)\?>')
let body_line = getline('.') 1
$ let style_end = search('^</style>')
call search('</body>', 'b') if style_start > 0 && style_end > 0
let s:body_end_line = getline('.') let buf_styles = getline(style_start + 1, style_end - 1)
endif for a_style in buf_styles
if index(style, a_style) == -1
" Grab the style information. Some of this will be duplicated so only insert if diff_style_start == 0
" it if it's not already there. {{{ if a_style =~ '\<Diff\(Change\|Text\|Add\|Delete\)'
1 let diff_style_start = len(style)-1
let style_start = search('^<style\( type="text/css"\)\?>') endif
1
let style_end = search('^</style>')
if style_start > 0 && style_end > 0
let buf_styles = getline(style_start + 1, style_end - 1)
for a_style in buf_styles
if index(style, a_style) == -1
if diff_style_start == 0
if a_style =~ '\<Diff\(Change\|Text\|Add\|Delete\)'
let diff_style_start = len(style)-1
endif endif
call insert(style, a_style, insert_index)
let insert_index += 1
endif endif
call insert(style, a_style, insert_index) endfor
let insert_index += 1 endif " }}}
endif
endfor
endif " }}}
" everything new will get added before the diff styles so diff highlight " everything new will get added before the diff styles so diff highlight
" properly overrides normal highlight " properly overrides normal highlight
if diff_style_start != 0 if diff_style_start != 0
let insert_index = diff_style_start let insert_index = diff_style_start
endif
" Delete those parts that are not needed so we can include the rest into the
" resulting table.
1,/^<body.*\%(\n<!--.*-->\_s\+.*id='oneCharWidth'.*\_s\+.*id='oneInputWidth'.*\_s\+.*id='oneEmWidth'\)\?\zs/d_
$
?</body>?,$d_
elseif !s:settings.no_modeline
" remove modeline from source files if it is included and we haven't deleted
" due to removing html footer already
$d
endif endif
" Delete those parts that are not needed so we can include the rest into the
" resulting table.
1,/^<body.*\%(\n<!--.*-->\_s\+.*id='oneCharWidth'.*\_s\+.*id='oneInputWidth'.*\_s\+.*id='oneEmWidth'\)\?\zs/d_
$
?</body>?,$d_
let temp = getline(1,'$') let temp = getline(1,'$')
" clean out id on the main content container because we already set it on " clean out id on the main content container because we already set it on
" the table " the table
@@ -478,7 +486,11 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" undo deletion of start and end part " undo deletion of start and end part
" so we can later save the file as valid html " so we can later save the file as valid html
" TODO: restore using grabbed lines if undolevel is 1? " TODO: restore using grabbed lines if undolevel is 1?
normal! 2u if !s:settings.no_doc
normal! 2u
elseif !s:settings.no_modeline
normal! u
endif
if s:settings.use_css if s:settings.use_css
call add(html, '<td><div>') call add(html, '<td><div>')
elseif s:settings.use_xhtml elseif s:settings.use_xhtml
@@ -495,17 +507,23 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
quit! quit!
endfor endfor
let html[body_line_num] = body_line if !s:settings.no_doc
let html[body_line_num] = body_line
endif
call add(html, '</tr>') call add(html, '</tr>')
call add(html, '</table>') call add(html, '</table>')
call add(html, s:body_end_line) if !s:settings.no_doc
call add(html, '</html>') call add(html, s:body_end_line)
call add(html, '</html>')
endif
" The generated HTML is admittedly ugly and takes a LONG time to fold. " The generated HTML is admittedly ugly and takes a LONG time to fold.
" Make sure the user doesn't do syntax folding when loading a generated file, " Make sure the user doesn't do syntax folding when loading a generated file,
" using a modeline. " using a modeline.
call add(html, '<!-- vim: set foldmethod=manual : -->') if !s:settings.no_modeline
call add(html, '<!-- vim: set foldmethod=manual : -->')
endif
let i = 1 let i = 1
let name = "Diff" . (s:settings.use_xhtml ? ".xhtml" : ".html") let name = "Diff" . (s:settings.use_xhtml ? ".xhtml" : ".html")
@@ -542,129 +560,131 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
call append(0, html) call append(0, html)
if len(style) > 0 if !s:settings.no_doc
1 if len(style) > 0
let style_start = search('^</head>')-1 1
let style_start = search('^</head>')-1
" add required javascript in reverse order so we can just call append again " add required javascript in reverse order so we can just call append again
" and again without adjusting {{{ " and again without adjusting {{{
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
" insert script closing tag if needed " insert script closing tag if needed
if s:uses_script if s:uses_script
call append(style_start, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
endif
" insert javascript to get IDs from line numbers, and to open a fold before
" jumping to any lines contained therein
if s:settings.line_ids
call append(style_start, [
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
\ " * we corrected the raw number to a line ID.",
\ " */",
\ " if (lineElem) {",
\ " lineElem.scrollIntoView(true);",
\ " }",
\ " return true;",
\ "}",
\ "if ('onhashchange' in window) {",
\ " window.onhashchange = JumpToLine;",
\ "}"
\ ])
if s:settings.dynamic_folds
call append(style_start, [ call append(style_start, [
\ "", \ '',
\ " /* navigate upwards in the DOM tree to open all folds containing the line */", \ s:settings.use_xhtml ? '//]]>' : '-->',
\ " var node = lineElem;", \ "</script>"
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " {",
\ " if (node.className == 'closed-fold')",
\ " {",
\ " /* toggle open the fold ID (remove window ID) */",
\ " toggleFold(node.id.substr(4));",
\ " }",
\ " node = node.parentNode;",
\ " }",
\ ]) \ ])
endif endif
endif
if s:settings.line_ids " insert javascript to get IDs from line numbers, and to open a fold before
call append(style_start, [ " jumping to any lines contained therein
\ "", if s:settings.line_ids
\ "/* function to open any folds containing a jumped-to line before jumping to it */", call append(style_start, [
\ "function JumpToLine()", \ " /* Always jump to new location even if the line was hidden inside a fold, or",
\ "{", \ " * we corrected the raw number to a line ID.",
\ " var lineNum;", \ " */",
\ " lineNum = window.location.hash;", \ " if (lineElem) {",
\ " lineNum = lineNum.substr(1); /* strip off '#' */", \ " lineElem.scrollIntoView(true);",
\ "", \ " }",
\ " if (lineNum.indexOf('L') == -1) {", \ " return true;",
\ " lineNum = 'L'+lineNum;", \ "}",
\ " }", \ "if ('onhashchange' in window) {",
\ " if (lineNum.indexOf('W') == -1) {", \ " window.onhashchange = JumpToLine;",
\ " lineNum = 'W1'+lineNum;", \ "}"
\ " }", \ ])
\ " var lineElem = document.getElementById(lineNum);"
\ ])
endif
" Insert javascript to toggle matching folds open and closed in all windows, if s:settings.dynamic_folds
" if dynamic folding is active. call append(style_start, [
if s:settings.dynamic_folds \ "",
call append(style_start, [ \ " /* navigate upwards in the DOM tree to open all folds containing the line */",
\ " function toggleFold(objID)", \ " var node = lineElem;",
\ " {", \ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)", \ " {",
\ " {", \ " if (node.className == 'closed-fold')",
\ " var fold;", \ " {",
\ ' fold = document.getElementById("win"+win_num+objID);', \ " /* toggle open the fold ID (remove window ID) */",
\ " if(fold.className == 'closed-fold')", \ " toggleFold(node.id.substr(4));",
\ " {", \ " }",
\ " fold.className = 'open-fold';", \ " node = node.parentNode;",
\ " }", \ " }",
\ " else if (fold.className == 'open-fold')", \ ])
\ " {", endif
\ " fold.className = 'closed-fold';", endif
\ " }",
\ " }",
\ " }",
\ ])
endif
if s:uses_script if s:settings.line_ids
" insert script tag if needed call append(style_start, [
call append(style_start, [ \ "",
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">", \ "/* function to open any folds containing a jumped-to line before jumping to it */",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"]) \ "function JumpToLine()",
endif \ "{",
\ " var lineNum;",
\ " lineNum = window.location.hash;",
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
\ "",
\ " if (lineNum.indexOf('L') == -1) {",
\ " lineNum = 'L'+lineNum;",
\ " }",
\ " if (lineNum.indexOf('W') == -1) {",
\ " lineNum = 'W1'+lineNum;",
\ " }",
\ " var lineElem = document.getElementById(lineNum);"
\ ])
endif
" Insert styles from all the generated html documents and additional styles " Insert javascript to toggle matching folds open and closed in all windows,
" for the table-based layout of the side-by-side diff. The diff should take " if dynamic folding is active.
" up the full browser window (but not more), and be static in size, if s:settings.dynamic_folds
" horizontally scrollable when the lines are too long. Otherwise, the diff call append(style_start, [
" is pretty useless for really long lines. {{{ \ " function toggleFold(objID)",
if s:settings.use_css \ " {",
call append(style_start, \ " for (win_num = 1; win_num <= ".len(a:buf_list)."; win_num++)",
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+ \ " {",
\ style+ \ " var fold;",
\ [ s:settings.use_xhtml ? '' : '<!--', \ ' fold = document.getElementById("win"+win_num+objID);',
\ 'table { table-layout: fixed; }', \ " if(fold.className == 'closed-fold')",
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }', \ " {",
\ 'table, td, th { border: 1px solid; }', \ " fold.className = 'open-fold';",
\ 'td { vertical-align: top; }', \ " }",
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }', \ " else if (fold.className == 'open-fold')",
\ 'td div { overflow: auto; }', \ " {",
\ s:settings.use_xhtml ? '' : '-->', \ " fold.className = 'closed-fold';",
\ '</style>' \ " }",
\]) \ " }",
endif "}}} \ " }",
\ ])
endif
if s:uses_script
" insert script tag if needed
call append(style_start, [
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
" Insert styles from all the generated html documents and additional styles
" for the table-based layout of the side-by-side diff. The diff should take
" up the full browser window (but not more), and be static in size,
" horizontally scrollable when the lines are too long. Otherwise, the diff
" is pretty useless for really long lines. {{{
if s:settings.use_css
call append(style_start,
\ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+
\ style+
\ [ s:settings.use_xhtml ? '' : '<!--',
\ 'table { table-layout: fixed; }',
\ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }',
\ 'table, td, th { border: 1px solid; }',
\ 'td { vertical-align: top; }',
\ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }',
\ 'td div { overflow: auto; }',
\ s:settings.use_xhtml ? '' : '-->',
\ '</style>'
\])
endif "}}}
endif
endif endif
let &paste = s:old_paste let &paste = s:old_paste

View File

@@ -0,0 +1,100 @@
" Adapted from fatih/vim-go: autoload/go/fmt.vim
"
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" Upstream: https://github.com/ziglang/zig.vim
function! zig#fmt#Format() abort
" Save cursor position and many other things.
let view = winsaveview()
if !executable('zig')
echohl Error | echomsg "no zig binary found in PATH" | echohl None
return
endif
let cmdline = 'zig fmt --stdin --ast-check'
let current_buf = bufnr('')
" The formatted code is output on stdout, the errors go on stderr.
if exists('*systemlist')
silent let out = systemlist(cmdline, current_buf)
else
silent let out = split(system(cmdline, current_buf))
endif
if len(out) == 1
if out[0] == "error: unrecognized parameter: '--ast-check'"
let cmdline = 'zig fmt --stdin'
if exists('*systemlist')
silent let out = systemlist(cmdline, current_buf)
else
silent let out = split(system(cmdline, current_buf))
endif
endif
endif
let err = v:shell_error
if err == 0
" remove undo point caused via BufWritePre.
try | silent undojoin | catch | endtry
" Replace the file content with the formatted version.
if exists('*deletebufline')
call deletebufline(current_buf, len(out), line('$'))
else
silent execute ':' . len(out) . ',' . line('$') . ' delete _'
endif
call setline(1, out)
" No errors detected, close the loclist.
call setloclist(0, [], 'r')
lclose
elseif get(g:, 'zig_fmt_parse_errors', 1)
let errors = s:parse_errors(expand('%'), out)
call setloclist(0, [], 'r', {
\ 'title': 'Errors',
\ 'items': errors,
\ })
let max_win_height = get(g:, 'zig_fmt_max_window_height', 5)
" Prevent the loclist from becoming too long.
let win_height = min([max_win_height, len(errors)])
" Open the loclist, but only if there's at least one error to show.
execute 'silent! lwindow ' . win_height
endif
call winrestview(view)
if err != 0
echohl Error | echomsg "zig fmt returned error" | echohl None
return
endif
" Run the syntax highlighter on the updated content and recompute the folds if
" needed.
syntax sync fromstart
endfunction
" parse_errors parses the given errors and returns a list of parsed errors
function! s:parse_errors(filename, lines) abort
" list of errors to be put into location list
let errors = []
for line in a:lines
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
if !empty(tokens)
call add(errors,{
\"filename": a:filename,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[4],
\ })
endif
endfor
return errors
endfunction
" vim: sw=2 ts=2 et

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 9.0. Last change: 2022 Nov 22 *autocmd.txt* For Vim version 9.0. Last change: 2023 Feb 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -64,7 +64,7 @@ Example in Vim9 script: >
In legacy script: > In legacy script: >
call autocmd_add(#{replace: v:true, call autocmd_add(#{replace: v:true,
\ group: 'DemoGroup', \ group: 'DemoGroup',
\ event: 'BufEnter', \ event: 'BufEnter',
\ pattern: '*.txt', \ pattern: '*.txt',
\ cmd: 'call DemoBufEnter()' \ cmd: 'call DemoBufEnter()'
\ }) \ })
@@ -97,7 +97,7 @@ If the `:autocmd` is in Vim9 script (a script that starts with `:vim9script`
and in a `:def` function) then {cmd} will be executed as in Vim9 and in a `:def` function) then {cmd} will be executed as in Vim9
script. Thus this depends on where the autocmd is defined, not where it is script. Thus this depends on where the autocmd is defined, not where it is
triggered. triggered.
*:autocmd-block*
{cmd} can be a block, like with `:command`, see |:command-repl|. Example: > {cmd} can be a block, like with `:command`, see |:command-repl|. Example: >
au BufReadPost *.xml { au BufReadPost *.xml {
setlocal matchpairs+=<:> setlocal matchpairs+=<:>
@@ -398,7 +398,7 @@ Name triggered by ~
|InsertEnter| starting Insert mode |InsertEnter| starting Insert mode
|InsertChange| when typing <Insert> while in Insert or Replace mode |InsertChange| when typing <Insert> while in Insert or Replace mode
|InsertLeave| when leaving Insert mode |InsertLeave| when leaving Insert mode
|InsertLeavePre| just before leaving Insert mode |InsertLeavePre| just before leaving Insert mode
|InsertCharPre| when a character was typed in Insert mode, before |InsertCharPre| when a character was typed in Insert mode, before
inserting it inserting it
@@ -611,9 +611,11 @@ CmdlineEnter After moving the cursor to the command line,
where the user can type a command or search where the user can type a command or search
string; including non-interactive use of ":" string; including non-interactive use of ":"
in a mapping, but not when using |<Cmd>|. in a mapping, but not when using |<Cmd>|.
The pattern is matched against the character
representing the type of command-line.
|cmdwin-char|
<afile> is set to a single character, <afile> is set to a single character,
indicating the type of command-line. indicating the type of command-line.
|cmdwin-char|
*CmdlineLeave* *CmdlineLeave*
CmdlineLeave Before leaving the command line; including CmdlineLeave Before leaving the command line; including
non-interactive use of ":" in a mapping, but non-interactive use of ":" in a mapping, but

View File

@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.0. Last change: 2022 Dec 05 *builtin.txt* For Vim version 9.0. Last change: 2023 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -211,6 +211,7 @@ getbufline({buf}, {lnum} [, {end}])
getbufoneline({buf}, {lnum}) String line {lnum} of buffer {buf} getbufoneline({buf}, {lnum}) String line {lnum} of buffer {buf}
getbufvar({buf}, {varname} [, {def}]) getbufvar({buf}, {varname} [, {def}])
any variable {varname} in buffer {buf} any variable {varname} in buffer {buf}
getcellwidths() List get character cell width overrides
getchangelist([{buf}]) List list of change list items getchangelist([{buf}]) List list of change list items
getchar([expr]) Number or String getchar([expr]) Number or String
get one character from the user get one character from the user
@@ -265,7 +266,7 @@ gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
gettagstack([{nr}]) Dict get the tag stack of window {nr} gettagstack([{nr}]) Dict get the tag stack of window {nr}
gettext({text}) String lookup translation of {text} gettext({text}) String lookup translation of {text}
getwininfo([{winid}]) List list of info about each window getwininfo([{winid}]) List list of info about each window
getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window getwinpos([{timeout}]) List X and Y coord in pixels of Vim window
getwinposx() Number X coord in pixels of the Vim window getwinposx() Number X coord in pixels of the Vim window
getwinposy() Number Y coord in pixels of the Vim window getwinposy() Number Y coord in pixels of the Vim window
getwinvar({nr}, {varname} [, {def}]) getwinvar({nr}, {varname} [, {def}])
@@ -381,7 +382,7 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]])
max({expr}) Number maximum value of items in {expr} max({expr}) Number maximum value of items in {expr}
menu_info({name} [, {mode}]) Dict get menu item information menu_info({name} [, {mode}]) Dict get menu item information
min({expr}) Number minimum value of items in {expr} min({expr}) Number minimum value of items in {expr}
mkdir({name} [, {path} [, {prot}]]) mkdir({name} [, {flags} [, {prot}]])
Number create directory {name} Number create directory {name}
mode([expr]) String current editing mode mode([expr]) String current editing mode
mzeval({expr}) any evaluate |MzScheme| expression mzeval({expr}) any evaluate |MzScheme| expression
@@ -666,6 +667,8 @@ test_garbagecollect_soon() none free memory soon for testing
test_getvalue({string}) any get value of an internal variable test_getvalue({string}) any get value of an internal variable
test_gui_event({event}, {args}) bool generate a GUI event for testing test_gui_event({event}, {args}) bool generate a GUI event for testing
test_ignore_error({expr}) none ignore a specific error test_ignore_error({expr}) none ignore a specific error
test_mswin_event({event}, {args})
bool generate MS-Windows event for testing
test_null_blob() Blob null value for testing test_null_blob() Blob null value for testing
test_null_channel() Channel null value for testing test_null_channel() Channel null value for testing
test_null_dict() Dict null value for testing test_null_dict() Dict null value for testing
@@ -2566,8 +2569,7 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()* extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()*
Like |extend()| but instead of adding items to {expr1} a new Like |extend()| but instead of adding items to {expr1} a new
List or Dictionary is created and returned. {expr1} remains List or Dictionary is created and returned. {expr1} remains
unchanged. Items can still be changed by {expr2}, if you unchanged.
don't want that use |deepcopy()| first.
feedkeys({string} [, {mode}]) *feedkeys()* feedkeys({string} [, {mode}]) *feedkeys()*
@@ -3260,6 +3262,13 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()*
< Can also be used as a |method|: > < Can also be used as a |method|: >
GetBufnr()->getbufvar(varname) GetBufnr()->getbufvar(varname)
< <
getcellwidths() *getcellwidths()*
Returns a |List| of cell widths of character ranges overridden
by |setcellwidths()|. The format is equal to the argument of
|setcellwidths()|. If no character ranges have their cell
widths overridden, an empty List is returned.
getchangelist([{buf}]) *getchangelist()* getchangelist([{buf}]) *getchangelist()*
Returns the |changelist| for the buffer {buf}. For the use Returns the |changelist| for the buffer {buf}. For the use
of {buf}, see |bufname()| above. If buffer {buf} doesn't of {buf}, see |bufname()| above. If buffer {buf} doesn't
@@ -3518,6 +3527,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
messages |:messages| suboptions messages |:messages| suboptions
option options option options
packadd optional package |pack-add| names packadd optional package |pack-add| names
runtime |:runtime| completion
scriptnames sourced script names |:scriptnames| scriptnames sourced script names |:scriptnames|
shellcmd Shell command shellcmd Shell command
sign |:sign| suboptions sign |:sign| suboptions
@@ -4135,7 +4145,7 @@ getscriptinfo([{opts}) *getscriptinfo()*
this script name links to, if any, otherwise this script name links to, if any, otherwise
zero zero
variables A dictionary with the script-local variables. variables A dictionary with the script-local variables.
Present only when the a particular script is Present only when a particular script is
specified using the "sid" item in {opts}. specified using the "sid" item in {opts}.
Note that this is a copy, the value of Note that this is a copy, the value of
script-local variables cannot be changed using script-local variables cannot be changed using
@@ -6250,17 +6260,20 @@ min({expr}) Return the minimum value of all items in {expr}. Example: >
mylist->min() mylist->min()
< *mkdir()* *E739* < *mkdir()* *E739*
mkdir({name} [, {path} [, {prot}]]) mkdir({name} [, {flags} [, {prot}]])
Create directory {name}. Create directory {name}.
If {path} contains "p" then intermediate directories are When {flags} is present it must be a string. An empty string
created as necessary. Otherwise it must be "". has no effect.
If {path} contains "D" then {name} is deleted at the end of If {flags} contains "p" then intermediate directories are
created as necessary.
If {flags} contains "D" then {name} is deleted at the end of
the current function, as with: > the current function, as with: >
defer delete({name}, 'd') defer delete({name}, 'd')
< <
If {path} contains "R" then {name} is deleted recursively at If {flags} contains "R" then {name} is deleted recursively at
the end of the current function, as with: > the end of the current function, as with: >
defer delete({name}, 'rf') defer delete({name}, 'rf')
< Note that when {name} has more than one part and "p" is used < Note that when {name} has more than one part and "p" is used
@@ -7947,7 +7960,7 @@ setcellwidths({list}) *setcellwidths()*
terminal, counted in screen cells. The values override terminal, counted in screen cells. The values override
'ambiwidth'. Example: > 'ambiwidth'. Example: >
call setcellwidths([ call setcellwidths([
\ [0x111, 0x111, 1], \ [0x111, 0x111, 1],
\ [0x2194, 0x2199, 2], \ [0x2194, 0x2199, 2],
\ ]) \ ])
@@ -7956,12 +7969,12 @@ setcellwidths({list}) *setcellwidths()*
{low} and {high} can be the same, in which case this refers to {low} and {high} can be the same, in which case this refers to
one character. Otherwise it is the range of characters from one character. Otherwise it is the range of characters from
{low} to {high} (inclusive). *E1111* *E1114* {low} to {high} (inclusive). *E1111* *E1114*
Only characters with value 0x100 and higher can be used. Only characters with value 0x80 and higher can be used.
{width} must be either 1 or 2, indicating the character width {width} must be either 1 or 2, indicating the character width
in screen cells. *E1112* in screen cells. *E1112*
An error is given if the argument is invalid, also when a An error is given if the argument is invalid, also when a
range overlaps with another. *E1113* range overlaps with another. *E1113*
If the new value causes 'fillchars' or 'listchars' to become If the new value causes 'fillchars' or 'listchars' to become
invalid it is rejected and an error is given. invalid it is rejected and an error is given.
@@ -9111,6 +9124,8 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
Blob 0z00112233.44556677.8899 Blob 0z00112233.44556677.8899
List [item, item] List [item, item]
Dictionary {key: value, key: value} Dictionary {key: value, key: value}
Class class SomeName
Object object of SomeName {lnum: 1, col: 3}
When a |List| or |Dictionary| has a recursive reference it is When a |List| or |Dictionary| has a recursive reference it is
replaced by "[...]" or "{...}". Using eval() on the result replaced by "[...]" or "{...}". Using eval() on the result
@@ -9795,6 +9810,8 @@ timer_start({time}, {callback} [, {options}])
{time} is the waiting time in milliseconds. This is the {time} is the waiting time in milliseconds. This is the
minimum time before invoking the callback. When the system is minimum time before invoking the callback. When the system is
busy or Vim is not waiting for input the time will be longer. busy or Vim is not waiting for input the time will be longer.
Zero can be used to execute the callback when Vim is back in
the main loop.
{callback} is the function to call. It can be the name of a {callback} is the function to call. It can be the name of a
function or a |Funcref|. It is called with one argument, which function or a |Funcref|. It is called with one argument, which
@@ -9943,6 +9960,8 @@ type({expr}) The result is a Number representing the type of {expr}.
Job: 8 |v:t_job| Job: 8 |v:t_job|
Channel: 9 |v:t_channel| Channel: 9 |v:t_channel|
Blob: 10 |v:t_blob| Blob: 10 |v:t_blob|
Class 12 |v:t_class|
Object 13 |v:t_object|
For backward compatibility, this method can be used: > For backward compatibility, this method can be used: >
:if type(myvar) == type(0) :if type(myvar) == type(0)
:if type(myvar) == type("") :if type(myvar) == type("")
@@ -9963,7 +9982,7 @@ typename({expr}) *typename()*
Return a string representation of the type of {expr}. Return a string representation of the type of {expr}.
Example: > Example: >
echo typename([1, 2, 3]) echo typename([1, 2, 3])
list<number> < list<number> ~
undofile({name}) *undofile()* undofile({name}) *undofile()*
@@ -10536,7 +10555,7 @@ writefile({object}, {fname} [, {flags}])
< <
'D' Delete the file when the current function ends. This 'D' Delete the file when the current function ends. This
works like: > works like: >
:defer delete({fname}) :defer delete({fname})
< Fails when not in a function. Also see |:defer|. < Fails when not in a function. Also see |:defer|.
's' fsync() is called after writing the file. This flushes 's' fsync() is called after writing the file. This flushes

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 9.0. Last change: 2022 Nov 20 *change.txt* For Vim version 9.0. Last change: 2023 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -296,7 +296,9 @@ gr{char} Replace the virtual characters under the cursor with
{char}. This replaces in screen space, not file {char}. This replaces in screen space, not file
space. See |gR| and |Virtual-Replace-mode| for more space. See |gR| and |Virtual-Replace-mode| for more
details. As with |r| a count may be given. details. As with |r| a count may be given.
{char} can be entered like with |r|. {char} can be entered like with |r|, but characters
that have a special meaning in Insert mode, such as
most CTRL-keys, cannot be used.
*digraph-arg* *digraph-arg*
The argument for Normal mode commands like |r| and |t| is a single character. The argument for Normal mode commands like |r| and |t| is a single character.
@@ -1033,7 +1035,7 @@ inside of strings can change! Also see 'softtabstop' option. >
< to display registers '1' and 'a'. Spaces are allowed < to display registers '1' and 'a'. Spaces are allowed
in {arg}. in {arg}.
*:di* *:display* *:di* *:dis* *:display*
:di[splay] [arg] Same as :registers. :di[splay] [arg] Same as :registers.
*y* *yank* *y* *yank*

View File

@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 9.0. Last change: 2022 Nov 11 *cmdline.txt* For Vim version 9.0. Last change: 2023 Feb 08
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -617,6 +617,7 @@ followed by another Vim command:
:read ! :read !
:scscope :scscope
:sign :sign
:tabdo
:tcl :tcl
:tcldo :tcldo
:tclfile :tclfile

View File

@@ -1,4 +1,4 @@
*diff.txt* For Vim version 9.0. Last change: 2022 Oct 01 *diff.txt* For Vim version 9.0. Last change: 2023 Jan 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -136,7 +136,7 @@ file for a moment and come back to the same file and be in diff mode again.
buffers. buffers.
The `:diffoff` command resets the relevant options to the values they had when The `:diffoff` command resets the relevant options to the values they had when
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode. using `:diffsplit`, `:diffpatch`, `:diffthis`. or starting Vim in diff mode.
When using `:diffoff` twice the last saved values are restored. When using `:diffoff` twice the last saved values are restored.
Otherwise they are set to their default value: Otherwise they are set to their default value:
@@ -148,6 +148,10 @@ Otherwise they are set to their default value:
'foldmethod' "manual" 'foldmethod' "manual"
'foldcolumn' 0 'foldcolumn' 0
'foldenable' will most-likely be reset to off. That is when 'foldmethod' is
is restored to "manual". The folds themselves are not cleared but they should
not show up, resetting 'foldenable' is the best way to do that.
============================================================================== ==============================================================================
2. Viewing diffs *view-diffs* 2. Viewing diffs *view-diffs*
@@ -177,7 +181,7 @@ possible to view the changes you have made to a buffer since the file was
loaded. Since Vim doesn't allow having two buffers for the same file, you loaded. Since Vim doesn't allow having two buffers for the same file, you
need another buffer. This command is useful: > need another buffer. This command is useful: >
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_
\ | diffthis | wincmd p | diffthis \ | diffthis | wincmd p | diffthis
(this is in |defaults.vim|). Use ":DiffOrig" to see the differences between (this is in |defaults.vim|). Use ":DiffOrig" to see the differences between
the current buffer and the file it was loaded from. the current buffer and the file it was loaded from.

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.0. Last change: 2022 Dec 03 *eval.txt* For Vim version 9.0. Last change: 2023 Feb 25
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -163,9 +163,10 @@ Note that " " and "0" are also non-empty strings, thus considered to be TRUE.
A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE. A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE.
*E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910* *E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910*
*E913* *E974* *E975* *E976* *E913* *E974* *E975* *E976* *E1319* *E1320* *E1321* *E1322*
|List|, |Dictionary|, |Funcref|, |Job|, |Channel| and |Blob| types are not *E1323* *E1324*
automatically converted. |List|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| and
|object| types are not automatically converted.
*E805* *E806* *E808* *E805* *E806* *E808*
When mixing Number and Float the Number is converted to Float. Otherwise When mixing Number and Float the Number is converted to Float. Otherwise
@@ -1371,7 +1372,7 @@ Note that the dot is also used for String concatenation. To avoid confusion
always put spaces around the dot for String concatenation. always put spaces around the dot for String concatenation.
expr10(expr1, ...) |Funcref| function call *E1085* expr10(expr1, ...) |Funcref| function call *E1085*
When expr10 is a |Funcref| type variable, invoke the function it refers to. When expr10 is a |Funcref| type variable, invoke the function it refers to.
@@ -1653,7 +1654,7 @@ See below |functions|.
lambda expression *expr-lambda* *lambda* lambda expression *expr-lambda* *lambda*
----------------- -----------------
{args -> expr1} legacy lambda expression *E451* {args -> expr1} legacy lambda expression *E451*
(args) => expr1 |Vim9| lambda expression (args) => expr1 |Vim9| lambda expression
A lambda expression creates a new unnamed function which returns the result of A lambda expression creates a new unnamed function which returns the result of
@@ -2503,6 +2504,10 @@ v:t_number Value of |Number| type. Read-only. See: |type()|
v:t_string Value of |String| type. Read-only. See: |type()| v:t_string Value of |String| type. Read-only. See: |type()|
*v:t_blob* *t_blob-variable* *v:t_blob* *t_blob-variable*
v:t_blob Value of |Blob| type. Read-only. See: |type()| v:t_blob Value of |Blob| type. Read-only. See: |type()|
*v:t_class* *t_class-variable*
v:t_class Value of |class| type. Read-only. See: |type()|
*v:t_object* *t_object-variable*
v:t_object Value of |object| type. Read-only. See: |type()|
*v:termresponse* *termresponse-variable* *v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV| v:termresponse The escape sequence returned by the terminal for the |t_RV|
@@ -2969,6 +2974,8 @@ text...
deleted when the script ends). Function-local deleted when the script ends). Function-local
variables are automatically deleted when the function variables are automatically deleted when the function
ends. ends.
In |Vim9| script variables declared in a function or
script cannot be removed.
:unl[et] ${env-name} ... *:unlet-environment* *:unlet-$* :unl[et] ${env-name} ... *:unlet-environment* *:unlet-$*
Remove environment variable {env-name}. Remove environment variable {env-name}.
@@ -4574,10 +4581,10 @@ The input is in the variable "line", the results in the variables "file",
getting the scriptnames in a Dictionary ~ getting the scriptnames in a Dictionary ~
*scriptnames-dictionary* *scriptnames-dictionary*
The |:scriptnames| command can be used to get a list of all script files that The `:scriptnames` command can be used to get a list of all script files that
have been sourced. There is no equivalent function or variable for this have been sourced. There is also the `getscriptinfo()` function, but the
(because it's rarely needed). In case you need to manipulate the list this information returned is not exactly the same. In case you need to manipulate
code can be used: > the output of `scriptnames` this code can be used: >
" Get the output of ":scriptnames" in the scriptnames_output variable. " Get the output of ":scriptnames" in the scriptnames_output variable.
let scriptnames_output = '' let scriptnames_output = ''
redir => scriptnames_output redir => scriptnames_output

View File

@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 9.0. Last change: 2022 Apr 09 *filetype.txt* For Vim version 9.0. Last change: 2023 Feb 15
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -679,7 +679,10 @@ MARKDOWN *ft-markdown-plugin*
To enable folding use this: > To enable folding use this: >
let g:markdown_folding = 1 let g:markdown_folding = 1
<
'expandtab' will be set by default. If you do not want that use this: >
let g:markdown_recommended_style = 0
PDF *ft-pdf-plugin* PDF *ft-pdf-plugin*

View File

@@ -1,4 +1,4 @@
*fold.txt* For Vim version 9.0. Last change: 2022 Nov 26 *fold.txt* For Vim version 9.0. Last change: 2023 Jan 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -202,7 +202,7 @@ non-matching marker pairs. Example: >
/* funcB() {{{2 */ /* funcB() {{{2 */
void funcB() {} void funcB() {}
< *{{{* *}}}*
A fold starts at a "{{{" marker. The following number specifies the fold A fold starts at a "{{{" marker. The following number specifies the fold
level. What happens depends on the difference between the current fold level level. What happens depends on the difference between the current fold level
and the level given by the marker: and the level given by the marker:

View File

@@ -48,7 +48,7 @@ typesetting command. That must be a function that takes a path and returns the
command as a List. For example: command as a List. For example:
> >
def ConTeXtCustomCommand(path: string): list<string> def ConTeXtCustomCommand(path: string): list<string>
return ['mtxrun', '--script', 'context', '--nonstopmode, path] return ['mtxrun', '--script', 'context', '--nonstopmode', path]
enddef enddef
context.ConTeXtTypeset("%", v:none, ConTeXtCustomCommand) context.ConTeXtTypeset("%", v:none, ConTeXtCustomCommand)

View File

@@ -84,7 +84,7 @@ METAFONT buffers, and it is set to 0 by default in MetaPost buffers.
Define additional keywords that end indented blocks. For instance, if you Define additional keywords that end indented blocks. For instance, if you
define: define:
> >
g:mp_end_tag = ['\<endfoo\>'] g:mp_close_tag = ['\<endfoo\>']
< <
any line starting with `endfoo` will be de-indented compared to its previous any line starting with `endfoo` will be de-indented compared to its previous
line. line.

View File

@@ -1,4 +1,4 @@
*gui.txt* For Vim version 9.0. Last change: 2022 Nov 17 *gui.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -95,11 +95,11 @@ terminal version.
Recommended place for your personal GUI initializations: Recommended place for your personal GUI initializations:
Unix $HOME/.gvimrc or $HOME/.vim/gvimrc Unix $HOME/.gvimrc or $HOME/.vim/gvimrc
Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc
or $VIM/_gvimrc or $VIM/_gvimrc
Amiga s:.gvimrc, home:.gvimrc, home:vimfiles:gvimrc Amiga s:.gvimrc, home:.gvimrc, home:vimfiles:gvimrc
or $VIM/.gvimrc or $VIM/.gvimrc
Haiku $HOME/config/settings/vim/gvimrc Haiku $HOME/config/settings/vim/gvimrc
The personal initialization files are searched in the order specified above The personal initialization files are searched in the order specified above
and only the first one that is found is read. and only the first one that is found is read.
@@ -856,7 +856,7 @@ Example for debugger tools: >
nnoremenu 1.20 WinBar.Next :Next<CR> nnoremenu 1.20 WinBar.Next :Next<CR>
nnoremenu 1.30 WinBar.Finish :Finish<CR> nnoremenu 1.30 WinBar.Finish :Finish<CR>
nnoremenu 1.40 WinBar.Cont :Continue<CR> nnoremenu 1.40 WinBar.Cont :Continue<CR>
< < *hl-ToolbarLine* *hl-ToolbarButton*
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups. The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
When splitting the window the window toolbar is not copied to the new window. When splitting the window the window toolbar is not copied to the new window.
@@ -1181,7 +1181,7 @@ When 'guifont' is set and a valid font is found in it and 'guifontwide' is
empty Vim will attempt to find a matching double-width font and set empty Vim will attempt to find a matching double-width font and set
'guifontwide' to it. 'guifontwide' to it.
GTK+ GUI only: *guifontwide_gtk* GTK+ GUI only: *guifontwide_gtk*
If set and valid, 'guifontwide' is always used for double width characters, If set and valid, 'guifontwide' is always used for double width characters,
even if 'encoding' is not set to "utf-8". even if 'encoding' is not set to "utf-8".

View File

@@ -17,7 +17,7 @@ Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
Other relevant documentation: Other relevant documentation:
|gui.txt| For generic items of the GUI. |gui.txt| For generic items of the GUI.
|os_win32.txt| For Win32 specific items. |os_win32.txt| For Win32 specific items.
============================================================================== ==============================================================================

View File

@@ -101,7 +101,7 @@ Help on help files *helphelp*
find a tag in a file with the same language as the find a tag in a file with the same language as the
current file. See |help-translated|. current file. See |help-translated|.
*:helpc* *:helpclose* *:helpc* *:helpclose*
:helpc[lose] Close one help window, if there is one. :helpc[lose] Close one help window, if there is one.
Vim will try to restore the window layout (including Vim will try to restore the window layout (including
cursor position) to the same layout it was before cursor position) to the same layout it was before

View File

@@ -857,7 +857,7 @@ You can test what Python version is available with: >
if has('python') if has('python')
echo 'there is Python 2.x' echo 'there is Python 2.x'
endif endif
if has('python3') if has('python3')
echo 'there is Python 3.x' echo 'there is Python 3.x'
endif endif
@@ -874,7 +874,7 @@ python support: >
echo 'Python 2.x dynamically loaded' echo 'Python 2.x dynamically loaded'
endif endif
endif endif
if has('python3_compiled') if has('python3_compiled')
echo 'compiled with Python 3.x support' echo 'compiled with Python 3.x support'
if has('python3_dynamic') if has('python3_dynamic')
echo 'Python 3.x dynamically loaded' echo 'Python 3.x dynamically loaded'

View File

@@ -1,4 +1,4 @@
*index.txt* For Vim version 9.0. Last change: 2022 Oct 15 *index.txt* For Vim version 9.0. Last change: 2023 Jan 09
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -236,7 +236,7 @@ tag char note action in Normal mode ~
|CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode (no-op) |CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode (no-op)
|CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode' |CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
CTRL-\ a - z reserved for extensions CTRL-\ a - z reserved for extensions
CTRL-\ others not used CTRL-\ others not used
|CTRL-]| CTRL-] :ta to ident under cursor |CTRL-]| CTRL-] :ta to ident under cursor
|CTRL-^| CTRL-^ edit Nth alternate file (equivalent to |CTRL-^| CTRL-^ edit Nth alternate file (equivalent to
":e #N") ":e #N")
@@ -247,7 +247,7 @@ tag char note action in Normal mode ~
2 filter Nmove text through the {filter} 2 filter Nmove text through the {filter}
command command
|!!| !!{filter} 2 filter N lines through the {filter} command |!!| !!{filter} 2 filter N lines through the {filter} command
|quote| "{register} use {register} for next delete, yank or put |quote| "{register} use {register} for next delete, yank or put
({.%#:} only work with put) ({.%#:} only work with put)
|#| # 1 search backward for the Nth occurrence of |#| # 1 search backward for the Nth occurrence of
the ident under the cursor the ident under the cursor
@@ -1239,6 +1239,7 @@ tag command action ~
|:checkpath| :che[ckpath] list included files |:checkpath| :che[ckpath] list included files
|:checktime| :checkt[ime] check timestamp of loaded buffers |:checktime| :checkt[ime] check timestamp of loaded buffers
|:chistory| :chi[story] list the error lists |:chistory| :chi[story] list the error lists
|:class| :class start of a class specification
|:clast| :cla[st] go to the specified error, default last one |:clast| :cla[st] go to the specified error, default last one
|:clearjumps| :cle[arjumps] clear the jump list |:clearjumps| :cle[arjumps] clear the jump list
|:clist| :cl[ist] list all errors |:clist| :cl[ist] list all errors
@@ -1313,6 +1314,7 @@ tag command action ~
|:else| :el[se] part of an :if command |:else| :el[se] part of an :if command
|:elseif| :elsei[f] part of an :if command |:elseif| :elsei[f] part of an :if command
|:emenu| :em[enu] execute a menu by name |:emenu| :em[enu] execute a menu by name
|:endclass| :endclass end of a class specification
|:enddef| :enddef end of a user function started with :def |:enddef| :enddef end of a user function started with :def
|:endif| :en[dif] end previous :if |:endif| :en[dif] end previous :if
|:endfor| :endfo[r] end previous :for |:endfor| :endfo[r] end previous :for
@@ -1529,6 +1531,7 @@ tag command action ~
|:ptprevious| :ptp[revious] |:tprevious| in preview window |:ptprevious| :ptp[revious] |:tprevious| in preview window
|:ptrewind| :ptr[ewind] |:trewind| in preview window |:ptrewind| :ptr[ewind] |:trewind| in preview window
|:ptselect| :pts[elect] |:tselect| and show tag in preview window |:ptselect| :pts[elect] |:tselect| and show tag in preview window
|:public| :public prefix for a class or object member
|:put| :pu[t] insert contents of register in the text |:put| :pu[t] insert contents of register in the text
|:pwd| :pw[d] print current directory |:pwd| :pw[d] print current directory
|:py3| :py3 execute Python 3 command |:py3| :py3 execute Python 3 command
@@ -1639,6 +1642,7 @@ tag command action ~
|:startinsert| :star[tinsert] start Insert mode |:startinsert| :star[tinsert] start Insert mode
|:startgreplace| :startg[replace] start Virtual Replace mode |:startgreplace| :startg[replace] start Virtual Replace mode
|:startreplace| :startr[eplace] start Replace mode |:startreplace| :startr[eplace] start Replace mode
|:static| :static prefix for a class member or function
|:stopinsert| :stopi[nsert] stop Insert mode |:stopinsert| :stopi[nsert] stop Insert mode
|:stjump| :stj[ump] do ":tjump" and split window |:stjump| :stj[ump] do ":tjump" and split window
|:stselect| :sts[elect] do ":tselect" and split window |:stselect| :sts[elect] do ":tselect" and split window

View File

@@ -877,7 +877,7 @@ Groß): >
func Thesaur(findstart, base) func Thesaur(findstart, base)
if a:findstart if a:findstart
return searchpos('\<', 'bnW', line('.'))[1] - 1 return searchpos('\<', 'bnW', line('.'))[1] - 1
endif endif
let res = [] let res = []
let h = '' let h = ''
@@ -1118,8 +1118,8 @@ cursor column will be replaced with the matches. If the returned value is
larger than the cursor column, the cursor column is used. larger than the cursor column, the cursor column is used.
Negative return values: Negative return values:
-2 To cancel silently and stay in completion mode. -2 To cancel silently and stay in completion mode.
-3 To cancel silently and leave completion mode. -3 To cancel silently and leave completion mode.
Another negative value: completion starts at the cursor column Another negative value: completion starts at the cursor column
On the second invocation the arguments are: On the second invocation the arguments are:
@@ -1176,7 +1176,7 @@ items:
item with the same word is already present. item with the same word is already present.
empty when non-zero this match will be added even when it is empty when non-zero this match will be added even when it is
an empty string an empty string
user_data custom data which is associated with the item and user_data custom data which is associated with the item and
available in |v:completed_item|; it can be any type; available in |v:completed_item|; it can be any type;
defaults to an empty string defaults to an empty string

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 9.0. Last change: 2022 Dec 01 *map.txt* For Vim version 9.0. Last change: 2023 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -20,9 +20,10 @@ manual.
1.8 Examples |map-examples| 1.8 Examples |map-examples|
1.9 Using mappings |map-typing| 1.9 Using mappings |map-typing|
1.10 Mapping alt-keys |:map-alt-keys| 1.10 Mapping alt-keys |:map-alt-keys|
1.11 Mapping in modifyOtherKeys mode |modifyOtherKeys| 1.11 Mapping meta-keys |:map-meta-keys|
1.12 Mapping with Kitty keyboard protocol |kitty-keyboard-protocol| 1.12 Mapping in modifyOtherKeys mode |modifyOtherKeys|
1.13 Mapping an operator |:map-operator| 1.13 Mapping with Kitty keyboard protocol |kitty-keyboard-protocol|
1.14 Mapping an operator |:map-operator|
2. Abbreviations |abbreviations| 2. Abbreviations |abbreviations|
3. Local mappings and functions |script-local| 3. Local mappings and functions |script-local|
4. User-defined commands |user-commands| 4. User-defined commands |user-commands|
@@ -777,8 +778,8 @@ To avoid mapping of the characters you type in insert or Command-line mode,
type a CTRL-V first. The mapping in Insert mode is disabled if the 'paste' type a CTRL-V first. The mapping in Insert mode is disabled if the 'paste'
option is on. option is on.
*map-error* *map-error*
Note that when an error is encountered (that causes an error message or beep) Note that when an error is encountered (that causes an error message or might
the rest of the mapping is not executed. This is Vi-compatible. cause a beep) the rest of the mapping is not executed. This is Vi-compatible.
Note that the second character (argument) of the commands @zZtTfF[]rm'`"v Note that the second character (argument) of the commands @zZtTfF[]rm'`"v
and CTRL-X is not mapped. This was done to be able to use all the named and CTRL-X is not mapped. This was done to be able to use all the named
@@ -794,8 +795,8 @@ otherwise you would not be able to use those commands anymore. Here are a few
suggestions: suggestions:
- Function keys <F2>, <F3>, etc.. Also the shifted function keys <S-F1>, - Function keys <F2>, <F3>, etc.. Also the shifted function keys <S-F1>,
<S-F2>, etc. Note that <F1> is already used for the help command. <S-F2>, etc. Note that <F1> is already used for the help command.
- Meta-keys (with the ALT key pressed). Depending on your keyboard accented - Any key with the Alt or Meta key pressed. Depending on your keyboard
characters may be used as well. |:map-alt-keys| accented characters may be used as well. |:map-alt-keys|
- Use the '_' or ',' character and then any other character. The "_" and "," - Use the '_' or ',' character and then any other character. The "_" and ","
commands do exist in Vim (see |_| and |,|), but you probably never use them. commands do exist in Vim (see |_| and |,|), but you probably never use them.
- Use a key that is a synonym for another command. For example: CTRL-P and - Use a key that is a synonym for another command. For example: CTRL-P and
@@ -844,7 +845,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
you type slowly, or your system is slow, reset the 'timeout' option. Then you you type slowly, or your system is slow, reset the 'timeout' option. Then you
might want to set the 'ttimeout' option. might want to set the 'ttimeout' option.
*map-precedence* *map-precedence*
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
global mappings. When a buffer-local mapping is the same as a global mapping, global mappings. When a buffer-local mapping is the same as a global mapping,
Vim will use the buffer-local mapping. In addition, Vim will use a complete Vim will use the buffer-local mapping. In addition, Vim will use a complete
@@ -922,12 +923,19 @@ in the original Vi, you would get back the text before the first undo).
1.10 MAPPING ALT-KEYS *:map-alt-keys* 1.10 MAPPING ALT-KEYS *:map-alt-keys*
For a readable mapping command the <A-k> form can be used. Note that <A-k>
and <A-K> are different, the latter will use an upper case letter. Actually,
<A-K> and <A-S-K> are the same. Instead of "A" you can use "M". If you have
an actual Meta modifier key, please see |:map-meta-keys|.
In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
always work. But in a terminal Vim gets a sequence of bytes and has to figure always work. But in a terminal Vim gets a sequence of bytes and has to figure
out whether ALT was pressed or not. out whether ALT was pressed or not.
If the terminal supports the modifyOtherKeys mode and it has been enabled, If the terminal supports the modifyOtherKeys mode and it has been enabled,
then Vim can recognize more key combinations, see |modifyOtherKeys| below. then Vim can recognize more key combinations, see |modifyOtherKeys| below.
The Kitty keyboard protocol works in a similar way, see
|kitty-keyboard-protocol|.
By default Vim assumes that pressing the ALT key sets the 8th bit of a typed By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
character. Most decent terminals can work that way, such as xterm, aterm and character. Most decent terminals can work that way, such as xterm, aterm and
@@ -966,7 +974,21 @@ on the terminal; that's a good last resource in case you want to send ESC when
using other applications but not when inside Vim. using other applications but not when inside Vim.
1.11 MAPPING IN modifyOtherKeys mode *modifyOtherKeys* 1.11 MAPPING META-KEYS *:map-meta-keys*
Mapping keys with the Meta modifier works very similar to using the Alt key.
What key on your keyboard produces the Meta modifier depends on your keyboard
and configuration.
Note that mapping <M-a> actually is for using the Alt key. That can be
confusing! It cannot be changed, it would not be backwards compatible.
For the Meta modifier the "T" character is used. For example, to map Meta-b
in Insert mode: >
:imap <T-b> terrible
1.12 MAPPING IN modifyOtherKeys mode *modifyOtherKeys*
Xterm and a few other terminals can be put in a mode where keys with modifiers Xterm and a few other terminals can be put in a mode where keys with modifiers
are sent with a special escape code. Vim recognizes these codes and can then are sent with a special escape code. Vim recognizes these codes and can then
@@ -1028,7 +1050,7 @@ 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. Insert mode to avoid every key with a modifier causing Insert mode to end.
1.12 MAPPING WITH KITTY KEYBOARD PROTOCOL *kitty-keyboard-protocol* 1.13 MAPPING WITH KITTY KEYBOARD PROTOCOL *kitty-keyboard-protocol*
If the value of 'term' contains "kitty" then Vim will send out an escape If the value of 'term' contains "kitty" then Vim will send out an escape
sequence to enable the Kitty keyboard protocol. This can be changed with the sequence to enable the Kitty keyboard protocol. This can be changed with the
@@ -1051,11 +1073,11 @@ translated). The meaning of {value}:
On protocol is used On protocol is used
Disabled protocol was used but expected to have been disabled Disabled protocol was used but expected to have been disabled
by 't_TE' by 't_TE'
Cleared protocol expected to have beeen disabled by 't_TE', Cleared protocol expected to have been disabled by 't_TE',
previous state is unknown previous state is unknown
1.13 MAPPING AN OPERATOR *:map-operator* 1.14 MAPPING AN OPERATOR *:map-operator*
An operator is used before a {motion} command. To define your own operator An operator is used before a {motion} command. To define your own operator
you must create a mapping that first sets the 'operatorfunc' option and then you must create a mapping that first sets the 'operatorfunc' option and then
@@ -1195,7 +1217,7 @@ non-id The "non-id" type ends in a non-keyword character, the other
Examples of strings that cannot be abbreviations: "a.b", "#def", "a b", "_$r" Examples of strings that cannot be abbreviations: "a.b", "#def", "a b", "_$r"
An abbreviation is only recognized when you type a non-keyword character. An abbreviation is only recognized when you type a non-keyword character.
This can also be the <Esc> that ends insert mode or the <CR> that ends a This can also be the <Esc> that ends Insert mode or the <CR> that ends a
command. The non-keyword character which ends the abbreviation is inserted command. The non-keyword character which ends the abbreviation is inserted
after the expanded abbreviation. An exception to this is the character <C-]>, after the expanded abbreviation. An exception to this is the character <C-]>,
which is used to expand an abbreviation without inserting any extra which is used to expand an abbreviation without inserting any extra
@@ -1399,12 +1421,13 @@ this, they can be made local to the script.
*<SID>* *<SNR>* *E81* *<SID>* *<SNR>* *E81*
The string "<SID>" can be used in a mapping or menu. This requires that the The string "<SID>" can be used in a mapping or menu. This requires that the
'<' flag is not present in 'cpoptions'. '<' flag is not present in 'cpoptions'. This is useful if you have a
script-local function that you want to call from a mapping in the same script.
When executing the map command, Vim will replace "<SID>" with the special When executing the map command, Vim will replace "<SID>" with the special
key code <SNR>, followed by a number that's unique for the script, and an key code <SNR>, followed by a number that's unique for the script, and an
underscore. Example: > underscore. Example: >
:map <SID>Add :map <SID>Add
could define a mapping "<SNR>23_Add". would define a mapping "<SNR>23_Add".
When defining a function in a script, "s:" can be prepended to the name to When defining a function in a script, "s:" can be prepended to the name to
make it local to the script (in |Vim9| script functions without a prefix are make it local to the script (in |Vim9| script functions without a prefix are
@@ -1706,7 +1729,7 @@ by default correspond to the current line, last line and the whole buffer,
relate to arguments, (loaded) buffers, windows or tab pages. relate to arguments, (loaded) buffers, windows or tab pages.
Possible values are (second column is the short name used in listing): Possible values are (second column is the short name used in listing):
-addr=lines Range of lines (this is the default for -range) -addr=lines Range of lines (this is the default for -range)
-addr=arguments arg Range for arguments -addr=arguments arg Range for arguments
-addr=buffers buf Range for buffers (also not loaded buffers) -addr=buffers buf Range for buffers (also not loaded buffers)
-addr=loaded_buffers load Range for loaded buffers -addr=loaded_buffers load Range for loaded buffers

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 9.0. Last change: 2022 Nov 30 *options.txt* For Vim version 9.0. Last change: 2023 Feb 17
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,6 +34,8 @@ achieve special effects. These options come in three forms:
key codes are not shown, because they are generated key codes are not shown, because they are generated
internally and can't be changed. Changing the terminal internally and can't be changed. Changing the terminal
codes in the GUI is not useful either... codes in the GUI is not useful either...
The options have the form t_AB, see
|terminal-options|.
:se[t]! termcap Idem, but don't use multiple columns. :se[t]! termcap Idem, but don't use multiple columns.
@@ -1249,7 +1251,7 @@ A jump table for the options with a short description can be found at |Q_op|.
\ ' on word "' .. v:beval_text .. '"' \ ' on word "' .. v:beval_text .. '"'
endfunction endfunction
set bexpr=MyBalloonExpr() set bexpr=MyBalloonExpr()
set ballooneval set ballooneval balloonevalterm
< <
Also see |balloon_show()|, it can be used if the content of the balloon Also see |balloon_show()|, it can be used if the content of the balloon
is to be fetched asynchronously. In that case evaluating is to be fetched asynchronously. In that case evaluating
@@ -1545,7 +1547,7 @@ A jump table for the options with a short description can be found at |Q_op|.
case mapping, the current locale is not effective. case mapping, the current locale is not effective.
This probably only matters for Turkish. This probably only matters for Turkish.
*'cdhome'* *'cdh'* *'cdhome'* *'cdh'* *'nocdhome'* *'nocdh'*
'cdhome' 'cdh' boolean (default: off) 'cdhome' 'cdh' boolean (default: off)
global global
When on, |:cd|, |:tcd| and |:lcd| without an argument changes the When on, |:cd|, |:tcd| and |:lcd| without an argument changes the
@@ -1897,7 +1899,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'allowrevins' + off no CTRL-_ command 'allowrevins' + off no CTRL-_ command
'antialias' + off don't use antialiased fonts 'antialias' + off don't use antialiased fonts
'arabic' + off reset arabic-related options 'arabic' + off reset arabic-related options
'arabicshape' + on correct character shapes 'arabicshape' + on correct character shapes
'backspace' + "" normal backspace 'backspace' + "" normal backspace
'backup' + off no backup file 'backup' + off no backup file
@@ -4936,6 +4938,12 @@ A jump table for the options with a short description can be found at |Q_op|.
CSI ?u request kitty keyboard protocol state CSI ?u request kitty keyboard protocol state
CSI >c request the termresponse CSI >c request the termresponse
If you notice problems, such as characters being displayed that
disappear after `CTRL-L`, you might want to try making this option
empty. Then set the 'term' option to have it take effect: >
set keyprotocol=
let &term = &term
<
*'keywordprg'* *'kp'* *'keywordprg'* *'kp'*
'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help", 'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help",
@@ -5193,8 +5201,8 @@ A jump table for the options with a short description can be found at |Q_op|.
are left blank. are left blank.
*lcs-multispace* *lcs-multispace*
multispace:c... multispace:c...
One or more characters to use cyclically to show for One or more characters to use cyclically to show for
multiple consecutive spaces. Overrides the "space" multiple consecutive spaces. Overrides the "space"
setting, except for single spaces. When omitted, the setting, except for single spaces. When omitted, the
"space" setting is used. For example, "space" setting is used. For example,
`:set listchars=multispace:---+` shows ten consecutive `:set listchars=multispace:---+` shows ten consecutive
@@ -5657,7 +5665,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'mousemodel' option is set by the |:behave| command. The 'mousemodel' option is set by the |:behave| command.
*'mousemoveevent'* *'mousemev'* *'mousemoveevent'* *'mousemev'* *'nomousemoveevent'* *'nomousemev'*
'mousemoveevent' 'mousemev' boolean (default off) 'mousemoveevent' 'mousemev' boolean (default off)
global global
{only works in the GUI} {only works in the GUI}
@@ -7112,51 +7120,55 @@ A jump table for the options with a short description can be found at |Q_op|.
*'shortmess'* *'shm'* *'shortmess'* *'shm'*
'shortmess' 'shm' string (Vim default "filnxtToOS", Vi default: "S", 'shortmess' 'shm' string (Vim default "filnxtToOS", Vi default: "S",
POSIX default: "AS") POSIX default: "AS")
global global *E1336*
This option helps to avoid all the |hit-enter| prompts caused by file This option helps to avoid all the |hit-enter| prompts caused by file
messages, for example with CTRL-G, and to avoid some other messages. messages, for example with CTRL-G, and to avoid some other messages.
It is a list of flags: It is a list of flags:
flag meaning when present ~ flag meaning when present ~
f use "(3 of 5)" instead of "(file 3 of 5)" f use "(3 of 5)" instead of "(file 3 of 5)" *shm-f*
i use "[noeol]" instead of "[Incomplete last line]" i use "[noeol]" instead of "[Incomplete last line]" *shm-i*
l use "999L, 888B" instead of "999 lines, 888 bytes" l use "999L, 888B" instead of "999 lines, 888 bytes" *shm-l*
m use "[+]" instead of "[Modified]" m use "[+]" instead of "[Modified]" *shm-m*
n use "[New]" instead of "[New File]" n use "[New]" instead of "[New File]" *shm-n*
r use "[RO]" instead of "[readonly]" r use "[RO]" instead of "[readonly]" *shm-r*
w use "[w]" instead of "written" for file write message w use "[w]" instead of "written" for file write message *shm-w*
and "[a]" instead of "appended" for ':w >> file' command and "[a]" instead of "appended" for ':w >> file' command
x use "[dos]" instead of "[dos format]", "[unix]" instead of x use "[dos]" instead of "[dos format]", "[unix]" *shm-x*
"[unix format]" and "[mac]" instead of "[mac format]". instead of "[unix format]" and "[mac]" instead of "[mac
a all of the above abbreviations format]"
a all of the above abbreviations *shm-a*
o overwrite message for writing a file with subsequent message o overwrite message for writing a file with subsequent *shm-o*
for reading a file (useful for ":wn" or when 'autowrite' on) message for reading a file (useful for ":wn" or when
O message for reading a file overwrites any previous message. 'autowrite' on)
Also for quickfix message (e.g., ":cn"). O message for reading a file overwrites any previous *shm-O*
s don't give "search hit BOTTOM, continuing at TOP" or "search message; also for quickfix message (e.g., ":cn")
hit TOP, continuing at BOTTOM" messages; when using the search s don't give "search hit BOTTOM, continuing at TOP" or *shm-s*
count do not show "W" after the count message (see S below) "search hit TOP, continuing at BOTTOM" messages; when using
t truncate file message at the start if it is too long to fit the search count do not show "W" after the count message (see
on the command-line, "<" will appear in the left most column. S below)
Ignored in Ex mode. t truncate file message at the start if it is too long *shm-t*
T truncate other messages in the middle if they are too long to to fit on the command-line, "<" will appear in the left most
fit on the command line. "..." will appear in the middle. column; ignored in Ex mode
Ignored in Ex mode. T truncate other messages in the middle if they are too *shm-T*
W don't give "written" or "[w]" when writing a file long to fit on the command line; "..." will appear in the
A don't give the "ATTENTION" message when an existing swap file middle; ignored in Ex mode
is found. W don't give "written" or "[w]" when writing a file *shm-W*
I don't give the intro message when starting Vim |:intro|. A don't give the "ATTENTION" message when an existing *shm-A*
c don't give |ins-completion-menu| messages. For example, swap file is found
"-- XXX completion (YYY)", "match 1 of 2", "The only match", I don't give the intro message when starting Vim, *shm-I*
"Pattern not found", "Back at original", etc. see |:intro|
C don't give messages while scanning for ins-completion items, c don't give |ins-completion-menu| messages; for *shm-c*
for instance "scanning tags" example, "-- XXX completion (YYY)", "match 1 of 2", "The only
q use "recording" instead of "recording @a" match", "Pattern not found", "Back at original", etc.
F don't give the file info when editing a file, like `:silent` C don't give messages while scanning for ins-completion *shm-C*
was used for the command; note that this also affects messages items, for instance "scanning tags"
from autocommands q use "recording" instead of "recording @a" *shm-q*
S do not show search count message when searching, e.g. F don't give the file info when editing a file, like *shm-F*
"[1/5]" `:silent` was used for the command; note that this also
affects messages from autocommands
S do not show search count message when searching, e.g. *shm-S*
"[1/5]"
This gives you the opportunity to avoid that a change between buffers This gives you the opportunity to avoid that a change between buffers
requires you to hit <Enter>, but still gives as useful a message as requires you to hit <Enter>, but still gives as useful a message as
@@ -7216,9 +7228,26 @@ A jump table for the options with a short description can be found at |Q_op|.
- When selecting more than one line, the number of lines. - When selecting more than one line, the number of lines.
- When selecting a block, the size in screen characters: - When selecting a block, the size in screen characters:
{lines}x{columns}. {lines}x{columns}.
This information can be displayed in an alternative location using the
'showcmdloc' option.
NOTE: This option is set to the Vi default value when 'compatible' is NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset. set and to the Vim default value when 'compatible' is reset.
*'showcmdloc'* *'sloc'*
'showcmdloc' 'sloc' string (default "last")
global
This option can be used to display the (partially) entered command in
another location. Possible values are:
last Last line of the screen (default).
statusline Status line of the current window.
tabline First line of the screen if 'showtabline' is enabled.
Setting this option to "statusline" or "tabline" means that these will
be redrawn whenever the command changes, which can be on every key
pressed.
The %S 'statusline' item can be used in 'statusline' or 'tabline' to
place the text. Without a custom 'statusline' or 'tabline' it will be
displayed in a convenient location.
*'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'* *'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'*
'showfulltag' 'sft' boolean (default off) 'showfulltag' 'sft' boolean (default off)
global global
@@ -7316,9 +7345,9 @@ A jump table for the options with a short description can be found at |Q_op|.
{not available when compiled without the |+signs| {not available when compiled without the |+signs|
feature} feature}
Whether or not to draw the signcolumn. Valid values are: Whether or not to draw the signcolumn. Valid values are:
"auto" only when there is a sign to display "auto" only when there is a sign to display
"no" never "no" never
"yes" always "yes" always
"number" display signs in the 'number' column. If the number "number" display signs in the 'number' column. If the number
column is not present, then behaves like "auto". column is not present, then behaves like "auto".
@@ -7657,6 +7686,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When there is error while evaluating the option then it will be made When there is error while evaluating the option then it will be made
empty to avoid further errors. Otherwise screen updating would loop. empty to avoid further errors. Otherwise screen updating would loop.
When the result contains unprintable characters the result is
unpredictable.
Note that the only effect of 'ruler' when this option is set (and Note that the only effect of 'ruler' when this option is set (and
'laststatus' is 2) is controlling the output of |CTRL-G|. 'laststatus' is 2) is controlling the output of |CTRL-G|.
@@ -7716,6 +7747,7 @@ A jump table for the options with a short description can be found at |Q_op|.
P S Percentage through file of displayed window. This is like the P S Percentage through file of displayed window. This is like the
percentage described for 'ruler'. Always 3 in length, unless percentage described for 'ruler'. Always 3 in length, unless
translated. translated.
S S 'showcmd' content, see 'showcmdloc'.
a S Argument list status as in default title. ({current} of {max}) a S Argument list status as in default title. ({current} of {max})
Empty if the argument file count is zero or one. Empty if the argument file count is zero or one.
{ NF Evaluate expression between '%{' and '}' and substitute result. { NF Evaluate expression between '%{' and '}' and substitute result.
@@ -7744,7 +7776,10 @@ A jump table for the options with a short description can be found at |Q_op|.
mark. This information is used for mouse clicks. mark. This information is used for mouse clicks.
< - Where to truncate line if too long. Default is at the start. < - Where to truncate line if too long. Default is at the start.
No width fields allowed. No width fields allowed.
= - Separation point between left and right aligned items. = - Separation point between alignment sections. Each section will
be separated by an equal number of spaces. With one %= what
comes after it will be right-aligned. With two %= there is a
middle part, with white space left and right of it.
No width fields allowed. No width fields allowed.
# - Set highlight group. The name must follow and then a # again. # - Set highlight group. The name must follow and then a # again.
Thus use %#HLname# for highlight group HLname. The same Thus use %#HLname# for highlight group HLname. The same
@@ -7752,8 +7787,8 @@ A jump table for the options with a short description can be found at |Q_op|.
windows. windows.
* - Set highlight group to User{N}, where {N} is taken from the * - Set highlight group to User{N}, where {N} is taken from the
minwid field, e.g. %1*. Restore normal highlight with %* or %0*. minwid field, e.g. %1*. Restore normal highlight with %* or %0*.
The difference between User{N} and StatusLine will be applied The difference between User{N} and StatusLine will be applied to
to StatusLineNC for the statusline of non-current windows. StatusLineNC for the statusline of non-current windows.
The number N must be between 1 and 9. See |hl-User1..9| The number N must be between 1 and 9. See |hl-User1..9|
When displaying a flag, Vim removes the leading comma, if any, when When displaying a flag, Vim removes the leading comma, if any, when
@@ -8199,7 +8234,7 @@ A jump table for the options with a short description can be found at |Q_op|.
:set encoding=utf-8 :set encoding=utf-8
< You need to do this when your system has no locale support for UTF-8. < You need to do this when your system has no locale support for UTF-8.
*'termguicolors'* *'tgc'* *E954* *'termguicolors'* *'tgc'* *'notermguicolors'* *'notgc'* *E954*
'termguicolors' 'tgc' boolean (default off) 'termguicolors' 'tgc' boolean (default off)
global global
{not available when compiled without the {not available when compiled without the
@@ -8647,6 +8682,9 @@ A jump table for the options with a short description can be found at |Q_op|.
set to a name that starts with "xterm", "mlterm", "screen", "tmux", set to a name that starts with "xterm", "mlterm", "screen", "tmux",
"st" (full match only), "st-" or "stterm", and 'ttymouse' is not set "st" (full match only), "st-" or "stterm", and 'ttymouse' is not set
already. already.
If the terminfo/termcap entry "XM" exists and the first number is
"1006" then 'ttymouse' will be set to "sgr". This works for many
modern terminals.
Additionally, if vim is compiled with the |+termresponse| feature and Additionally, if vim is compiled with the |+termresponse| feature and
|t_RV| is set to the escape sequence to request the xterm version |t_RV| is set to the escape sequence to request the xterm version
number, more intelligent detection is done. number, more intelligent detection is done.

View File

@@ -10,7 +10,7 @@ This file contains the particulars for the z/OS UNIX version of Vim.
2. Putty and Colors |zOS-PuTTY| 2. Putty and Colors |zOS-PuTTY|
3. Motif Problems |zOS-Motif| 3. Motif Problems |zOS-Motif|
4. Bugs |zOS-Bugs| 4. Bugs |zOS-Bugs|
5. Limitations |zOS-limitations| 5. Limitations |zOS-limitations|
6. Open source on z/OS UNIX |zOS-open-source| 6. Open source on z/OS UNIX |zOS-open-source|
Contributors: ~ Contributors: ~
@@ -75,7 +75,7 @@ There is no solution for this yet.
this occurs in both the terminal and gui versions. this occurs in both the terminal and gui versions.
============================================================================== ==============================================================================
5. Limitations *OS390-limitations* *zOS-limitations* 5. Limitations *OS390-limitations* *zOS-limitations*
- No binary search in tag files. - No binary search in tag files.
The program /bin/sort sorts by ASCII value by default. This program is The program /bin/sort sorts by ASCII value by default. This program is

View File

@@ -203,7 +203,7 @@ You can check that everything is at the right place with the :version command.
Example LOGIN.COM: > Example LOGIN.COM: >
$ define/nolog VIM DKA0:[UTIL.VIM81] $ define/nolog VIM DKA0:[UTIL.VIM81]
$ vi*m :== mcr VIM:VIM.EXE $ vi*m :== mcr VIM:VIM.EXE
$ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40 $ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40
$ set disp/create/node=192.168.10.202/trans=tcpip $ set disp/create/node=192.168.10.202/trans=tcpip

View File

@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 9.0. Last change: 2022 Sep 24 *pattern.txt* For Vim version 9.0. Last change: 2023 Feb 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -101,6 +101,8 @@ g# Like "#", but don't put "\<" and "\>" around the word.
*gd* *gd*
gd Goto local Declaration. When the cursor is on a local gd Goto local Declaration. When the cursor is on a local
variable, this command will jump to its declaration. variable, this command will jump to its declaration.
This was made to work for C code, in other languages
it may not work well.
First Vim searches for the start of the current First Vim searches for the start of the current
function, just like "[[". If it is not found the function, just like "[[". If it is not found the
search stops in line 1. If it is found, Vim goes back search stops in line 1. If it is found, Vim goes back
@@ -1142,21 +1144,21 @@ x A single character, with no special meaning, matches itself
are supported: are supported:
Name Func Contents ~ Name Func Contents ~
*[:alnum:]* [:alnum:] isalnum ASCII letters and digits *[:alnum:]* [:alnum:] isalnum ASCII letters and digits
*[:alpha:]* [:alpha:] isalpha ASCII letters *[:alpha:]* [:alpha:] isalpha ASCII letters
*[:blank:]* [:blank:] space and tab *[:blank:]* [:blank:] space and tab
*[:cntrl:]* [:cntrl:] iscntrl ASCII control characters *[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
*[:digit:]* [:digit:] decimal digits '0' to '9' *[:digit:]* [:digit:] decimal digits '0' to '9'
*[:graph:]* [:graph:] isgraph ASCII printable characters excluding *[:graph:]* [:graph:] isgraph ASCII printable characters excluding
space space
*[:lower:]* [:lower:] (1) lowercase letters (all letters when *[:lower:]* [:lower:] (1) lowercase letters (all letters when
'ignorecase' is used) 'ignorecase' is used)
*[:print:]* [:print:] (2) printable characters including space *[:print:]* [:print:] (2) printable characters including space
*[:punct:]* [:punct:] ispunct ASCII punctuation characters *[:punct:]* [:punct:] ispunct ASCII punctuation characters
*[:space:]* [:space:] whitespace characters: space, tab, CR, *[:space:]* [:space:] whitespace characters: space, tab, CR,
NL, vertical tab, form feed NL, vertical tab, form feed
*[:upper:]* [:upper:] (3) uppercase letters (all letters when *[:upper:]* [:upper:] (3) uppercase letters (all letters when
'ignorecase' is used) 'ignorecase' is used)
*[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F *[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
*[:return:]* [:return:] the <CR> character *[:return:]* [:return:] the <CR> character
*[:tab:]* [:tab:] the <Tab> character *[:tab:]* [:tab:] the <Tab> character
*[:escape:]* [:escape:] the <Esc> character *[:escape:]* [:escape:] the <Esc> character

View File

@@ -24,7 +24,7 @@ get the latest versions of scripts listed therein from http://vim.sf.net/.
============================================================================== ==============================================================================
1. Contents *glvs-contents* *glvs* *getscript* 1. Contents *glvs-contents* *glvs* *getscript*
*GetLatestVimScripts* *GetLatestVimScripts*
1. Contents........................................: |glvs-contents| 1. Contents........................................: |glvs-contents|
2. GetLatestVimScripts -- Getting Started..........: |glvs-install| 2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
@@ -116,7 +116,7 @@ reflect the latest version of script(s) so downloaded.
============================================================================== ==============================================================================
4. GetLatestVimScripts Data File *getscript-data* *glvs-data* 4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
*:GetLatestVimScripts_dat* *:GetLatestVimScripts_dat*
The data file <GetLatestVimScripts.dat> must have for its first two lines The data file <GetLatestVimScripts.dat> must have for its first two lines
the following text: the following text:
> >
@@ -330,7 +330,7 @@ after/syntax/c.vim contained in it to overwrite a user's c.vim.
This variable holds the options to be used with the This variable holds the options to be used with the
g:GetLatestVimScripts_wget command. g:GetLatestVimScripts_wget command.
> >
g:GetLatestVimScripts_allowautoinstall g:GetLatestVimScripts_allowautoinstall
< default= 1 < default= 1
This variable indicates whether GetLatestVimScripts is allowed This variable indicates whether GetLatestVimScripts is allowed
to attempt to automatically install scripts. Furthermore, the to attempt to automatically install scripts. Furthermore, the

View File

@@ -1085,8 +1085,8 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab| <c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
- Makes Netrw go up one directory |netrw--| - Makes Netrw go up one directory |netrw--|
a Cycles between normal display, |netrw-a| a Cycles between normal display, |netrw-a|
hiding (suppress display of files matching g:netrw_list_hide) hiding (suppress display of files matching g:netrw_list_hide)
and showing (display only files which match g:netrw_list_hide) and showing (display only files which match g:netrw_list_hide)
cd Make browsing directory the current directory |netrw-cd| cd Make browsing directory the current directory |netrw-cd|
C Setting the editing window |netrw-C| C Setting the editing window |netrw-C|
d Make a directory |netrw-d| d Make a directory |netrw-d|
@@ -1118,7 +1118,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
mX Apply arbitrary shell command to marked files en bloc|netrw-mX| mX Apply arbitrary shell command to marked files en bloc|netrw-mX|
mz Compress/decompress marked files |netrw-mz| mz Compress/decompress marked files |netrw-mz|
o Enter the file/directory under the cursor in a new |netrw-o| o Enter the file/directory under the cursor in a new |netrw-o|
browser window. A horizontal split is used. browser window. A horizontal split is used.
O Obtain a file specified by cursor |netrw-O| O Obtain a file specified by cursor |netrw-O|
p Preview the file |netrw-p| p Preview the file |netrw-p|
P Browse in the previously used window |netrw-P| P Browse in the previously used window |netrw-P|
@@ -1134,7 +1134,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
u Change to recently-visited directory |netrw-u| u Change to recently-visited directory |netrw-u|
U Change to subsequently-visited directory |netrw-U| U Change to subsequently-visited directory |netrw-U|
v Enter the file/directory under the cursor in a new |netrw-v| v Enter the file/directory under the cursor in a new |netrw-v|
browser window. A vertical split is used. browser window. A vertical split is used.
x View file with an associated program |netrw-x| x View file with an associated program |netrw-x|
X Execute filename under cursor via |system()| |netrw-X| X Execute filename under cursor via |system()| |netrw-X|
@@ -2271,7 +2271,7 @@ Example:
... ...
MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files) (See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the global marked-file list) (uses the global marked-file list)
@@ -2620,7 +2620,7 @@ your browsing preferences. (see also: |netrw-settings|)
Used to change access permission for a file. Used to change access permission for a file.
*g:netrw_clipboard* =1 *g:netrw_clipboard* =1
By default, netrw will attempt to insure that By default, netrw will attempt to insure that
the clipboard's values will remain unchanged. the clipboard's values will remain unchanged.
However, some users report that they have However, some users report that they have
speed problems with this; consequently, this speed problems with this; consequently, this
@@ -2768,7 +2768,7 @@ your browsing preferences. (see also: |netrw-settings|)
escaped before applying glob() escaped before applying glob()
*g:netrw_gx* ="<cfile>" *g:netrw_gx* ="<cfile>"
This option controls how gx (|netrw-gx|) picks This option controls how gx (|netrw-gx|) picks
up the text under the cursor. See |expand()| up the text under the cursor. See |expand()|
for possibilities. for possibilities.
@@ -2834,11 +2834,11 @@ your browsing preferences. (see also: |netrw-settings|)
directory (|netrw-mt|, |netrw-mc|) directory (|netrw-mt|, |netrw-mc|)
*g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin
=' \c copy' Windows =' \c copy' Windows
Options for the |g:netrw_localcopycmd| Options for the |g:netrw_localcopycmd|
*g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows =expand("$COMSPEC") Windows
Copies directories to target directory. Copies directories to target directory.
(|netrw-mc|, |netrw-mt|) (|netrw-mc|, |netrw-mt|)
@@ -2864,7 +2864,7 @@ your browsing preferences. (see also: |netrw-settings|)
Options for |g:netrw_localmovecmd| Options for |g:netrw_localmovecmd|
*g:netrw_localrmdir* ="rmdir" Linux/Unix/MacOS/Cygwin *g:netrw_localrmdir* ="rmdir" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows =expand("$COMSPEC") Windows
Remove directory command (rmdir) Remove directory command (rmdir)
This variable is only used if your vim is This variable is only used if your vim is
earlier than 7.4 or if your vim doesn't earlier than 7.4 or if your vim doesn't
@@ -2900,10 +2900,10 @@ your browsing preferences. (see also: |netrw-settings|)
(see |'ballooneval'|) (see |'ballooneval'|)
*g:netrw_sizestyle* not defined: actual bytes (default) *g:netrw_sizestyle* not defined: actual bytes (default)
="b" : actual bytes (default) ="b" : actual bytes (default)
="h" : human-readable (ex. 5k, 4m, 3g) ="h" : human-readable (ex. 5k, 4m, 3g)
uses 1000 base uses 1000 base
="H" : human-readable (ex. 5K, 4M, 3G) ="H" : human-readable (ex. 5K, 4M, 3G)
uses 1024 base uses 1024 base
The long listing (|netrw-i|) and query-file The long listing (|netrw-i|) and query-file
maps (|netrw-qf|) will display file size maps (|netrw-qf|) will display file size
@@ -2951,7 +2951,7 @@ your browsing preferences. (see also: |netrw-settings|)
default: "NETRWSERVER" default: "NETRWSERVER"
*g:netrw_sort_by* sort by "name", "time", "size", or *g:netrw_sort_by* sort by "name", "time", "size", or
"exten". "exten".
default: "name" default: "name"
*g:netrw_sort_direction* sorting direction: "normal" or "reverse" *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
@@ -3008,7 +3008,7 @@ your browsing preferences. (see also: |netrw-settings|)
.vim/after/syntax/netrw.vim. .vim/after/syntax/netrw.vim.
< The netrwGray highlighting is set up by < The netrwGray highlighting is set up by
netrw when > netrw when >
* netrwGray has not been previously * netrwGray has not been previously
defined defined
* the gui is running * the gui is running
< As an example, I myself use a dark-background < As an example, I myself use a dark-background
@@ -3266,7 +3266,7 @@ If there are marked files: (see |netrw-mf|)
name, applying that substitute, and renaming each file to the result. name, applying that substitute, and renaming each file to the result.
As an example : > As an example : >
mr [query: reply with *.c] mr [query: reply with *.c]
R [query: reply with s/^\(.*\)\.c$/\1.cpp/] R [query: reply with s/^\(.*\)\.c$/\1.cpp/]
< <
This example will mark all *.c files and then rename them to *.cpp This example will mark all *.c files and then rename them to *.cpp
@@ -3275,7 +3275,7 @@ If there are marked files: (see |netrw-mf|)
The ctrl-X character has special meaning for renaming files: > The ctrl-X character has special meaning for renaming files: >
<c-x> : a single ctrl-x tells netrw to ignore the portion of the response <c-x> : a single ctrl-x tells netrw to ignore the portion of the response
lying between the last '/' and the ctrl-x. lying between the last '/' and the ctrl-x.
<c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
@@ -3843,7 +3843,7 @@ netrw:
Decho.vim is provided as a "vimball"; see |vimball-intro|. You Decho.vim is provided as a "vimball"; see |vimball-intro|. You
should edit the Decho.vba.gz file and source it in: > should edit the Decho.vba.gz file and source it in: >
vim Decho.vba.gz vim Decho.vba.gz
:so % :so %
:q :q
< <
@@ -3885,7 +3885,7 @@ netrw:
To save the file: under linux, the output will be in a separate To save the file: under linux, the output will be in a separate
remote server window; in it, just save the file with > remote server window; in it, just save the file with >
:w! DBG :w! DBG
< Under a vim that doesn't support clientserver, your debugging < Under a vim that doesn't support clientserver, your debugging
output will appear in another tab: > output will appear in another tab: >

View File

@@ -770,7 +770,7 @@ The second argument of |popup_create()| is a dictionary with options:
cursorline TRUE: Highlight the cursor line. Also scrolls the cursorline TRUE: Highlight the cursor line. Also scrolls the
text to show this line (only works properly text to show this line (only works properly
when 'wrap' is off). when 'wrap' is off).
zero: Do not highlight the cursor line. zero: Do not highlight the cursor line.
Default is zero, except for |popup_menu()|. Default is zero, except for |popup_menu()|.
filter A callback that can filter typed characters, see filter A callback that can filter typed characters, see
|popup-filter|. |popup-filter|.

View File

@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 9.0. Last change: 2022 Sep 26 *quickfix.txt* For Vim version 9.0. Last change: 2023 Jan 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -365,8 +365,6 @@ processing a quickfix or location list command, it will be aborted.
If numbers [from] and/or [to] are given, the respective If numbers [from] and/or [to] are given, the respective
range of errors is listed. A negative number counts range of errors is listed. A negative number counts
from the last error backwards, -1 being the last error. from the last error backwards, -1 being the last error.
The 'switchbuf' settings are respected when jumping
to a buffer.
The |:filter| command can be used to display only the The |:filter| command can be used to display only the
quickfix entries matching a supplied pattern. The quickfix entries matching a supplied pattern. The
pattern is matched against the filename, module name, pattern is matched against the filename, module name,
@@ -1273,6 +1271,21 @@ not "b:current_compiler". What the command actually does is the following:
For writing a compiler plugin, see |write-compiler-plugin|. For writing a compiler plugin, see |write-compiler-plugin|.
DOTNET *compiler-dotnet*
The .NET CLI compiler outputs both errors and warnings by default. The output
may be limited to include only errors, by setting the g:dotnet_errors_only
variable to |v:true|.
The associated project name is included in each error and warning. To suppress
the project name, set the g:dotnet_show_project_file variable to |v:false|.
Example: limit output to only display errors, and suppress the project name: >
let dotnet_errors_only = v:true
let dotnet_show_project_file = v:false
compiler dotnet
<
GCC *quickfix-gcc* *compiler-gcc* GCC *quickfix-gcc* *compiler-gcc*
There's one variable you can set for the GCC compiler: There's one variable you can set for the GCC compiler:

View File

@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 9.0. Last change: 2022 Nov 23 *quickref.txt* For Vim version 9.0. Last change: 2022 Dec 16
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -902,7 +902,8 @@ Short explanation of each option: *option-list*
'shortmess' 'shm' list of flags, reduce length of messages 'shortmess' 'shm' list of flags, reduce length of messages
'shortname' 'sn' Filenames assumed to be 8.3 chars 'shortname' 'sn' Filenames assumed to be 8.3 chars
'showbreak' 'sbr' string to use at the start of wrapped lines 'showbreak' 'sbr' string to use at the start of wrapped lines
'showcmd' 'sc' show (partial) command in status line 'showcmd' 'sc' show (partial) command somewhere
'showcmdloc' 'sloc' where to show (partial) command
'showfulltag' 'sft' show full tag pattern when completing tag 'showfulltag' 'sft' show full tag pattern when completing tag
'showmatch' 'sm' briefly jump to matching bracket if insert one 'showmatch' 'sm' briefly jump to matching bracket if insert one
'showmode' 'smd' message on status line to show current mode 'showmode' 'smd' message on status line to show current mode

View File

@@ -64,7 +64,7 @@ The following command line arguments are available:
below). The name used will be uppercase. below). The name used will be uppercase.
*--remote-send* *--remote-send*
--remote-send {keys} Send {keys} to server and exit. The {keys} --remote-send {keys} Send {keys} to server and exit. The {keys}
are not mapped. Special key names are are not mapped. Special key names are
recognized, e.g., "<CR>" results in a CR recognized, e.g., "<CR>" results in a CR
character. character.
*--remote-expr* *--remote-expr*

View File

@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 9.0. Last change: 2022 Sep 22 *repeat.txt* For Vim version 9.0. Last change: 2023 Feb 25
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -267,7 +267,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
When [where] is omitted only 'runtimepath' is used. When [where] is omitted only 'runtimepath' is used.
Other values: Other values:
START search under "start" in 'packpath' START search under "start" in 'packpath'
OPT search under "opt" in 'packpath' OPT search under "opt" in 'packpath'
PACK search under "start" and "opt" in PACK search under "start" and "opt" in
'packpath' 'packpath'
ALL first use 'runtimepath', then search ALL first use 'runtimepath', then search
@@ -423,6 +423,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
after resolving symbolic links got sourced with after resolving symbolic links got sourced with
another name the other script is after "->". E.g. another name the other script is after "->". E.g.
"20->22" means script 20 was sourced as script 22. "20->22" means script 20 was sourced as script 22.
Also see `getscriptinfo()`.
{not available when compiled without the |+eval| {not available when compiled without the |+eval|
feature} feature}
@@ -729,15 +730,15 @@ up-to-date easily, but it requires a program like "git" to be available.
You can do both, github can automatically create an archive for a release. You can do both, github can automatically create an archive for a release.
Your directory layout would be like this: Your directory layout would be like this:
start/foobar/plugin/foo.vim " always loaded, defines commands start/foobar/plugin/foo.vim " always loaded, defines commands
start/foobar/plugin/bar.vim " always loaded, defines commands start/foobar/plugin/bar.vim " always loaded, defines commands
start/foobar/autoload/foo.vim " loaded when foo command used start/foobar/autoload/foo.vim " loaded when foo command used
start/foobar/doc/foo.txt " help for foo.vim start/foobar/doc/foo.txt " help for foo.vim
start/foobar/doc/tags " help tags start/foobar/doc/tags " help tags
opt/fooextra/plugin/extra.vim " optional plugin, defines commands opt/fooextra/plugin/extra.vim " optional plugin, defines commands
opt/fooextra/autoload/extra.vim " loaded when extra command used opt/fooextra/autoload/extra.vim " loaded when extra command used
opt/fooextra/doc/extra.txt " help for extra.vim opt/fooextra/doc/extra.txt " help for extra.vim
opt/fooextra/doc/tags " help tags opt/fooextra/doc/tags " help tags
This allows for the user to do: > This allows for the user to do: >
mkdir ~/.vim/pack mkdir ~/.vim/pack

View File

@@ -1,4 +1,4 @@
*sign.txt* For Vim version 9.0. Last change: 2021 Dec 05 *sign.txt* For Vim version 9.0. Last change: 2023 Feb 21
VIM REFERENCE MANUAL by Gordon Prieur VIM REFERENCE MANUAL by Gordon Prieur
@@ -614,23 +614,23 @@ sign_placelist({list})
|sign_place()| function. The {list} argument specifies the |sign_place()| function. The {list} argument specifies the
List of signs to place. Each list item is a dict with the List of signs to place. Each list item is a dict with the
following sign attributes: following sign attributes:
buffer buffer name or number. For the accepted buffer Buffer name or number. For the accepted
values, see |bufname()|. values, see |bufname()|.
group sign group. {group} functions as a namespace group Sign group. {group} functions as a namespace
for {id}, thus two groups can use the same for {id}, thus two groups can use the same
IDs. If not specified or set to an empty IDs. If not specified or set to an empty
string, then the global group is used. See string, then the global group is used. See
|sign-group| for more information. |sign-group| for more information.
id sign identifier. If not specified or zero, id Sign identifier. If not specified or zero,
then a new unique identifier is allocated. then a new unique identifier is allocated.
Otherwise the specified number is used. See Otherwise the specified number is used. See
|sign-identifier| for more information. |sign-identifier| for more information.
lnum line number in the buffer {expr} where the lnum Line number in the buffer where the sign is to
sign is to be placed. For the accepted values, be placed. For the accepted values, see
see |line()|. |line()|.
name name of the sign to place. See |sign_define()| name Name of the sign to place. See |sign_define()|
for more information. for more information.
priority priority of the sign. When multiple signs are priority Priority of the sign. When multiple signs are
placed on a line, the sign with the highest placed on a line, the sign with the highest
priority is used. If not specified, the priority is used. If not specified, the
default value of 10 is used. See default value of 10 is used. See

View File

@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 9.0. Last change: 2022 Nov 24 *syntax.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1307,18 +1307,32 @@ When not set 4 is used.
DOSBATCH *dosbatch.vim* *ft-dosbatch-syntax* DOSBATCH *dosbatch.vim* *ft-dosbatch-syntax*
There is one option with highlighting DOS batch files. This covers new Select the set of Windows Command interpreter extensions that should be
extensions to the Command Interpreter introduced with Windows 2000 and supported with the variable dosbatch_cmdextversion. For versions of Windows
is controlled by the variable dosbatch_cmdextversion. For Windows NT NT (before Windows 2000) this should have the value of 1. For Windows 2000
this should have the value 1, and for Windows 2000 it should be 2. and later it should be 2.
Select the version you want with the following line: > Select the version you want with the following line: >
:let dosbatch_cmdextversion = 1 :let dosbatch_cmdextversion = 1
If this variable is not defined it defaults to a value of 2 to support If this variable is not defined it defaults to a value of 2 to support
Windows 2000. Windows 2000 and later.
A second option covers whether *.btm files should be detected as type The original MS-DOS supports an idiom of using a double colon (::) as an
alternative way to enter a comment line. This idiom can be used with the
current Windows Command Interpreter, but it can lead to problems when used
inside ( ... ) command blocks. You can find a discussion about this on
Stack Overflow -
https://stackoverflow.com/questions/12407800/which-comment-style-should-i-use-in-batch-files
To allow the use of the :: idiom for comments in the Windows Command
Interpreter or working with MS-DOS bat files, set the
dosbatch_colons_comment variable to anything: >
:let dosbatch_colons_comment = 1
There is an option that covers whether *.btm files should be detected as type
"dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter "dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter
is used by default. You may select the former with the following line: > is used by default. You may select the former with the following line: >
@@ -2777,17 +2791,25 @@ For highlighted doctests and code inside: >
:let python_no_doctest_highlight = 1 :let python_no_doctest_highlight = 1
or > or >
:let python_no_doctest_code_highlight = 1 :let python_no_doctest_code_highlight = 1
(first option implies second one). The first option implies the second one.
For highlighted trailing whitespace and mix of spaces and tabs: > For highlighted trailing whitespace and mix of spaces and tabs: >
:let python_space_error_highlight = 1 :let python_space_error_highlight = 1
If you want all possible Python highlighting (the same as setting the If you want all possible Python highlighting:
preceding last option and unsetting all other ones): >
:let python_highlight_all = 1 :let python_highlight_all = 1
This has the same effect as setting python_space_error_highlight and
unsetting all the other ones.
If you use Python 2 or straddling code (Python 2 and 3 compatible),
you can enforce the use of an older syntax file with support for
Python 2 and up to Python 3.5.
: let python_use_python2_syntax = 1
This option will exclude all modern Python 3.6 or higher features.
Note: Only existence of these options matters, not their value.
You can replace 1 above with anything.
Note: Only existence of these options matter, not their value. You can replace
1 above with anything.
QUAKE *quake.vim* *ft-quake-syntax* QUAKE *quake.vim* *ft-quake-syntax*
@@ -3836,7 +3858,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
clear: Syntax specific iskeyword setting is disabled and the clear: Syntax specific iskeyword setting is disabled and the
buffer-local 'iskeyword' setting is used. buffer-local 'iskeyword' setting is used.
{option} Set the syntax 'iskeyword' option to a new value. {option} Set the syntax 'iskeyword' option to a new value.
Example: > Example: >
:syntax iskeyword @,48-57,192-255,$,_ :syntax iskeyword @,48-57,192-255,$,_
@@ -5003,7 +5025,7 @@ in their own color.
*highlight-clear* *:hi-clear* *highlight-clear* *:hi-clear*
:hi[ghlight] clear Reset all highlighting to the defaults. Removes all :hi[ghlight] clear Reset all highlighting to the defaults. Removes all
highlighting for groups added by the user! highlighting for groups added by the user.
Uses the current value of 'background' to decide which Uses the current value of 'background' to decide which
default colors to use. default colors to use.
If there was a default link, restore it. |:hi-link| If there was a default link, restore it. |:hi-link|
@@ -5283,7 +5305,7 @@ guisp={color-name} *highlight-guisp*
(guisp) color to use in the GUI. "guisp" is used for undercurl and (guisp) color to use in the GUI. "guisp" is used for undercurl and
strikethrough. strikethrough.
There are a few special names: There are a few special names:
NONE no color (transparent) NONE no color (transparent) *E1361*
bg use normal background color bg use normal background color
background use normal background color background use normal background color
fg use normal foreground color fg use normal foreground color
@@ -5356,7 +5378,7 @@ ColorColumn Used for the columns set with 'colorcolumn'.
*hl-Conceal* *hl-Conceal*
Conceal Placeholder characters substituted for concealed Conceal Placeholder characters substituted for concealed
text (see 'conceallevel'). text (see 'conceallevel').
*hl-Cursor* *hl-Cursor* *hl-lCursor*
Cursor Character under the cursor. Cursor Character under the cursor.
lCursor Character under the cursor when |language-mapping| lCursor Character under the cursor when |language-mapping|
is used (see 'guicursor'). is used (see 'guicursor').

View File

@@ -568,6 +568,8 @@ $quote eval.txt /*$quote*
'nobreakindent' options.txt /*'nobreakindent'* 'nobreakindent' options.txt /*'nobreakindent'*
'nobri' options.txt /*'nobri'* 'nobri' options.txt /*'nobri'*
'nobuflisted' options.txt /*'nobuflisted'* 'nobuflisted' options.txt /*'nobuflisted'*
'nocdh' options.txt /*'nocdh'*
'nocdhome' options.txt /*'nocdhome'*
'nocf' options.txt /*'nocf'* 'nocf' options.txt /*'nocf'*
'noci' options.txt /*'noci'* 'noci' options.txt /*'noci'*
'nocin' options.txt /*'nocin'* 'nocin' options.txt /*'nocin'*
@@ -676,6 +678,8 @@ $quote eval.txt /*$quote*
'nomousef' options.txt /*'nomousef'* 'nomousef' options.txt /*'nomousef'*
'nomousefocus' options.txt /*'nomousefocus'* 'nomousefocus' options.txt /*'nomousefocus'*
'nomousehide' options.txt /*'nomousehide'* 'nomousehide' options.txt /*'nomousehide'*
'nomousemev' options.txt /*'nomousemev'*
'nomousemoveevent' options.txt /*'nomousemoveevent'*
'nonu' options.txt /*'nonu'* 'nonu' options.txt /*'nonu'*
'nonumber' options.txt /*'nonumber'* 'nonumber' options.txt /*'nonumber'*
'noodev' options.txt /*'noodev'* 'noodev' options.txt /*'noodev'*
@@ -745,10 +749,12 @@ $quote eval.txt /*$quote*
'notbidi' options.txt /*'notbidi'* 'notbidi' options.txt /*'notbidi'*
'notbs' options.txt /*'notbs'* 'notbs' options.txt /*'notbs'*
'notermbidi' options.txt /*'notermbidi'* 'notermbidi' options.txt /*'notermbidi'*
'notermguicolors' options.txt /*'notermguicolors'*
'noterse' options.txt /*'noterse'* 'noterse' options.txt /*'noterse'*
'notextauto' options.txt /*'notextauto'* 'notextauto' options.txt /*'notextauto'*
'notextmode' options.txt /*'notextmode'* 'notextmode' options.txt /*'notextmode'*
'notf' options.txt /*'notf'* 'notf' options.txt /*'notf'*
'notgc' options.txt /*'notgc'*
'notgst' options.txt /*'notgst'* 'notgst' options.txt /*'notgst'*
'notildeop' options.txt /*'notildeop'* 'notildeop' options.txt /*'notildeop'*
'notimeout' options.txt /*'notimeout'* 'notimeout' options.txt /*'notimeout'*
@@ -926,6 +932,7 @@ $quote eval.txt /*$quote*
'shortname' options.txt /*'shortname'* 'shortname' options.txt /*'shortname'*
'showbreak' options.txt /*'showbreak'* 'showbreak' options.txt /*'showbreak'*
'showcmd' options.txt /*'showcmd'* 'showcmd' options.txt /*'showcmd'*
'showcmdloc' options.txt /*'showcmdloc'*
'showfulltag' options.txt /*'showfulltag'* 'showfulltag' options.txt /*'showfulltag'*
'showmatch' options.txt /*'showmatch'* 'showmatch' options.txt /*'showmatch'*
'showmode' options.txt /*'showmode'* 'showmode' options.txt /*'showmode'*
@@ -938,6 +945,7 @@ $quote eval.txt /*$quote*
'siso' options.txt /*'siso'* 'siso' options.txt /*'siso'*
'sj' options.txt /*'sj'* 'sj' options.txt /*'sj'*
'slm' options.txt /*'slm'* 'slm' options.txt /*'slm'*
'sloc' options.txt /*'sloc'*
'slow' vi_diff.txt /*'slow'* 'slow' vi_diff.txt /*'slow'*
'slowopen' vi_diff.txt /*'slowopen'* 'slowopen' vi_diff.txt /*'slowopen'*
'sm' options.txt /*'sm'* 'sm' options.txt /*'sm'*
@@ -1082,6 +1090,7 @@ $quote eval.txt /*$quote*
't_VS' term.txt /*'t_VS'* 't_VS' term.txt /*'t_VS'*
't_WP' term.txt /*'t_WP'* 't_WP' term.txt /*'t_WP'*
't_WS' term.txt /*'t_WS'* 't_WS' term.txt /*'t_WS'*
't_XM' term.txt /*'t_XM'*
't_ZH' term.txt /*'t_ZH'* 't_ZH' term.txt /*'t_ZH'*
't_ZR' term.txt /*'t_ZR'* 't_ZR' term.txt /*'t_ZR'*
't_al' term.txt /*'t_al'* 't_al' term.txt /*'t_al'*
@@ -2201,6 +2210,7 @@ $quote eval.txt /*$quote*
:aun gui.txt /*:aun* :aun gui.txt /*:aun*
:aunmenu gui.txt /*:aunmenu* :aunmenu gui.txt /*:aunmenu*
:autocmd autocmd.txt /*:autocmd* :autocmd autocmd.txt /*:autocmd*
:autocmd-block autocmd.txt /*:autocmd-block*
:autocmd-verbose autocmd.txt /*:autocmd-verbose* :autocmd-verbose autocmd.txt /*:autocmd-verbose*
:b windows.txt /*:b* :b windows.txt /*:b*
:bN windows.txt /*:bN* :bN windows.txt /*:bN*
@@ -2449,6 +2459,7 @@ $quote eval.txt /*$quote*
:diffupdate diff.txt /*:diffupdate* :diffupdate diff.txt /*:diffupdate*
:dig digraph.txt /*:dig* :dig digraph.txt /*:dig*
:digraphs digraph.txt /*:digraphs* :digraphs digraph.txt /*:digraphs*
:dis change.txt /*:dis*
:disa vim9.txt /*:disa* :disa vim9.txt /*:disa*
:disassemble vim9.txt /*:disassemble* :disassemble vim9.txt /*:disassemble*
:display change.txt /*:display* :display change.txt /*:display*
@@ -2838,6 +2849,7 @@ $quote eval.txt /*$quote*
:map-commands map.txt /*:map-commands* :map-commands map.txt /*:map-commands*
:map-expression map.txt /*:map-expression* :map-expression map.txt /*:map-expression*
:map-local map.txt /*:map-local* :map-local map.txt /*:map-local*
:map-meta-keys map.txt /*:map-meta-keys*
:map-modes map.txt /*:map-modes* :map-modes map.txt /*:map-modes*
:map-nowait map.txt /*:map-nowait* :map-nowait map.txt /*:map-nowait*
:map-operator map.txt /*:map-operator* :map-operator map.txt /*:map-operator*
@@ -3017,6 +3029,7 @@ $quote eval.txt /*$quote*
:pts tagsrch.txt /*:pts* :pts tagsrch.txt /*:pts*
:ptselect tagsrch.txt /*:ptselect* :ptselect tagsrch.txt /*:ptselect*
:pu change.txt /*:pu* :pu change.txt /*:pu*
:public vim9class.txt /*:public*
:put change.txt /*:put* :put change.txt /*:put*
:pw editing.txt /*:pw* :pw editing.txt /*:pw*
:pwd editing.txt /*:pwd* :pwd editing.txt /*:pwd*
@@ -3988,6 +4001,7 @@ CTRL-{char} intro.txt /*CTRL-{char}*
Channel eval.txt /*Channel* Channel eval.txt /*Channel*
Channels eval.txt /*Channels* Channels eval.txt /*Channels*
Chinese mbyte.txt /*Chinese* Chinese mbyte.txt /*Chinese*
Class vim9class.txt /*Class*
Cmd-event autocmd.txt /*Cmd-event* Cmd-event autocmd.txt /*Cmd-event*
CmdUndefined autocmd.txt /*CmdUndefined* CmdUndefined autocmd.txt /*CmdUndefined*
Cmdline cmdline.txt /*Cmdline* Cmdline cmdline.txt /*Cmdline*
@@ -4368,11 +4382,59 @@ E1311 map.txt /*E1311*
E1312 windows.txt /*E1312* E1312 windows.txt /*E1312*
E1313 eval.txt /*E1313* E1313 eval.txt /*E1313*
E1314 vim9class.txt /*E1314* E1314 vim9class.txt /*E1314*
E1315 vim9class.txt /*E1315*
E1316 vim9class.txt /*E1316*
E1317 vim9class.txt /*E1317*
E1318 vim9class.txt /*E1318*
E1319 eval.txt /*E1319*
E132 userfunc.txt /*E132* E132 userfunc.txt /*E132*
E1320 eval.txt /*E1320*
E1321 eval.txt /*E1321*
E1322 eval.txt /*E1322*
E1323 eval.txt /*E1323*
E1324 eval.txt /*E1324*
E1325 vim9class.txt /*E1325*
E1326 vim9class.txt /*E1326*
E1327 vim9class.txt /*E1327*
E1328 vim9class.txt /*E1328*
E1329 vim9class.txt /*E1329*
E133 userfunc.txt /*E133* E133 userfunc.txt /*E133*
E1330 vim9class.txt /*E1330*
E1331 vim9class.txt /*E1331*
E1332 vim9class.txt /*E1332*
E1333 vim9class.txt /*E1333*
E1334 vim9class.txt /*E1334*
E1335 vim9class.txt /*E1335*
E1336 options.txt /*E1336*
E1337 vim9class.txt /*E1337*
E1338 vim9class.txt /*E1338*
E1339 textprop.txt /*E1339*
E134 change.txt /*E134* E134 change.txt /*E134*
E1340 vim9class.txt /*E1340*
E1341 vim9class.txt /*E1341*
E1342 vim9class.txt /*E1342*
E1343 vim9class.txt /*E1343*
E1344 vim9class.txt /*E1344*
E1345 vim9class.txt /*E1345*
E1346 vim9class.txt /*E1346*
E1347 vim9class.txt /*E1347*
E1348 vim9class.txt /*E1348*
E1349 vim9class.txt /*E1349*
E135 autocmd.txt /*E135* E135 autocmd.txt /*E135*
E1350 vim9class.txt /*E1350*
E1351 vim9class.txt /*E1351*
E1352 vim9class.txt /*E1352*
E1353 vim9class.txt /*E1353*
E1354 vim9class.txt /*E1354*
E1355 vim9class.txt /*E1355*
E1356 vim9class.txt /*E1356*
E1357 vim9class.txt /*E1357*
E1358 vim9class.txt /*E1358*
E1359 vim9class.txt /*E1359*
E136 starting.txt /*E136* E136 starting.txt /*E136*
E1360 vim9class.txt /*E1360*
E1361 syntax.txt /*E1361*
E1362 vim9class.txt /*E1362*
E137 starting.txt /*E137* E137 starting.txt /*E137*
E138 starting.txt /*E138* E138 starting.txt /*E138*
E139 message.txt /*E139* E139 message.txt /*E139*
@@ -5427,6 +5489,7 @@ OS390-bugs os_390.txt /*OS390-bugs*
OS390-has-ebcdic os_390.txt /*OS390-has-ebcdic* OS390-has-ebcdic os_390.txt /*OS390-has-ebcdic*
OS390-limitations os_390.txt /*OS390-limitations* OS390-limitations os_390.txt /*OS390-limitations*
OS390-open-source os_390.txt /*OS390-open-source* OS390-open-source os_390.txt /*OS390-open-source*
Object vim9class.txt /*Object*
OffTheSpot mbyte.txt /*OffTheSpot* OffTheSpot mbyte.txt /*OffTheSpot*
OnTheSpot mbyte.txt /*OnTheSpot* OnTheSpot mbyte.txt /*OnTheSpot*
Operator-pending intro.txt /*Operator-pending* Operator-pending intro.txt /*Operator-pending*
@@ -5588,6 +5651,7 @@ View starting.txt /*View*
Vim9 vim9.txt /*Vim9* Vim9 vim9.txt /*Vim9*
Vim9-abstract-class vim9class.txt /*Vim9-abstract-class* Vim9-abstract-class vim9class.txt /*Vim9-abstract-class*
Vim9-class vim9class.txt /*Vim9-class* Vim9-class vim9class.txt /*Vim9-class*
Vim9-class-member vim9class.txt /*Vim9-class-member*
Vim9-class-overview vim9class.txt /*Vim9-class-overview* Vim9-class-overview vim9class.txt /*Vim9-class-overview*
Vim9-enum vim9class.txt /*Vim9-enum* Vim9-enum vim9class.txt /*Vim9-enum*
Vim9-script vim9.txt /*Vim9-script* Vim9-script vim9.txt /*Vim9-script*
@@ -6264,8 +6328,8 @@ cino-w indent.txt /*cino-w*
cino-{ indent.txt /*cino-{* cino-{ indent.txt /*cino-{*
cino-} indent.txt /*cino-}* cino-} indent.txt /*cino-}*
cinoptions-values indent.txt /*cinoptions-values* cinoptions-values indent.txt /*cinoptions-values*
class-member vim9class.txt /*class-member* class vim9class.txt /*class*
class-method vim9class.txt /*class-method* class-function vim9class.txt /*class-function*
clear-undo undo.txt /*clear-undo* clear-undo undo.txt /*clear-undo*
clearmatches() builtin.txt /*clearmatches()* clearmatches() builtin.txt /*clearmatches()*
client-server remote.txt /*client-server* client-server remote.txt /*client-server*
@@ -6322,6 +6386,7 @@ compile-changes-8 version8.txt /*compile-changes-8*
compile-changes-9 version9.txt /*compile-changes-9* compile-changes-9 version9.txt /*compile-changes-9*
compiler-compaqada ft_ada.txt /*compiler-compaqada* compiler-compaqada ft_ada.txt /*compiler-compaqada*
compiler-decada ft_ada.txt /*compiler-decada* compiler-decada ft_ada.txt /*compiler-decada*
compiler-dotnet quickfix.txt /*compiler-dotnet*
compiler-gcc quickfix.txt /*compiler-gcc* compiler-gcc quickfix.txt /*compiler-gcc*
compiler-gnat ft_ada.txt /*compiler-gnat* compiler-gnat ft_ada.txt /*compiler-gnat*
compiler-hpada ft_ada.txt /*compiler-hpada* compiler-hpada ft_ada.txt /*compiler-hpada*
@@ -7511,6 +7576,7 @@ getbufinfo() builtin.txt /*getbufinfo()*
getbufline() builtin.txt /*getbufline()* getbufline() builtin.txt /*getbufline()*
getbufoneline() builtin.txt /*getbufoneline()* getbufoneline() builtin.txt /*getbufoneline()*
getbufvar() builtin.txt /*getbufvar()* getbufvar() builtin.txt /*getbufvar()*
getcellwidths() builtin.txt /*getcellwidths()*
getchangelist() builtin.txt /*getchangelist()* getchangelist() builtin.txt /*getchangelist()*
getchar() builtin.txt /*getchar()* getchar() builtin.txt /*getchar()*
getcharmod() builtin.txt /*getcharmod()* getcharmod() builtin.txt /*getcharmod()*
@@ -7834,6 +7900,8 @@ hl-TabLineFill syntax.txt /*hl-TabLineFill*
hl-TabLineSel syntax.txt /*hl-TabLineSel* hl-TabLineSel syntax.txt /*hl-TabLineSel*
hl-Terminal syntax.txt /*hl-Terminal* hl-Terminal syntax.txt /*hl-Terminal*
hl-Title syntax.txt /*hl-Title* hl-Title syntax.txt /*hl-Title*
hl-ToolbarButton gui.txt /*hl-ToolbarButton*
hl-ToolbarLine gui.txt /*hl-ToolbarLine*
hl-Tooltip syntax.txt /*hl-Tooltip* hl-Tooltip syntax.txt /*hl-Tooltip*
hl-User1 syntax.txt /*hl-User1* hl-User1 syntax.txt /*hl-User1*
hl-User1..9 syntax.txt /*hl-User1..9* hl-User1..9 syntax.txt /*hl-User1..9*
@@ -7845,6 +7913,7 @@ hl-WarningMsg syntax.txt /*hl-WarningMsg*
hl-WildMenu syntax.txt /*hl-WildMenu* hl-WildMenu syntax.txt /*hl-WildMenu*
hl-debugBreakpoint terminal.txt /*hl-debugBreakpoint* hl-debugBreakpoint terminal.txt /*hl-debugBreakpoint*
hl-debugPC terminal.txt /*hl-debugPC* hl-debugPC terminal.txt /*hl-debugPC*
hl-lCursor syntax.txt /*hl-lCursor*
hlID() builtin.txt /*hlID()* hlID() builtin.txt /*hlID()*
hlexists() builtin.txt /*hlexists()* hlexists() builtin.txt /*hlexists()*
hlget() builtin.txt /*hlget()* hlget() builtin.txt /*hlget()*
@@ -8183,6 +8252,7 @@ keypad-point intro.txt /*keypad-point*
keys() builtin.txt /*keys()* keys() builtin.txt /*keys()*
keytrans() builtin.txt /*keytrans()* keytrans() builtin.txt /*keytrans()*
kitty-keyboard-protocol map.txt /*kitty-keyboard-protocol* kitty-keyboard-protocol map.txt /*kitty-keyboard-protocol*
kitty-terminal term.txt /*kitty-terminal*
known-bugs todo.txt /*known-bugs* known-bugs todo.txt /*known-bugs*
l motion.txt /*l* l motion.txt /*l*
l: eval.txt /*l:* l: eval.txt /*l:*
@@ -8460,6 +8530,7 @@ motion-count-multiplied motion.txt /*motion-count-multiplied*
motion.txt motion.txt /*motion.txt* motion.txt motion.txt /*motion.txt*
mouse-mode-table term.txt /*mouse-mode-table* mouse-mode-table term.txt /*mouse-mode-table*
mouse-overview term.txt /*mouse-overview* mouse-overview term.txt /*mouse-overview*
mouse-reporting term.txt /*mouse-reporting*
mouse-scrolling-off scroll.txt /*mouse-scrolling-off* mouse-scrolling-off scroll.txt /*mouse-scrolling-off*
mouse-swap-buttons term.txt /*mouse-swap-buttons* mouse-swap-buttons term.txt /*mouse-swap-buttons*
mouse-using term.txt /*mouse-using* mouse-using term.txt /*mouse-using*
@@ -8878,6 +8949,14 @@ nr2char() builtin.txt /*nr2char()*
nroff.vim syntax.txt /*nroff.vim* nroff.vim syntax.txt /*nroff.vim*
null vim9.txt /*null* null vim9.txt /*null*
null-variable eval.txt /*null-variable* null-variable eval.txt /*null-variable*
null_blob vim9.txt /*null_blob*
null_channel vim9.txt /*null_channel*
null_dict vim9.txt /*null_dict*
null_function vim9.txt /*null_function*
null_job vim9.txt /*null_job*
null_list vim9.txt /*null_list*
null_partial vim9.txt /*null_partial*
null_string vim9.txt /*null_string*
number_relativenumber options.txt /*number_relativenumber* number_relativenumber options.txt /*number_relativenumber*
numbered-function eval.txt /*numbered-function* numbered-function eval.txt /*numbered-function*
numbermax-variable eval.txt /*numbermax-variable* numbermax-variable eval.txt /*numbermax-variable*
@@ -8887,6 +8966,7 @@ o insert.txt /*o*
o_CTRL-V motion.txt /*o_CTRL-V* o_CTRL-V motion.txt /*o_CTRL-V*
o_V motion.txt /*o_V* o_V motion.txt /*o_V*
o_v motion.txt /*o_v* o_v motion.txt /*o_v*
object vim9class.txt /*object*
object-motions motion.txt /*object-motions* object-motions motion.txt /*object-motions*
object-select motion.txt /*object-select* object-select motion.txt /*object-select*
objects index.txt /*objects* objects index.txt /*objects*
@@ -9545,6 +9625,28 @@ shellescape() builtin.txt /*shellescape()*
shift intro.txt /*shift* shift intro.txt /*shift*
shift-left-right change.txt /*shift-left-right* shift-left-right change.txt /*shift-left-right*
shiftwidth() builtin.txt /*shiftwidth()* shiftwidth() builtin.txt /*shiftwidth()*
shm-A options.txt /*shm-A*
shm-C options.txt /*shm-C*
shm-F options.txt /*shm-F*
shm-I options.txt /*shm-I*
shm-O options.txt /*shm-O*
shm-S options.txt /*shm-S*
shm-T options.txt /*shm-T*
shm-W options.txt /*shm-W*
shm-a options.txt /*shm-a*
shm-c options.txt /*shm-c*
shm-f options.txt /*shm-f*
shm-i options.txt /*shm-i*
shm-l options.txt /*shm-l*
shm-m options.txt /*shm-m*
shm-n options.txt /*shm-n*
shm-o options.txt /*shm-o*
shm-q options.txt /*shm-q*
shm-r options.txt /*shm-r*
shm-s options.txt /*shm-s*
shm-t options.txt /*shm-t*
shm-w options.txt /*shm-w*
shm-x options.txt /*shm-x*
short-name-changed version4.txt /*short-name-changed* short-name-changed version4.txt /*short-name-changed*
showing-menus gui.txt /*showing-menus* showing-menus gui.txt /*showing-menus*
sign-column sign.txt /*sign-column* sign-column sign.txt /*sign-column*
@@ -9948,6 +10050,7 @@ t_Us term.txt /*t_Us*
t_VS term.txt /*t_VS* t_VS term.txt /*t_VS*
t_WP term.txt /*t_WP* t_WP term.txt /*t_WP*
t_WS term.txt /*t_WS* t_WS term.txt /*t_WS*
t_XM term.txt /*t_XM*
t_ZH term.txt /*t_ZH* t_ZH term.txt /*t_ZH*
t_ZR term.txt /*t_ZR* t_ZR term.txt /*t_ZR*
t_al term.txt /*t_al* t_al term.txt /*t_al*
@@ -9961,6 +10064,7 @@ t_channel-variable eval.txt /*t_channel-variable*
t_ci version4.txt /*t_ci* t_ci version4.txt /*t_ci*
t_cil version4.txt /*t_cil* t_cil version4.txt /*t_cil*
t_cl term.txt /*t_cl* t_cl term.txt /*t_cl*
t_class-variable eval.txt /*t_class-variable*
t_cm term.txt /*t_cm* t_cm term.txt /*t_cm*
t_cri version4.txt /*t_cri* t_cri version4.txt /*t_cri*
t_cs term.txt /*t_cs* t_cs term.txt /*t_cs*
@@ -10025,6 +10129,7 @@ t_ms term.txt /*t_ms*
t_nd term.txt /*t_nd* t_nd term.txt /*t_nd*
t_none-variable eval.txt /*t_none-variable* t_none-variable eval.txt /*t_none-variable*
t_number-variable eval.txt /*t_number-variable* t_number-variable eval.txt /*t_number-variable*
t_object-variable eval.txt /*t_object-variable*
t_op term.txt /*t_op* t_op term.txt /*t_op*
t_se term.txt /*t_se* t_se term.txt /*t_se*
t_sf1 version4.txt /*t_sf1* t_sf1 version4.txt /*t_sf1*
@@ -10264,6 +10369,7 @@ test_garbagecollect_soon() testing.txt /*test_garbagecollect_soon()*
test_getvalue() testing.txt /*test_getvalue()* test_getvalue() testing.txt /*test_getvalue()*
test_gui_event() testing.txt /*test_gui_event()* test_gui_event() testing.txt /*test_gui_event()*
test_ignore_error() testing.txt /*test_ignore_error()* test_ignore_error() testing.txt /*test_ignore_error()*
test_mswin_event() testing.txt /*test_mswin_event()*
test_null_blob() testing.txt /*test_null_blob()* test_null_blob() testing.txt /*test_null_blob()*
test_null_channel() testing.txt /*test_null_channel()* test_null_channel() testing.txt /*test_null_channel()*
test_null_dict() testing.txt /*test_null_dict()* test_null_dict() testing.txt /*test_null_dict()*
@@ -10532,6 +10638,7 @@ v:t_TYPE eval.txt /*v:t_TYPE*
v:t_blob eval.txt /*v:t_blob* v:t_blob eval.txt /*v:t_blob*
v:t_bool eval.txt /*v:t_bool* v:t_bool eval.txt /*v:t_bool*
v:t_channel eval.txt /*v:t_channel* v:t_channel eval.txt /*v:t_channel*
v:t_class eval.txt /*v:t_class*
v:t_dict eval.txt /*v:t_dict* v:t_dict eval.txt /*v:t_dict*
v:t_float eval.txt /*v:t_float* v:t_float eval.txt /*v:t_float*
v:t_func eval.txt /*v:t_func* v:t_func eval.txt /*v:t_func*
@@ -10539,6 +10646,7 @@ v:t_job eval.txt /*v:t_job*
v:t_list eval.txt /*v:t_list* v:t_list eval.txt /*v:t_list*
v:t_none eval.txt /*v:t_none* v:t_none eval.txt /*v:t_none*
v:t_number eval.txt /*v:t_number* v:t_number eval.txt /*v:t_number*
v:t_object eval.txt /*v:t_object*
v:t_string eval.txt /*v:t_string* v:t_string eval.txt /*v:t_string*
v:termblinkresp eval.txt /*v:termblinkresp* v:termblinkresp eval.txt /*v:termblinkresp*
v:termrbgresp eval.txt /*v:termrbgresp* v:termrbgresp eval.txt /*v:termrbgresp*
@@ -11020,6 +11128,7 @@ xterm-cursor-keys term.txt /*xterm-cursor-keys*
xterm-end-home-keys term.txt /*xterm-end-home-keys* xterm-end-home-keys term.txt /*xterm-end-home-keys*
xterm-focus-event term.txt /*xterm-focus-event* xterm-focus-event term.txt /*xterm-focus-event*
xterm-function-keys term.txt /*xterm-function-keys* xterm-function-keys term.txt /*xterm-function-keys*
xterm-kitty term.txt /*xterm-kitty*
xterm-modifier-keys term.txt /*xterm-modifier-keys* xterm-modifier-keys term.txt /*xterm-modifier-keys*
xterm-mouse options.txt /*xterm-mouse* xterm-mouse options.txt /*xterm-mouse*
xterm-mouse-wheel scroll.txt /*xterm-mouse-wheel* xterm-mouse-wheel scroll.txt /*xterm-mouse-wheel*
@@ -11028,6 +11137,7 @@ xterm-save-screen tips.txt /*xterm-save-screen*
xterm-screens tips.txt /*xterm-screens* xterm-screens tips.txt /*xterm-screens*
xterm-scroll-region term.txt /*xterm-scroll-region* xterm-scroll-region term.txt /*xterm-scroll-region*
xterm-shifted-keys term.txt /*xterm-shifted-keys* xterm-shifted-keys term.txt /*xterm-shifted-keys*
xterm-terminfo-entries term.txt /*xterm-terminfo-entries*
xterm-true-color term.txt /*xterm-true-color* xterm-true-color term.txt /*xterm-true-color*
y change.txt /*y* y change.txt /*y*
yaml.vim syntax.txt /*yaml.vim* yaml.vim syntax.txt /*yaml.vim*
@@ -11124,6 +11234,8 @@ zz scroll.txt /*zz*
{rhs} map.txt /*{rhs}* {rhs} map.txt /*{rhs}*
{server} remote.txt /*{server}* {server} remote.txt /*{server}*
{subject} helphelp.txt /*{subject}* {subject} helphelp.txt /*{subject}*
{{{ fold.txt /*{{{*
{} intro.txt /*{}* {} intro.txt /*{}*
} motion.txt /*}* } motion.txt /*}*
}}} fold.txt /*}}}*
~ change.txt /*~* ~ change.txt /*~*

View File

@@ -1,4 +1,4 @@
*tagsrch.txt* For Vim version 9.0. Last change: 2020 Dec 19 *tagsrch.txt* For Vim version 9.0. Last change: 2023 Feb 13
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -98,7 +98,7 @@ The ignore-case matches are found when:
- when 'tagcase' is "followscs" and 'ignorecase' is on or the 'smartcase' - when 'tagcase' is "followscs" and 'ignorecase' is on or the 'smartcase'
option is on and the pattern does not contain an upper case character option is on and the pattern does not contain an upper case character
- when 'tagcase' is "ignore" - when 'tagcase' is "ignore"
- when 'tagcase' is "smart" and the patter does not contain an upper case - when 'tagcase' is "smart" and the pattern does not contain an upper case
character character
Note that using ignore-case tag searching disables binary searching in the Note that using ignore-case tag searching disables binary searching in the

View File

@@ -1,4 +1,4 @@
*term.txt* For Vim version 9.0. Last change: 2022 Dec 01 *term.txt* For Vim version 9.0. Last change: 2023 Jan 15
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -88,7 +88,8 @@ Output resumes when you hit <BS>.
Note: When 't_ti' is not empty, Vim assumes that it causes switching to the Note: When 't_ti' is not empty, Vim assumes that it causes switching to the
alternate screen. This may slightly change what happens when executing a alternate screen. This may slightly change what happens when executing a
shell command or exiting Vim. To avoid this use 't_TI' and 't_TE'. shell command or exiting Vim. To avoid this use 't_TI' and 't_TE' (but make
sure to add to them, not overwrite).
Vim will try to detect what keyboard protocol the terminal is using with the Vim will try to detect what keyboard protocol the terminal is using with the
't_RK' termcap entry. This is sent after 't_TI', but only when there is no 't_RK' termcap entry. This is sent after 't_TI', but only when there is no
@@ -117,6 +118,10 @@ have a problem with this, disable bracketed paste by putting this in your
If this is done while Vim is running the 't_BD' will be sent to the terminal If this is done while Vim is running the 't_BD' will be sent to the terminal
to disable bracketed paste. to disable bracketed paste.
If |t_PS| or |t_PE| is not set, then |t_BE| will not be used. This is to make
sure that bracketed paste is not enabled when the escape codes surrounding
pasted text cannot be recognized.
If your terminal supports bracketed paste, but the options are not set If your terminal supports bracketed paste, but the options are not set
automatically, you can try using something like this: > automatically, you can try using something like this: >
@@ -126,7 +131,11 @@ automatically, you can try using something like this: >
exec "set t_PS=\e[200~" exec "set t_PS=\e[200~"
exec "set t_PE=\e[201~" exec "set t_PE=\e[201~"
endif endif
<
The terminfo entries "BE", "BD", "PS" and "PE" were added in ncurses version
6.4, early 2023, for some terminals. If you have this version then you may
not have to manually configure your terminal.
*tmux-integration* *tmux-integration*
If you experience issues when running Vim inside tmux, here are a few hints. If you experience issues when running Vim inside tmux, here are a few hints.
You can comment-out parts if something doesn't work (it may depend on the You can comment-out parts if something doesn't work (it may depend on the
@@ -294,6 +303,58 @@ When Vim receives a response to the |t_RV| (request version) sequence and it
starts with CSI, it assumes that the terminal is in 8-bit mode and will starts with CSI, it assumes that the terminal is in 8-bit mode and will
convert all key sequences to their 8-bit variants. convert all key sequences to their 8-bit variants.
*xterm-terminfo-entries*
For some time the terminfo entries were insufficient to describe all the
features tht Vim can use. The builtin xterm termcap entries did have these,
with the result that several terminals that were similar enough to xterm took
advantage of these by prefixing "xterm-" to the terminal name in $TERM.
This leads to problems, because quite often these terminals are not 100%
compatible with xterm. At the start of 2023 several entries have been added
to the terminfo database to make it possible to use these features without
using the "xterm" workaround. These are the relevant entries (so far):
name xterm value description ~
RV "\033[>c" Request version |t_RV|
BE "\033[?2004h" enable bracketed paste mode |t_BE|
BD "\033[?2004l" disable bracketed paste mode |t_BD|
PS "\033[200~" pasted text start |t_PS|
PE "\033[201~" pasted text end |t_PE|
XM "\033[?1006;1004;1000%?%p1%{1}%=%th%el%;"
mouse enable / disable |t_XM|
The "XM" entry includes "1006" to enable SGR style mouse reporting. This
supports columns above 223. It also includes "1004" which enables focus
reporting. The t_fe and t_fd entries can be left empty (they don't have
entries in terminfo/termcap anyway).
*xterm-kitty* *kitty-terminal*
The Kitty terminal is a special case. Mainly because it works differently
from most other terminals, but also because, instead of trying the fit in and
make it behave like other terminals by default, it dictates how applications
need to work when using Kitty. This makes it very difficult for Vim to work
in a Kitty terminal. Some exceptions have been hard coded, but it is not at
all nice to have to make exceptions for one specific terminal.
One of the problems is that the value for $TERM is set to "xterm-kitty". For
Vim this is an indication that the terminal is xterm-compatible and the
builtin xterm termcap entries should be used. Many other terminals depend on
this. However, Kitty is not fully xterm compatible. The author suggested to
ignore the "xterm-" prefix and use the terminfo entry anyway, so that is what
happens now, the builtin xterm termcap entries are not used. However, the
t_RV is set, otherwise other things would not work, such as automatically
setting 'ttymouse' to "sgr" (at least until |t_XM| is being used for this).
It is not clear why kitty sets $TERM to "xterm-kitty", the terminal isn't
really xterm compatible. "kitty" would be more appropriate, but a terminfo
entry with that name is not widespread.
Note that using the kitty keyboard protocol is a separate feature, see
|kitty-keyboard-protocol|.
============================================================================== ==============================================================================
2. Terminal options *terminal-options* *termcap-options* *E436* 2. Terminal options *terminal-options* *termcap-options* *E436*
@@ -393,6 +454,8 @@ Added by Vim (there are no standard codes for these):
xterm and other terminal emulators) The xterm and other terminal emulators) The
response is stored in |v:termresponse| |xterm-8bit| response is stored in |v:termresponse| |xterm-8bit|
|'ttymouse'| |xterm-codes| |'ttymouse'| |xterm-codes|
t_XM enable/disable mouse reporting, *t_XM* *'t_XM'*
see |mouse-reporting| below
t_RK request terminal keyboard protocol state; *t_RK* *'t_RK'* t_RK request terminal keyboard protocol state; *t_RK* *'t_RK'*
sent after |t_TI| sent after |t_TI|
t_u7 request cursor position (for xterm) *t_u7* *'t_u7'* t_u7 request cursor position (for xterm) *t_u7* *'t_u7'*
@@ -423,10 +486,10 @@ Added by Vim (there are no standard codes for these):
t_Si save icon text to stack *t_Si* *'t_Si'* t_Si save icon text to stack *t_Si* *'t_Si'*
t_Ri restore icon text from stack *t_Ri* *'t_Ri'* t_Ri restore icon text from stack *t_Ri* *'t_Ri'*
t_TE end of "raw" mode *t_TE* *'t_TE'* t_TE end of "raw" mode *t_TE* *'t_TE'*
t_TI put terminal into "raw" mode *t_TI* *'t_TI'* t_TI put terminal into "raw" mode *t_TI* *'t_TI'*
t_fe enable focus-event tracking *t_fe* *'t_fe'* t_fe enable focus-event tracking *t_fe* *'t_fe'*
|xterm-focus-event| |xterm-focus-event|
t_fd disable focus-event tracking *t_fd* *'t_fd'* t_fd disable focus-event tracking *t_fd* *'t_fd'*
|xterm-focus-event| |xterm-focus-event|
Some codes have a start, middle and end part. The start and end are defined Some codes have a start, middle and end part. The start and end are defined
@@ -436,8 +499,8 @@ by the termcap option, the middle part is text.
set cursor color: t_SC {color name} t_EC set cursor color: t_SC {color name} t_EC
t_SH must take one argument: t_SH must take one argument:
0, 1 or none blinking block cursor 0, 1 or none blinking block cursor
2 block cursor 2 block cursor
3 blinking underline cursor 3 blinking underline cursor
4 underline cursor 4 underline cursor
5 blinking vertical bar cursor 5 blinking vertical bar cursor
@@ -446,6 +509,21 @@ t_SH must take one argument:
t_RS is sent only if the response to t_RV has been received. It is not used t_RS is sent only if the response to t_RV has been received. It is not used
on Mac OS when Terminal.app could be recognized from the termresponse. on Mac OS when Terminal.app could be recognized from the termresponse.
*mouse-reporting*
Many terminals can report mouse clicks and some can report mouse movement and
dragging. Vim needs to know what codes are being used for this.
The "XM" terminfo/termcap entry is used for this. Vim also has the 'ttymouse'
option to specify the mouse protocol being used. See the option for the
possible values.
If Vim can read the "XM" terminfo/termcap entry then it will be used for
enabling and disabling the mouse reporting. If it is missing, then the value
from 'ttymouse' is used to decide how to do this.
If the "XM" entry exists and the first number is "1006" then 'ttymouse' will
be set to "sgr", unless it was already set earlier.
KEY CODES *terminal-key-codes* KEY CODES *terminal-key-codes*
Note: Use the <> form if possible Note: Use the <> form if possible
@@ -506,6 +584,7 @@ Note: Use the <> form if possible
t_%1 <Help> help key *t_%1* *'t_%1'* t_%1 <Help> help key *t_%1* *'t_%1'*
t_&8 <Undo> undo key *t_&8* *'t_&8'* t_&8 <Undo> undo key *t_&8* *'t_&8'*
t_kI <Insert> insert key *t_kI* *'t_kI'* t_kI <Insert> insert key *t_kI* *'t_kI'*
<kInsert> keypad insert key
t_kD <Del> delete key *t_kD* *'t_kD'* t_kD <Del> delete key *t_kD* *'t_kD'*
t_kb <BS> backspace key *t_kb* *'t_kb'* t_kb <BS> backspace key *t_kb* *'t_kb'*
t_kB <S-Tab> back-tab (shift-tab) *<S-Tab>* *t_kB* *'t_kB'* t_kB <S-Tab> back-tab (shift-tab) *<S-Tab>* *t_kB* *'t_kB'*
@@ -538,9 +617,13 @@ Note: Use the <> form if possible
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'* t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'* t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
<Mouse> leader of mouse code *<Mouse>* <Mouse> leader of mouse code *<Mouse>*
*t_PS* *'t_PS'*
t_PS start of bracketed paste |xterm-bracketed-paste| t_PS <PasteStart> start of bracketed paste *t_PS* *'t_PS'*
t_PE end of bracketed paste |xterm-bracketed-paste| *t_PE* *'t_PE'* |xterm-bracketed-paste|
t_PE <PasteEnd> end of bracketed paste *t_PE* *'t_PE'*
|xterm-bracketed-paste|
<FocusGained> Vim window got focus (internal only)
<FocusLost> Vim window lost focus (internal only)
Note about t_so and t_mr: When the termcap entry "so" is not present the Note about t_so and t_mr: When the termcap entry "so" is not present the
entry for "mr" is used. And vice versa. The same is done for "se" and "me". entry for "mr" is used. And vice versa. The same is done for "se" and "me".
@@ -579,12 +662,15 @@ work the 'termguicolors' option needs to be set.
See https://github.com/termstandard/colors for a list of terminals that See https://github.com/termstandard/colors for a list of terminals that
support true colors. support true colors.
Sometimes setting 'termguicolors' is not enough and one has to set the |t_8f| For telling the terminal what RGB color to use the |t_8f| and |t_8b| termcap
and |t_8b| options explicitly. Default values of these options are entries are used. These are set by default to values that work for most
"^[[38;2;%lu;%lu;%lum" and "^[[48;2;%lu;%lu;%lum" respectively, but it is only terminals. If that does not work for your terminal you can set them manually.
set when `$TERM` is `xterm`. Some terminals accept the same sequences, but The default values are set like this: >
with all semicolons replaced by colons (this is actually more compatible, but let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
less widely supported): > let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
Some terminals accept the same sequences, but with all semicolons replaced by
colons (this is actually more compatible, but less widely supported): >
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum" let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum" let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
@@ -602,7 +688,7 @@ is actually the case.
To overrule the default, put this line in your ~/.Xdefaults or To overrule the default, put this line in your ~/.Xdefaults or
~/.Xresources: ~/.Xresources:
> >
XTerm*allowWindowOps: true XTerm*allowWindowOps: true
And run "xrdb -merge .Xresources" to make it effective. You can check the And run "xrdb -merge .Xresources" to make it effective. You can check the
value with the context menu (right mouse button while CTRL key is pressed), value with the context menu (right mouse button while CTRL key is pressed),

View File

@@ -30,9 +30,9 @@ If the result is "1" you have it.
Using the client-server feature |terminal-client-server| Using the client-server feature |terminal-client-server|
4. Remote testing |terminal-testing| 4. Remote testing |terminal-testing|
5. Diffing screen dumps |terminal-diff| 5. Diffing screen dumps |terminal-diff|
Writing a screen dump test for Vim |terminal-dumptest| Writing a screen dump test for Vim |terminal-dumptest|
Creating a screen dump |terminal-screendump| Creating a screen dump |terminal-screendump|
Comparing screen dumps |terminal-diffscreendump| Comparing screen dumps |terminal-diffscreendump|
6. Debugging |terminal-debug| 6. Debugging |terminal-debug|
Starting |termdebug-starting| Starting |termdebug-starting|
Example session |termdebug-example| Example session |termdebug-example|
@@ -240,7 +240,7 @@ Command syntax ~
in a session file. in a session file.
++shell Instead of executing {command} ++shell Instead of executing {command}
directly, use a shell, like with directly, use a shell, like with
`:!command` *E279* `:!command` *E279*
{only works on Unix and MS-Windows} {only works on Unix and MS-Windows}
++kill={how} When trying to close the terminal ++kill={how} When trying to close the terminal
window kill the job with {how}. See window kill the job with {how}. See

View File

@@ -1,4 +1,4 @@
*testing.txt* For Vim version 9.0. Last change: 2022 Nov 28 *testing.txt* For Vim version 9.0. Last change: 2022 Dec 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -94,7 +94,7 @@ test_gui_event({event}, {args})
"findrepl" search and replace text. "findrepl" search and replace text.
"mouse" mouse button click event. "mouse" mouse button click event.
"scrollbar" move or drag the scrollbar. "scrollbar" move or drag the scrollbar.
"sendevent" send a low-level GUI event. "key" send a low-level keyboard event.
"tabline" select a tab page by mouse click. "tabline" select a tab page by mouse click.
"tabmenu" select a tabline menu entry. "tabmenu" select a tabline menu entry.
@@ -178,8 +178,8 @@ test_gui_event({event}, {args})
dragging: 1 to drag the scrollbar and 0 to click in the dragging: 1 to drag the scrollbar and 0 to click in the
scrollbar. scrollbar.
"sendevent": "key":
Send a low-level GUI event (e.g. key-up or down). Send a low-level keyboard event (e.g. key-up or down).
Currently only supported on MS-Windows. Currently only supported on MS-Windows.
The supported items in {args} are: The supported items in {args} are:
event: The supported string values are: event: The supported string values are:
@@ -197,7 +197,7 @@ test_gui_event({event}, {args})
Inject an event to select a tabline menu entry. The Inject an event to select a tabline menu entry. The
supported items in {args} are: supported items in {args} are:
tabnr: tab page number tabnr: tab page number
item: tab page menu item number. 1 for the first item: tab page menu item number. 1 for the first
menu item, 2 for the second item and so on. menu item, 2 for the second item and so on.
After injecting the GUI events you probably should call After injecting the GUI events you probably should call
@@ -224,6 +224,77 @@ test_ignore_error({expr}) *test_ignore_error()*
GetErrorText()->test_ignore_error() GetErrorText()->test_ignore_error()
test_mswin_event({event}, {args}) *test_mswin_event()*
Generate a low-level MS-Windows {event} with arguments {args}
for testing Vim functionality. It works for MS-Windows GUI
and for the console.
{event} is a String and the supported values are:
"mouse" mouse event.
"key" keyboard event.
"mouse":
Inject either a mouse button click, or a mouse move, event.
The supported items in {args} are:
button: mouse button. The supported values are:
0 right mouse button
1 middle mouse button
2 left mouse button
3 mouse button release
4 scroll wheel down
5 scroll wheel up
6 scroll wheel left
7 scroll wheel right
row: mouse click row number. The first row of the
Vim window is 1 and the last row is 'lines'.
col: mouse click column number. The maximum value
of {col} is 'columns'.
Note: row and col are always interpreted as
screen cells for the console application.
But, they may be interpreted as pixels
for the GUI, depending on "cell".
multiclick: set to 1 to inject a double-click mouse event.
modifiers: key modifiers. The supported values are:
4 shift is pressed
8 alt is pressed
16 ctrl is pressed
move: Optional; if used and TRUE then a mouse move
event can be generated.
Only {args} row: and col: are used and
required.
Only results in an event when 'mousemoveevent'
is set or a popup uses mouse move events.
cell: Optional for the GUI: when present and TRUE
then "move" uses screen cells instead of pixel
positions. Not used by the console.
"key":
Send a low-level keyboard event (e.g. keyup or keydown).
The supported items in {args} are:
event: The supported string values are:
keyup generate a keyup event
keydown generate a keydown event
keycode: Keycode to use for a keyup or a keydown event.
modifiers: Optional; key modifiers.
The supported values are:
2 shift is pressed
4 ctrl is pressed
8 alt is pressed
Note: These values are different from the
mouse modifiers.
execute: Optional. Similar to |feedkeys()| mode x.
When this is included and set to true
(non-zero) then Vim will process any buffered
unprocessed key events. All other {args}
items are optional when this is set and true.
Returns TRUE if the event is successfully added or executed,
FALSE if there is a failure.
Can also be used as a |method|: >
GetEvent()->test_mswin_event({args})
<
test_null_blob() *test_null_blob()* test_null_blob() *test_null_blob()*
Return a |Blob| that is null. Only useful for testing. Return a |Blob| that is null. Only useful for testing.
@@ -298,7 +369,7 @@ test_override({name}, {val}) *test_override()*
string is detected string is detected
ui_delay time in msec to use in ui_delay(); overrules a ui_delay time in msec to use in ui_delay(); overrules a
wait time of up to 3 seconds for messages wait time of up to 3 seconds for messages
uptime overrules sysinfo.uptime uptime overrules sysinfo.uptime
vterm_title setting the window title by a job running in a vterm_title setting the window title by a job running in a
terminal window terminal window
ALL clear all overrides, except alloc_lines ({val} is ALL clear all overrides, except alloc_lines ({val} is

View File

@@ -1,4 +1,4 @@
*textprop.txt* For Vim version 9.0. Last change: 2022 Nov 18 *textprop.txt* For Vim version 9.0. Last change: 2022 Dec 19
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -56,7 +56,7 @@ how to highlight the text. The property type can have these entries:
priority will be used. priority will be used.
"start_incl" when TRUE inserts at the start position will be "start_incl" when TRUE inserts at the start position will be
included in the text property included in the text property
"end_incl" when TRUE inserts at the end position will be "end_incl" when TRUE inserts at the end position will be
included in the text property included in the text property
@@ -107,14 +107,14 @@ prop_type_list([{props}]) get list of property types
Manipulating text properties: Manipulating text properties:
prop_add({lnum}, {col}, {props}) add a text property prop_add({lnum}, {col}, {props}) add a text property
prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) prop_add_list({props}, [{item}, ...])
add a text property at multiple add a text property at multiple
positions. positions.
prop_clear({lnum} [, {lnum-end} [, {bufnr}]]) prop_clear({lnum} [, {lnum-end} [, {bufnr}]])
remove all text properties remove all text properties
prop_find({props} [, {direction}]) search for a text property prop_find({props} [, {direction}]) search for a text property
prop_list({lnum} [, {props}]) text properties in {lnum} prop_list({lnum} [, {props}]) text properties in {lnum}
prop_remove({props} [, {lnum} [, {lnum-end}]]) prop_remove({props} [, {lnum} [, {lnum-end}]])
remove a text property remove a text property
@@ -149,7 +149,7 @@ prop_add({lnum}, {col}, {props})
highlighting; cannot be used with "length", highlighting; cannot be used with "length",
"end_lnum" and "end_col" "end_lnum" and "end_col"
See |virtual-text| for more information. See |virtual-text| for more information.
*E1294* *E1294*
text_align when "text" is present and {col} is zero; text_align when "text" is present and {col} is zero;
specifies where to display the text: specifies where to display the text:
after after the end of the line after after the end of the line
@@ -172,7 +172,7 @@ prop_add({lnum}, {col}, {props})
fit: fit:
wrap wrap the text to the next line wrap wrap the text to the next line
truncate truncate the text to make it fit truncate truncate the text to make it fit
When omitted "truncate" is used. When omitted "truncate" is used.
Note that this applies to the individual text Note that this applies to the individual text
property, the 'wrap' option sets the overall property, the 'wrap' option sets the overall
behavior behavior
@@ -220,10 +220,16 @@ prop_add({lnum}, {col}, {props})
Any Tab and other control character in the text will be Any Tab and other control character in the text will be
changed to a space (Rationale: otherwise the size of the text changed to a space (Rationale: otherwise the size of the text
is difficult to compute). is difficult to compute).
A negative "id" will be chosen and is returned. Once a A negative "id" will be chosen and is returned.
property with "text" has been added for a buffer then using a
negative "id" for any other property will give an error: Before text properties with text were supported it was
*E1293* possible to use a negative "id", even though this was very
rare. Now that negative "id"s are reserved for text
properties with text an error is given when using a negative
"id". When a text property with text already exists using a
negative "id" results in *E1293* . If a negative "id" was
used and later a text property with text is added results in
*E1339* .
Can also be used as a |method|: > Can also be used as a |method|: >
GetLnum()->prop_add(col, props) GetLnum()->prop_add(col, props)
@@ -257,12 +263,12 @@ prop_add_list({props}, [{item}, ...])
It is not possible to add a text property with a "text" field It is not possible to add a text property with a "text" field
here. here.
Example: Example: >
call prop_add_list(#{type: 'MyProp', id: 2}, call prop_add_list(#{type: 'MyProp', id: 2},
\ [[1, 4, 1, 7], \ [[1, 4, 1, 7],
\ [1, 15, 1, 20], \ [1, 15, 1, 20],
\ [2, 30, 3, 30]] \ [2, 30, 3, 30]]
<
Can also be used as a |method|: > Can also be used as a |method|: >
GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]]) GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]])

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.0. Last change: 2022 Dec 05 *todo.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,6 +38,25 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Crash when splitting window: #11961. Set RedrawingDisabled in
win_split_ins().
CI: include #12008 end of February.
In runtime/autoload/dist/script.vim change "set ft=" to "setlocal ft=" ?
CTRL-J mapping is not used if halfway another mapping. #12002
Is simplified mapping not used but escape code has been simplified?
Include #11952 after a runtime files update.
Errors when running tests with valgrind:
- test_codestyle.vim: e.g.:
command line..script /home/mool/vim/vim90/src/testdir/runtest.vim[569]..function RunTheTest[52]..Test_test_files line 6: keycode_check.vim: space before tab: Expected 0 but got 7
command line..script /home/mool/vim/vim90/src/testdir/runtest.vim[569]..function RunTheTest[52]..Test_test_files line 10: setup.vim: trailing white space: Expected 0 but got 23
- test_gui.vim:
Found errors in Test_gui_mouse_event():
Upcoming larger works: Upcoming larger works:
- Make spell checking work with recent .dic/.aff files, e.g. French. #4916 - Make spell checking work with recent .dic/.aff files, e.g. French. #4916
Make Vim understand the format somehow? Search for "spell" below. Make Vim understand the format somehow? Search for "spell" below.
@@ -53,15 +72,100 @@ Upcoming larger works:
Further Vim9 improvements, possibly after launch: Further Vim9 improvements, possibly after launch:
- implement :class and :interface: See |vim9-classes| #11544 - implement :class and :interface: See |vim9-classes
- Change access: public by default, private by prefixing "_".
Check for error: can't have same name twice (ignoring "_" prefix).
- Make ":defcompile ClassName" compile all functions and methods in the
class.
- Private methods?
either: private def Func()
or: def _Func()
Perhaps use "private" keyword instead of "_" prefix?
- "final" object members - can only be set in the constructor.
- accept line breaks in member initialization. #11957
- object empty(), len() - can class define a method to be used for them?
- add to help: when using a default new() method then reordering object
members may cause trouble. Can define new() without arguments to avoid.
- TODO items: check types for "implements" - members and methods
- how about lock/unlock?
- When checking "implements" also check types of members and function args.
- For chaining, allow using the class name as type for function return
value.
- Implement generics
- Add "instanceof" (exact class name). And "assignable" (class or child)?
- More efficient way for interface member index than iterating over list?
- a variant of type() that returns a different type for each class?
list<number> and list<string> should also differ.
- Issue #11822: any.Func() can be a dict or an object call, need to handle
this at runtime.
- implement :type - implement :type
- implement :enum - implement :enum
- Promise class, could be used to wait on a popup close callback?
- class local to a function
- Use Vim9 for more runtime files. - Use Vim9 for more runtime files.
- Inline call to map() and filter(), better type checking. - Inline call to map() and filter(), better type checking.
- When evaluating constants for script variables, some functions could work: - When evaluating constants for script variables, some functions could work:
has(featureName), len(someString) has(featureName), len(someString)
- Implement as part of an expression: ++expr, --expr, expr++, expr--. - Implement as part of an expression: ++expr, --expr, expr++, expr--.
Information missing in terminfo:
- Accept "hyper" and "meta" modifiers (16 and 32) from Kitty like Meta?
8 is actually "super".
- t_RV request terminal version string; xterm: "\033[>c"
change in terminfo for "RV" uses the wrong escape sequence 7 - 14 Jan only
Codes used for focus gained and lost (currently using use_xterm_like_mouse())
termcodes are hard-coded in set_termname(), not named.
Use the XF flag? enables recognizing the focus in/out events.
Check if t_fe is not empty.
Check for "1004" in t_XM. (disadvantage: only focus events when mouse is
used)
- t_fe enable focus-event tracking
- t_fd disable focus-event tracking
Modifiers for various keys
- flag to indicate "xterm compatible modifiers" ?
Underline and similar:
- t_AU - Set underline color: like "AF" and "AB" entries.
- t_Ce undercurl and underline end
- t_Cs undercurl (curly underline) mode
- t_Us double underline mode
- t_ds dotted underline mode
- t_Ds dashed underline mode
- t_Te strikethrough end
- t_Ts strikethrough mode
Cursor codes: |termcap-cursor-shape|
- t_RC request terminal cursor blinking
- t_RS request terminal cursor style
- t_VS cursor normally visible (no blink)
- t_SI start insert mode (bar cursor shape)
- t_SR start replace mode (underline cursor shape)
- t_EI end insert or replace mode (block cursor shape)
- t_SC set cursor color start
- t_EC set cursor color end
- t_SH set cursor shape
State requests:
- t_RF request terminal foreground color
- t_RB request terminal background color
Less important (not needed for regular editing):
- t_IS set icon text start
- t_IE set icon text end
- t_ST save window title to stack
- t_RT restore window title from stack
- t_Si save icon text to stack
- t_Ri restore icon text from stack
- t_WP set window position (Y, X) in pixels
- t_GP get window position (Y, X) in pixels
- t_WS set window size (height, width in cells)
Vim internal, but there should be a terminfo entry for these:
- t_8f set foreground color (R, G, B) in printf() format
- t_8b set background color (R, G, B) in printf() format
- t_8u set underline color (R, G, B) in printf() format
Probably Vim internal, not in terminfo:
- t_TE end of "raw" mode
- t_TI put terminal into "raw" mode
- t_RK request terminal keyboard protocol state; sent after |t_TI|
Already working, not properly documented:
- t_u7 request cursor position
Popup windows: Popup windows:
- Add a function to redraw a specific popup window. Esp. to be used when - Add a function to redraw a specific popup window. Esp. to be used when
editing the command line, when screen updating doesn't happen. (Shougo) editing the command line, when screen updating doesn't happen. (Shougo)
@@ -169,6 +273,8 @@ Terminal emulator window:
- When 'encoding' is not utf-8, or the job is using another encoding, setup - When 'encoding' is not utf-8, or the job is using another encoding, setup
conversions. conversions.
Patch adds showcmd() function #11708
Crash when a variable is removed while listing variables (Issue #11435) Crash when a variable is removed while listing variables (Issue #11435)
Autoconf: must use autoconf 2.69, later version generates lots of warnings Autoconf: must use autoconf 2.69, later version generates lots of warnings
@@ -204,14 +310,24 @@ https://github.com/vim/vim/pull/5566
PR #11579 to add visualtext(), return Visually selected text. PR #11579 to add visualtext(), return Visually selected text.
Stray characters in the shell #11719, caused by requesting a response for:
- XT key sequences
- Whether modifyOtherKeys is active
- Whether kitty keyboard protocol is active
Can we not request XT key sequences, or reduce them drastically?
Issue #10512: Dynamic loading broken with Perl 5.36 Issue #10512: Dynamic loading broken with Perl 5.36
Damien has a patch (2022 Dec 4) Damien has a patch (2022 Dec 4)
Request #11965: Allow severaql "%=" items in 'statusline', makes it possible
to have text in the center.
Add some kind of ":whathappend" command and functions to make visible what the Add some kind of ":whathappend" command and functions to make visible what the
last few typed keys and executed commands are. To be used when the user last few typed keys and executed commands are. To be used when the user
wonders what went wrong. wonders what went wrong. Could also be used for statistics #12046.
- typed keys - Normal mode command - like what is recorded in a register and - typed keys - Normal mode command - like what is recorded in a register and
displayed by 'showcmd'. displayed by 'showcmd'.
- register used - #12063
- executed command lines - executed command lines
- with more verbosity: what scripts/functions/autocommands were executed - with more verbosity: what scripts/functions/autocommands were executed
@@ -246,7 +362,7 @@ Better terminal emulator support:
"xterm" and then add "kitty" entries. "xterm" and then add "kitty" entries.
Using "A" and "o" in manually created fold (in empty buffer) does not behave Using "A" and "o" in manually created fold (in empty buffer) does not behave
consistenly (James McCoy, #10698) consistently (James McCoy, #10698)
In a timer callback, when using ":echo" and then input() the message is In a timer callback, when using ":echo" and then input() the message is
overwritten. Could use ":echowin" and call redraw_cmd() in get_user_input(). overwritten. Could use ":echowin" and call redraw_cmd() in get_user_input().
@@ -291,8 +407,6 @@ IDEA: when drawing the text, store the text byte index in ScreenLinesIdx[].
When converting screen column to text position use this. When converting screen column to text position use this.
The line number can be obtained from win->w_lines[]. The line number can be obtained from win->w_lines[].
MS-Windows: did path modifier :p:8 stop working? #8600
Version of getchar() that does not move the cursor - #10603 Use a separate Version of getchar() that does not move the cursor - #10603 Use a separate
argument for the new flag. argument for the new flag.
@@ -374,6 +488,9 @@ Any way to convert "$" back by using a special value? (#6901)
Can we detect true color support? https://gist.github.com/XVilka/8346728 Can we detect true color support? https://gist.github.com/XVilka/8346728
Try setting a color then request the current color, like using t_u7. Try setting a color then request the current color, like using t_u7.
Add a v:register_used variable, which has the name of the register used for
the last command, e.g. put. #12003
Make the jumplist behave like a tag stack. (#7738) Should there be a more Make the jumplist behave like a tag stack. (#7738) Should there be a more
time bound navigation, like with undo? time bound navigation, like with undo?
@@ -418,6 +535,10 @@ work.
Using "au!" after "filetype on" is a bit slow. Can the matching of Using "au!" after "filetype on" is a bit slow. Can the matching of
autocommands be made faster? (#7056) autocommands be made faster? (#7056)
Using a search pattern containing "\%V" and 'hlsearch' set keeps old matches
when the Visual area changes. #11694. Do a redraw when starting a Visual
selection?
Append in Visual block mode inserts the wrong character. Append in Visual block mode inserts the wrong character.
Test_visual_block_mode() already has the proper check, which is commented out. Test_visual_block_mode() already has the proper check, which is commented out.
(#8288) (#8288)
@@ -585,6 +706,7 @@ Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work.
Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use
t:diffexpr_option t:diffopt_option? (#4782) t:diffexpr_option t:diffopt_option? (#4782)
Also make 'scrollopt' tab-local, remove "hor" only for the current tab page.
Internal diff doesn't handle binary file like external diff does. (Mike Internal diff doesn't handle binary file like external diff does. (Mike
Williams, 2018 Oct 30) Williams, 2018 Oct 30)
@@ -1075,9 +1197,6 @@ Avoids exceptions, e.g. when using the b: namespace as a dict.
Patch to make v:shell_error writable. (Christian Brabandt, 2016 Sep 27) Patch to make v:shell_error writable. (Christian Brabandt, 2016 Sep 27)
Useful to restore it. Is there another solution? Useful to restore it. Is there another solution?
"ci[" does not look for next [ like ci" does look for next ".
(J.F. 2017 Jan 7)
Patch for wrong cursor position on wrapped line, involving breakindent. Patch for wrong cursor position on wrapped line, involving breakindent.
(Ozaki Kiichi, 2016 Nov 25) (Ozaki Kiichi, 2016 Nov 25)
@@ -1101,9 +1220,6 @@ Should :vmap in matchit.vim be :xmap? (Tony Mechelynck)
Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807) Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807)
Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we
no longer support.
Support sort(l, 'F'), convert strings to float. (#7857) Support sort(l, 'F'), convert strings to float. (#7857)
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
@@ -1289,9 +1405,6 @@ Do not include the linebreak at the start?
Feature request: add the "al" text object, to manipulate a screen line. Feature request: add the "al" text object, to manipulate a screen line.
Especially useful when using 'linebreak' Especially useful when using 'linebreak'
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
Patch to avoid redrawing tabline when the popup menu is visible. Patch to avoid redrawing tabline when the popup menu is visible.
(Christian Brabandt, 2016 Jan 28) (Christian Brabandt, 2016 Jan 28)
@@ -2876,10 +2989,6 @@ Win32 GUI known bugs:
console, go back to Vim and click "reload" in the dialog for the changed console, go back to Vim and click "reload" in the dialog for the changed
file: Window moves with the cursor! file: Window moves with the cursor!
Put focus event in input buffer and let generic Vim code handle it? Put focus event in input buffer and let generic Vim code handle it?
8 Win32 GUI: With maximized window, ":set go-=r" doesn't use the space that
comes available. (Poucet) It works OK on Win 98 but doesn't work on Win
NT 4.0. Leaves a grey area where the scrollbar was. ":set go+=r" also
doesn't work properly.
8 When Vim is minimized and when maximizing it a file-changed dialog pops 8 When Vim is minimized and when maximizing it a file-changed dialog pops
up, Vim isn't maximized. It should be done before the dialog, so that it up, Vim isn't maximized. It should be done before the dialog, so that it
appears in the right position. (Webb) appears in the right position. (Webb)
@@ -3403,8 +3512,6 @@ Problems that will (probably) not be solved:
input method called from GDK code. Without Perl it doesn't crash. input method called from GDK code. Without Perl it doesn't crash.
- VMS: Vimdiff doesn't work with the VMS diff, because the output looks - VMS: Vimdiff doesn't work with the VMS diff, because the output looks
different. This makes test 47 fail. Install a Unix-compatible diff. different. This makes test 47 fail. Install a Unix-compatible diff.
- Win32 GUI: mouse wheel always scrolls rightmost window. The events arrive
in Vim as if the rightmost scrollbar was used.
- GTK with Gnome: Produces an error message when starting up: - GTK with Gnome: Produces an error message when starting up:
Gdk-WARNING **: locale not supported by C library Gdk-WARNING **: locale not supported by C library
This is caused by the gnome library gnome_init() setting $LC_CTYPE to This is caused by the gnome library gnome_init() setting $LC_CTYPE to
@@ -4361,8 +4468,6 @@ Tags:
Win32 GUI: Win32 GUI:
8 Make debug mode work while starting up (vim -D). Open console window for 8 Make debug mode work while starting up (vim -D). Open console window for
the message and input? the message and input?
7 GvimExt: when there are several existing Vims, move the list to a submenu.
(Mike McCollister)
8 When using "Edit with Vim" for one file it changes directory, when several 8 When using "Edit with Vim" for one file it changes directory, when several
files are selected and using "Edit with single Vim" the directory isn't files are selected and using "Edit with single Vim" the directory isn't
changed. At least change directory when the path is the same for all changed. At least change directory when the path is the same for all
@@ -5907,7 +6012,7 @@ Various improvements:
many percent down the windows). many percent down the windows).
- Make it possible for the 'showbreak' to be displayed at the end of the - Make it possible for the 'showbreak' to be displayed at the end of the
line. Use a comma to separate the part at the end and the start of the line. Use a comma to separate the part at the end and the start of the
line? Highlight the linebreak characters, add flag in 'highlight'. line? #754 Highlight the linebreak characters, add flag in 'highlight'.
Make 'showbreak' local to a window. Make 'showbreak' local to a window.
- Some string options should be expanded if they have wildcards, e.g. - Some string options should be expanded if they have wildcards, e.g.
'dictionary' when it is "*.h". 'dictionary' when it is "*.h".

View File

@@ -250,7 +250,7 @@ Credit Card: You can use PayPal to send money with a Credit card. This is
Bram@iccf-holland.org Bram@iccf-holland.org
Others: Transfer to this account if possible: Others: Transfer to this account if possible:
ING bank: IBAN: NL95 INGB 0004 5487 74 ING bank: IBAN: NL95 INGB 0004 5487 74
Swift code: INGBNL2A Swift code: INGBNL2A
under the name "stichting ICCF Holland", Amersfoort under the name "stichting ICCF Holland", Amersfoort
Checks are not accepted. Checks are not accepted.

View File

@@ -1,4 +1,4 @@
*userfunc.txt* For Vim version 9.0. Last change: 2022 Nov 17 *userfunc.txt* For Vim version 9.0. Last change: 2023 Feb 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -187,12 +187,21 @@ See |:verbose-cmd| for more information.
If "[expr]" is not given, the number 0 is returned. If "[expr]" is not given, the number 0 is returned.
When a function ends without an explicit ":return", When a function ends without an explicit ":return",
the number 0 is returned. the number 0 is returned.
In a :def function *E1095* is given if unreachable In a :def function *E1095* is given if unreachable
code follows after the `:return`. code follows after the `:return`.
In legacy script there is no check for unreachable In legacy script there is no check for unreachable
lines, thus there is no warning if commands follow lines, thus there is no warning if commands follow
`:return`. `:return`. Also, there is no check if the following
line contains a valid command. Forgetting the line
continuation backslash may go unnoticed: >
return 'some text'
.. ' some more text'
< Will happily return "some text" without an error. It
should have been: >
return 'some text'
\ .. ' some more text'
<
If the ":return" is used after a |:try| but before the If the ":return" is used after a |:try| but before the
matching |:finally| (if present), the commands matching |:finally| (if present), the commands
following the ":finally" up to the matching |:endtry| following the ":finally" up to the matching |:endtry|
@@ -202,7 +211,8 @@ See |:verbose-cmd| for more information.
*function-argument* *a:var* *function-argument* *a:var*
An argument can be defined by giving its name. In the function this can then An argument can be defined by giving its name. In the function this can then
be used as "a:name" ("a:" for argument). be used as "a:name" ("a:" for argument) (in a `:def` function "a:" is not
used).
*a:0* *a:1* *a:000* *E740* *...* *a:0* *a:1* *a:000* *E740* *...*
Up to 20 arguments can be given, separated by commas. After the named Up to 20 arguments can be given, separated by commas. After the named
arguments an argument "..." can be specified, which means that more arguments arguments an argument "..." can be specified, which means that more arguments
@@ -237,9 +247,10 @@ Example: >
call Something('key', 20) "key: 20" call Something('key', 20) "key: 20"
The argument default expressions are evaluated at the time of the function 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 call, not when the function is defined. Thus it is possible to use an
invalid the moment the function is defined. The expressions are also only expression which is invalid the moment the function is defined. The
evaluated when arguments are not specified during a call. expressions are also only evaluated when arguments are not specified during a
call.
*none-function_argument* *none-function_argument*
You can pass |v:none| to use the default expression. Note that this means you 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 cannot pass v:none as an ordinary value when an argument has a default

View File

@@ -505,7 +505,7 @@ You can use the error ID at the start to find help about it: >
:help E37 :help E37
Summary: *help-summary* > Summary: *help-summary* >
1) Use Ctrl-D after typing a topic and let Vim show all available topics. 1) Use Ctrl-D after typing a topic and let Vim show all available topics.
Or press Tab to complete: > Or press Tab to complete: >

View File

@@ -409,7 +409,7 @@ an archive or as a repository. For an archive you can follow these steps:
package. package.
2. unpack the archive in that directory. This assumes the top 2. unpack the archive in that directory. This assumes the top
directory in the archive is "start": > directory in the archive is "start": >
cd ~/.vim/pack/fancy cd ~/.vim/pack/fancy
unzip /tmp/fancy.zip unzip /tmp/fancy.zip
< If the archive layout is different make sure that you end up with a < If the archive layout is different make sure that you end up with a
path like this: path like this:

View File

@@ -77,25 +77,25 @@ browser. This is what you get: >
9. Directory Browsing netrw-browse netrw-dir netrw-list netrw-help 9. Directory Browsing netrw-browse netrw-dir netrw-list netrw-help
MAPS netrw-maps MAPS netrw-maps
<F1>.............Help.......................................|netrw-help| <F1>.............Help.......................................|netrw-help|
<cr>.............Browsing...................................|netrw-cr| <cr>.............Browsing...................................|netrw-cr|
<del>............Deleting Files or Directories..............|netrw-delete| <del>............Deleting Files or Directories..............|netrw-delete|
-................Going Up...................................|netrw--| -................Going Up...................................|netrw--|
a................Hiding Files or Directories................|netrw-a| a................Hiding Files or Directories................|netrw-a|
mb...............Bookmarking a Directory....................|netrw-mb| mb...............Bookmarking a Directory....................|netrw-mb|
gb...............Changing to a Bookmarked Directory.........|netrw-gb| gb...............Changing to a Bookmarked Directory.........|netrw-gb|
cd...............Make Browsing Directory The Current Dir....|netrw-c| cd...............Make Browsing Directory The Current Dir....|netrw-c|
d................Make A New Directory.......................|netrw-d| d................Make A New Directory.......................|netrw-d|
D................Deleting Files or Directories..............|netrw-D| D................Deleting Files or Directories..............|netrw-D|
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h| <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
i................Change Listing Style.......................|netrw-i| i................Change Listing Style.......................|netrw-i|
<c-l>............Refreshing the Listing.....................|netrw-ctrl-l| <c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
o................Browsing with a Horizontal Split...........|netrw-o| o................Browsing with a Horizontal Split...........|netrw-o|
p................Use Preview Window.........................|netrw-p| p................Use Preview Window.........................|netrw-p|
P................Edit in Previous Window....................|netrw-p| P................Edit in Previous Window....................|netrw-p|
q................Listing Bookmarks and History..............|netrw-qb| q................Listing Bookmarks and History..............|netrw-qb|
r................Reversing Sorting Order....................|netrw-r| r................Reversing Sorting Order....................|netrw-r|
< (etc) < (etc)
The <F1> key thus brings you to a netrw directory browsing contents help page. The <F1> key thus brings you to a netrw directory browsing contents help page.
It's a regular help page; use the usual |CTRL-]| to jump to tagged help items It's a regular help page; use the usual |CTRL-]| to jump to tagged help items
@@ -106,7 +106,7 @@ To select files for display and editing: (with the cursor is atop a filename)
<enter> Open the file in the current window. |netrw-cr| <enter> Open the file in the current window. |netrw-cr|
o Horizontally split window and display file |netrw-o| o Horizontally split window and display file |netrw-o|
v Vertically split window and display file |netrw-v| v Vertically split window and display file |netrw-v|
p Use the |preview-window| |netrw-p| p Use the |preview-window| |netrw-p|
P Edit in the previous window |netrw-P| P Edit in the previous window |netrw-P|
t Open file in a new tab |netrw-t| t Open file in a new tab |netrw-t|

View File

@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 9.0. Last change: 2022 Dec 05 *usr_41.txt* For Vim version 9.0. Last change: 2023 Jan 17
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@@ -757,6 +757,7 @@ String manipulation: *string-functions*
strwidth() size of string when displayed strwidth() size of string when displayed
strdisplaywidth() size of string when displayed, deals with tabs strdisplaywidth() size of string when displayed, deals with tabs
setcellwidths() set character cell width overrides setcellwidths() set character cell width overrides
getcellwidths() get character cell width overrides
substitute() substitute a pattern match with a string substitute() substitute a pattern match with a string
submatch() get a specific match in ":s" and substitute() submatch() get a specific match in ":s" and substitute()
strpart() get part of a string using byte index strpart() get part of a string using byte index
@@ -1186,6 +1187,7 @@ Testing: *test-functions*
test_getvalue() get value of an internal variable test_getvalue() get value of an internal variable
test_gui_event() generate a GUI event for testing test_gui_event() generate a GUI event for testing
test_ignore_error() ignore a specific error message test_ignore_error() ignore a specific error message
test_mswin_event() generate an MS-Windows event
test_null_blob() return a null Blob test_null_blob() return a null Blob
test_null_channel() return a null Channel test_null_channel() return a null Channel
test_null_dict() return a null Dict test_null_dict() return a null Dict

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 9.0. Last change: 2022 Nov 04 *various.txt* For Vim version 9.0. Last change: 2022 Dec 13
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -496,7 +496,7 @@ T *+visualextra* extra Visual mode commands |blockwise-operators|
T *+vreplace* |gR| and |gr| T *+vreplace* |gR| and |gr|
*+vtp* on MS-Windows console: support for 'termguicolors' *+vtp* on MS-Windows console: support for 'termguicolors'
T *+wildignore* |'wildignore'| Always enabled since 9.0.0278 T *+wildignore* |'wildignore'| Always enabled since 9.0.0278
T *+wildmenu* |'wildmenu'|| Always enabled since 9.0.0279 T *+wildmenu* |'wildmenu'| Always enabled since 9.0.0279
T *+windows* more than one window; Always enabled since 8.0.1118. T *+windows* more than one window; Always enabled since 8.0.1118.
m *+writebackup* |'writebackup'| is default on m *+writebackup* |'writebackup'| is default on
m *+xim* X input method |xim| m *+xim* X input method |xim|

View File

@@ -8123,7 +8123,7 @@ Files: src/message.c
Patch 7.2.119 Patch 7.2.119
Problem: Status line is redrawn too often. Problem: Status line is redrawn too often.
Solution: Check ScreeenLinesUC[] properly. (Yukihiro Nakadaira) Solution: Check ScreenLinesUC[] properly. (Yukihiro Nakadaira)
Files: src/screen.c Files: src/screen.c
Patch 7.2.120 Patch 7.2.120
@@ -9782,8 +9782,8 @@ Files: src/syntax.c
Patch 7.2.406 Patch 7.2.406
Problem: Patch 7.2.119 introduces uninit mem read. (Dominique Pelle) Problem: Patch 7.2.119 introduces uninit mem read. (Dominique Pelle)
Solution: Only used ScreeenLinesC when ScreeenLinesUC is not zero. (Yukihiro Solution: Only used ScreenLinesC when ScreenLinesUC is not zero. (Yukihiro
Nakadaira) Also clear ScreeenLinesC when allocating. Nakadaira) Also clear ScreenLinesC when allocating.
Files: src/screen.c Files: src/screen.c
Patch 7.2.407 Patch 7.2.407

View File

@@ -342,11 +342,11 @@ New Vim variables: ~
|v:mouse_winid| Window ID for a mouse click obtained with |getchar()| |v:mouse_winid| Window ID for a mouse click obtained with |getchar()|
|v:none| an empty String, used for JSON |v:none| an empty String, used for JSON
|v:null| an empty String, used for JSON |v:null| an empty String, used for JSON
|v:option_new| new value of the option, used by |OptionSet| |v:option_new| new value of the option, used by |OptionSet|
|v:option_old| old value of the option, used by |OptionSet| |v:option_old| old value of the option, used by |OptionSet|
|v:option_oldlocal| old local value of the option, used by |OptionSet| |v:option_oldlocal| old local value of the option, used by |OptionSet|
|v:option_oldglobal| old global value of the option, used by |OptionSet| |v:option_oldglobal| old global value of the option, used by |OptionSet|
|v:option_type| scope of the set command, used by |OptionSet| |v:option_type| scope of the set command, used by |OptionSet|
|v:option_command| command used to set the option, used by |OptionSet| |v:option_command| command used to set the option, used by |OptionSet|
|v:progpath| the command with which Vim was invoked |v:progpath| the command with which Vim was invoked
|v:t_bool| value of Boolean type |v:t_bool| value of Boolean type

View File

@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 9.0. Last change: 2022 Dec 03 *vim9.txt* For Vim version 9.0. Last change: 2023 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -105,7 +105,7 @@ script and `:def` functions; details are below:
`:open` `:open`
`:s` with only flags `:s` with only flags
`:t` `:t`
`:xit` `:xit`
- Some commands, especially those used for flow control, cannot be shortened. - Some commands, especially those used for flow control, cannot be shortened.
E.g., `:throw` cannot be written as `:th`. *vim9-no-shorten* E.g., `:throw` cannot be written as `:th`. *vim9-no-shorten*
- You cannot use curly-braces names. - You cannot use curly-braces names.
@@ -113,7 +113,7 @@ script and `:def` functions; details are below:
:%s/this/that :%s/this/that
- Executing a register with "@r" does not work, you can prepend a colon or use - Executing a register with "@r" does not work, you can prepend a colon or use
`:exe`: > `:exe`: >
:exe @a :exe @a
- Unless mentioned specifically, the highest |scriptversion| is used. - Unless mentioned specifically, the highest |scriptversion| is used.
- When defining an expression mapping, the expression will be evaluated in the - When defining an expression mapping, the expression will be evaluated in the
context of the script where it was defined. context of the script where it was defined.
@@ -265,7 +265,7 @@ Detail: this is because "Inner" will actually become a function reference to a
function with a generated name. function with a generated name.
It is not possible to define a script-local function in a function. You can It is not possible to define a script-local function in a function. You can
define a local function and assign it to a script-local funcref (it must have define a local function and assign it to a script-local Funcref (it must have
been declared at the script level). It is possible to define a global been declared at the script level). It is possible to define a global
function by using the "g:" prefix. function by using the "g:" prefix.
@@ -388,7 +388,6 @@ used: >
echo temp # Error! echo temp # Error!
This is especially useful in a user command: > This is especially useful in a user command: >
command -range Rename { command -range Rename {
var save = @a var save = @a
@a = 'some expression' @a = 'some expression'
@@ -397,7 +396,6 @@ This is especially useful in a user command: >
} }
And with autocommands: > And with autocommands: >
au BufWritePre *.go { au BufWritePre *.go {
var save = winsaveview() var save = winsaveview()
silent! exe ':%! some formatting command' silent! exe ':%! some formatting command'
@@ -624,7 +622,7 @@ Additionally, a lambda can contain statements in {}: >
} }
This can be useful for a timer, for example: > This can be useful for a timer, for example: >
var count = 0 var count = 0
var timer = timer_start(500, (_) => { var timer = timer_start(500, (_) => {
count += 1 count += 1
echom 'Handler called ' .. count echom 'Handler called ' .. count
}, {repeat: 3}) }, {repeat: 3})
@@ -746,7 +744,7 @@ continuation is used without a backslash and a line starts with a bar: >
*E1050* *E1050*
To make it possible for the operator at the start of the line to be To make it possible for the operator at the start of the line to be
recognized, it is required to put a colon before a range. This example will recognized, it is required to put a colon before a range. This example will
add "start" and print: > add "start" and "print": >
var result = start var result = start
+ print + print
Like this: > Like this: >
@@ -805,7 +803,7 @@ Notes:
echo [1, 2] echo [1, 2]
[3, 4] [3, 4]
- In some cases it is difficult for Vim to parse a command, especially when - In some cases it is difficult for Vim to parse a command, especially when
commands are used as an argument to another command, such as `windo`. In commands are used as an argument to another command, such as `:windo`. In
those cases the line continuation with a backslash has to be used. those cases the line continuation with a backslash has to be used.
@@ -826,7 +824,7 @@ White space is required around most operators.
White space is required in a sublist (list slice) around the ":", except at White space is required in a sublist (list slice) around the ":", except at
the start and end: > the start and end: >
otherlist = mylist[v : count] # v:count has a different meaning otherlist = mylist[v : count] # v:count has a different meaning
otherlist = mylist[:] # make a copy of the List otherlist = mylist[:] # make a copy of the List
otherlist = mylist[v :] otherlist = mylist[v :]
otherlist = mylist[: v] otherlist = mylist[: v]
@@ -881,7 +879,7 @@ This works for alphanumeric characters, underscore and dash. If you want to
use another character, use a single or double quoted string: > use another character, use a single or double quoted string: >
var dict = {'key with space': value} var dict = {'key with space': value}
var dict = {"key\twith\ttabs": value} var dict = {"key\twith\ttabs": value}
var dict = {'': value} # empty key var dict = {'': value} # empty key
< *E1139* < *E1139*
In case the key needs to be an expression, square brackets can be used, just In case the key needs to be an expression, square brackets can be used, just
like in JavaScript: > like in JavaScript: >
@@ -1023,7 +1021,9 @@ always converted to string: >
Simple types are Number, Float, Special and Bool. For other types |string()| Simple types are Number, Float, Special and Bool. For other types |string()|
should be used. should be used.
*false* *true* *null* *E1034* *false* *true* *null* *null_blob* *null_channel*
*null_dict* *null_function* *null_job* *null_list*
*null_partial* *null_string* *E1034*
In Vim9 script one can use the following predefined values: > In Vim9 script one can use the following predefined values: >
true true
false false
@@ -1254,6 +1254,7 @@ level. They cannot be created in a function, also not in a legacy function.
:defc[ompile] Compile functions defined in the current script that :defc[ompile] Compile functions defined in the current script that
were not compiled yet. were not compiled yet.
This will report any errors found during compilation. This will report any errors found during compilation.
This excludes functions defined inside a class.
:defc[ompile] {func} :defc[ompile] {func}
:defc[ompile] debug {func} :defc[ompile] debug {func}
@@ -1261,6 +1262,10 @@ level. They cannot be created in a function, also not in a legacy function.
Compile function {func}, if needed. Use "debug" and Compile function {func}, if needed. Use "debug" and
"profile" to specify the compilation mode. "profile" to specify the compilation mode.
This will report any errors found during compilation. This will report any errors found during compilation.
{func} call also be "ClassName.functionName" to
compile a function or method in a class.
{func} call also be "ClassName" to compile all
functions and methods in a class.
*:disa* *:disassemble* *:disa* *:disassemble*
:disa[ssemble] {func} Show the instructions generated for {func}. :disa[ssemble] {func} Show the instructions generated for {func}.
@@ -1309,7 +1314,7 @@ Closures defined in a loop will share the same context. For example: >
< *E1271* < *E1271*
A closure must be compiled in the context that it is defined in, so that A closure must be compiled in the context that it is defined in, so that
variables in that context can be found. This mostly happens correctly, except variables in that context can be found. This mostly happens correctly, except
when a function is marked for debugging with `breakadd` after it was compiled. when a function is marked for debugging with `:breakadd` after it was compiled.
Make sure to define the breakpoint before compiling the outer function. Make sure to define the breakpoint before compiling the outer function.
The "inloop" variable will exist only once, all closures put in the list refer The "inloop" variable will exist only once, all closures put in the list refer
@@ -1351,7 +1356,7 @@ closure: >
} }
endfor endfor
Using `echowindow` is useful in a timer, the messages go into a popup and will Using `:echowindow` is useful in a timer, the messages go into a popup and will
not interfere with what the user is doing when it triggers. not interfere with what the user is doing when it triggers.
@@ -1402,7 +1407,7 @@ to a Vim9 function:
echo line(1) .. line(2) echo line(1) .. line(2)
- line continuation does not always require a backslash: > - line continuation does not always require a backslash: >
echo ['one', echo ['one',
\ 'two', \ 'two',
\ 'three' \ 'three'
\ ] \ ]
@@ -1592,7 +1597,7 @@ That is because the declaration looks like a list of numbers, thus is
equivalent to: > equivalent to: >
var ll: list<number> = [1, 2, 3] var ll: list<number> = [1, 2, 3]
If you do want a more permissive list you need to declare the type: > If you do want a more permissive list you need to declare the type: >
var ll: list<any = [1, 2, 3] var ll: list<any> = [1, 2, 3]
ll->extend(['x']) # OK ll->extend(['x']) # OK

View File

@@ -1,21 +1,22 @@
*vim9class.txt* For Vim version 9.0. Last change: 2022 Dec 04 *vim9class.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
NOTE - This is under development, anything can still change! - NOTE NOTE - This is not finished yet, anything can still change! - NOTE
Vim9 classes, objects, interfaces, types and enums. Vim9 classes, objects, interfaces, types and enums.
1. Overview |Vim9-class-overview| 1. Overview |Vim9-class-overview|
2. A simple class |Vim9-simple-class| 2. A simple class |Vim9-simple-class|
3. Using an abstract class |Vim9-abstract-class| 3. Class members and functions |Vim9-class-member|
4. Using an interface |Vim9-using-interface| 4. Using an abstract class |Vim9-abstract-class|
5. More class details |Vim9-class| 5. Using an interface |Vim9-using-interface|
6. Type definition |Vim9-type| 6. More class details |Vim9-class|
7. Enum |Vim9-enum| 7. Type definition |Vim9-type|
8. Enum |Vim9-enum|
9. Rationale 9. Rationale
10. To be done later 10. To be done later
@@ -25,25 +26,25 @@ Vim9 classes, objects, interfaces, types and enums.
1. Overview *Vim9-class-overview* 1. Overview *Vim9-class-overview*
The fancy term is "object-oriented programming". You can find lots of study The fancy term is "object-oriented programming". You can find lots of study
material about this subject. Here we document what |Vim9| script provides, material on this subject. Here we document what |Vim9| script provides,
assuming you know the basics already. Added are helpful hints about how assuming you know the basics already. Added are helpful hints about how to
to use this functionality effectively. use this functionality effectively.
The basic item is an object: The basic item is an object:
- An object stores state. It contains one or more variables that can each - An object stores state. It contains one or more variables that can each
have a value. have a value.
- An object usually provides functions that manipulate its state. These - An object provides functions that use and manipulate its state. These
functions are invoked "on the object", which is what sets it apart from the functions are invoked "on the object", which is what sets it apart from the
traditional separation of data and code that manipulates the data. traditional separation of data and code that manipulates the data.
- An object has a well defined interface, with typed member variables and - An object has a well defined interface, with typed member variables and
member functions. member functions.
- Objects are created by a class and all objects have the same interface. - Objects are created from a class and all objects have the same interface.
This never changes, it is not dynamic. This does not change at runtime, it is not dynamic.
An object can only be created by a class. A class provides: An object can only be created by a class. A class provides:
- A new() method, the constructor, which returns an object for the class. - A new() method, the constructor, which returns an object for the class.
This method is invoked on the class name: MyClass.new(). This method is invoked on the class name: MyClass.new().
- State shared by all objects of the class: class variables and constants. - State shared by all objects of the class: class variables (class members).
- A hierarchy of classes, with super-classes and sub-classes, inheritance. - A hierarchy of classes, with super-classes and sub-classes, inheritance.
An interface is used to specify properties of an object: An interface is used to specify properties of an object:
@@ -62,17 +63,18 @@ teachers use real-world objects to explain class relations and you might think
your model should therefore reflect the real world. It doesn't! The model your model should therefore reflect the real world. It doesn't! The model
should match your purpose. should match your purpose.
You will soon find that composition is often better than inheritance. Don't Keep in mind that composition (an object contains other objects) is often
waste time trying to find the optimal class model. Or waste time discussing better than inheritance (an object extends another object). Don't waste time
whether a square is a rectangle or that a rectangle is a square. It doesn't trying to find the optimal class model. Or waste time discussing whether a
matter. square is a rectangle or that a rectangle is a square. It doesn't matter.
============================================================================== ==============================================================================
2. A simple class *Vim9-simple-class* 2. A simple class *Vim9-simple-class*
Let's start with a simple example: a class that stores a text position: > Let's start with a simple example: a class that stores a text position (see
below for how to do this more efficiently): >
class TextPosition class TextPosition
this.lnum: number this.lnum: number
@@ -96,7 +98,7 @@ Let's start with a simple example: a class that stores a text position: >
this.col = col this.col = col
enddef enddef
endclass endclass
< *object* *Object*
You can create an object from this class with the new() method: > You can create an object from this class with the new() method: >
var pos = TextPosition.new(1, 1) var pos = TextPosition.new(1, 1)
@@ -104,10 +106,10 @@ You can create an object from this class with the new() method: >
The object members "lnum" and "col" can be accessed directly: > The object members "lnum" and "col" can be accessed directly: >
echo $'The text position is ({pos.lnum}, {pos.col})' echo $'The text position is ({pos.lnum}, {pos.col})'
< *E1317* *E1327*
If you have been using other object-oriented languages you will notice that If you have been using other object-oriented languages you will notice that
in Vim the object members are consistently referred to with the "this." in Vim the object members are consistently referred to with the "this."
prefix. This is different from languages like Java and TypeScript. This prefix. This is different from languages like Java and TypeScript. The
naming convention makes the object members easy to spot. Also, when a naming convention makes the object members easy to spot. Also, when a
variable does not have the "this." prefix you know it is not an object member. variable does not have the "this." prefix you know it is not an object member.
@@ -117,9 +119,9 @@ Member write access ~
Now try to change an object member directly: > Now try to change an object member directly: >
pos.lnum = 9 pos.lnum = 9
< *E1335*
This will give you an error! That is because by default object members can be This will give you an error! That is because by default object members can be
read but not set. That's why the class provides a method for it: > read but not set. That's why the TextPosition class provides a method for it: >
pos.SetLnum(9) pos.SetLnum(9)
@@ -128,19 +130,23 @@ way. Most often there is no problem using a value, while setting a value may
have side effects that need to be taken care of. In this case, the SetLnum() have side effects that need to be taken care of. In this case, the SetLnum()
method could check if the line number is valid and either give an error or use method could check if the line number is valid and either give an error or use
the closest valid value. the closest valid value.
*:public* *E1331*
If you don't care about side effects and want to allow the object member to be If you don't care about side effects and want to allow the object member to be
changed at any time, you can make it public: > changed at any time, you can make it public: >
public this.lnum: number public this.lnum: number
public this.col number public this.col: number
Now you don't need the SetLnum(), SetCol() and SetPosition() methods, setting Now you don't need the SetLnum(), SetCol() and SetPosition() methods, setting
"pos.lnum" directly above will no longer give an error. "pos.lnum" directly above will no longer give an error.
*E1334*
If you try to set an object member that doesn't exist you get an error: >
pos.other = 9
< E1334: Object member not found: other ~
Private members ~ Private members ~
*E1332* *E1333*
On the other hand, if you do not want the object members to be read directly, On the other hand, if you do not want the object members to be read directly,
you can make them private. This is done by prefixing an underscore to the you can make them private. This is done by prefixing an underscore to the
name: > name: >
@@ -149,7 +155,7 @@ name: >
this._col number this._col number
Now you need to provide methods to get the value of the private members. Now you need to provide methods to get the value of the private members.
These are commonly call getters. We recommend using a name that starts with These are commonly called getters. We recommend using a name that starts with
"Get": > "Get": >
def GetLnum(): number def GetLnum(): number
@@ -177,6 +183,7 @@ Simplifying the new() method ~
Many constructors take values for the object members. Thus you very often see Many constructors take values for the object members. Thus you very often see
this pattern: > this pattern: >
class SomeClass
this.lnum: number this.lnum: number
this.col: number this.col: number
@@ -184,6 +191,7 @@ this pattern: >
this.lnum = lnum this.lnum = lnum
this.col = col this.col = col
enddef enddef
endclass
Not only is this text you need to write, it also has the type of each member Not only is this text you need to write, it also has the type of each member
twice. Since this is so common a shorter way to write new() is provided: > twice. Since this is so common a shorter way to write new() is provided: >
@@ -193,8 +201,24 @@ twice. Since this is so common a shorter way to write new() is provided: >
The semantics are easy to understand: Providing the object member name, The semantics are easy to understand: Providing the object member name,
including "this.", as the argument to new() means the value provided in the including "this.", as the argument to new() means the value provided in the
new() call is assigned to that object member. This mechanism is coming from new() call is assigned to that object member. This mechanism comes from the
the Dart language. Dart language.
Putting together this way of using new() and making the members public results
in a much shorter class definition as what we started with: >
class TextPosition
public this.lnum: number
public this.col: number
def new(this.lnum, this.col)
enddef
def SetPosition(lnum: number, col: number)
this.lnum = lnum
this.col = col
enddef
endclass
The sequence of constructing a new object is: The sequence of constructing a new object is:
1. Memory is allocated and cleared. All values are zero/false/empty. 1. Memory is allocated and cleared. All values are zero/false/empty.
@@ -204,22 +228,69 @@ The sequence of constructing a new object is:
3. Arguments in the new() method in the "this.name" form are assigned. 3. Arguments in the new() method in the "this.name" form are assigned.
4. The body of the new() method is executed. 4. The body of the new() method is executed.
TODO: for a sub-class the constructor of the parent class will be invoked If the class extends a parent class, the same thing happens. In the second
somewhere. step the members of the parent class are done first. There is no need to call
"super()" or "new()" on the parent.
============================================================================== ==============================================================================
3. Using an abstract class *Vim9-abstract-class* 3. class members and functions *Vim9-class-member*
*:static* *E1337* *E1338*
Class members are declared with "static". They are used by the name without a
prefix: >
class OtherThing
this.size: number
static totalSize: number
def new(this.size)
totalSize += this.size
enddef
endclass
< *E1340* *E1341*
Since the name is used as-is, shadowing the name by a function argument name
or local variable name is not allowed.
Just like object members the access can be made private by using an underscore
as the first character in the name, and it can be made public by prefixing
"public": >
class OtherThing
static total: number # anybody can read, only class can write
static _sum: number # only class can read and write
public static result: number # anybody can read and write
endclass
<
*class-function*
Class functions are also declared with "static". They have no access to
object members, they cannot use the "this" keyword. >
class OtherThing
this.size: number
static totalSize: number
# Clear the total size and return the value it had before.
static def ClearTotalSize(): number
var prev = totalSize
totalSize = 0
return prev
enddef
endclass
Inside the class the function can be called by name directly, outside the
class the class name must be prefixed: `OtherThing.ClearTotalSize()`.
==============================================================================
4. Using an abstract class *Vim9-abstract-class*
An abstract class forms the base for at least one sub-class. In the class An abstract class forms the base for at least one sub-class. In the class
model one often finds that a few classes have the same properties that can be model one often finds that a few classes have the same properties that can be
shared, but a class with those properties does not have enough state to create shared, but a class with these properties does not have enough state to create
an object from. A sub-class must extend the abstract class and add the an object from. A sub-class must extend the abstract class and add the
missing state and/or methods before it can be used to create objects for. missing state and/or methods before it can be used to create objects for.
An abstract class does not have a new() method.
For example, a Shape class could store a color and thickness. You cannot For example, a Shape class could store a color and thickness. You cannot
create a Shape object, it is missing the information about what kind of shape create a Shape object, it is missing the information about what kind of shape
it is. The Shape class functions as the base for a Square and a Triangle it is. The Shape class functions as the base for a Square and a Triangle
@@ -245,39 +316,13 @@ class, for which objects can be created. Example: >
enddef enddef
endclass endclass
< <
*class-member* *:static* An abstract class is defined the same way as a normal class, except that it
Class members are declared with "static". They are used by the name without a does not have any new() method. *E1359*
prefix: >
class OtherThing
this.size: number
static totalSize: number
def new(this.size)
totalSize += this.size
enddef
endclass
<
*class-method*
Class methods are also declared with "static". They have no access to object
members, they cannot use the "this" keyword. >
class OtherThing
this.size: number
static totalSize: number
" Clear the total size and return the value it had before.
static def ClearTotalSize(): number
var prev = totalSize
totalSize = 0
return prev
enddef
endclass
============================================================================== ==============================================================================
4. Using an interface *Vim9-using-interface* 5. Using an interface *Vim9-using-interface*
The example above with Shape, Square and Triangle can be made more useful if The example above with Shape, Square and Triangle can be made more useful if
we add a method to compute the surface of the object. For that we create the we add a method to compute the surface of the object. For that we create the
@@ -316,6 +361,9 @@ a number. This example extends the one above: >
enddef enddef
endclass endclass
If a class declares to implement an interface, all the items specified in the
interface must appear in the class, with the same types. *E1348* *E1349*
The interface name can be used as a type: > The interface name can be used as a type: >
var shapes: list<HasSurface> = [ var shapes: list<HasSurface> = [
@@ -329,14 +377,14 @@ The interface name can be used as a type: >
============================================================================== ==============================================================================
5. More class details *Vim9-class* 6. More class details *Vim9-class* *Class* *class*
Defining a class ~ Defining a class ~
*:class* *:endclass* *:abstract* *:class* *:endclass* *:abstract*
A class is defined between `:class` and `:endclass`. The whole class is A class is defined between `:class` and `:endclass`. The whole class is
defined in one script file. It is not possible to add to a class later. defined in one script file. It is not possible to add to a class later.
A class can only be defined in a |Vim9| script file. *E1315* A class can only be defined in a |Vim9| script file. *E1316*
A class cannot be defined inside a function. A class cannot be defined inside a function.
It is possible to define more than one class in a script file. Although it It is possible to define more than one class in a script file. Although it
@@ -361,22 +409,89 @@ these variants: >
*E1314* *E1314*
The class name should be CamelCased. It must start with an uppercase letter. The class name should be CamelCased. It must start with an uppercase letter.
That avoids clashing with builtin types. That avoids clashing with builtin types.
*E1315*
After the class name these optional items can be used. Each can appear only After the class name these optional items can be used. Each can appear only
once. They can appear in any order, although this order is recommended: > once. They can appear in any order, although this order is recommended: >
extends ClassName extends ClassName
implements InterfaceName, OtherInterface implements InterfaceName, OtherInterface
specifies SomeInterface specifies SomeInterface
< *extends* < *E1355*
A class can extend one other class. Each member and function name can be used only once. It is not possible to
*implements* define a function with the same name and different type of arguments.
A class can implement one or more interfaces.
Extending a class ~
*extends*
A class can extend one other class. *E1352* *E1353* *E1354*
The basic idea is to build on top of an existing class, add properties to it.
The extended class is called the "base class" or "super class". The new class
is called the "child class".
Object members from the base class are all taken over by the child class. It
is not possible to override them (unlike some other languages).
*E1356* *E1357* *E1358*
Object methods of the base class can be overruled. The signature (arguments,
argument types and return type) must be exactly the same. The method of the
base class can be called by prefixing "super.".
Other object methods of the base class are taken over by the child class.
Class functions, including functions starting with "new", can be overruled,
like with object methods. The function on the base class can be called by
prefixing the name of the class (for class functions) or "super.".
Unlike other languages, the constructor of the base class does not need to be
invoked. In fact, it cannot be invoked. If some initialization from the base
class also needs to be done in a child class, put it in an object method and
call that method from every constructor().
If the base class did not specify a new() function then one was automatically
created. This function will not be taken over by the child class. The child
class can define its own new() function, or, if there isn't one, a new()
function will be added automatically.
A class implementing an interface ~
*implements* *E1346* *E1347*
A class can implement one or more interfaces. The "implements" keyword can
only appear once *E1350* . Multiple interfaces can be specified, separated by
commas. Each interface name can appear only once. *E1351*
A class defining an interface ~
*specifies* *specifies*
A class can declare its interface, the object members and methods, with a A class can declare its interface, the object members and methods, with a
named interface. This avoids the need for separately specifying the named interface. This avoids the need for separately specifying the
interface, which is often done in many languages, especially Java. interface, which is often done in many languages, especially Java.
Items in a class ~
*E1318* *E1325* *E1326*
Inside a class, in between `:class` and `:endclass`, these items can appear:
- An object member declaration: >
this._memberName: memberType
this.memberName: memberType
public this.memberName: memberType
- A constructor method: >
def new(arguments)
def newName(arguments)
- An object method: >
def SomeMethod(arguments)
< *E1329*
For the object member the type must be specified. The best way is to do this
explicitly with ": {type}". For simple types you can also use an initializer,
such as "= 123", and Vim will see that the type is a number. Avoid doing this
for more complex types and when the type will be incomplete. For example: >
this.nameList = []
This specifies a list, but the item type is unknown. Better use: >
this.nameList: list<string>
The initialization isn't needed, the list is empty by default.
*E1330*
Some types cannot be used, such as "void", "null" and "v:none".
Defining an interface ~ Defining an interface ~
*:interface* *:endinterface* *:interface* *:endinterface*
An interface is defined between `:interface` and `:endinterface`. It may be An interface is defined between `:interface` and `:endinterface`. It may be
@@ -387,10 +502,10 @@ prefixed with `:export`: >
export interface InterfaceName export interface InterfaceName
endinterface endinterface
< *E1344*
An interface can declare object members, just like in a class but without any An interface can declare object members, just like in a class but without any
initializer. initializer.
*E1345*
An interface can declare methods with `:def`, including the arguments and An interface can declare methods with `:def`, including the arguments and
return type, but without the body and without `:enddef`. Example: > return type, but without the body and without `:enddef`. Example: >
@@ -399,8 +514,19 @@ return type, but without the body and without `:enddef`. Example: >
def Surface(): number def Surface(): number
endinterface endinterface
An interface name must start with an uppercase letter. *E1343*
The "Has" prefix can be used to make it easier to guess this is an interface The "Has" prefix can be used to make it easier to guess this is an interface
name, with a hint about what it provides. name, with a hint about what it provides.
An interface can only be defined in a |Vim9| script file. *E1342*
null object ~
When a variable is declared to have the type of an object, but it is not
initialized, the value is null. When trying to use this null object Vim often
does not know what class was supposed to be used. Vim then cannot check if
a member name is correct and you will get an "Using a null object" error,
even when the member name is invalid. *E1360* *E1362*
Default constructor ~ Default constructor ~
@@ -417,10 +543,35 @@ members, in the order they were specified. Thus if your class looks like: >
Then The default constructor will be: > Then The default constructor will be: >
def new(this.name, this.age, this.gender) def new(this.name = v:none, this.age = v:none, this.gender = v:none)
enddef enddef
All object members will be used, also private access ones. The "= v:none" default values make the arguments optional. Thus you can also
call `new()` without any arguments. No assignment will happen and the default
value for the object members will be used. This is a more useful example,
with default values: >
class TextPosition
this.lnum: number = 1
this.col: number = 1
endclass
If you want the constructor to have mandatory arguments, you need to write it
yourself. For example, if for the AutoNew class above you insist on getting
the name, you can define the constructor like this: >
def new(this.name, this.age = v:none, this.gender = v:none)
enddef
< *E1328*
Note that you cannot use another default value than "v:none" here. If you
want to initialize the object members, do it where they are declared. This
way you only need to look in one place for the default values.
All object members will be used in the default constructor, also private
access ones.
If the class extends another one, the object members of that class will come
first.
Multiple constructors ~ Multiple constructors ~
@@ -455,7 +606,7 @@ constructor methods.
============================================================================== ==============================================================================
6. Type definition *Vim9-type* *:type* 7. Type definition *Vim9-type* *:type*
A type definition is giving a name to a type specification. For Example: > A type definition is giving a name to a type specification. For Example: >
@@ -466,7 +617,7 @@ TODO: more explanation
============================================================================== ==============================================================================
7. Enum *Vim9-enum* *:enum* *:endenum* 8. Enum *Vim9-enum* *:enum* *:endenum*
An enum is a type that can have one of a list of values. Example: > An enum is a type that can have one of a list of values. Example: >
@@ -560,6 +711,22 @@ type checking will make sure it works as you intended. This rules out
polymorphism, which we don't really need anyway. polymorphism, which we don't really need anyway.
Single inheritance and interfaces ~
Some languages support multiple inheritance. Although that can be useful in
some cases, it makes the rules of how a class works quite complicated.
Instead, using interfaces to declare what is supported is much simpler. The
very popular Java language does it this way, and it should be good enough for
Vim. The "keep it simple" rule applies here.
Explicitly declaring that a class supports an interface makes it easy to see
what a class is intended for. It also makes it possible to do proper type
checking. When an interface is changed any class that declares to implement
it will be checked if that change was also changed. The mechanism to assume a
class implements an interface just because the methods happen to match is
brittle and leads to obscure problems, let's not do that.
Using "this.member" everywhere ~ Using "this.member" everywhere ~
The object members in various programming languages can often be accessed in The object members in various programming languages can often be accessed in
@@ -578,22 +745,6 @@ also directly clear which variable references are object members and which
aren't. aren't.
Single inheritance and interfaces ~
Some languages support multiple inheritance. Although that can be useful in
some cases, it makes the rules of how a class works quite complicated.
Instead, using interfaces to declare what is supported is much simpler. The
very popular Java language does it this way, and it should be good enough for
Vim. The "keep it simple" rule applies here.
Explicitly declaring that a class supports an interface makes it easy to see
what a class is intended for. It also makes it possible to do proper type
checking. When an interface is changed any class that declares to implement
it will be checked if that change was also changed. The mechanism to assume a
class implements an interface just because the methods happen to match is
brittle and leads to obscure problems, let's not do that.
Using class members ~ Using class members ~
Using "static member" to declare a class member is very common, nothing new Using "static member" to declare a class member is very common, nothing new
@@ -608,6 +759,55 @@ quite a bit of space, and when the class is renamed all these places need to
be changed too. be changed too.
Declaring object and class members ~
The main choice is whether to use "var" as with variable declarations.
TypeScript does not use it: >
class Point {
x: number;
y = 0;
}
Following that Vim object members could be declared like this: >
class Point
this.x: number
this.y = 0
endclass
Some users pointed out that this looks more like an assignment than a
declaration. Adding "var" changes that: >
class Point
var this.x: number
var this.y = 0
endclass
We also need to be able to declare class members using the "static" keyword.
There we can also choose to leave out "var": >
class Point
var this.x: number
static count = 0
endclass
Or do use it, before "static": >
class Point
var this.x: number
var static count = 0
endclass
Or after "static": >
class Point
var this.x: number
static var count = 0
endclass
This is more in line with "static def Func()".
There is no clear preference whether to use "var" or not. The two main
reasons to leave it out are:
1. TypeScript, Java and other popular languages do not use it.
2. Less clutter.
Using "ClassName.new()" to construct an object ~ Using "ClassName.new()" to construct an object ~
Many languages use the "new" operator to create an object, which is actually Many languages use the "new" operator to create an object, which is actually

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2022 Dec 05 " Last Change: 2023 Feb 25
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@@ -110,9 +110,11 @@ au BufNewFile,BufRead *.a65 setf a65
" Applescript " Applescript
au BufNewFile,BufRead *.scpt setf applescript au BufNewFile,BufRead *.scpt setf applescript
" Automake (must be before the *.am pattern)
au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake
" Applix ELF " Applix ELF
au BufNewFile,BufRead *.am au BufNewFile,BufRead *.am setf elf
\ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
" ALSA configuration " ALSA configuration
au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf
@@ -187,9 +189,6 @@ au BufNewFile,BufRead *.au3 setf autoit
" Autohotkey " Autohotkey
au BufNewFile,BufRead *.ahk setf autohotkey au BufNewFile,BufRead *.ahk setf autohotkey
" Automake
au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake
" Autotest .at files are actually m4 " Autotest .at files are actually m4
au BufNewFile,BufRead *.at setf m4 au BufNewFile,BufRead *.at setf m4
@@ -206,6 +205,9 @@ au BufNewFile,BufRead *.mch,*.ref,*.imp setf b
au BufNewFile,BufRead *.bas call dist#ft#FTbas() au BufNewFile,BufRead *.bas call dist#ft#FTbas()
au BufNewFile,BufRead *.bi,*.bm call dist#ft#FTbas() au BufNewFile,BufRead *.bi,*.bm call dist#ft#FTbas()
" Bass
au BufNewFile,BufRead *.bass setf bass
" Visual Basic Script (close to Visual Basic) or Visual Basic .NET " Visual Basic Script (close to Visual Basic) or Visual Basic .NET
au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb
@@ -265,7 +267,7 @@ au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
au BufNewFile,BufRead *.bsd,*.bsdl setf bsdl au BufNewFile,BufRead *.bsd,*.bsdl setf bsdl
" Bazel (http://bazel.io) " Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,*.bazel,WORKSPACE setf bzl autocmd BufRead,BufNewFile *.bzl,*.bazel,WORKSPACE,WORKSPACE.bzlmod setf bzl
if has("fname_case") if has("fname_case")
" There is another check for BUILD further below. " There is another check for BUILD further below.
autocmd BufRead,BufNewFile *.BUILD,BUILD setf bzl autocmd BufRead,BufNewFile *.BUILD,BUILD setf bzl
@@ -278,6 +280,9 @@ au BufNewFile,BufRead *.lpc,*.ulpc setf lpc
" Calendar " Calendar
au BufNewFile,BufRead calendar setf calendar au BufNewFile,BufRead calendar setf calendar
" Cap'n Proto
au BufNewFile,BufRead *.capnp setf capnp
" C# " C#
au BufNewFile,BufRead *.cs,*.csx setf cs au BufNewFile,BufRead *.cs,*.csx setf cs
@@ -308,6 +313,9 @@ au BufNewFile,BufRead *.cdl setf cdl
" Conary Recipe " Conary Recipe
au BufNewFile,BufRead *.recipe setf conaryrecipe au BufNewFile,BufRead *.recipe setf conaryrecipe
" ChainPack Object Notation (CPON)
au BufNewFile,BufRead *.cpon setf cpon
" Controllable Regex Mutilator " Controllable Regex Mutilator
au BufNewFile,BufRead *.crm setf crm au BufNewFile,BufRead *.crm setf crm
@@ -369,6 +377,9 @@ au BufNewFile,BufRead *.ch call dist#ft#FTchange()
" ChordPro " ChordPro
au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro
" Clangd
au BufNewFile,BufRead .clangd setf yaml
" Clang-format " Clang-format
au BufNewFile,BufRead .clang-format setf yaml au BufNewFile,BufRead .clang-format setf yaml
@@ -431,6 +442,9 @@ au BufNewFile,BufRead *.csv setf csv
" CUDA Compute Unified Device Architecture " CUDA Compute Unified Device Architecture
au BufNewFile,BufRead *.cu,*.cuh setf cuda au BufNewFile,BufRead *.cu,*.cuh setf cuda
" Cue
au BufNewFile,BufRead *.cue setf cue
" Dockerfile; Podman uses the same syntax with name Containerfile " Dockerfile; Podman uses the same syntax with name Containerfile
" Also see Dockerfile.* below. " Also see Dockerfile.* below.
au BufNewFile,BufRead Containerfile,Dockerfile,dockerfile,*.[dD]ockerfile setf dockerfile au BufNewFile,BufRead Containerfile,Dockerfile,dockerfile,*.[dD]ockerfile setf dockerfile
@@ -514,6 +528,9 @@ au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources
" Deny hosts " Deny hosts
au BufNewFile,BufRead denyhosts.conf setf denyhosts au BufNewFile,BufRead denyhosts.conf setf denyhosts
" Dhall
au BufNewFile,BufRead *.dhall setf dhall
" dnsmasq(8) configuration files " dnsmasq(8) configuration files
au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq
@@ -606,8 +623,8 @@ au BufNewFile,BufRead *.edn
\ setf clojure | \ setf clojure |
\ endif \ endif
" EditorConfig (close enough to dosini) " EditorConfig
au BufNewFile,BufRead .editorconfig setf dosini au BufNewFile,BufRead .editorconfig setf editorconfig
" Embedix Component Description " Embedix Component Description
au BufNewFile,BufRead *.ecd setf ecd au BufNewFile,BufRead *.ecd setf ecd
@@ -627,6 +644,9 @@ au BufNewFile,BufRead *.elm setf elm
" Elm Filter Rules file " Elm Filter Rules file
au BufNewFile,BufRead filter-rules setf elmfilt au BufNewFile,BufRead filter-rules setf elmfilt
" Elsa - https://github.com/ucsd-progsys/elsa
au BufNewFile,BufRead *.lc setf elsa
" ESMTP rc file " ESMTP rc file
au BufNewFile,BufRead *esmtprc setf esmtprc au BufNewFile,BufRead *esmtprc setf esmtprc
@@ -663,6 +683,9 @@ autocmd BufRead,BufNewFile *.fnl setf fennel
" Fetchmail RC file " Fetchmail RC file
au BufNewFile,BufRead .fetchmailrc setf fetchmail au BufNewFile,BufRead .fetchmailrc setf fetchmail
" FIRRTL - Flexible Internal Representation for RTL
au BufNewFile,BufRead *.fir setf firrtl
" Fish shell " Fish shell
au BufNewFile,BufRead *.fish setf fish au BufNewFile,BufRead *.fish setf fish
@@ -695,12 +718,18 @@ au BufNewFile,BufRead *.fsl setf framescript
" FStab " FStab
au BufNewFile,BufRead fstab,mtab setf fstab au BufNewFile,BufRead fstab,mtab setf fstab
" Func
au BufNewFile,BufRead *.fc setf func
" Fusion " Fusion
au BufRead,BufNewFile *.fusion setf fusion au BufRead,BufNewFile *.fusion setf fusion
" F# or Forth " F# or Forth
au BufNewFile,BufRead *.fs call dist#ft#FTfs() au BufNewFile,BufRead *.fs call dist#ft#FTfs()
" FHIR Shorthand (FSH)
au BufNewFile,BufRead *.fsh setf fsh
" F# " F#
au BufNewFile,BufRead *.fsi,*.fsx setf fsharp au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
@@ -847,6 +876,9 @@ au BufNewFile,BufRead *.htpp setf hastepreproc
" HCL " HCL
au BufRead,BufNewFile *.hcl setf hcl au BufRead,BufNewFile *.hcl setf hcl
" Go checksum file (must be before *.sum Hercules)
au BufNewFile,BufRead go.sum,go.work.sum setf gosum
" Hercules " Hercules
au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum setf hercules au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum setf hercules
@@ -993,23 +1025,27 @@ au BufNewFile,BufRead *.jgr setf jgraph
" Jovial " Jovial
au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
" JSON " Jq
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json au BufNewFile,BufRead *.jq setf jq
" JSON5 " JSON5
au BufNewFile,BufRead *.json5 setf json5 au BufNewFile,BufRead *.json5 setf json5
" JSON Patch (RFC 6902) " JSON Patch (RFC 6902)
au BufNewFile,BufRead *.json-patch setf json au BufNewFile,BufRead *.json-patch setf json
" Jupyter Notebook is also json " Jupyter Notebook is also json
au BufNewFile,BufRead *.ipynb setf json au BufNewFile,BufRead *.ipynb setf json
" Other files that look like json " Other files that look like json
au BufNewFile,BufRead .babelrc,.eslintrc,.prettierrc,.firebaserc setf json au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc setf json
" JSONC " JSONC (JSON with comments)
au BufNewFile,BufRead *.jsonc setf jsonc au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc setf jsonc
au BufNewFile,BufRead .jshintrc,.hintrc,.swrc,[jt]sconfig*.json setf jsonc
" JSON
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
" Jsonnet " Jsonnet
au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet
@@ -1017,6 +1053,9 @@ au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet
" Julia " Julia
au BufNewFile,BufRead *.jl setf julia au BufNewFile,BufRead *.jl setf julia
" KDL
au BufNewFile,BufRead *.kdl setf kdl
" Kixtart " Kixtart
au BufNewFile,BufRead *.kix setf kix au BufNewFile,BufRead *.kix setf kix
@@ -1240,6 +1279,9 @@ au BufNewFile,BufRead *.[mi][3g] setf modula3
" Larch/Modula-3 " Larch/Modula-3
au BufNewFile,BufRead *.lm3 setf modula3 au BufNewFile,BufRead *.lm3 setf modula3
" Modconf
au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
" Monk " Monk
au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk
@@ -1249,8 +1291,8 @@ au BufNewFile,BufRead *.moo setf moo
" Moonscript " Moonscript
au BufNewFile,BufRead *.moon setf moonscript au BufNewFile,BufRead *.moon setf moonscript
" Modconf " Move language
au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf au BufNewFile,BufRead *.move setf move
" MPD is based on XML " MPD is based on XML
au BufNewFile,BufRead *.mpd setf xml au BufNewFile,BufRead *.mpd setf xml
@@ -1387,6 +1429,7 @@ au BufNewFile,BufRead pf.conf setf pf
" ini style config files, using # comments " ini style config files, using # comments
au BufNewFile,BufRead */etc/pacman.conf,mpv.conf setf confini au BufNewFile,BufRead */etc/pacman.conf,mpv.conf setf confini
au BufNewFile,BufRead */.aws/config,*/.aws/credentials setf confini au BufNewFile,BufRead */.aws/config,*/.aws/credentials setf confini
au BufNewFile,BufRead *.nmconnection setf confini
" Pacman hooks " Pacman hooks
au BufNewFile,BufRead *.hook au BufNewFile,BufRead *.hook
@@ -1491,7 +1534,7 @@ au BufNewFile,BufRead *.plp setf plp
au BufNewFile,BufRead *.po,*.pot setf po au BufNewFile,BufRead *.po,*.pot setf po
" Postfix main config " Postfix main config
au BufNewFile,BufRead main.cf setf pfmain au BufNewFile,BufRead main.cf,main.cf.proto setf pfmain
" PostScript (+ font files, encapsulated PostScript, Adobe Illustrator) " PostScript (+ font files, encapsulated PostScript, Adobe Illustrator)
au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr
@@ -1601,7 +1644,7 @@ au BufNewFile,BufRead *.ptl,*.pyi,SConstruct setf python
au BufRead,BufNewFile *.ql,*.qll setf ql au BufRead,BufNewFile *.ql,*.qll setf ql
" Quarto " Quarto
au BufRead,BufNewFile *.qmd setf quarto au BufRead,BufNewFile *.qmd setf quarto
" Radiance " Radiance
au BufNewFile,BufRead *.rad,*.mat setf radiance au BufNewFile,BufRead *.rad,*.mat setf radiance
@@ -1692,12 +1735,15 @@ au BufNewFile,BufRead *.robot,*.resource setf robot
" Robots.txt " Robots.txt
au BufNewFile,BufRead robots.txt setf robots au BufNewFile,BufRead robots.txt setf robots
" Rpcgen " RON (Rusty Object Notation)
au BufNewFile,BufRead *.x setf rpcgen au BufNewFile,BufRead *.ron setf ron
" MikroTik RouterOS script " MikroTik RouterOS script
au BufRead,BufNewFile *.rsc setf routeros au BufRead,BufNewFile *.rsc setf routeros
" Rpcgen
au BufNewFile,BufRead *.x setf rpcgen
" reStructuredText Documentation Format " reStructuredText Documentation Format
au BufNewFile,BufRead *.rst setf rst au BufNewFile,BufRead *.rst setf rst
@@ -1886,10 +1932,16 @@ au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
" SKILL " SKILL
au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
" Cadence
au BufNewFile,BufRead *.cdc setf cdc
" SLRN " SLRN
au BufNewFile,BufRead .slrnrc setf slrnrc au BufNewFile,BufRead .slrnrc setf slrnrc
au BufNewFile,BufRead *.score setf slrnsc au BufNewFile,BufRead *.score setf slrnsc
" Smali
au BufNewFile,BufRead *.smali setf smali
" Smalltalk " Smalltalk
au BufNewFile,BufRead *.st setf st au BufNewFile,BufRead *.st setf st
@@ -1918,6 +1970,9 @@ au BufNewFile,BufRead *.smi
" SMITH " SMITH
au BufNewFile,BufRead *.smt,*.smith setf smith au BufNewFile,BufRead *.smt,*.smith setf smith
" Smithy
au BufNewFile,BufRead *.smithy setf smithy
" Snobol4 and spitbol " Snobol4 and spitbol
au BufNewFile,BufRead *.sno,*.spt setf snobol4 au BufNewFile,BufRead *.sno,*.spt setf snobol4
@@ -1965,6 +2020,9 @@ au BufNewFile,BufRead *.sql call dist#ft#SQL()
" SQLJ " SQLJ
au BufNewFile,BufRead *.sqlj setf sqlj au BufNewFile,BufRead *.sqlj setf sqlj
" PRQL
au BufNewFile,BufRead *.prql setf prql
" SQR " SQR
au BufNewFile,BufRead *.sqr,*.sqi setf sqr au BufNewFile,BufRead *.sqr,*.sqi setf sqr
@@ -1979,6 +2037,9 @@ au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf setf sshconfig
au BufNewFile,BufRead sshd_config setf sshdconfig au BufNewFile,BufRead sshd_config setf sshdconfig
au BufNewFile,BufRead */etc/ssh/sshd_config.d/*.conf setf sshdconfig au BufNewFile,BufRead */etc/ssh/sshd_config.d/*.conf setf sshdconfig
" Starlark
au BufNewFile,BufRead *.ipd,*.star,*.starlark setf starlark
" OpenVPN configuration " OpenVPN configuration
au BufNewFile,BufRead *.ovpn setf openvpn au BufNewFile,BufRead *.ovpn setf openvpn
au BufNewFile,BufRead */openvpn/*/*.conf setf openvpn au BufNewFile,BufRead */openvpn/*/*.conf setf openvpn
@@ -2088,6 +2149,9 @@ au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
" TeX configuration " TeX configuration
au BufNewFile,BufRead texmf.cnf setf texmf au BufNewFile,BufRead texmf.cnf setf texmf
" Thrift (Apache)
au BufNewFile,BufRead *.thrift setf thrift
" Tidy config " Tidy config
au BufNewFile,BufRead .tidyrc,tidyrc,tidy.conf setf tidy au BufNewFile,BufRead .tidyrc,tidyrc,tidy.conf setf tidy
@@ -2156,6 +2220,9 @@ au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm
" Udev symlinks config " Udev symlinks config
au BufNewFile,BufRead */etc/udev/cdsymlinks.conf setf sh au BufNewFile,BufRead */etc/udev/cdsymlinks.conf setf sh
" Ungrammar, AKA Un-grammar
au BufNewFile,BufRead *.ungram setf ungrammar
" UnrealScript " UnrealScript
au BufNewFile,BufRead *.uc setf uc au BufNewFile,BufRead *.uc setf uc
@@ -2392,6 +2459,9 @@ au BufNewFile,BufRead */etc/yum.conf setf dosini
" YANG " YANG
au BufRead,BufNewFile *.yang setf yang au BufRead,BufNewFile *.yang setf yang
" Yuck
au BufNewFile,BufRead *.yuck setf yuck
" Zimbu " Zimbu
au BufNewFile,BufRead *.zu setf zimbu au BufNewFile,BufRead *.zu setf zimbu
" Zimbu Templates " Zimbu Templates

View File

@@ -3,9 +3,9 @@
" Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org> " Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org>
" Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de> " Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de>
" Stefano Zacchiroli <zack@debian.org> " Stefano Zacchiroli <zack@debian.org>
" Last Change: 2022 Jul 25 " Last Change: 2023 Jan 16
" License: Vim License " License: Vim License
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debchangelog.vim
" Bug completion requires apt-listbugs installed for Debian packages or " Bug completion requires apt-listbugs installed for Debian packages or
" python-launchpadlib installed for Ubuntu packages " python-launchpadlib installed for Ubuntu packages
@@ -35,14 +35,14 @@ if exists('g:did_changelog_ftplugin')
finish finish
endif endif
" Don't load another plugin (this is global)
let g:did_changelog_ftplugin = 1
" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
" <CR> would not be recognized. See ":help 'cpoptions'". " <CR> would not be recognized. See ":help 'cpoptions'".
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" Don't load another plugin (this is global)
let g:did_changelog_ftplugin = 1
" {{{1 GUI menu " {{{1 GUI menu
" Helper functions returning various data. " Helper functions returning various data.

View File

@@ -2,8 +2,8 @@
" Language: Debian control files " Language: Debian control files
" Maintainer: Debian Vim Maintainers " Maintainer: Debian Vim Maintainers
" Former Maintainer: Pierre Habouzit <madcoder@debian.org> " Former Maintainer: Pierre Habouzit <madcoder@debian.org>
" Last Change: 2018-01-28 " Last Change: 2023 Jan 16
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debcontrol.vim " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debcontrol.vim
" Do these settings once per buffer " Do these settings once per buffer
if exists('b:did_ftplugin') if exists('b:did_ftplugin')

View File

@@ -1,7 +1,10 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: MS-DOS .bat files " Language: MS-DOS/Windows .bat files
" Maintainer: Mike Williams <mrw@eandem.co.uk> " Maintainer: Mike Williams <mrmrdubya@gmail.com>
" Last Change: 7th May 2020 " Last Change: 12th February 2023
"
" Options Flags:
" dosbatch_colons_comment - any value to treat :: as comment line
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -15,8 +18,13 @@ let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" BAT comment formatting " BAT comment formatting
setlocal comments=b:rem,b:@rem,b:REM,b:@REM,::: setlocal comments=b:rem,b:@rem,b:REM,b:@REM
setlocal commentstring=::\ %s if exists("dosbatch_colons_comment")
setlocal comments+=:::
setlocal commentstring=::\ %s
else
setlocal commentstring=REM\ %s
endif
setlocal formatoptions-=t formatoptions+=rol setlocal formatoptions-=t formatoptions+=rol
" Lookup DOS keywords using Windows command help. " Lookup DOS keywords using Windows command help.

15
runtime/ftplugin/fish.vim Normal file
View File

@@ -0,0 +1,15 @@
" Vim filetype plugin file
" Language: fish
" Maintainer: Nicholas Boyle (github.com/nickeb96)
" Repository: https://github.com/nickeb96/fish.vim
" Last Change: February 1, 2023
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal iskeyword=@,48-57,_,192-255,-,.
setlocal comments=:#
setlocal commentstring=#%s
setlocal formatoptions+=crjq

View File

@@ -1,9 +1,9 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: Logcheck " Language: Logcheck
" Maintainer: Debian Vim Maintainers " Maintainer: Debian Vim Maintainers
" Last Change: 2018 Dec 27 " Last Change: 2023 Jan 16
" License: Vim License " License: Vim License
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/logcheck.vim " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/logcheck.vim
if exists('b:did_ftplugin') if exists('b:did_ftplugin')
finish finish

View File

@@ -0,0 +1 @@
runtime ftplugin/rmd.vim

View File

@@ -2,7 +2,7 @@
" Language: R " Language: R
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Aug 15, 2020 11:37AM " Last Change: Sun Apr 24, 2022 09:14AM
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -22,7 +22,7 @@ setlocal comments=:#',:###,:##,:#
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R)\t*.R\n" . let b:browsefilter = "R Source Files (*.R)\t*.R\n" .
\ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst)\t*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif

View File

@@ -1,7 +1,8 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: readline(3) configuration file " Language: readline(3) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" Latest Revision: 2008-07-09 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Last Change: 2022 Dec 09
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@@ -11,9 +12,25 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
setlocal comments=:#
setlocal commentstring=#\ %s
setlocal formatoptions-=t formatoptions+=croql
let b:undo_ftplugin = "setl com< cms< fo<" let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0
let b:match_words = '$if:$else:$endif'
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Readline Intialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" ..
\ "All Files (*.*)\t*.*\n"
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet:

View File

@@ -2,7 +2,7 @@
" Language: R help file " Language: R help file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Aug 15, 2020 12:01PM " Last Change: Sun Apr 24, 2022 09:12AM
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -18,7 +18,7 @@ set cpo&vim
setlocal iskeyword=@,48-57,_,. setlocal iskeyword=@,48-57,_,.
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif

View File

@@ -2,7 +2,7 @@
" Language: R Markdown file " Language: R Markdown file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Aug 15, 2020 12:03PM " Last Change: Sun Apr 24, 2022 09:12AM
" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
@@ -32,13 +32,24 @@ function! FormatRmd()
return 1 return 1
endfunction endfunction
" If you do not want 'comments' dynamically defined, put in your vimrc: function! SetRmdCommentStr()
" let g:rmd_dynamic_comments = 0 if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
set commentstring=#\ %s
else
set commentstring=<!--\ %s\ -->
endif
endfunction
" If you do not want both 'comments' and 'commentstring' dynamically defined,
" put in your vimrc: let g:rmd_dynamic_comments = 0
if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1) if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1)
setlocal formatexpr=FormatRmd() setlocal formatexpr=FormatRmd()
augroup RmdCStr
autocmd!
autocmd CursorMoved <buffer> call SetRmdCommentStr()
augroup END
endif endif
" Enables pandoc if it is installed " Enables pandoc if it is installed
unlet! b:did_ftplugin unlet! b:did_ftplugin
runtime ftplugin/pandoc.vim runtime ftplugin/pandoc.vim
@@ -47,7 +58,7 @@ runtime ftplugin/pandoc.vim
let b:did_ftplugin = 1 let b:did_ftplugin = 1
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif

View File

@@ -2,7 +2,7 @@
" Language: Rnoweb " Language: Rnoweb
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Aug 15, 2020 12:02PM " Last Change: Sun Apr 24, 2022 09:13AM
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -25,10 +25,27 @@ setlocal suffixesadd=.bib,.tex
setlocal comments=b:%,b:#,b:##,b:###,b:#' setlocal comments=b:%,b:#,b:##,b:###,b:#'
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif
function! SetRnwCommentStr()
if (search("^\s*<<.*>>=", "bncW") > search("^@", "bncW"))
set commentstring=#\ %s
else
set commentstring=%\ %s
endif
endfunction
" If you do not want both 'comments' and 'commentstring' dynamically defined,
" put in your vimrc: let g:rnw_dynamic_comments = 0
if !exists("g:rnw_dynamic_comments") || (exists("g:rnw_dynamic_comments") && g:rnw_dynamic_comments == 1)
augroup RnwCStr
autocmd!
autocmd CursorMoved <buffer> call SetRnwCommentStr()
augroup END
endif
if exists('b:undo_ftplugin') if exists('b:undo_ftplugin')
let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter" let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter"
else else

View File

@@ -2,7 +2,7 @@
" Language: reStructuredText documentation format with R code " Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Aug 15, 2020 12:02PM " Last Change: Sun Apr 24, 2022 09:13AM
" Original work by Alex Zvoleff " Original work by Alex Zvoleff
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
@@ -38,7 +38,7 @@ if !exists("g:rrst_dynamic_comments") || (exists("g:rrst_dynamic_comments") && g
endif endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin " Vim filetype plugin
" Language: Vim " Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2022 Nov 27 " Last Change: 2023 Feb 07
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -99,18 +99,23 @@ if exists("loaded_matchit")
" func name " func name
" require a parenthesis following, then there can be an "endfunc". " require a parenthesis following, then there can be an "endfunc".
let b:match_words = let b:match_words =
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' . \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' ..
\ '\<\(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\(w\%[hile]\|fo\%[r]\)\>,' . \ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\%(w\%[hile]\|fo\%[r]\)\>,' ..
\ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' . \ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' ..
\ '{:},' . \ '{:},' ..
\ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' . \ '\<try\>:\%(\%(^\||\)\s*\)\@<=\<cat\%[ch]\>:\%(\%(^\||\)\s*\)\@<=\<fina\%[lly]\>:\%(\%(^\||\)\s*\)\@<=\<endt\%[ry]\>,' ..
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' ..
\ '\<class\>:\<endclass\>,' ..
\ '\<inte\%[rface]\>:\<endinterface\>,' ..
\ '\<enu\%[m]\>:\<endenum\>,'
" Ignore syntax region commands and settings, any 'en*' would clobber " Ignore syntax region commands and settings, any 'en*' would clobber
" if-endif. " if-endif.
" - set spl=de,en " - set spl=de,en
" - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ … " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") " Also ignore here-doc and dictionary keys (vimVar).
\ =~? "comment\\|string\\|vimLetHereDoc\\|vimSynReg\\|vimSet"' let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
\ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"'
endif endif
let &cpo = s:cpo_save let &cpo = s:cpo_save

82
runtime/indent/fish.vim Normal file
View File

@@ -0,0 +1,82 @@
" Vim indent file
" Language: fish
" Maintainer: Nicholas Boyle (github.com/nickeb96)
" Repository: https://github.com/nickeb96/fish.vim
" Last Change: February 4, 2023
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetFishIndent(v:lnum)
setlocal indentkeys+==end,=else,=case
function s:PrevCmdStart(linenum)
let l:linenum = a:linenum
" look for the first line that isn't a line continuation
while l:linenum > 1 && getline(l:linenum - 1) =~# '\\$'
let l:linenum = l:linenum - 1
endwhile
return l:linenum
endfunction
function GetFishIndent(lnum)
let l:shiftwidth = shiftwidth()
let l:prevlnum = prevnonblank(a:lnum - 1)
if l:prevlnum ==# 0
return 0
endif
" if the previous line ended with a line continuation
if getline(a:lnum - 1) =~# '\\$'
if a:lnum ==# 0 || getline(a:lnum - 2) !~# '\\$'
" this is the first line continuation in a chain, so indent it
return indent(a:lnum - 1) + l:shiftwidth
else
" use the same indentation as the previous continued line
return indent(a:lnum - 1)
endif
endif
let l:prevlnum = s:PrevCmdStart(l:prevlnum)
let l:prevline = getline(l:prevlnum)
if l:prevline =~# '^\s*\(begin\|if\|else\|while\|for\|function\|case\|switch\)\>'
let l:indent = l:shiftwidth
else
let l:indent = 0
endif
let l:line = getline(a:lnum)
if l:line =~# '^\s*end\>'
" find end's matching start
let l:depth = 1
let l:currentlnum = a:lnum
while l:depth > 0 && l:currentlnum > 0
let l:currentlnum = s:PrevCmdStart(prevnonblank(l:currentlnum - 1))
let l:currentline = getline(l:currentlnum)
if l:currentline =~# '^\s*end\>'
let l:depth = l:depth + 1
elseif l:currentline =~# '^\s*\(begin\|if\|while\|for\|function\|switch\)\>'
let l:depth = l:depth - 1
endif
endwhile
if l:currentline =~# '^\s*switch\>'
return indent(l:currentlnum)
else
return indent(l:prevlnum) + l:indent - l:shiftwidth
endif
elseif l:line =~# '^\s*else\>'
return indent(l:prevlnum) + l:indent - l:shiftwidth
elseif l:line =~# '^\s*case\>'
if getline(l:prevlnum) =~# '^\s*switch\>'
return indent(l:prevlnum) + l:indent
else
return indent(l:prevlnum) + l:indent - l:shiftwidth
endif
else
return indent(l:prevlnum) + l:indent
endif
endfunction

View File

@@ -1,19 +1,78 @@
" Vim indent file " Vim indent file
" Language: nginx.conf " Language: nginx.conf
" Maintainer: Chris Aumann <me@chr4.org> " Maintainer: Chris Aumann <me@chr4.org>
" Last Change: 2022 Apr 06 " Last Change: 2022 Dec 01
if exists("b:did_indent") " Only load this indent file when no other was loaded.
finish if exists('b:did_indent')
finish
endif endif
let b:did_indent = 1 let b:did_indent = 1
setlocal indentexpr= setlocal indentexpr=GetNginxIndent()
" cindent actually works for nginx' simple file structure setlocal indentkeys=0{,0},0#,!^F,o,O
setlocal cindent
" Just make sure that the comments are not reset as defs would be. let b:undo_indent = 'setl inde< indk<'
setlocal cinkeys-=0#
let b:undo_indent = "setl inde< cin< cink<" " Only define the function once.
if exists('*GetNginxIndent')
finish
endif
function GetNginxIndent() abort
let plnum = s:PrevNotAsBlank(v:lnum - 1)
" Hit the start of the file, use zero indent.
if plnum == 0
return 0
endif
let ind = indent(plnum)
" Add a 'shiftwidth' after '{'
if s:AsEndWith(getline(plnum), '{')
let ind = ind + shiftwidth()
end
" Subtract a 'shiftwidth' on '}'
" This is the part that requires 'indentkeys'.
if getline(v:lnum) =~ '^\s*}'
let ind = ind - shiftwidth()
endif
let pplnum = s:PrevNotAsBlank(plnum - 1)
if s:IsLineContinuation(plnum)
if !s:IsLineContinuation(pplnum)
let ind = ind + shiftwidth()
end
else
if s:IsLineContinuation(pplnum)
let ind = ind - shiftwidth()
end
endif
return ind
endfunction
" Find the first line at or above {lnum} that is non-blank and not a comment.
function s:PrevNotAsBlank(lnum) abort
let lnum = prevnonblank(a:lnum)
while lnum > 0
if getline(lnum) !~ '^\s*#'
break
endif
let lnum = prevnonblank(lnum - 1)
endwhile
return lnum
endfunction
" Check whether {line} ends with {pat}, ignoring trailing comments.
function s:AsEndWith(line, pat) abort
return a:line =~ a:pat . '\m\s*\%(#.*\)\?$'
endfunction
function s:IsLineContinuation(lnum) abort
return a:lnum > 0 && !s:AsEndWith(getline(a:lnum), '[;{}]')
endfunction

View File

@@ -0,0 +1 @@
runtime indent/rmd.vim

View File

@@ -2,7 +2,7 @@
" Language: R " Language: R
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sun Aug 19, 2018 09:13PM " Last Change: Wed Oct 26, 2022 12:04PM
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -14,6 +14,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRIndent() setlocal indentexpr=GetRIndent()
let b:undo_indent = "setl inde< indk<"
" Only define the function once. " Only define the function once.
if exists("*GetRIndent") if exists("*GetRIndent")
finish finish
@@ -28,7 +30,7 @@ let g:r_indent_ess_comments = get(g:, 'r_indent_ess_comments', 0)
let g:r_indent_comment_column = get(g:, 'r_indent_comment_column', 40) let g:r_indent_comment_column = get(g:, 'r_indent_comment_column', 40)
let g:r_indent_ess_compatible = get(g:, 'r_indent_ess_compatible', 0) let g:r_indent_ess_compatible = get(g:, 'r_indent_ess_compatible', 0)
let g:r_indent_op_pattern = get(g:, 'r_indent_op_pattern', let g:r_indent_op_pattern = get(g:, 'r_indent_op_pattern',
\ '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$') \ '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\||>\)\s*$')
function s:RDelete_quotes(line) function s:RDelete_quotes(line)
let i = 0 let i = 0
@@ -359,17 +361,19 @@ function GetRIndent()
let olnum = s:Get_prev_line(lnum) let olnum = s:Get_prev_line(lnum)
let oline = getline(olnum) let oline = getline(olnum)
if olnum > 0 if olnum > 0
if line =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 if substitute(line, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 if substitute(oline, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) return indent(lnum)
else else
return indent(lnum) + shiftwidth() return indent(lnum) + shiftwidth()
endif endif
else else
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0 if substitute(oline, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) - shiftwidth() return indent(lnum) - shiftwidth()
endif endif
endif endif
elseif substitute(line, '#.*', '', '') =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum) + shiftwidth()
endif endif
let post_fun = 0 let post_fun = 0

View File

@@ -2,7 +2,7 @@
" Language: R Documentation (Help), *.Rd " Language: R Documentation (Help), *.Rd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Apr 07, 2015 04:38PM " Last Change: Feb 25, 2023
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -20,6 +20,8 @@ setlocal nolisp
setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetCorrectRHelpIndent() setlocal indentexpr=GetCorrectRHelpIndent()
let b:undo_indent = "setl ai< cin< inde< indk< <lisp <si"
" Only define the functions once. " Only define the functions once.
if exists("*GetRHelpIndent") if exists("*GetRHelpIndent")
finish finish

View File

@@ -2,7 +2,7 @@
" Language: Rmd " Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sun Mar 28, 2021 08:05PM " Last Change: Wed Nov 09, 2022 09:44PM
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -16,6 +16,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},<:>,!^F,o,O,e setlocal indentkeys=0{,0},<:>,!^F,o,O,e
setlocal indentexpr=GetRmdIndent() setlocal indentexpr=GetRmdIndent()
let b:undo_indent = "setl inde< indk<"
if exists("*GetRmdIndent") if exists("*GetRmdIndent")
finish finish
endif endif
@@ -47,6 +49,8 @@ function s:GetMdIndent()
return indent(v:lnum - 1) + 2 return indent(v:lnum - 1) + 2
elseif pline =~ '^\s*\d\+\.\s\+' elseif pline =~ '^\s*\d\+\.\s\+'
return indent(v:lnum - 1) + 3 return indent(v:lnum - 1) + 3
elseif pline =~ '^\[\^\S\+\]: '
return indent(v:lnum - 1) + shiftwidth()
endif endif
return indent(prevnonblank(v:lnum - 1)) return indent(prevnonblank(v:lnum - 1))
endfunction endfunction

View File

@@ -2,7 +2,7 @@
" Language: Rnoweb " Language: Rnoweb
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Fri Apr 15, 2016 10:58PM " Last Change: Feb 25, 2023
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -29,6 +29,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item setlocal indentkeys=0{,0},!^F,o,O,e,},=\bibitem,=\item
setlocal indentexpr=GetRnowebIndent() setlocal indentexpr=GetRnowebIndent()
let b:undo_indent = "setl inde< indk<"
if exists("*GetRnowebIndent") if exists("*GetRnowebIndent")
finish finish
endif endif

View File

@@ -2,7 +2,7 @@
" Language: Rrst " Language: Rrst
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Apr 07, 2015 04:38PM " Last Change: Feb 25, 2023
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -16,6 +16,8 @@ let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRrstIndent() setlocal indentexpr=GetRrstIndent()
let b:undo_indent = "setl inde< indk<"
if exists("*GetRrstIndent") if exists("*GetRrstIndent")
finish finish
endif endif

View File

@@ -0,0 +1,134 @@
' vim: filetype=vb shiftwidth=4 expandtab
'
' START_INDENT
Public Type GEmployeeRecord ' Create user-defined type.
ID As Integer ' Define elements of data type.
Name As String * 20
Address As String * 30
Phone As Long
HireDate As Date
End Type
Public Enum InterfaceColors
icMistyRose = &HE1E4FF&
icSlateGray = &H908070&
icDodgerBlue = &HFF901E&
icDeepSkyBlue = &HFFBF00&
icSpringGreen = &H7FFF00&
icForestGreen = &H228B22&
icGoldenrod = &H20A5DA&
icFirebrick = &H2222B2&
End Enum
Enum SecurityLevel
IllegalEntry = -1
SecurityLevel1 = 0
SecurityLevel2 = 1
End Enum
Public Function TestConditional (number As Integer, ext As String) As Boolean
Dim inRange As Boolean
Select Case number
Case <= 0
inRange = False
Case > 10
inRange = False
Case Else
inRange = True
End Select
' This is a special case identified in the indent script.
Select Case number
End Select
If ext = ".xlm" Then
If inRange Then
TestConditional = True
Else
TestConditional = False
End If
ElseIf ext = ".xlsx" Then
If inRange Then
TestConditional = False
Else
TestConditional = True
End If
Else
TestConditional = False
End If
End Function
Private Sub TestIterators (lLimit As Integer, uLimit As Integer)
Dim a() As Variant
Dim elmt As Variant
Dim found As Boolean
Dim indx As Integer
Const specialValue As Integer = 5
If uLimit < lLimit Then
Exit Sub
End If
ReDim a(lLimit To uLimit)
For indx=lLimit To Ulimit
a(indx) = 2 * indx
Next indx
found = False
For Each elmt in a
If elmt = specialValue Then
found = True
End If
Next elmt
If found then
indx = uLimit
Do While indx >= lLimit
indx = indx - 1
Loop
End If
End Sub
Public Sub TestMultiline (cellAddr As String, rowNbr As Long)
Dim rng As Range
Set rng = Range(cellAddr)
With rng
.Cells(1,1).Value = _
"Line 1 of multiline string; " & _
"Line 2 of multiline string; " & _
"Line 3 of multiline string"
End With
' The following lines have whitespace after the underscore character
' and therefore do not form a valid multiline statement. The indent
' script correctly treats them as four single line statements contrary
' to the author's obvious indent.
rng..Cells(1,1).Value = _
"Line 1 of multiline string; " & _
"Line 2 of multiline string; " & _
"Line 3 of multiline string"
End Sub
Private Sub TestStmtLabel()
GoTo stmtLabel
' Statement labels are never indented
stmtLabel:
End Sub
Sub TestTypeKeyword()
Type EmployeeRecord ' Create user-defined type.
ID As Integer ' Define elements of data type.
Name As String * 20
Address As String * 30
Phone As Long
HireDate As Date
End Type
Dim varType As EmployeeRecord
End Sub
' END_INDENT

View File

@@ -0,0 +1,134 @@
' vim: filetype=vb shiftwidth=4 expandtab
'
' START_INDENT
Public Type GEmployeeRecord ' Create user-defined type.
ID As Integer ' Define elements of data type.
Name As String * 20
Address As String * 30
Phone As Long
HireDate As Date
End Type
Public Enum InterfaceColors
icMistyRose = &HE1E4FF&
icSlateGray = &H908070&
icDodgerBlue = &HFF901E&
icDeepSkyBlue = &HFFBF00&
icSpringGreen = &H7FFF00&
icForestGreen = &H228B22&
icGoldenrod = &H20A5DA&
icFirebrick = &H2222B2&
End Enum
Enum SecurityLevel
IllegalEntry = -1
SecurityLevel1 = 0
SecurityLevel2 = 1
End Enum
Public Function TestConditional (number As Integer, ext As String) As Boolean
Dim inRange As Boolean
Select Case number
Case <= 0
inRange = False
Case > 10
inRange = False
Case Else
inRange = True
End Select
' This is a special case identified in the indent script.
Select Case number
End Select
If ext = ".xlm" Then
If inRange Then
TestConditional = True
Else
TestConditional = False
End If
ElseIf ext = ".xlsx" Then
If inRange Then
TestConditional = False
Else
TestConditional = True
End If
Else
TestConditional = False
End If
End Function
Private Sub TestIterators (lLimit As Integer, uLimit As Integer)
Dim a() As Variant
Dim elmt As Variant
Dim found As Boolean
Dim indx As Integer
Const specialValue As Integer = 5
If uLimit < lLimit Then
Exit Sub
End If
ReDim a(lLimit To uLimit)
For indx=lLimit To Ulimit
a(indx) = 2 * indx
Next indx
found = False
For Each elmt in a
If elmt = specialValue Then
found = True
End If
Next elmt
If found then
indx = uLimit
Do While indx >= lLimit
indx = indx - 1
Loop
End If
End Sub
Public Sub TestMultiline (cellAddr As String, rowNbr As Long)
Dim rng As Range
Set rng = Range(cellAddr)
With rng
.Cells(1,1).Value = _
"Line 1 of multiline string; " & _
"Line 2 of multiline string; " & _
"Line 3 of multiline string"
End With
' The following lines have whitespace after the underscore character
' and therefore do not form a valid multiline statement. The indent
' script correctly treats them as four single line statements contrary
' to the author's obvious indent.
rng..Cells(1,1).Value = _
"Line 1 of multiline string; " & _
"Line 2 of multiline string; " & _
"Line 3 of multiline string"
End Sub
Private Sub TestStmtLabel()
GoTo stmtLabel
' Statement labels are never indented
stmtLabel:
End Sub
Sub TestTypeKeyword()
Type EmployeeRecord ' Create user-defined type.
ID As Integer ' Define elements of data type.
Name As String * 20
Address As String * 30
Phone As Long
HireDate As Date
End Type
Dim varType As EmployeeRecord
End Sub
' END_INDENT

View File

@@ -887,3 +887,55 @@ if true
elseif elseif
endif endif
" END_INDENT " END_INDENT
" START_INDENT
if (
true)
&& true
echo
endif
" END_INDENT
" START_INDENT
abstract class Shape
this.color = Color.Black
this.thickness = 10
endclass
" END_INDENT
" START_INDENT
class OtherThing
this.size: number
static totalSize: number
static def ClearTotalSize(): number
var prev = totalSize
totalSize = 0
return prev
enddef
endclass
" END_INDENT
" START_INDENT
interface HasSurface
this.size: number
def Surface(): number
endinterface
" END_INDENT
" START_INDENT
interface EnterExit
def Enter(): void
def Exit(): void
endinterface
" END_INDENT
" START_INDENT
enum Color
White
Red
Green
Blue
Black
endenum
" END_INDENT

View File

@@ -887,3 +887,55 @@ if true
elseif elseif
endif endif
" END_INDENT " END_INDENT
" START_INDENT
if (
true)
&& true
echo
endif
" END_INDENT
" START_INDENT
abstract class Shape
this.color = Color.Black
this.thickness = 10
endclass
" END_INDENT
" START_INDENT
class OtherThing
this.size: number
static totalSize: number
static def ClearTotalSize(): number
var prev = totalSize
totalSize = 0
return prev
enddef
endclass
" END_INDENT
" START_INDENT
interface HasSurface
this.size: number
def Surface(): number
endinterface
" END_INDENT
" START_INDENT
interface EnterExit
def Enter(): void
def Exit(): void
endinterface
" END_INDENT
" START_INDENT
enum Color
White
Red
Green
Blue
Black
endenum
" END_INDENT

View File

@@ -1,8 +1,12 @@
" Vim indent file " Vim indent file
" Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb) " Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb)
" Author: Johannes Zellner <johannes@zellner.org> " Author: Johannes Zellner <johannes@zellner.org>
" Maintainer: Michael Soyka (mssr953@gmail.com)
" Last Change: Fri, 18 Jun 2004 07:22:42 CEST " Last Change: Fri, 18 Jun 2004 07:22:42 CEST
" Small update 2010 Jul 28 by Maxim Kim " Small update 2010 Jul 28 by Maxim Kim
" 2022/12/15: add support for multiline statements.
" 2022/12/21: move VbGetIndent from global to script-local scope
" 2022/12/26: recognize "Type" keyword
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@@ -10,28 +14,33 @@ endif
let b:did_indent = 1 let b:did_indent = 1
setlocal autoindent setlocal autoindent
setlocal indentexpr=VbGetIndent(v:lnum) setlocal indentexpr=s:VbGetIndent(v:lnum)
setlocal indentkeys& setlocal indentkeys&
setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop,<:> setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop
let b:undo_indent = "set ai< indentexpr< indentkeys<" let b:undo_indent = "set ai< indentexpr< indentkeys<"
" Only define the function once. " Only define the function once.
if exists("*VbGetIndent") if exists("*s:VbGetIndent")
finish finish
endif endif
fun! VbGetIndent(lnum) function s:VbGetIndent(lnum)
let this_lnum = a:lnum
let this_line = getline(this_lnum)
" labels and preprocessor get zero indent immediately " labels and preprocessor get zero indent immediately
let this_line = getline(a:lnum)
let LABELS_OR_PREPROC = '^\s*\(\<\k\+\>:\s*$\|#.*\)' let LABELS_OR_PREPROC = '^\s*\(\<\k\+\>:\s*$\|#.*\)'
if this_line =~? LABELS_OR_PREPROC if this_line =~? LABELS_OR_PREPROC
return 0 return 0
endif endif
" Get the current value of "shiftwidth"
let bShiftwidth = shiftwidth()
" Find a non-blank line above the current line. " Find a non-blank line above the current line.
" Skip over labels and preprocessor directives. " Skip over labels and preprocessor directives.
let lnum = a:lnum let lnum = this_lnum
while lnum > 0 while lnum > 0
let lnum = prevnonblank(lnum - 1) let lnum = prevnonblank(lnum - 1)
let previous_line = getline(lnum) let previous_line = getline(lnum)
@@ -45,34 +54,102 @@ fun! VbGetIndent(lnum)
return 0 return 0
endif endif
let ind = indent(lnum) " Variable "previous_line" now contains the text in buffer line "lnum".
" Multi-line statements have the underscore character at end-of-line:
"
" object.method(arguments, _
" arguments, _
" arguments)
"
" and require extra logic to determine the correct indentation.
"
" Case 1: Line "lnum" is the first line of a multiline statement.
" Line "lnum" will have a trailing underscore character
" but the preceding non-blank line does not.
" Line "this_lnum" will be indented relative to "lnum".
"
" Case 2: Line "lnum" is the last line of a multiline statement.
" Line "lnum" will not have a trailing underscore character
" but the preceding non-blank line will.
" Line "this_lnum" will have the same indentation as the starting
" line of the multiline statement.
"
" Case 3: Line "lnum" is neither the first nor last line.
" Lines "lnum" and "lnum-1" will have a trailing underscore
" character.
" Line "this_lnum" will have the same indentation as the preceding
" line.
"
" No matter which case it is, the starting line of the statement must be
" found. It will be assumed that multiline statements cannot have
" intermingled comments, statement labels, preprocessor directives or
" blank lines.
"
let lnum_is_continued = (previous_line =~ '_$')
if lnum > 1
let before_lnum = prevnonblank(lnum-1)
let before_previous_line = getline(before_lnum)
else
let before_lnum = 0
let before_previous_line = ""
endif
if before_previous_line !~ '_$'
" Variable "previous_line" contains the start of a statement.
"
let ind = indent(lnum)
if lnum_is_continued
let ind += bShiftwidth
endif
elseif ! lnum_is_continued
" Line "lnum" contains the last line of a multiline statement.
" Need to find where this multiline statement begins
"
while before_lnum > 0
let before_lnum -= 1
if getline(before_lnum) !~ '_$'
let before_lnum += 1
break
endif
endwhile
if before_lnum == 0
let before_lnum = 1
endif
let previous_line = getline(before_lnum)
let ind = indent(before_lnum)
else
" Line "lnum" is not the first or last line of a multiline statement.
"
let ind = indent(lnum)
endif
" Add " Add
if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\|else\|elseif\|do\|for\|while\|enum\|with\)\>' if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\|enum\|type\)\|select\|case\|default\|if\|else\|elseif\|do\|for\|while\|with\)\>'
let ind = ind + shiftwidth() let ind = ind + bShiftwidth
endif endif
" Subtract " Subtract
if this_line =~? '^\s*\<end\>\s\+\<select\>' if this_line =~? '^\s*\<end\>\s\+\<select\>'
if previous_line !~? '^\s*\<select\>' if previous_line !~? '^\s*\<select\>'
let ind = ind - 2 * shiftwidth() let ind = ind - 2 * bShiftwidth
else else
" this case is for an empty 'select' -- 'end select' " this case is for an empty 'select' -- 'end select'
" (w/o any case statements) like: " (w/o any case statements) like:
" "
" select case readwrite " select case readwrite
" end select " end select
let ind = ind - shiftwidth() let ind = ind - bShiftwidth
endif endif
elseif this_line =~? '^\s*\<\(end\|else\|elseif\|until\|loop\|next\|wend\)\>' elseif this_line =~? '^\s*\<\(end\|else\|elseif\|until\|loop\|next\|wend\)\>'
let ind = ind - shiftwidth() let ind = ind - bShiftwidth
elseif this_line =~? '^\s*\<\(case\|default\)\>' elseif this_line =~? '^\s*\<\(case\|default\)\>'
if previous_line !~? '^\s*\<select\>' if previous_line !~? '^\s*\<select\>'
let ind = ind - shiftwidth() let ind = ind - bShiftwidth
endif endif
endif endif
return ind return ind
endfun endfunction
" vim:sw=4 " vim:sw=4

View File

@@ -3,7 +3,7 @@ vim9script
# Vim indent file # Vim indent file
# Language: Vim script # Language: Vim script
# Maintainer: Bram Moolenaar <Bram@vim.org> # Maintainer: Bram Moolenaar <Bram@vim.org>
# Last Change: 2022 Oct 5 # Last Change: 2023 Feb 02
# Only load this indent file when no other was loaded. # Only load this indent file when no other was loaded.
if exists('b:did_indent') if exists('b:did_indent')
@@ -16,7 +16,7 @@ b:undo_indent = 'setlocal indentkeys< indentexpr<'
import autoload '../autoload/dist/vimindent.vim' import autoload '../autoload/dist/vimindent.vim'
setlocal indentexpr=vimindent.Expr() setlocal indentexpr=vimindent.Expr()
setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=},=else,=cat,=finall,=END,0\\ setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=endclass,=endinterface,=endenum,=},=else,=cat,=finall,=END,0\\
execute('setlocal indentkeys+=0=\"\\\ ,0=#\\\ ') execute('setlocal indentkeys+=0=\"\\\ ,0=#\\\ ')
setlocal indentkeys-=0# setlocal indentkeys-=0#
setlocal indentkeys-=: setlocal indentkeys-=:

View File

@@ -1,12 +1,14 @@
" Vim indent file placeholder " Vim indent file placeholder
" Language: Vue " Language: Vue
" Maintainer: None, please volunteer if you have a real Vue indent script " Maintainer: None, please volunteer if you have a real Vue indent script
" Last Change: 2022 Dec 24
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
let b:did_indent = 1 " don't set b:did_indent, otherwise html indenting won't be activated
" let b:did_indent = 1
" Html comes closest " Html comes closest
runtime! indent/html.vim runtime! indent/html.vim

View File

@@ -1,7 +1,7 @@
" These commands create the option window. " These commands create the option window.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2022 Nov 23 " Last Change: 2022 Dec 16
" If there already is an option window, jump to that one. " If there already is an option window, jump to that one.
let buf = bufnr('option-window') let buf = bufnr('option-window')
@@ -743,10 +743,12 @@ call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show se
call <SID>BinOptionG("terse", &terse) call <SID>BinOptionG("terse", &terse)
call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter")) call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))
call <SID>OptionG("shm", &shm) call <SID>OptionG("shm", &shm)
call <SID>AddOption("showcmd", gettext("show (partial) command keys in the status line")) call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'"))
let &sc = s:old_sc let &sc = s:old_sc
call <SID>BinOptionG("sc", &sc) call <SID>BinOptionG("sc", &sc)
set nosc set nosc
call <SID>AddOption("showcmdloc", gettext("location where to show the (partial) command keys for 'showcmd'"))
call <SID>OptionG("sloc", &sloc)
call <SID>AddOption("showmode", gettext("display the current mode in the status line")) call <SID>AddOption("showmode", gettext("display the current mode in the status line"))
call <SID>BinOptionG("smd", &smd) call <SID>BinOptionG("smd", &smd)
call <SID>AddOption("ruler", gettext("show cursor position below each window")) call <SID>AddOption("ruler", gettext("show cursor position below each window"))

View File

@@ -108,8 +108,9 @@ func s:Highlight_Matching_Pair()
" searchpairpos()'s skip argument. " searchpairpos()'s skip argument.
" We match "escape" for special items, such as lispEscapeSpecial, and " We match "escape" for special items, such as lispEscapeSpecial, and
" match "symbol" for lispBarSymbol. " match "symbol" for lispBarSymbol.
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . let s_skip = 'synstack(".", col("."))'
\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|symbol\\|comment"''))' \ . '->indexof({_, id -> synIDattr(id, "name") =~? '
\ . '"string\\|character\\|singlequote\\|escape\\|symbol\\|comment"}) >= 0'
" If executing the expression determines that the cursor is currently in " If executing the expression determines that the cursor is currently in
" one of the syntax types, then we want searchpairpos() to find the pair " one of the syntax types, then we want searchpairpos() to find the pair
" within those syntax types (i.e., not skip). Otherwise, the cursor is " within those syntax types (i.e., not skip). Otherwise, the cursor is

View File

@@ -1,6 +1,6 @@
" Vim plugin for converting a syntax highlighted file to HTML. " Vim plugin for converting a syntax highlighted file to HTML.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com> " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2019 Nov 13 " Last Change: 2023 Jan 01
" "
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
" $VIMRUNTIME/syntax/2html.vim " $VIMRUNTIME/syntax/2html.vim
@@ -8,11 +8,23 @@
if exists('g:loaded_2html_plugin') if exists('g:loaded_2html_plugin')
finish finish
endif endif
let g:loaded_2html_plugin = 'vim8.1_v2' let g:loaded_2html_plugin = 'vim9.0_v1'
" "
" Changelog: {{{ " Changelog: {{{
" 8.1_v2 (this version): - Fix Bitbucket issue #19: fix calculation of tab " 9.0_v1 (this version): - Implement g:html_no_doc and g:html_no_modeline
" for diff mode. Add tests.
" (Vim 9.0.1122): NOTE: no version string update for this version!
" - Bugfix for variable name in g:html_no_doc
" (Vim 9.0.0819): NOTE: no version string update for this version!
" - Add options g:html_no_doc, g:html_no_lines,
" and g:html_no_modeline (partially included in Vim
" runtime prior to version string update).
" - Updates for new Vim9 string append style (i.e. use
" ".." instead of ".")
"
" 8.1 updates: {{{
" 8.1_v2 (Vim 8.1.2312): - Fix SourceForge issue #19: fix calculation of tab
" stop position to use in expanding a tab, when that " stop position to use in expanding a tab, when that
" tab occurs after a syntax match which in turn " tab occurs after a syntax match which in turn
" comes after previously expanded tabs. " comes after previously expanded tabs.
@@ -20,17 +32,17 @@ let g:loaded_2html_plugin = 'vim8.1_v2'
" destination file to ignore FileType events; " destination file to ignore FileType events;
" speeds up processing when the destination file " speeds up processing when the destination file
" already exists and HTML highlight takes too long. " already exists and HTML highlight takes too long.
" - Fix Bitbucket issue #20: progress bar could not be " - Fix SourceForge issue #20: progress bar could not be
" seen when DiffDelete background color matched " seen when DiffDelete background color matched
" StatusLine background color. Added TOhtmlProgress " StatusLine background color. Added TOhtmlProgress
" highlight group for manual user override, but " highlight group for manual user override, but
" calculate it to be visible compared to StatusLine " calculate it to be visible compared to StatusLine
" by default. " by default.
" - Fix Bitbucket issue #1: Remove workaround for old " - Fix SourceForge issue #1: Remove workaround for old
" browsers which don't support 'ch' CSS unit, since " browsers which don't support 'ch' CSS unit, since
" all modern browsers, including IE>=9, support it. " all modern browsers, including IE>=9, support it.
" - Fix Bitbucket issue #10: support termguicolors " - Fix SourceForge issue #10: support termguicolors
" - Fix Bitbucket issue #21: default to using " - Fix SourceForge issue #21: default to using
" generated content instead of <input> tags for " generated content instead of <input> tags for
" uncopyable text, so that text is correctly " uncopyable text, so that text is correctly
" prevented from being copied in chrome. Use " prevented from being copied in chrome. Use
@@ -41,13 +53,14 @@ let g:loaded_2html_plugin = 'vim8.1_v2'
" - Fix fallback sizing of <input> tags for browsers " - Fix fallback sizing of <input> tags for browsers
" without "ch" support. " without "ch" support.
" - Fix cursor on unselectable diff filler text. " - Fix cursor on unselectable diff filler text.
" 8.1_v1 (Vim 8.1.0528): - Fix Bitbucket issue #6: Don't generate empty " 8.1_v1 (Vim 8.1.0528): - Fix SourceForge issue #6: Don't generate empty
" script tag. " script tag.
" - Fix Bitbucket issue #5: javascript should " - Fix SourceForge issue #5: javascript should
" declare variables with "var". " declare variables with "var".
" - Fix Bitbucket issue #13: errors thrown sourcing " - Fix SourceForge issue #13: errors thrown sourcing
" 2html.vim directly when plugins not loaded. " 2html.vim directly when plugins not loaded.
" - Fix Bitbucket issue #16: support 'vartabstop'. " - Fix SourceForge issue #16: support 'vartabstop'.
"}}}
" "
" 7.4 updates: {{{ " 7.4 updates: {{{
" 7.4_v2 (Vim 7.4.0899): Fix error raised when converting a diff containing " 7.4_v2 (Vim 7.4.0899): Fix error raised when converting a diff containing
@@ -152,7 +165,7 @@ let g:loaded_2html_plugin = 'vim8.1_v2'
" TODO: {{{ " TODO: {{{
" * Check the issue tracker: " * Check the issue tracker:
" https://bitbucket.org/fritzophrenic/vim-tohtml/issues?status=new&status=open " https://sourceforge.net/p/vim-tohtml/issues/search/?q=%21status%3Aclosed
" * Options for generating the CSS in external style sheets. New :TOcss " * Options for generating the CSS in external style sheets. New :TOcss
" command to convert the current color scheme into a (mostly) generic CSS " command to convert the current color scheme into a (mostly) generic CSS
" stylesheet which can be re-used. Alternate stylesheet support? Good start " stylesheet which can be re-used. Alternate stylesheet support? Good start

View File

@@ -1,6 +1,6 @@
" Vim syntax support file " Vim syntax support file
" Maintainer: Ben Fritz <fritzophrenic@gmail.com> " Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2020 Jan 05 " Last Change: 2023 Jan 01
" "
" Additional contributors: " Additional contributors:
" "
@@ -1881,7 +1881,7 @@ if s:settings.use_css && !s:settings.no_doc
endif endif
endif endif
if !s:settings.use_css && !s:settings_no_doc if !s:settings.use_css && !s:settings.no_doc
" For Netscape 4, set <body> attributes too, though, strictly speaking, it's " For Netscape 4, set <body> attributes too, though, strictly speaking, it's
" incorrect. " incorrect.
execute '%s:<body\([^>]*\):<body bgcolor="' . s:bgc . '" text="' . s:fgc . '"\1>\r<font face="'. s:htmlfont .'"' execute '%s:<body\([^>]*\):<body bgcolor="' . s:bgc . '" text="' . s:fgc . '"\1>\r<font face="'. s:htmlfont .'"'

View File

@@ -2,8 +2,8 @@
" Language: automake Makefile.am " Language: automake Makefile.am
" Maintainer: Debian Vim Maintainers " Maintainer: Debian Vim Maintainers
" Former Maintainer: John Williams <jrw@pobox.com> " Former Maintainer: John Williams <jrw@pobox.com>
" Last Change: 2018 Dec 27 " Last Change: 2023 Jan 16
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/automake.vim " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/automake.vim
" "
" XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain " XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain
" it only because patches have been submitted for it by Debian users and the " it only because patches have been submitted for it by Debian users and the

View File

@@ -3,8 +3,8 @@
" Maintainer: Debian Vim Maintainers " Maintainer: Debian Vim Maintainers
" Former Maintainers: Gerfried Fuchs <alfie@ist.org> " Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org> " Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2022 Oct 29 " Last Change: 2023 Jan 16
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debchangelog.vim
" Standard syntax initialization " Standard syntax initialization
if exists('b:current_syntax') if exists('b:current_syntax')

View File

@@ -3,8 +3,8 @@
" Maintainer: Debian Vim Maintainers " Maintainer: Debian Vim Maintainers
" Former Maintainers: Gerfried Fuchs <alfie@ist.org> " Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org> " Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2022 May 11 " Last Change: 2023 Jan 16
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcontrol.vim " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcontrol.vim
" Standard syntax initialization " Standard syntax initialization
if exists('b:current_syntax') if exists('b:current_syntax')

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