Compare commits

...

141 Commits

Author SHA1 Message Date
Bram Moolenaar
52bf81c2d5 patch 8.2.2002: Vim9: lambda argument shadowed by function name
Problem:    Vim9: lambda argument shadowed by function name.
Solution:   Let function name be shadowed by lambda argument. (closes #7313)
2020-11-17 18:50:44 +01:00
Bram Moolenaar
0ba48e8c27 patch 8.2.2001: Vim9: :def function does not apply 'maxfuncdepth'
Problem:    Vim9: :def function does not apply 'maxfuncdepth'.
Solution:   Use 'maxfuncdepth'. (issue #7313)
2020-11-17 18:23:19 +01:00
Bram Moolenaar
fc74d03e76 patch 8.2.2000: Vim9: dict.key assignment not implemented yet
Problem:    Vim9: dict.key assignment not implemented yet.
Solution:   Implement dict.key assignment. (closes #7312)
2020-11-16 22:11:49 +01:00
Bram Moolenaar
e6329e4c55 patch 8.2.1999: terminal popup test sometimes fails
Problem:    Terminal popup test sometimes fails.
Solution:   Wait for the popup to close.
2020-11-16 21:10:34 +01:00
Bram Moolenaar
27f4f6baee patch 8.2.1998: terminal Cmd test sometimes fails to close popup
Problem:    Terminal Cmd test sometimes fails to close popup.
Solution:   Add "term_finish" option.
2020-11-16 21:02:28 +01:00
Bram Moolenaar
8adc8d9b73 patch 8.2.1997: window changes when using bufload() while in a terminal popup
Problem:    Window changes when using bufload() while in a terminal popup.
Solution:   When searching for a window by ID also find a popup window.
            (closes #7307)
2020-11-16 20:47:31 +01:00
Bram Moolenaar
193f6201b4 patch 8.2.1996: Vim9: invalid error for argument of extend()
Problem:    Vim9: invalid error for argument of extend().
Solution:   Check if the type could match. (closes #7299)
2020-11-16 20:08:35 +01:00
Bram Moolenaar
714cbe5b21 patch 8.2.1995: the popup menu can cause too much redrawing
Problem:    The popup menu can cause too much redrawing.
Solution:   Reduce the length of the displayed text. (Yasuhiro Matsumoto,
            closes #7306)
2020-11-16 19:12:00 +01:00
Bram Moolenaar
c4390fe6c0 patch 8.2.1994: MS-Windows: MinGW always does a full build
Problem:    MS-Windows: MinGW always does a full build.
Solution:   Only check if $OUTDIR exists. (Masamichi Abe, closes #7311)
2020-11-16 18:49:47 +01:00
Bram Moolenaar
50dc3ecc64 patch 8.2.1993: occasional failure of the netbeans test
Problem:    Occasional failure of the netbeans test.
Solution:   Add "silent!". (Yegappan Lakshmanan, closes #7304)
2020-11-16 18:39:43 +01:00
Bram Moolenaar
4792a679f9 patch 8.2.1992: build fails with small features
Problem:    Build fails with small features.
Solution:   Add #ifdef.
2020-11-15 21:11:18 +01:00
Bram Moolenaar
ca359cbedd patch 8.2.1991: Coverity warns for not using the ga_grow() return value
Problem:    Coverity warns for not using the ga_grow() return value.
Solution:   Bail out if ga_grow() fails. (Yegappan Lakshmanan, closes #7303)
2020-11-15 20:49:41 +01:00
Bram Moolenaar
6a07644db3 patch 8.2.1990: cursor position wrong in terminal popup with finished job
Problem:    Cursor position wrong in terminal popup with finished job.
Solution:   Only add the top and left offset when not done already.
            (closes #7298)
2020-11-15 20:32:58 +01:00
Bram Moolenaar
2dfae04f37 patch 8.2.1989: info popup triggers WinEnter and WinLeave autocommands
Problem:    Info popup triggers WinEnter and WinLeave autocommands.
Solution:   Suppress autocommands for the info popup. (closes #7296)
2020-11-15 14:09:37 +01:00
Bram Moolenaar
e41decc892 patch 8.2.1988: still in Insert mode when opening terminal popup
Problem:    Still in Insert mode when opening terminal popup with a <Cmd>
            mapping in Insert mode.
Solution:   Exit Insert mode. (closes #7295)
2020-11-14 21:34:59 +01:00
Bram Moolenaar
6453cc8078 patch 8.2.1987: MS-Windows: Win32.mak is no longer needed
Problem:    MS-Windows: Win32.mak is no longer needed.
Solution:   Do not include Win32.mak. (Jason McHugh, closes #7290)
2020-11-14 21:04:33 +01:00
Bram Moolenaar
a065a14115 patch 8.2.1986: expression test is flaky on Appveyor
Problem:    Expression test is flaky on Appveyor.
Solution:   Temporarily disable the test in MS-Windows.
2020-11-14 20:57:20 +01:00
Bram Moolenaar
02764713a7 patch 8.2.1985: crash when closing terminal popup with <Cmd> mapping
Problem:    Crash when closing terminal popup with <Cmd> mapping.
Solution:   Check b_term is not NULL. (closes #7294)
2020-11-14 20:21:55 +01:00
Bram Moolenaar
33aecb1f2c patch 8.2.1984: cannot use :vimgrep in omni completion
Problem:    Cannot use :vimgrep in omni completion, causing C completion to
            fail.
Solution:   Add the EX_LOCK_OK flag to :vimgrep. (closes #7292)
2020-11-14 17:25:51 +01:00
Bram Moolenaar
f4d61bc559 patch 8.2.1983: ml_get error when using <Cmd> to open a terminal
Problem:    ml_get error when using <Cmd> to open a terminal.
Solution:   If the window changed reset the incsearch state. (closes #7289)
2020-11-14 14:22:28 +01:00
Bram Moolenaar
2ce7790348 patch 8.2.1982: quickfix window now updated when adding invalid entries
Problem:    Quickfix window now updated when adding invalid entries.
Solution:   Update the quickfix buffer properly. (Yegappan Lakshmanan, closes
            #7291, closes #7271)
2020-11-14 13:15:24 +01:00
Bram Moolenaar
8496c9eadb patch 8.2.1981: MinGW: parallel compilation might fail
Problem:    MinGW: parallel compilation might fail.
Solution:   Add dependencies on $(OUTDIR). (Masamichi Abe, closes #7287)
2020-11-13 17:47:33 +01:00
Bram Moolenaar
659bb2275e patch 8.2.1980: Vim9: some tests are not done at the script level
Problem:    Vim9: some tests are not done at the script level.
Solution:   Use CheckDefAndScriptSuccess() in more places.  Fix uncovered
            problems.
2020-11-12 20:16:39 +01:00
Bram Moolenaar
47c5ea44b9 patch 8.2.1979: "term_opencmd" option of term_start() is truncated
Problem:    "term_opencmd" option of term_start() is truncated. (Sergey
            Vlasov)
Solution:   Allocate the buffer to hold the command. (closes #7284)
2020-11-12 15:12:15 +01:00
Bram Moolenaar
957cf67d50 patch 8.2.1978: making a mapping work in all modes is complicated
Problem:    Making a mapping work in all modes is complicated.
Solution:   Add the <Cmd> special key. (Yegappan Lakshmanan, closes #7282,
            closes 4784, based on patch by Bjorn Linse)
2020-11-12 14:21:06 +01:00
Bram Moolenaar
ea2d407f9c patch 8.2.1977: Vim9: error for using a string in a condition is confusing
Problem:    Vim9: error for using a string in a condition is confusing.
Solution:   Give a more specific error.  Also adjust the compile time type
            checking for || and &&.
2020-11-12 12:08:51 +01:00
Bram Moolenaar
6f6244855f patch 8.2.1976: cannot backspace in prompt buffer after using cursor-left
Problem:    Cannot backspace in prompt buffer after using cursor-left. (Maxim
            Kim)
Solution:   Ignore "arrow_used" in a prompt buffer. (closes #7281)
2020-11-11 20:52:40 +01:00
Bram Moolenaar
bbf9f344af patch 8.2.1975: Win32: memory leak when encoding conversion fails
Problem:    Win32: memory leak when encoding conversion fails.
Solution:   Free the allocated memory. (Ken Takata, closes #7277)
2020-11-10 22:03:40 +01:00
Bram Moolenaar
29b281ba8d patch 8.2.1974: Vim9: test for has('gui_running') fails with VIMDLL
Problem:    Vim9: test for has('gui_running') fails with VIMDLL.
Solution:   Adjust the #ifdef. (Ken Takata, closes #7276)
2020-11-10 20:58:00 +01:00
Bram Moolenaar
232f4612e2 patch 8.2.1973: finding a patch number can be a bit slow
Problem:    Finding a patch number can be a bit slow.
Solution:   Use binary search. (closes #7279)
2020-11-10 20:54:29 +01:00
Bram Moolenaar
5e1f22ff61 patch 8.2.1972: crash when recreating nested fold
Problem:    Crash when recreating nested fold.
Solution:   Check for empty growarray. (closes #7278)
2020-11-10 18:23:52 +01:00
Bram Moolenaar
c56936e2ba patch 8.2.1971: memory leak when map() fails
Problem:    Memory leak when map() fails.
Solution:   Clear the typval.
2020-11-10 11:43:56 +01:00
Bram Moolenaar
f883508e36 patch 8.2.1970: it is easy to make mistakes when cleaning up swap files
Problem:    It is easy to make mistakes when cleaning up swap files after the
            system crashed.
Solution:   Warn for the process still running after recovery.  Do not
            automatically delete a swap file created on another system.
            (David Fries, closes #7273)
2020-11-09 21:04:17 +01:00
Bram Moolenaar
ea696852e7 patch 8.2.1969: Vim9: map() may change the list or dict item type
Problem:    Vim9: map() may change the list or dict item type.
Solution:   Add mapnew().
2020-11-09 18:31:39 +01:00
Bram Moolenaar
8cebd43e97 patch 8.2.1968: Vim9: has() assumes a feature does not change dynamically
Problem:    Vim9: has() assumes a feature does not change dynamically.
Solution:   Check whether a feature may change dynamically. (closes #7265)
2020-11-08 12:49:47 +01:00
Bram Moolenaar
59d8e56e04 patch 8.2.1967: the session file does not restore the alternate file
Problem:    The session file does not restore the alternate file.
Solution:   Add ":balt".  Works like ":badd" and also sets the buffer as the
            alternate file.  Use it in the session file. (closes #7269,
            closes #6714)
2020-11-07 18:41:10 +01:00
Bram Moolenaar
cbcd9cbd77 patch 8.2.1966: popup becomes current window after closing a terminal window
Problem:    Popup becomes current window after closing a terminal window.
Solution:   When restoring the window after executing autocommands, check that
            the window ID is still the same.  (Naruhiko Nishino,
            closes #7272)
2020-11-07 16:58:59 +01:00
Bram Moolenaar
46f479c756 patch 8.2.1965: Vim9: tests fail without the channel feature
Problem:    Vim9: tests fail without the channel feature.
Solution:   Check if the channel feature is present. (Dominique Pellé,
            closes 7270)
2020-11-07 13:09:18 +01:00
Bram Moolenaar
faebda8cc1 patch 8.2.1964: not all ConTeXt files are recognized
Problem:    Not all ConTeXt files are recognized.
Solution:   Add two patterns. (closes #7263)
2020-11-06 18:52:55 +01:00
Bram Moolenaar
927495b1fe patch 8.2.1963: crash when using a popup window with "latin1" encoding
Problem:    Crash when using a popup window with "latin1" encoding.
Solution:   Don't use ScreenLinesUC when enc_utf8 is false. (closes #7241)
2020-11-06 17:58:35 +01:00
Bram Moolenaar
32e5ec0b01 patch 8.2.1962: netbeans may access freed memory
Problem:    Netbeans may access freed memory.
Solution:   Check the buffer pointer is still valid.  Add a test. (Yegappan
            Lakshmanan, closes #7248)
2020-11-06 13:44:21 +01:00
Bram Moolenaar
85d9b03f84 Correct list of patches. 2020-11-06 12:03:08 +01:00
Bram Moolenaar
22286895fc patch 8.2.1961: various comments can be improved
Problem:    Various comments can be improved.
Solution:   Various comment adjustments.
2020-11-05 20:50:51 +01:00
Bram Moolenaar
0fd797eacd patch 8.2.1960: warning for uninitialized variable
Problem:    Warning for uninitialized variable.
Solution:   Initialize the variable.
2020-11-05 20:46:32 +01:00
Bram Moolenaar
3132cddd20 Update runtime files 2020-11-05 20:41:49 +01:00
Bram Moolenaar
00806bceb6 patch 8.2.1959: crash when terminal buffer name is made empty
Problem:    Crash when terminal buffer name is made empty. (Dhiraj Mishra)
Solution:   Fall back to "[No Name]". (closes #7262)
2020-11-05 19:36:38 +01:00
Bram Moolenaar
b885b435d1 patch 8.2.1958: build failure with timers
Problem:    Build failure with timers.
Solution:   Add missing change.
2020-11-05 19:34:41 +01:00
Bram Moolenaar
fabc3ca896 patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Problem:    Diff and cursorcolumn highlighting don't mix.
Solution:   Fix condition for what attribute to use. (Christian Brabandt,
            closes #7258, closes #7260)
2020-11-05 19:07:21 +01:00
Bram Moolenaar
b4d16cb11d patch 8.2.1956: Vim9: cannot specify argument types for lambda
Problem:    Vim9: cannot specify argument types for lambda.
Solution:   Allow adding argument types.  Check arguments when calling a
            function reference.
2020-11-05 18:45:46 +01:00
Bram Moolenaar
66669fc664 patch 8.2.1955: Vim9: not all command modifiers are tested
Problem:    Vim9: not all command modifiers are tested.
Solution:   Add tests for remaining modifiers.
2020-11-04 18:53:35 +01:00
Bram Moolenaar
f65b35b446 patch 8.2.1954: Vim9: not all command modifiers are tested
Problem:    Vim9: not all command modifiers are tested.
Solution:   Add tests for "keep" modifiers.  Fix that marks are lost even
            though ":lockmarks" is used.
2020-11-04 18:02:44 +01:00
Bram Moolenaar
631e8f9345 patch 8.2.1953: Vim9: extra "unknown" error after other error
Problem:    Vim9: extra "unknown" error after other error.
Solution:   Restore did_emsg count after EXEC instruction. (closes #7254)
            Improve error message from assert_fails()
2020-11-04 15:07:16 +01:00
Bram Moolenaar
c7f7f6db3e patch 8.2.1952: Vim9: crash when using a NULL dict key
Problem:    Vim9: crash when using a NULL dict key.
Solution:   Use a NULL dict key like an empty string. (closes #7249)
2020-11-04 13:38:28 +01:00
Bram Moolenaar
64ffa9b5fb patch 8.2.1951: test for list and dict fails
Problem:    Test for list and dict fails.
Solution:   Adjust for using an empty list/dict for a null one.
2020-11-04 12:23:06 +01:00
Bram Moolenaar
9c13f76275 patch 8.2.1950: Vim9: crash when compiling function fails when getting type
Problem:    Vim9: crash when compiling function fails when getting type.
Solution:   Handle NULL type. (closes #7253)
2020-11-04 12:00:53 +01:00
Bram Moolenaar
348be7ed07 patch 8.2.1949: Vim9: using extend() on null dict is silently ignored
Problem:    Vim9: using extend() on null dict is silently ignored.
Solution:   Give an error message.  Initialize a dict variable with an empty
            dictionary. (closes #7251)
2020-11-04 11:36:35 +01:00
Bram Moolenaar
4778b4d0e1 patch 8.2.1948: GUI: crash when handling message while closing a window
Problem:    GUI: crash when handling message while closing a window. (Srinath
            Avadhanula)
Solution:   Don't handle message while closing a window. (closes #7250)
2020-11-04 11:03:12 +01:00
Bram Moolenaar
c136a3528b patch 8.2.1947: crash when using "zj" without folds
Problem:    Crash when using "zj" without folds. (Sean Dewar)
Solution:   Check for at least one fold. (closes #7245)
2020-11-03 20:05:40 +01:00
Bram Moolenaar
35efa22ff2 patch 8.2.1946: sort() with NULL string not tested
Problem:    sort() with NULL string not tested.
Solution:   Add a test.  use v:collate. (Dominique Pellé, closes #7247)
2020-11-03 18:51:54 +01:00
Bram Moolenaar
0d90e728fe patch 8.2.1945: crash when passing NULL function to reduce()
Problem:    Crash when passing NULL function to reduce().
Solution:   Check for NULL pointer and give an error. (Dominique Pellé,
            closes #7243)
2020-11-03 18:20:19 +01:00
Bram Moolenaar
6fd3a4ba23 patch 8.2.1944: Netbeans test is flaky
Problem:    Netbeans test is flaky.
Solution:   Add a short delay. (Yegappan Lakshmanan, closes #7246)
2020-11-03 11:53:29 +01:00
Bram Moolenaar
36113e46b4 patch 8.2.1943: Vim9: wrong error message when colon is missing
Problem:    Vim9: wrong error message when colon is missing.
Solution:   Check for a missing colon. (issue #7239)
2020-11-02 21:08:47 +01:00
Bram Moolenaar
dbfa795d8b patch 8.2.1942: insufficient test coverage for the Netbeans interface
Problem:    Insufficient test coverage for the Netbeans interface.
Solution:   Add more tests. Fix an uncovered bug. (Yegappan Lakshmanan,
            closes #7240)
2020-11-02 20:04:22 +01:00
Bram Moolenaar
399db046ed patch 8.2.1941: Ex mode test fails on MS-Windows with GUI
Problem:    Ex mode test fails on MS-Windows with GUI.
Solution:   Skip the test when using gvim.
2020-11-01 22:31:08 +01:00
Bram Moolenaar
97a19005e1 patch 8.2.1940: Vim9: browse modifier test fails on Mac
Problem:    Vim9: browse modifier test fails on Mac.
Solution:   Only test when the +browse feature is available.
2020-11-01 22:15:44 +01:00
Bram Moolenaar
3b6d57f2ce patch 8.2.1939: invalid memory access in Ex mode with global command
Problem:    Invalid memory access in Ex mode with global command.
Solution:   Make sure the cursor is on a valid line. (closes #7238)
2020-11-01 21:56:40 +01:00
Bram Moolenaar
a46765a797 patch 8.2.1938: wiping out a terminal buffer makes some tests fail
Problem:    Wiping out a terminal buffer makes some tests fail.
Solution:   Do not wipe out the terminal buffer unless wanted.
2020-11-01 20:58:26 +01:00
Bram Moolenaar
645cd3eb1f patch 8.2.1937: Vim9: test for confirm modifier fails in some situations
Problem:    Vim9: test for confirm modifier fails in some situations.
Solution:   Add a short wait.  Handle failure better.
2020-11-01 20:04:57 +01:00
Bram Moolenaar
388908352f patch 8.2.1936: session sets the local 'scrolloff' value to the global value
Problem:    Session sets the local 'scrolloff' value to the global value.
Solution:   Do not let restoring the global option value change the local
            value.
2020-11-01 17:40:54 +01:00
Bram Moolenaar
578f4cc7d0 patch 8.2.1935: sort test fails on Mac
Problem:    Sort test fails on Mac.
Solution:   Disable the sort test with locale on Mac.
2020-11-01 17:19:07 +01:00
Bram Moolenaar
e88c8e802c patch 8.2.1934: Vim9: command modifiers in :def function not tested
Problem:    Vim9: command modifiers in :def function not tested.
Solution:   Add tests.  Fix using modifier before filter command.
2020-11-01 17:03:37 +01:00
Bram Moolenaar
55e29611d2 patch 8.2.1933: cannot sort using locale ordering
Problem:    Cannot sort using locale ordering.
Solution:   Add a flag for :sort and sort() to use the locale. (Dominique
            Pellé, closes #7237)
2020-11-01 13:57:44 +01:00
Bram Moolenaar
963734e316 patch 8.2.1932: compiler warnings when building with Athena GUI
Problem:    Compiler warnings when building with Athena GUI.
Solution:   Fix function signatures.
2020-11-01 13:33:49 +01:00
Bram Moolenaar
fbcbffe1ad patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Problem:    Vim9: arguments of extend() not checked at compile time.
Solution:   Add argument type checking for extend().
2020-10-31 19:33:38 +01:00
Bram Moolenaar
749bc9521d patch 8.2.1930: wrong input if removing shift results in special key code
Problem:    Wrong input if removing shift results in special key code.
Solution:   Handle special key codes. (closes #7189)
2020-10-31 16:33:47 +01:00
Bram Moolenaar
0289065e41 patch 8.2.1929: MS-Windows: problem loading Perl 5.32
Problem:    MS-Windows: problem loading Perl 5.32.
Solution:   Define NO_THREAD_SAFE_LOCALE. (Ken Takata, closes #7234)
2020-10-31 13:05:11 +01:00
Bram Moolenaar
cd030c4b60 patch 8.2.1928: Vim9: "silent!" not effective when list index is wrong
Problem:    Vim9: "silent!" not effective when list index is wrong.
Solution:   Ignore list indes failure when emsg_silent is set. (closes #7232)
2020-10-30 21:49:40 +01:00
Bram Moolenaar
d66960bf57 patch 8.2.1927: Vim9: get unknown error with an error in a timer function
Problem:    Vim9: get unknown error with an error in a timer function.
Solution:   Use did_emsg instead of called_emsg. (closes #7231)
2020-10-30 20:46:26 +01:00
Bram Moolenaar
b2620202c7 patch 8.2.1926: cannot use a space in 'spellfile'
Problem:    Cannot use a space in 'spellfile'. (Filipe Brandenburger)
Solution:   Permit using a space. (closes #7230)
2020-10-30 19:25:09 +01:00
Bram Moolenaar
6d967125ad patch 8.2.1925: list/dict test fails
Problem:    List/dict test fails.
Solution:   Correct expected exception.
2020-10-30 19:06:18 +01:00
Bram Moolenaar
086fc9a585 patch 8.2.1924: Vim9: crash when indexing dict with NULL key
Problem:    Vim9: crash when indexing dict with NULL key.
Solution:   Use empty string instead of NULL. (closes #7229)  Make error
            message more useful for empty string.
2020-10-30 18:33:02 +01:00
Bram Moolenaar
4f6b6ed208 patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Problem:    Vim9: "filter" command modifier doesn't work.
Solution:   Check for space on char before argument. (closes #7216,
            closes #7222)
2020-10-29 20:24:34 +01:00
Bram Moolenaar
185577e47e patch 8.2.1922: Win32: scrolling problems when part of window is off-screen
Problem:    Win32: scrolling doesn't work properly when part of window is
            off-screen.
Solution:   Fall back to GDI scrolling if part of the window is off-screen.
            Handle multi-monitor setup better. (Ken Takata, closes #7219)
2020-10-29 20:08:21 +01:00
Bram Moolenaar
dcdd42a8cc patch 8.2.1921: fuzzy matching does not recognize path separators
Problem:    Fuzzy matching does not recognize path separators.
Solution:   Add a bonus for slash and backslash. (Yegappan Lakshmanan,
            closes #7225)
2020-10-29 18:58:01 +01:00
Bram Moolenaar
cf4d454df0 patch 8.2.1920: listlbr test fails when run after another test
Problem:    Listlbr test fails when run after another test.
Solution:   Add test separately to list of test targets.
2020-10-28 22:46:42 +01:00
Bram Moolenaar
28ee892ac4 patch 8.2.1919: assert_fails() setting emsg_silent changes normal execution
Problem:    Assert_fails() setting emsg_silent changes normal execution.
Solution:   Use a separate flag in_assert_fails.
2020-10-28 20:20:00 +01:00
Bram Moolenaar
3e2534ed1a patch 8.2.1918: Vim9: E1100 mentions :let
Problem:    Vim9: E1100 mentions :let.
Solution:   Mention "var". (closes #7207)
2020-10-28 17:55:31 +01:00
Bram Moolenaar
159563b439 patch 8.2.1917: no test for improved Man command
Problem:    No test for improved Man command.
Solution:   Test that shell arguments are properly escaped.
2020-10-28 17:21:26 +01:00
Bram Moolenaar
171fb923b8 patch 8.2.1916: Vim9: function call is aborted even when "silent!" is used
Problem:    Vim9: function call is aborted even when "silent!" is used.
Solution:   Use did_emsg instead of called_emsg. (closes #7213)
2020-10-28 16:54:47 +01:00
Bram Moolenaar
6cf7e3b026 patch 8.2.1915: Vim9: error for wrong number of arguments is not useful
Problem:    Vim9: error for wrong number of arguments is not useful.
Solution:   Mention whatever we have for the name. (closes #7208)
2020-10-28 14:31:16 +01:00
Bram Moolenaar
b4bcea474d patch 8.2.1914: Vim9: cannot put line break in expression for '=' register
Problem:    Vim9: cannot put line break in expression for '=' register.
Solution:   Pass fgetline to set_expr_line(). (closes #7209)
2020-10-28 13:53:50 +01:00
Bram Moolenaar
70cf45810c patch 8.2.1913: GTK GUI: rounding for the cell height is too strict
Problem:    GTK GUI: rounding for the cell height is too strict.
Solution:   Round up above 15/16 of a pixel. (closes #7203)
2020-10-27 20:43:26 +01:00
Bram Moolenaar
68a48ee55e patch 8.2.1912: with Python 3.9 some tests fail
Problem:    With Python 3.9 some tests fail.
Solution:   Take into account the different error message. (James McCoy,
            closes #7210)
2020-10-27 19:59:10 +01:00
Bram Moolenaar
977fd0b327 patch 8.2.1911: tiny build fails
Problem:    Tiny build fails.
Solution:   Add #ifdef.
2020-10-27 09:12:45 +01:00
Bram Moolenaar
caf73dcfad patch 8.2.1910: reading past the end of the command line
Problem:    Reading past the end of the command line.
Solution:   Check for NUL. (closes #7204)
2020-10-26 21:39:13 +01:00
Bram Moolenaar
cb80aa2d53 Update runtime files. 2020-10-26 21:12:46 +01:00
Bram Moolenaar
8133cc6bf4 patch 8.2.1909: number of status line items is limited to 80
Problem:    Number of status line items is limited to 80.
Solution:   Dynamically allocate the arrays. (Rom Grk, closes #7181)
2020-10-26 21:05:27 +01:00
Bram Moolenaar
c8970b9464 patch 8.2.1908: Lua is initialized even when not used
Problem:    Lua is initialized even when not used.
Solution:   Put lua_init() after check for "eap->skip". (Christian Brabandt,
            closes #7191).  Avoid compiler warnings.
2020-10-26 20:18:08 +01:00
Bram Moolenaar
f9d51354de patch 8.2.1907: complete_info().selected may be wrong
Problem:    Complete_info().selected may be wrong.
Solution:   Update cp_number if it was never set. (issue #6945)
2020-10-26 19:22:42 +01:00
Bram Moolenaar
a360dbe3b6 patch 8.2.1906: warning for signed/unsigned
Problem:    Warning for signed/unsigned.
Solution:   Use size_t instead of int. (Mike Williams)
2020-10-26 18:46:53 +01:00
Bram Moolenaar
4882d98339 patch 8.2.1905: the wininfo list may contain stale entries
Problem:    The wininfo list may contain stale entries.
Solution:   When closing a window remove any other entry where the window
            pointer is NULL.
2020-10-25 17:55:09 +01:00
Bram Moolenaar
89b693e562 patch 8.2.1904: still using default option values after using ":badd +1"
Problem:    Still using default option values after using ":badd +1".
Solution:   Find a window where options were set.  Don't set the window when
            using ":badd".
2020-10-25 17:09:50 +01:00
Bram Moolenaar
37e4e03c67 patch 8.2.1903: buffer test fails with normal features
Problem:    Buffer test fails with normal features.
Solution:   Use 'numberwidth' instead of 'conceallevel' in the test.
2020-10-25 16:18:26 +01:00
Bram Moolenaar
e974fa7b2b patch 8.2.1902: default option values changed with :badd for existing buffer
Problem:    Default option values are changed when using :badd for an existing
            buffer.
Solution:   When calling buflist_new() pass a zero line number. (closes #7195)
2020-10-25 15:02:51 +01:00
Bram Moolenaar
4ff2f2fb6b patch 8.2.1901: variable completion does not work in command line window
Problem:    Variable completion does not work in command line window.
Solution:   Use the "prevwin". (closes #7198)
2020-10-25 13:22:42 +01:00
Bram Moolenaar
02194d2bd5 patch 8.2.1900: Vim9: command modifiers do not work
Problem:    Vim9: command modifiers do not work.
Solution:   Make most command modifiers work.
2020-10-24 23:08:38 +02:00
Bram Moolenaar
67def64a4e patch 8.2.1899: crash in out-of-memory situation
Problem:    Crash in out-of-memory situation.
Solution:   Bail out if shell_name is NULL. (Dominique Pellé, closes #7196)
2020-10-24 20:58:06 +02:00
Bram Moolenaar
e100440158 patch 8.2.1898: command modifier parsing always uses global cmdmod
Problem:    Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
2020-10-24 20:49:43 +02:00
Bram Moolenaar
5661ed6c83 patch 8.2.1897: command modifiers are saved and set inconsistently
Problem:    Command modifiers are saved and set inconsistently.
Solution:   Separate parsing and applying command modifiers.  Save values in
            cmdmod_T.
2020-10-24 17:19:16 +02:00
Bram Moolenaar
e1be11864d patch 8.2.1896: valgrind warns for using uninitialized memory
Problem:    Valgrind warns for using uninitialized memory.
Solution:   NUL terminate the SmcOpenConnection() error message. (Dominique
            Pellé, closes #7194)
2020-10-24 13:30:51 +02:00
Bram Moolenaar
210681c509 patch 8.2.1895: Vim9: silent command modifier test fails
Problem:    Vim9: silent command modifier test fails.
Solution:   Add missing changes.
2020-10-23 18:51:06 +02:00
Bram Moolenaar
f4c6e1e75c patch 8.2.1894: Vim9: command modifiers are not supported
Problem:    Vim9: command modifiers are not supported.
Solution:   Support "silent" and "silent!".
2020-10-23 18:02:32 +02:00
Bram Moolenaar
8ded5b647a patch 8.2.1893: fuzzy matching does not support multiple words
Problem:    Fuzzy matching does not support multiple words.
Solution:   Add support for matching white space separated words. (Yegappan
            Lakshmanan, closes #7163)
2020-10-23 16:50:30 +02:00
Bram Moolenaar
9c24cd11e2 patch 8.2.1892: valgrind warns for using uninitialized access in tests
Problem:    Valgrind warns for using uninitialized access in tests.
Solution:   Fix condition for breaking out of loop. (Dominique Pellé,
            closes #7187)
2020-10-23 15:40:39 +02:00
Bram Moolenaar
683581eb49 patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Problem:    Vim9: skipping over expression doesn't handle line breaks.
Solution:   Pass evalarg to skip_expr(). (closes #7157)
2020-10-22 21:22:58 +02:00
Bram Moolenaar
081db1a66d patch 8.2.1890: Vim9: strange error for subtracting from a list
Problem:    Vim9: strange error for subtracting from a list.
Solution:   Check getting a number, not a string. (closes #7167)
2020-10-22 20:09:43 +02:00
Bram Moolenaar
b07a39de48 patch 8.2.1889: Vim9: errornous error for missing white space after {}
Problem:    Vim9: errornous error for missing white space after {}.
Solution:   Don't skip over white space after {}. (issue #7167)
2020-10-22 19:00:01 +02:00
Bram Moolenaar
e6e70a10f1 patch 8.2.1888: Vim9: getbufline(-1, 1, '$') gives an error
Problem:    Vim9: Getbufline(-1, 1, '$') gives an error.
Solution:   Return an empty list. (closes #7180)
2020-10-22 18:23:38 +02:00
Bram Moolenaar
15ab48f088 patch 8.2.1887: Github actions not optimally configured
Problem:    Github actions not optimally configured.
Solution:   Run CI on any pushed branches. Set fail-fast. (Ozaki Kiichi,
            closes #7184)
2020-10-22 17:33:17 +02:00
Bram Moolenaar
371806e164 patch 8.2.1886: using ":silent!" in a popup filter has unexpected effect
Problem:    Using ":silent!" in a popup filter has unexpected effect.
Solution:   Use did_emsg instead of called_emsg. (closes #7178)
2020-10-22 13:44:54 +02:00
Bram Moolenaar
2733779a1a patch 8.2.1885: filetype tests unnessarily creates swap files
Problem:    Filetype tests unnessarily creates swap files.
Solution:   Disable 'swapfile'. (Ken Takata, closes #7183)
2020-10-22 12:33:32 +02:00
Bram Moolenaar
a1224cb706 patch 8.2.1884: compiler warning for uninitialized variable
Problem:    Compiler warning for uninitialized variable. (John Marriott)
Solution:   Initialize with NULL.
2020-10-22 12:31:49 +02:00
Bram Moolenaar
4ce5fe4c87 patch 8.2.1883: compiler warnings when using Python
Problem:    Compiler warnings when using Python.
Solution:   Adjust PyCFunction to also have the second argument.  Use "int"
            return type for some functions.  Insert "(void *)" to get rid of
            the remaining warnings.
2020-10-21 21:01:59 +02:00
Bram Moolenaar
c58f5456e5 patch 8.2.1882: Vim9: v:disallow_let is no longer needed
Problem:    Vim9: v:disallow_let is no longer needed.
Solution:   Remove v:disallow_let.
2020-10-21 20:58:52 +02:00
Bram Moolenaar
692d1a51e7 patch 8.2.1881: cannot build with GTK3
Problem:    Cannot build with GTK3.
Solution:   Adjust form functions.
2020-10-21 17:28:27 +02:00
Bram Moolenaar
af7a9066a9 patch 8.2.1880: Vim9: asan complains about adding zero to NULL
Problem:    Vim9: Asan complains about adding zero to NULL.
Solution:   Check for argument count first.
2020-10-21 16:49:17 +02:00
Bram Moolenaar
ca17453e73 patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Problem:    Vim9: argument types of insert() not checked when compiling.
Solution:   Add argument type checks for insert().
2020-10-21 16:42:22 +02:00
Bram Moolenaar
8a99e66b4f patch 8.2.1878: GTK: error for redefining function
Problem:    GTK: error for redefining function. (Tony Mechelynck)
Solution:   Remove "gtk_" prefix from local functions and prepend "gui_" to
            global functions.
2020-10-21 16:10:21 +02:00
Bram Moolenaar
b8f519e538 patch 8.2.1877: test for function list fails
Problem:    Test for function list fails.
Solution:   Move "obsolete" comments one line up.
2020-10-21 14:49:08 +02:00
Bram Moolenaar
94738d8fab patch 8.2.1876: Vim9: argument types are not checked at compile time
Problem:    Vim9: argument types for builtin functions are not checked at
            compile time.
Solution:   Add an argument type checking mechanism. Implement type checks for
            one function.
2020-10-21 14:25:07 +02:00
Bram Moolenaar
3da855c8e2 patch 8.2.1875: warning when building GTK gui
Problem:    Warning when building GTK gui.
Solution:   Add missing function parameter.
2020-10-21 12:38:00 +02:00
Bram Moolenaar
b53e13a91a patch 8.2.1874: can't do something just before leaving Insert mode
Problem:    Can't do something just before leaving Insert mode.
Solution:   Add the InsertLeavePre autocommand event. (closes #7177)
2020-10-21 12:19:53 +02:00
Bram Moolenaar
20d89e0ac6 patch 8.2.1873: Vim9: missing white space when using <f-args>
Problem:    Vim9: missing white space when using <f-args>.
Solution:   Add spaces. (Christian J. Robinson)
2020-10-20 23:11:33 +02:00
Bram Moolenaar
e9f9f16387 patch 8.2.1872: matchfuzzy() does not prefer sequential matches
Problem:    Matchfuzzy() does not prefer sequential matches.
Solution:   Give sequential matches a higher bonus. (Christian Brabandt,
            closes #7140)
2020-10-20 19:01:30 +02:00
Bram Moolenaar
c95940c06a patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Problem:    Using %v in 'errorformat' may fail before %Z.
Solution:   Set qf_viscol only when qf_col is set. (closes #7169)
2020-10-20 14:59:12 +02:00
Bram Moolenaar
39ca4127a0 patch 8.2.1870: Vim9: no need to keep all script variables
Problem:    Vim9: no need to keep all script variables.
Solution:   Only keep script variables when a function was defined that could
            use them.  Fix freeing static string on exit.
2020-10-20 14:25:07 +02:00
Bram Moolenaar
955347cc7e patch 8.2.1869: Vim9: memory leak when using add()
Problem:    Vim9: memory leak when using add().
Solution:   Free the added item.
2020-10-19 23:01:46 +02:00
Bram Moolenaar
9a13e185e5 patch 8.2.1868: Vim9: no error for missing space after comma in dict
Problem:    Vim9: no error for missing space after comma in dict.
Solution:   Check for white space. (closes #6672)
2020-10-19 21:45:07 +02:00
Bram Moolenaar
80b0e5ea11 patch 8.2.1867: Vim9: argument to add() not checked for blob
Problem:    Vim9: argument to add() not checked for blob.
Solution:   Add the BLOBAPPEND instruction.
2020-10-19 20:45:36 +02:00
Bram Moolenaar
66fa5fd54f patch 8.2.1866: Vim9: appending to pushed blob gives wrong result
Problem:    Vim9: appending to pushed blob gives wrong result.
Solution:   Set ga_maxlen when copying a blob.
2020-10-19 20:21:03 +02:00
Bram Moolenaar
1dcae59957 patch 8.2.1865: Vim9: add() does not check type of argument
Problem:    Vim9: add() does not check type of argument.
Solution:   Inline the add() call. (closes #7160)
2020-10-19 19:02:42 +02:00
258 changed files with 8347 additions and 3608 deletions

4
.github/CODEOWNERS vendored
View File

@@ -63,6 +63,7 @@ runtime/doc/pi_netrw.txt @cecamp
runtime/doc/pi_tar.txt @cecamp
runtime/doc/pi_vimball.txt @cecamp
runtime/doc/pi_zip.txt @cecamp
runtime/ftplugin/awk.vim @dkearns
runtime/ftplugin/bst.vim @tpope
runtime/ftplugin/css.vim @dkearns
runtime/ftplugin/cucumber.vim @tpope
@@ -107,6 +108,9 @@ runtime/plugin/tarPlugin.vim @cecamp
runtime/plugin/vimballPlugin.vim @cecamp
runtime/plugin/zipPlugin.vim @cecamp
runtime/syntax/amiga.vim @cecamp
runtime/syntax/asm.vim @dkearns
runtime/syntax/asmh8300.vim @dkearns
runtime/syntax/awk.vim @dkearns
runtime/syntax/bst.vim @tpope
runtime/syntax/csh.vim @cecamp
runtime/syntax/cucumber.vim @tpope

View File

@@ -3,7 +3,7 @@ name: GitHub CI
on:
push:
branches:
- '*'
- '**'
pull_request:
env:
@@ -39,6 +39,7 @@ jobs:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
toolchain: [msvc, mingw]
arch: [x64, x86]

View File

@@ -1,7 +1,7 @@
" zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION
" Date: Jan 07, 2020
" Version: 30
" Version: 31
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" License: Vim License (see vim's :help license)
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
@@ -20,7 +20,7 @@
if &cp || exists("g:loaded_zip")
finish
endif
let g:loaded_zip= "v30"
let g:loaded_zip= "v31"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of zip needs vim 7.2 or later"
@@ -65,7 +65,7 @@ endif
" zip#Browse: {{{2
fun! zip#Browse(zipfile)
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
" sanity check: ensure that the zipfile has "PK" as its first two letters
" sanity check: insure that the zipfile has "PK" as its first two letters
" (zipped files have a leading PK as a "magic cookie")
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
exe "noswapfile noautocmd noswapfile e ".fnameescape(a:zipfile)

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.2. Last change: 2020 Sep 25
*autocmd.txt* For Vim version 8.2. Last change: 2020 Oct 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -278,7 +278,7 @@ Name triggered by ~
|BufWinLeave| before a buffer is removed from a window
|BufUnload| before unloading a buffer
|BufHidden| just after a buffer has become hidden
|BufHidden| just before a buffer becomes hidden
|BufNew| just after creating a new buffer
|SwapExists| detected an existing swap file
@@ -551,12 +551,15 @@ CmdlineChanged After a change was made to the text in the
*CmdlineEnter*
CmdlineEnter After moving the cursor to the command line,
where the user can type a command or search
string.
string; including non-interactive use of ":"
in a mapping, but not when using |<Cmd>|.
<afile> is set to a single character,
indicating the type of command-line.
|cmdwin-char|
*CmdlineLeave*
CmdlineLeave Before leaving the command line.
CmdlineLeave Before leaving the command line; including
non-interactive use of ":" in a mapping, but
not when using |<Cmd>|.
Also when abandoning the command line, after
typing CTRL-C or <Esc>.
When the commands result in an error the
@@ -881,9 +884,14 @@ InsertEnter Just before starting Insert mode. Also for
The cursor is restored afterwards. If you do
not want that set |v:char| to a non-empty
string.
*InsertLeavePre*
InsertLeavePre Just before leaving Insert mode. Also when
using CTRL-O |i_CTRL-O|. Be careful not to
change mode or use `:normal`, it will likely
cause trouble.
*InsertLeave*
InsertLeave When leaving Insert mode. Also when using
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
InsertLeave Just after leaving Insert mode. Also when
using CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
*MenuPopup*
MenuPopup Just before showing the popup menu (under the
right mouse button). Useful for adjusting the

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 8.2. Last change: 2020 Aug 15
*change.txt* For Vim version 8.2. Last change: 2020 Nov 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1801,7 +1801,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
*:sor* *:sort*
:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.
@@ -1809,6 +1809,16 @@ found here: |sort()|, |uniq()|.
With [i] case is ignored.
With [l] sort uses the current collation locale.
Implementation details: strcoll() is used to compare
strings. See |:language| to check or set the collation
locale. Example: >
:language collate en_US.UTF-8
:%sort l
< |v:collate| can also used to check the current locale.
Sorting using the locale typically ignores case.
This does not work properly on Mac.
Options [n][f][x][o][b] are mutually exclusive.
With [n] sorting is done on the first decimal number
@@ -1875,8 +1885,7 @@ found here: |sort()|, |uniq()|.
Note that using `:sort` with `:global` doesn't sort the matching lines, it's
quite useless.
The details about sorting depend on the library function used. There is no
guarantee that sorting obeys the current locale. You will have to try it out.
`:sort` does not use the current locale unless the l flag is used.
Vim does do a "stable" sort.
The sorting can be interrupted, but if you interrupt it too late in the

View File

@@ -1,4 +1,4 @@
*channel.txt* For Vim version 8.2. Last change: 2020 Sep 03
*channel.txt* For Vim version 8.2. Last change: 2020 Oct 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -965,6 +965,10 @@ job_status({job}) *job_status()* *E916*
"fail", because a fork happens before the failure can be
detected.
If in Vim9 script a variable is declared with type "job" but
never assigned to, passing that variable to job_status()
returns "fail".
If an exit callback was set with the "exit_cb" option and the
job is now detected to be "dead" the callback will be invoked.
@@ -1288,7 +1292,7 @@ prompt. >
" Send the text to a shell with Enter appended.
call ch_sendraw(g:shell_job, a:text .. "\n")
endfunc
" Function handling output from the shell: Added above the prompt.
func GotOutput(channel, msg)
call append(line("$") - 1, "- " . a:msg)

View File

@@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.2. Last change: 2020 Aug 17
*editing.txt* For Vim version 8.2. Last change: 2020 Oct 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -73,10 +73,14 @@ g CTRL-G Prints the current position of the cursor in five
ways: Column, Line, Word, Character and Byte. If the
number of Characters and Bytes is the same then the
Character position is omitted.
If there are characters in the line that take more
than one position on the screen (<Tab> or special
character), both the "real" column and the screen
column are shown, separated with a dash.
character), or characters using more than one byte per
column (characters above 0x7F when 'encoding' is
utf-8), both the byte column and the screen column are
shown, separated by a dash.
Also see the 'ruler' option and the |wordcount()|
function.

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Oct 05
*eval.txt* For Vim version 8.2. Last change: 2020 Nov 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -120,7 +120,7 @@ base, use |str2nr()|.
*TRUE* *FALSE* *Boolean*
For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE.
You can also use |v:false| and |v:true|. In Vim9 script |false| and |true|.
You can also use |v:false| and |v:true|. In Vim9 script |false| and |true|.
When TRUE is returned from a function it is the Number one, FALSE is the
number zero.
@@ -2669,8 +2669,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]])
rhs of mapping {name} in mode {mode}
mapcheck({name} [, {mode} [, {abbr}]])
String check for mappings matching {name}
mapset({mode}, {abbr}, {dict})
none restore mapping from |maparg()| result
mapnew({expr1}, {expr2}) List/Dict like |map()| but creates a new List
or Dictionary
mapset({mode}, {abbr}, {dict}) none restore mapping from |maparg()| result
match({expr}, {pat} [, {start} [, {count}]])
Number position where {pat} matches in {expr}
matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
@@ -2746,7 +2747,7 @@ prop_type_change({name}, {props})
none change an existing property type
prop_type_delete({name} [, {props}])
none delete a property type
prop_type_get([{name} [, {props}]])
prop_type_get({name} [, {props}])
Dict get property type values
prop_type_list([{props}]) List get list of property types
pum_getpos() Dict position and size of pum if visible
@@ -3126,7 +3127,7 @@ appendbufline({expr}, {lnum}, {text}) *appendbufline()*
error message is given. Example: >
:let failed = appendbufline(13, 0, "# THE START")
<
< Can also be used as a |method| after a List, the base is
Can also be used as a |method| after a List, the base is
passed as the second argument: >
mylist->appendbufline(buf, lnum)
@@ -3798,7 +3799,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
not need to be the first letter: >
confirm("file has been modified", "&Save\nSave &All")
< For the console, the first letter of each choice is used as
the default shortcut key.
the default shortcut key. Case is ignored.
The optional {default} argument is the number of the choice
that is made if the user hits <CR>. Use 1 to make the first
@@ -4427,10 +4428,10 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
|Dictionaries|.
If they are |Lists|: Append {expr2} to {expr1}.
If {expr3} is given insert the items of {expr2} before item
{expr3} in {expr1}. When {expr3} is zero insert before the
first item. When {expr3} is equal to len({expr1}) then
{expr2} is appended.
If {expr3} is given insert the items of {expr2} before the
item with index {expr3} in {expr1}. When {expr3} is zero
insert before the first item. When {expr3} is equal to
len({expr1}) then {expr2} is appended.
Examples: >
:echo sort(extend(mylist, [7, 5]))
:call extend(mylist, [2, 3], 1)
@@ -6987,9 +6988,14 @@ luaeval({expr} [, {expr}]) *luaeval()*
< {only available when compiled with the |+lua| feature}
map({expr1}, {expr2}) *map()*
{expr1} must be a |List| or a |Dictionary|.
{expr1} must be a |List|, |Blob| or |Dictionary|.
Replace each item in {expr1} with the result of evaluating
{expr2}. {expr2} must be a |string| or |Funcref|.
{expr2}. For a |Blob| each byte is replaced.
If the item type changes you may want to use |mapnew()| to
create a new List or Dictionary. This is required when using
Vim9 script.
{expr2} must be a |string| or |Funcref|.
If {expr2} is a |string|, inside {expr2} |v:val| has the value
of the current item. For a |Dictionary| |v:key| has the key
@@ -7024,11 +7030,11 @@ map({expr1}, {expr2}) *map()*
|Dictionary| to remain unmodified make a copy first: >
:let tlist = map(copy(mylist), ' v:val . "\t"')
< Returns {expr1}, the |List| or |Dictionary| that was filtered.
When an error is encountered while evaluating {expr2} no
further items in {expr1} are processed. When {expr2} is a
Funcref errors inside a function are ignored, unless it was
defined with the "abort" flag.
< Returns {expr1}, the |List|, |Blob| or |Dictionary| that was
filtered. When an error is encountered while evaluating
{expr2} no further items in {expr1} are processed. When
{expr2} is a Funcref errors inside a function are ignored,
unless it was defined with the "abort" flag.
Can also be used as a |method|: >
mylist->map(expr2)
@@ -7137,7 +7143,13 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()*
GetKey()->mapcheck('n')
mapset({mode}, {abbr}, {dict}) *mapset()*
mapnew({expr1}, {expr2}) *mapnew()*
Like |map()| but instead of replacing items in {expr1} a new
List or Dictionary is created and returned. {expr1} remains
unchanged.
mapset({mode}, {abbr}, {dict}) *mapset()*
Restore a mapping from a dictionary returned by |maparg()|.
{mode} and {abbr} should be the same as for the call to
|maparg()|. *E460*
@@ -7367,8 +7379,15 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
the strings in {list} that fuzzy match {str}. The strings in
the returned list are sorted based on the matching score.
The optional {dict} argument always supports the following
items:
matchseq When this item is present and {str} contains
multiple words separated by white space, then
returns only matches that contain the words in
the given sequence.
If {list} is a list of dictionaries, then the optional {dict}
argument supports the following items:
argument supports the following additional items:
key key of the item which is fuzzy matched against
{str}. The value of this item should be a
string.
@@ -7382,6 +7401,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
matching is NOT supported. The maximum supported {str} length
is 256.
When {str} has multiple words each separated by white space,
then the list of strings that have all the words is returned.
If there are no matching strings or there is an error, then an
empty list is returned. If length of {str} is greater than
256, then returns an empty list.
@@ -7401,7 +7423,12 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
:echo v:oldfiles->matchfuzzy("test")
< results in a list of file names fuzzy matching "test". >
:let l = readfile("buffer.c")->matchfuzzy("str")
< results in a list of lines in "buffer.c" fuzzy matching "str".
< results in a list of lines in "buffer.c" fuzzy matching "str". >
:echo ['one two', 'two one']->matchfuzzy('two one')
< results in ['two one', 'one two']. >
:echo ['one two', 'two one']->matchfuzzy('two one',
\ {'matchseq': 1})
< results in ['two one'].
matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
Same as |matchfuzzy()|, but returns the list of matched
@@ -7957,8 +7984,8 @@ printf({fmt}, {expr1} ...) *printf()*
prompt_getprompt({buf}) *prompt_getprompt()*
Returns the effective prompt text for buffer {buf}. {buf} can
be a buffer name or number. |prompt-buffer|.
Returns the effective prompt text for buffer {buf}. {buf} can
be a buffer name or number. See |prompt-buffer|.
If the buffer doesn't exist or isn't a prompt buffer, an empty
string is returned.
@@ -8304,15 +8331,18 @@ reg_recording() *reg_recording()*
Returns an empty string when not recording. See |q|.
reltime([{start} [, {end}]]) *reltime()*
Return an item that represents a time value. The format of
the item depends on the system. It can be passed to
|reltimestr()| to convert it to a string or |reltimefloat()|
to convert to a Float.
Without an argument it returns the current time.
Return an item that represents a time value. The item is a
list with items that depend on the system. In Vim 9 script
list<any> can be used.
The item can be passed to |reltimestr()| to convert it to a
string or |reltimefloat()| to convert to a Float.
Without an argument reltime() returns the current time.
With one argument is returns the time passed since the time
specified in the argument.
With two arguments it returns the time passed between {start}
and {end}.
The {start} and {end} arguments must be values returned by
reltime().
@@ -8630,6 +8660,7 @@ screencol() *screencol()*
the following mappings: >
nnoremap <expr> GG ":echom ".screencol()."\n"
nnoremap <silent> GG :echom screencol()<CR>
nnoremap GG <Cmd>echom screencol()<CR>
<
screenpos({winid}, {lnum}, {col}) *screenpos()*
The result is a Dict with the screen position of the text
@@ -9685,8 +9716,25 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
When {func} is given and it is '1' or 'i' then case is
ignored.
When {func} is given and it is 'l' then the current collation
locale is used for ordering. Implementation details: strcoll()
is used to compare strings. See |:language| check or set the
collation locale. |v:collate| can also be used to check the
current locale. Sorting using the locale typically ignores
case. Example: >
" ö is sorted similarly to o with English locale.
:language collate en_US.UTF8
:echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l')
< ['n', 'o', 'O', 'ö', 'p', 'z'] ~
>
" ö is sorted after z with Swedish locale.
:language collate sv_SE.UTF8
:echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l')
< ['n', 'o', 'O', 'p', 'z', 'ö'] ~
This does not work properly on Mac.
When {func} is given and it is 'n' then all items will be
sorted numerical (Implementation detail: This uses the
sorted numerical (Implementation detail: this uses the
strtod() function to parse numbers, Strings, Lists, Dicts and
Funcrefs will be considered as being 0).
@@ -10694,8 +10742,8 @@ terminalprops() *terminalprops()*
detected from the response to |t_RV| request. See
|v:termresponse| for the response itself. If |v:termresponse|
is empty most values here will be 'u' for unknown.
cursor_style wether sending |t_RS| works **
cursor_blink_mode wether sending |t_RC| works **
cursor_style whether sending |t_RS| works **
cursor_blink_mode whether sending |t_RC| works **
underline_rgb whether |t_8u| works **
mouse mouse type supported
@@ -11351,7 +11399,8 @@ winsaveview() Returns a |Dictionary| that contains information to restore
curswant column for vertical movement
topline first line in the window
topfill filler lines, only in diff mode
leftcol first column displayed
leftcol first column displayed; only used when
'wrap' is off
skipcol columns skipped
Note that no option values are saved.
@@ -11570,7 +11619,7 @@ menu Compiled with support for |:menu|.
mksession Compiled with support for |:mksession|.
modify_fname Compiled with file name modifiers. |filename-modifiers|
(always true)
mouse Compiled with support mouse.
mouse Compiled with support for mouse.
mouse_dec Compiled with support for Dec terminal mouse.
mouse_gpm Compiled with support for gpm (Linux console mouse)
mouse_gpm_enabled GPM mouse is working
@@ -12125,8 +12174,9 @@ be used to pass settings to the autoload script before it's loaded: >
Note that when you make a mistake and call a function that is supposed to be
defined in an autoload script, but the script doesn't actually define the
function, the script will be sourced every time you try to call the function.
And you will get an error message every time.
function, you will get an error message for the missing function. If you fix
the autoload script it won't be automatically loaded again. Either restart
Vim or manually source the script.
Also note that if you have two script files, and one calls a function in the
other and vice versa, before the used function is defined, it won't work.

View File

@@ -1,4 +1,4 @@
*if_mzsch.txt* For Vim version 8.2. Last change: 2019 Dec 07
*if_mzsch.txt* For Vim version 8.2. Last change: 2020 Oct 14
VIM REFERENCE MANUAL by Sergey Khorev
@@ -43,7 +43,7 @@ To speed up the process, you might also want to use --disable-gracket and
{script}
{endmarker}
Execute inlined MzScheme script {script}.
Note: This command doesn't work if the MzScheme
Note: This command doesn't work when the MzScheme
feature wasn't compiled in. To avoid errors, see
|script-here|.

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.2. Last change: 2020 Sep 19
*insert.txt* For Vim version 8.2. Last change: 2020 Oct 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -312,6 +312,7 @@ If you enter a value of 10, it will end up in the file as a 0. The 10 is a
the buffer to a file, the <NL> character is translated into <Nul>. The <NL>
character is written at the end of each line. Thus if you want to insert a
<NL> character in a file you will have to make a line break.
Also see 'fileformat'.
*i_CTRL-X* *insert_expand*
CTRL-X enters a sub-mode where several commands can be used. Most of these

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 8.2. Last change: 2020 Oct 07
*map.txt* For Vim version 8.2. Last change: 2020 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -271,7 +271,7 @@ For this reason the following is blocked:
- The |:normal| command.
- Moving the cursor is allowed, but it is restored afterwards.
If you want the mapping to do any of these let the returned characters do
that.
that, or use a |<Cmd>| mapping instead.
You can use getchar(), it consumes typeahead if there is any. E.g., if you
have these mappings: >
@@ -303,6 +303,40 @@ empty string, so that nothing is inserted.
Note that using 0x80 as a single byte before other text does not work, it will
be seen as a special key.
*<Cmd>* *:map-cmd*
The special text <Cmd> begins a "command mapping", it executes the command
directly without changing modes. Where you might use ":...<CR>" in the
{rhs} of a mapping, you can instead use "<Cmd>...<CR>".
Example: >
noremap x <Cmd>echo mode(1)<CR>
<
This is more flexible than `:<C-U>` in Visual and Operator-pending mode, or
`<C-O>:` in Insert mode, because the commands are executed directly in the
current mode, instead of always going to Normal mode. Visual mode is
preserved, so tricks with |gv| are not needed. Commands can be invoked
directly in Command-line mode (which would otherwise require timer hacks).
Example of using <Cmd> halfway Insert mode: >
nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc>
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
command: it is executed as if an (unrestricted) |autocmd| was invoked.
Note:
- Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and
|CmdlineLeave| events, because no user interaction is expected.
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
unmapped keys.
- In Select mode, |:map| and |:vmap| command mappings are executed in
Visual mode. Use |:smap| to handle Select mode differently.
*E1135* *E1136*
<Cmd> commands must terminate, that is, they must be followed by <CR> in the
{rhs} of the mapping definition. |Command-line| mode is never entered.
*E1137*
<Cmd> commands can have only normal characters and cannot contain special
characters like function keys.
1.3 MAPPING AND MODES *:map-modes*
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*

View File

@@ -1,4 +1,4 @@
*motion.txt* For Vim version 8.2. Last change: 2020 Aug 24
*motion.txt* For Vim version 8.2. Last change: 2020 Oct 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -190,11 +190,14 @@ l or *l*
*^*
^ To the first non-blank character of the line.
|exclusive| motion.
|exclusive| motion. Any count is ignored.
*$* *<End>* *<kEnd>*
$ or <End> To the end of the line. When a count is given also go
[count - 1] lines downward. |inclusive| motion.
[count - 1] lines downward, or as far is possible.
|inclusive| motion. If a count of 2 of larger is
given and the cursor is on the last line, that is an
error an the cursor doesn't move.
In Visual mode the cursor goes to just after the last
character in the line.
When 'virtualedit' is active, "$" may move the cursor

View File

@@ -1,4 +1,4 @@
*netbeans.txt* For Vim version 8.2. Last change: 2020 Aug 15
*netbeans.txt* For Vim version 8.2. Last change: 2020 Nov 02
VIM REFERENCE MANUAL by Gordon Prieur et al.
@@ -562,9 +562,10 @@ setModtime time
saved directly by the Vim Controller.
New in version 2.3.
setReadOnly
Set a file as readonly
Implemented in version 2.3.
setReadOnly readonly
When the boolean argument "readonly" is "T" for True, mark the
buffer as readonly, when it is "F" for False, mark it as not
readonly. Implemented in version 2.3.
setStyle Not implemented.

View File

@@ -7225,7 +7225,7 @@ A jump table for the options with a short description can be found at |Q_op|.
normal text. Each status line item is of the form:
%-0{minwid}.{maxwid}{item}
All fields except the {item} are optional. A single percent sign can
be given as "%%". Up to 80 items can be specified. *E541*
be given as "%%".
When the option starts with "%!" then it is used as an expression,
evaluated and the result is used as the option value. Example: >

View File

@@ -154,4 +154,4 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
==============================================================================
vim:tw=78:ts=8:noet:ft=help:fdm=marker
vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker

View File

@@ -1,4 +1,4 @@
*popup.txt* For Vim version 8.2. Last change: 2020 Sep 28
*popup.txt* For Vim version 8.2. Last change: 2020 Oct 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -314,6 +314,7 @@ popup_filter_menu({id}, {key}) *popup_filter_menu()*
<Space> <Enter> accept current selection
x Esc CTRL-C cancel the menu
Other keys are ignored.
Always returns |v:true|.
A match is set on that line to highlight it, see
|popup_menu()|.

View File

@@ -1,4 +1,4 @@
*sign.txt* For Vim version 8.2. Last change: 2020 Aug 31
*sign.txt* For Vim version 8.2. Last change: 2020 Oct 28
VIM REFERENCE MANUAL by Gordon Prieur
@@ -81,6 +81,10 @@ on the same line, the attributes of the sign with the highest priority is used
independently of the sign group. The default priority for a sign is 10. The
priority is assigned at the time of placing a sign.
When two signs with the same priority are present, and one has an icon or text
in the signcolumn while the other has line highlighting, then both are
displayed.
When the line on which the sign is placed is deleted, the sign is moved to the
next line (or the last line of the buffer, if there is no next line). When
the delete is undone the sign does not move back.
@@ -458,11 +462,11 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()*
entries
The dictionary for each sign contains the following entries:
group sign group. Set to '' for the global group.
id identifier of the sign
lnum line number where the sign is placed
name name of the defined sign
priority sign priority
group sign group. Set to '' for the global group.
id identifier of the sign
lnum line number where the sign is placed
name name of the defined sign
priority sign priority
The returned signs in a buffer are ordered by their line
number and priority.

View File

@@ -1,4 +1,4 @@
*tabpage.txt* For Vim version 8.2. Last change: 2020 Aug 10
*tabpage.txt* For Vim version 8.2. Last change: 2020 Oct 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -195,8 +195,8 @@ gt *i_CTRL-<PageDown>* *i_<C-PageDown>*
:+2tabnext " go to the two next tab page
:1tabnext " go to the first tab page
:$tabnext " go to the last tab page
:tabnext # " go to the last accessed tab page
:tabnext $ " as above
:tabnext # " go to the last accessed tab page
:tabnext - " go to the previous tab page
:tabnext -1 " as above
:tabnext + " go to the next tab page
@@ -225,7 +225,7 @@ gT Go to the previous tab page. Wraps around from the first one
*:tabl* *:tablast*
:tabl[ast] Go to the last tab page.
*g<Tab>* *CTRL-W_g<Tab>* *<C-Tab>*
*g<Tab>* *CTRL-W_g<Tab>* *<C-Tab>*
g<Tab> Go to the last accessed tab page.
Other commands:
@@ -259,7 +259,7 @@ REORDERING TAB PAGES:
:tabmove " move the tab page to the last
:$tabmove " as above
:tabmove $ " as above
:tabmove # " move the tab page after the last accessed
:tabmove # " move the tab page after the last accessed
" tab page
:tabm[ove] +[N]

View File

@@ -4378,7 +4378,6 @@ E538 options.txt /*E538*
E539 options.txt /*E539*
E54 pattern.txt /*E54*
E540 options.txt /*E540*
E541 options.txt /*E541*
E542 options.txt /*E542*
E543 options.txt /*E543*
E544 options.txt /*E544*
@@ -4932,6 +4931,7 @@ InsertChange autocmd.txt /*InsertChange*
InsertCharPre autocmd.txt /*InsertCharPre*
InsertEnter autocmd.txt /*InsertEnter*
InsertLeave autocmd.txt /*InsertLeave*
InsertLeavePre autocmd.txt /*InsertLeavePre*
Integer eval.txt /*Integer*
J change.txt /*J*
Japanese mbyte.txt /*Japanese*

View File

@@ -1,4 +1,4 @@
*textprop.txt* For Vim version 8.2. Last change: 2020 Mar 05
*textprop.txt* For Vim version 8.2. Last change: 2020 Oct 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -101,7 +101,7 @@ Manipulating text property types:
prop_type_add({name}, {props}) define a new property type
prop_type_change({name}, {props}) change an existing property type
prop_type_delete({name} [, {props}]) delete a property type
prop_type_get([{name} [, {props}]]) get property type values
prop_type_get({name} [, {props}]) get property type values
prop_type_list([{props}]) get list of property types
@@ -291,7 +291,7 @@ prop_type_delete({name} [, {props}]) *prop_type_delete()*
Can also be used as a |method|: >
GetPropName()->prop_type_delete()
prop_type_get([{name} [, {props}]]) *prop_type_get()*
prop_type_get({name} [, {props}]) *prop_type_get()*
Returns the properties of property type {name}. This is a
dictionary with the same fields as was given to
prop_type_add().

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Oct 10
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,29 +38,14 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
test_vim9_func fails: type from default value not used.
Without extra sleeps netbeans test has valgrind errors.
PR #7248 from Yegappan - test doesn't fail without code changes
Making everything work:
- If a function is defined in a block it may need to keep the block-locals,
like a compiled closure.
- Fix memory leaks in test_vim9_assign, remove "if 0"
- Fix memory leaks in test_vim9_script
- Closure arguments should be more strict, like any function call?
- Remove v:disallow_let
- Recognize call to assert_fails() and execute it in the function context?
Won't work if the command itself fails, not an expression failure:
assert_fails("unknown", "E99:")
Use try/catch is complicated:
let did_catch = false
try
unknown
catch
assert_caught('E99:')
did_catch = true
endtry
assert_true('did_catch')
Add a new command perhaps:
assertfail
unknown
endassertfail E99:.*unknown
- Closure argument call should not always set varargs, like any function call?
- Invoke user command in a :def function
- Make map() give an error if the resulting type is wrong.
Add mapnew() or mapcopy() to create a new List/Dict for the result, which
can have a different value type.
@@ -70,6 +55,7 @@ Making everything work:
- In autocmd: use legacy syntax, not whatever the current script uses?
- need to check type when a declaration specifies a type: #6507
let nr: number = 'asdf'
- Check many more builtin function arguments at compile time.
- Make sure that in vim9script a function call without namespace only finds
the script-local function, not a global one.
- Make sure that where a callback is expected a function can be used (without
@@ -124,12 +110,12 @@ Making everything work:
- Make "++nr" work.
- Make closures work:
- Create closure in a loop. Need to make a list of them.
- nested closure only uses one context, not all (#7150)
- expandcmd() with `=expr` in filename uses legacy expression.
- eval_expr() in ex_cexpr()
- eval_expr() call in dbg_parsearg() and debuggy_find()
- has() is compiled as a constant, but some checks are dynamic.
Check for dynamic values, such as "gui_running".
- Implement command modifiers, such as "silent". (#6530)
New syntax and functionality:
Improve error checking:
- "echo Func()" is an error if Func() does not return anything.
@@ -295,13 +281,13 @@ Was originally written by Felipe Morales.
Remove SPACE_IN_FILENAME ? It is only used for completion.
Patch to use collation based sorting. (Christian Brabandt, #6229)
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
with 'termguicolors'. #1740
Patch for blockwise paste reporting changes: #6660.
Missing filetype test for bashrc, PKGBUILD, etc.
Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co
changes.
@@ -351,8 +337,6 @@ work.
Using "au!" after "filetype on" is a bit slow. Can the matching of
autocommands be made faster? (#7056)
Valgrind warns for uninitialized values in f_term_dumpwrite().
Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
replace this:
let left = GetLeftFunc()
@@ -455,7 +439,6 @@ Patch to fix session file when using multiple tab pages. (Jason Franklin, 2019
May 20)
Also put :argadd commands at the start for all buffers, so that their order
remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
Also #4994: window-local options not always restored, related to using :badd.
Also #5326: netrw buffers are not restored.
Alternate file is not set in the session file. Use setwintabvar("@#") ?
@@ -595,10 +578,6 @@ Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work.
":2resize +10" uses size of the current window, adds 10 and applies it to
window 2. User expects 10 to be added to size of window 2. (Daniel Steinberg,
#5443)
Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use
t:diffexpr_option t:diffopt_option? (#4782)
@@ -3858,10 +3837,6 @@ Macintosh:
on the status line (caused by 'winheight'). Select window on button up,
instead of on button down.
8 Dragging the status line doesn't scroll but redraw.
9 Evaluating 'statusline' in build_stl_str_hl() does not properly check for
reaching the end of the available buffer.
Patch to dynamically allocate the buffer for % items. (Eric Arnold, 2006
May 14)
8 When performing incremental search, should abort searching as soon as a
character is typed.
8 When the value of $MAKE contains a path, configure can't handle this.

View File

@@ -1,4 +1,4 @@
*undo.txt* For Vim version 8.2. Last change: 2019 Dec 07
*undo.txt* For Vim version 8.2. Last change: 2020 Oct 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -392,7 +392,7 @@ back the text of three deletes ago with '"3P'.
*redo-register*
If you want to get back more than one part of deleted text, you can use a
special feature of the repeat command ".". It will increase the number of the
register used. So if you first do ""1P", the following "." will result in a
register used. So if you first do '"1P', the following "." will result in a
'"2P'. Repeating this will result in all numbered registers being inserted.
Example: If you deleted text with 'dd....' it can be restored with

View File

@@ -1,4 +1,4 @@
*usr_11.txt* For Vim version 8.2. Last change: 2020 Jul 08
*usr_11.txt* For Vim version 8.2. Last change: 2020 Oct 25
VIM USER MANUAL - by Bram Moolenaar
@@ -294,7 +294,7 @@ If you really don't want to see this message, you can add the 'A' flag to the
'shortmess' option. But it's very unusual that you need this.
For remarks about encryption and the swap file, see |:recover-crypt|.
For programatic access to the swap file, see |swapinfo()|.
For programmatic access to the swap file, see |swapinfo()|.
==============================================================================
*11.4* Further reading

View File

@@ -644,6 +644,7 @@ List manipulation: *list-functions*
deepcopy() make a full copy of a List
filter() remove selected items from a List
map() change each List item
mapnew() make a new List with changed items
reduce() reduce a List to a value
sort() sort a List
reverse() reverse the order of a List
@@ -669,6 +670,7 @@ Dictionary manipulation: *dict-functions*
extend() add entries from one Dictionary to another
filter() remove selected entries from a Dictionary
map() change each Dictionary entry
mapnew() make a new Dictionary with changed items
keys() get List of Dictionary keys
values() get List of Dictionary values
items() get List of Dictionary key-value pairs

View File

@@ -1,4 +1,4 @@
*version7.txt* For Vim version 8.2. Last change: 2020 Aug 15
*version7.txt* For Vim version 8.2. Last change: 2020 Oct 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -10260,7 +10260,7 @@ Commands:
Brabandt)
Other:
Lua interface now also uses userdata binded to Vim structures. (Taro
Lua interface now also uses userdata bound to Vim structures. (Taro
Muraoka, Luis Carvalho)
glob() and autocommand patterns used to work with the undocumented

View File

@@ -1,4 +1,4 @@
*version8.txt* For Vim version 8.2. Last change: 2020 Aug 15
*version8.txt* For Vim version 8.2. Last change: 2020 Oct 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -47698,7 +47698,7 @@ Files: src/eval.c, src/testdir/test_vim9_expr.vim
Patch 8.2.1064
Problem: Vim9: no line break allowed before comparators.
Solution: Check for comperator after line break.
Solution: Check for comparator after line break.
Files: src/eval.c, src/testdir/test_vim9_expr.vim
Patch 8.2.1065

View File

@@ -459,6 +459,9 @@ Use {name} as the server name. Used for the current Vim, unless used with a
\-\-socketid {id}
GTK GUI only: Use the GtkPlug mechanism to run gvim in another window.
.TP
\-\-startuptime {file}
During startup write timing messages to the file {fname}.
.TP
\-\-version
Print version information and exit.
.SH ON-LINE HELP

View File

@@ -345,6 +345,9 @@ OPTIONS
GTK GUI only: Use the GtkPlug mechanism to run gvim in an
other window.
--startuptime {file}
During startup write timing messages to the file {fname}.
--version Print version information and exit.
ON-LINE HELP

View File

@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2020 Oct 05
*vim9.txt* For Vim version 8.2. Last change: 2020 Oct 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -176,8 +176,8 @@ However, it is recommended to always use "g:" to refer to a global function
for clarity.
In all cases the function must be defined before used. That is when it is
called, when `:defcompile` causes the it to be compiled, or when code that
calls it is being compiled (to figure out the return type).
called, when `:defcompile` causes it to be compiled, or when code that calls
it is being compiled (to figure out the return type).
The result is that functions and variables without a namespace can usually be
found in the script, either defined there or imported. Global functions and
@@ -901,7 +901,7 @@ The script name after `import` can be:
location of the script file itself. This is useful to split up a large
plugin into several files.
- An absolute path, starting with "/" on Unix or "D:/" on MS-Windows. This
will be rarely used.
will rarely be used.
- A path not being relative or absolute. This will be found in the
"import" subdirectories of 'runtimepath' entries. The name will usually be
longer and unique, to avoid loading the wrong file.
@@ -1160,8 +1160,8 @@ Some details are unexpected and can be improved. For example a boolean
condition would accept a string, convert it to a number and check if the
number is non-zero. This is unexpected and often leads to mistakes, since
text not starting with a number would be converted to zero, which is
considered false. Thus a string would not give an error and be considered
false if it doesn't start with a number. That is confusing.
considered false. Thus using a string for a condition would often not give an
error and be considered false. That is confusing.
In Vim9 type checking is more strict to avoid mistakes. Where a condition is
used, e.g. with the `:if` command and the `||` operator, only boolean-like
@@ -1169,7 +1169,7 @@ values are accepted:
true: `true`, `v:true`, `1`, `0 < 9`
false: `false`, `v:false`, `0`, `0 > 9`
Note that the number zero is false and the number one is true. This is more
persmissive than most other languages. It was done because many builtin
permissive than most other languages. It was done because many builtin
functions return these values.
If you have any type of value and want to use it as a boolean, use the `!!`

View File

@@ -1,4 +1,4 @@
*windows.txt* For Vim version 8.2. Last change: 2020 Sep 02
*windows.txt* For Vim version 8.2. Last change: 2020 Nov 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1119,6 +1119,11 @@ list of buffers. |unlisted-buffer|
line when the buffer is first entered. Note that other
commands after the + will be ignored.
*:balt*
:balt [+lnum] {fname}
Like `:badd` and also set the alternate file for the current
window to {fname}.
:[N]bd[elete][!] *:bd* *:bdel* *:bdelete* *E516*
:bd[elete][!] [N]
Unload buffer [N] (default: current buffer) and delete it from

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Sep 30
" Last Change: 2020 Oct 24
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -1506,9 +1506,10 @@ au BufNewFile,BufRead *.decl,*.dcl,*.dec
au BufNewFile,BufRead catalog setf catalog
" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
" Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
" bash scripts.
" NOTE: Patterns ending in a star are further down, these have lower priority.
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD call dist#ft#SetFileTypeSH("bash")
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
@@ -1720,7 +1721,7 @@ au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
au BufNewFile,BufRead *.tex call dist#ft#FTtex()
" ConTeXt
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx setf context
" Texinfo
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
@@ -2163,7 +2164,7 @@ au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
" Shell scripts ending in a star
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD* call dist#ft#SetFileTypeSH("bash")
au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))

View File

@@ -1,7 +1,8 @@
" Vim filetype plugin
" Language: awk, nawk, gawk, mawk
" Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2020 Sep 28
" Language: awk, nawk, gawk, mawk
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2020 Sep 28
" This plugin was prepared by Mark Sikora
" This plugin was updated as proposed by Doug Kearns

View File

@@ -1,7 +1,7 @@
" Vim ftplugin file
" Language: Erlang
" Author: Oscar Hellstr<EFBFBD>m <oscar@oscarh.net>
" Contributors: Ricardo Catalinas Jim<EFBFBD>nez <jimenezrick@gmail.com>
" Author: Oscar Hellström <oscar@oscarh.net>
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
" Eduardo Lopez (http://github.com/tapichu)
" License: Vim license
" Version: 2012/01/25

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Make
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Apr 02
" Last Change: 2020 Oct 16
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -9,10 +9,10 @@ if exists("b:did_ftplugin")
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl et< sts< fo< com< cms< inc<"
let b:undo_ftplugin = "setl et< sts< sw< fo< com< cms< inc<"
" Make sure a hard tab is used, required for most make programs
setlocal noexpandtab softtabstop=0
setlocal noexpandtab softtabstop=0 shiftwidth=0
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".

View File

@@ -2,7 +2,7 @@
" Language: man
" Maintainer: Jason Franklin <vim@justemail.net>
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Last Change: 2020 Jun 01
" Last Change: 2020 Oct 09
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -76,7 +76,7 @@ catch /E145:/
" Ignore the error in restricted mode
endtry
func <SID>PreGetPage(cnt)
func s:PreGetPage(cnt)
if a:cnt == 0
let old_isk = &iskeyword
if &ft == 'man'
@@ -99,24 +99,27 @@ func <SID>PreGetPage(cnt)
call s:GetPage('', sect, page)
endfunc
func <SID>GetCmdArg(sect, page)
if a:sect == ''
return a:page
func s:GetCmdArg(sect, page)
if empty(a:sect)
return shellescape(a:page)
endif
return s:man_sect_arg.' '.a:sect.' '.a:page
return s:man_sect_arg . ' ' . shellescape(a:sect) . ' ' . shellescape(a:page)
endfunc
func <SID>FindPage(sect, page)
let where = system("man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
if where !~ "^/"
if matchstr(where, " [^ ]*$") !~ "^ /"
return 0
endif
func s:FindPage(sect, page)
let l:cmd = printf('man %s %s', s:man_find_arg, s:GetCmdArg(a:sect, a:page))
call system(l:cmd)
if v:shell_error
return 0
endif
return 1
endfunc
func <SID>GetPage(cmdmods, ...)
func s:GetPage(cmdmods, ...)
if a:0 >= 2
let sect = a:1
let page = a:2
@@ -226,7 +229,7 @@ func <SID>GetPage(cmdmods, ...)
setl noma
endfunc
func <SID>PopPage()
func s:PopPage()
if s:man_tag_depth > 0
let s:man_tag_depth = s:man_tag_depth - 1
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth

View File

@@ -1,6 +1,6 @@
" Vim filetype plugin file
" Language: RPL/2
" Maintainer: Jo<EFBFBD>l BERTRAND <rpl2@free.fr>
" Maintainer: Joël BERTRAND <rpl2@free.fr>
" Last Change: 2012 Mar 07
" Version: 0.1

View File

@@ -2,7 +2,7 @@
" Language: RPL/2
" Version: 0.2
" Last Change: 2017 Jun 13
" Maintainer: BERTRAND Jo<EFBFBD>l <rpl2@free.fr>
" Maintainer: BERTRAND Joël <rpl2@free.fr>
" Only load this indent file when no other was loaded.
if exists("b:did_indent")

View File

@@ -1,5 +1,5 @@
"Description: Indent scheme for the tilde weblanguage
"Author: Tobias Rundstr<EFBFBD>m <tobi@tobi.nu>
"Author: Tobias Rundström <tobi@tobi.nu>
"URL: http://tilde.tildesoftware.net
"Last Change: May 8 09:15:09 CEST 2002

View File

@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Sep 10
" Last Change: 2020 Oct 27
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
@@ -617,7 +617,7 @@ call <SID>AddOption("mousemodel", gettext("\"extend\", \"popup\" or \"popup_setp
call <SID>OptionG("mousem", &mousem)
call <SID>AddOption("mousetime", gettext("maximum time in msec to recognize a double-click"))
call append("$", " \tset mouset=" . &mouset)
call <SID>AddOption("ttymouse", gettext("\"xterm\", \"xterm2\", \"dec\" or \"netterm\"; type of mouse"))
call <SID>AddOption("ttymouse", gettext("\"xterm\", \"xterm2\", \"sgr\", etc.; type of mouse"))
call <SID>OptionG("ttym", &ttym)
if has("mouseshape")
call <SID>AddOption("mouseshape", gettext("what the mouse pointer looks like in different modes"))
@@ -689,10 +689,6 @@ if has("gui")
call append("$", " \tset bexpr=" . &bexpr)
endif
endif
if exists("+macatsui")
call <SID>AddOption("macatsui", gettext("use ATSUI text drawing; disable to avoid display problems"))
call <SID>OptionG("macatsui", &macatsui)
endif
endif
if has("printer")
@@ -791,7 +787,7 @@ call <SID>BinOptionL("mod")
call <SID>AddOption("readonly", gettext("buffer is not to be written"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>BinOptionL("ro")
call <SID>AddOption("modifiable", gettext("changes to the text are not possible"))
call <SID>AddOption("modifiable", gettext("changes to the text are possible"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>BinOptionL("ma")
call <SID>AddOption("textwidth", gettext("line length above which to break a line"))
@@ -852,7 +848,7 @@ if has("digraphs")
endif
call <SID>AddOption("tildeop", gettext("the \"~\" command behaves like an operator"))
call <SID>BinOptionG("top", &top)
call <SID>AddOption("operatorfunc", gettext("function called for the\"g@\" operator"))
call <SID>AddOption("operatorfunc", gettext("function called for the \"g@\" operator"))
call <SID>OptionG("opfunc", &opfunc)
call <SID>AddOption("showmatch", gettext("when inserting a bracket, briefly jump to its match"))
call <SID>BinOptionG("sm", &sm)
@@ -863,7 +859,7 @@ call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("mps")
call <SID>AddOption("joinspaces", gettext("use two spaces after '.' when joining a line"))
call <SID>BinOptionG("js", &js)
call <SID>AddOption("nrformats", gettext("\"alpha\", \"octal\" and/or \"hex\"; number formats recognized for\nCTRL-A and CTRL-X commands"))
call <SID>AddOption("nrformats", gettext("\"alpha\", \"octal\", \"hex\", \"bin\" and/or \"unsigned\"; number formats\nrecognized for CTRL-A and CTRL-X commands"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("nf")
@@ -938,7 +934,7 @@ endif
if has("folding")
call <SID>Header(gettext("folding"))
call <SID>AddOption("foldenable", gettext("set to display all folds open"))
call <SID>AddOption("foldenable", gettext("unset to display all folds open"))
call append("$", "\t" .. s:local_to_window)
call <SID>BinOptionL("fen")
call <SID>AddOption("foldlevel", gettext("folds with a level higher than this number will be closed"))
@@ -961,7 +957,7 @@ if has("folding")
call <SID>OptionL("fml")
call <SID>AddOption("commentstring", gettext("template for comments; used to put the marker in"))
call <SID>OptionL("cms")
call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\" or \"syntax\""))
call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\",\n\"syntax\" or \"diff\""))
call append("$", "\t" .. s:local_to_window)
call <SID>OptionL("fdm")
call <SID>AddOption("foldexpr", gettext("expression used when 'foldmethod' is \"expr\""))
@@ -1069,7 +1065,7 @@ call <SID>BinOptionG("fs", &fs)
call <SID>AddOption("shortname", gettext("use 8.3 file names"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>BinOptionL("sn")
call <SID>AddOption("cryptmethod", gettext("encryption method for file writing: zip or blowfish"))
call <SID>AddOption("cryptmethod", gettext("encryption method for file writing: zip, blowfish or blowfish2"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("cm")
@@ -1093,7 +1089,7 @@ call append("$", " \tset mmt=" . &mmt)
call <SID>Header(gettext("command line editing"))
call <SID>AddOption("history", gettext("how many command lines are remembered "))
call <SID>AddOption("history", gettext("how many command lines are remembered"))
call append("$", " \tset hi=" . &hi)
call <SID>AddOption("wildchar", gettext("key that triggers command-line expansion"))
call append("$", " \tset wc=" . &wc)
@@ -1187,19 +1183,12 @@ if has("quickfix")
endif
if has("win32") || has("osfiletype")
if has("win32")
call <SID>Header(gettext("system specific"))
if has("osfiletype")
call <SID>AddOption("osfiletype", gettext("OS-specific information about the type of file"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("oft")
endif
if has("win32")
call <SID>AddOption("shellslash", gettext("use forward slashes in file names; for Unix-like shells"))
call <SID>BinOptionG("ssl", &ssl)
call <SID>AddOption("completeslash", gettext("specifies slash/backslash used for completion"))
call <SID>OptionG("csl", &csl)
endif
call <SID>AddOption("shellslash", gettext("use forward slashes in file names; for Unix-like shells"))
call <SID>BinOptionG("ssl", &ssl)
call <SID>AddOption("completeslash", gettext("specifies slash/backslash used for completion"))
call <SID>OptionG("csl", &csl)
endif
@@ -1236,12 +1225,6 @@ if has("rightleft")
call <SID>AddOption("hkmapp", gettext("use phonetic Hebrew keyboard mapping"))
call <SID>BinOptionG("hkp", &hkp)
endif
if has("farsi")
call <SID>AddOption("altkeymap", gettext("use Farsi as the second language when 'revins' is set"))
call <SID>BinOptionG("akm", &akm)
call <SID>AddOption("fkmap", gettext("use Farsi keyboard mapping"))
call <SID>BinOptionG("fk", &fk)
endif
if has("arabic")
call <SID>AddOption("arabic", gettext("prepare for editing Arabic text"))
call append("$", "\t" .. s:local_to_window)
@@ -1284,7 +1267,7 @@ endif
call <SID>Header(gettext("multi-byte characters"))
call <SID>AddOption("encoding", gettext("character encoding used in Vim: \"latin1\", \"utf-8\"\n\"euc-jp\", \"big5\", etc."))
call <SID>AddOption("encoding", gettext("character encoding used in Vim: \"latin1\", \"utf-8\",\n\"euc-jp\", \"big5\", etc."))
call <SID>OptionG("enc", &enc)
call <SID>AddOption("fileencoding", gettext("character encoding for the current file"))
call append("$", "\t" .. s:local_to_buffer)
@@ -1310,7 +1293,7 @@ call <SID>BinOptionG("emo", &emo)
call <SID>Header(gettext("various"))
call <SID>AddOption("virtualedit", gettext("when to use virtual editing: \"block\", \"insert\" and/or \"all\""))
call <SID>AddOption("virtualedit", gettext("when to use virtual editing: \"block\", \"insert\", \"all\"\nand/or \"onemore\""))
call <SID>OptionG("ve", &ve)
call <SID>AddOption("eventignore", gettext("list of autocommand events which are to be ignored"))
call <SID>OptionG("ei", &ei)
@@ -1350,7 +1333,7 @@ if has("quickfix")
call <SID>AddOption("bufhidden", gettext("what happens with a buffer when it's no longer in a window"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("bh")
call <SID>AddOption("buftype", gettext("\"\", \"nofile\", \"nowrite\" or \"quickfix\": type of buffer"))
call <SID>AddOption("buftype", gettext("empty, \"nofile\", \"nowrite\", \"quickfix\", etc.: type of buffer"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("bt")
endif

View File

@@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
" Last Change: 2020 Aug 31
" Last Change: 2020 Oct 28
"
" WORK IN PROGRESS - Only the basics work
" Note: On MS-Windows you need a recent version of gdb. The one included with
@@ -119,7 +119,11 @@ func s:StartDebug_internal(dict)
" call ch_logfile('debuglog', 'w')
let s:sourcewin = win_getid(winnr())
let s:startsigncolumn = &signcolumn
" Remember the old value of 'signcolumn' for each buffer that it's set in, so
" that we can restore the value for all buffers.
let b:save_signcolumn = &signcolumn
let s:signcolumn_buflist = [bufnr()]
let s:save_columns = 0
let s:allleft = 0
@@ -556,8 +560,20 @@ func s:EndDebugCommon()
exe 'bwipe! ' . s:ptybuf
endif
" Restore 'signcolumn' in all buffers for which it was set.
call win_gotoid(s:sourcewin)
let &signcolumn = s:startsigncolumn
let was_buf = bufnr()
for bufnr in s:signcolumn_buflist
if bufexists(bufnr)
exe bufnr .. "buf"
if exists('b:save_signcolumn')
let &signcolumn = b:save_signcolumn
unlet b:save_signcolumn
endif
endif
endfor
exe was_buf .. "buf"
call s:DeleteCommands()
call win_gotoid(curwinid)
@@ -938,6 +954,10 @@ func s:HandleCursor(msg)
exe lnum
exe 'sign unplace ' . s:pc_id
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC priority=110 file=' . fname
if !exists('b:save_signcolumn')
let b:save_signcolumn = &signcolumn
call add(s:signcolumn_buflist, bufnr())
endif
setlocal signcolumn=yes
endif
elseif !s:stopped || fname != ''
@@ -1014,7 +1034,7 @@ endfunc
func s:PlaceSign(id, subid, entry)
let nr = printf('%d.%d', a:id, a:subid)
exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' file=' . a:entry['fname']
exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' priority=110 file=' . a:entry['fname']
let a:entry['placed'] = 1
endfunc

View File

@@ -20,14 +20,14 @@
if &cp || exists("g:loaded_zipPlugin")
finish
endif
let g:loaded_zipPlugin = "v30"
let g:loaded_zipPlugin = "v31"
let s:keepcpo = &cpo
set cpo&vim
" ---------------------------------------------------------------------
" Options: {{{1
if !exists("g:zipPlugin_ext")
let g:zipPlugin_ext='*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
endif
" ---------------------------------------------------------------------

View File

@@ -1,11 +1,10 @@
" Vim syntax file
" Language: GNU Assembler
" Maintainer: Erik Wognsen <erik.wognsen@gmail.com>
" Previous maintainer:
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2014 Feb 04
" Thanks to Ori Avtalion for feedback on the comment markers!
" Language: GNU Assembler
" Maintainer: Doug Kearns dougkearns@gmail.com
" Previous Maintainers: Erik Wognsen <erik.wognsen@gmail.com>
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Contributors: Ori Avtalion, Lakshay Garg
" Last Change: 2020 Oct 31
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -34,29 +33,49 @@ syn match asmType "\.space"
syn match asmType "\.string"
syn match asmType "\.word"
syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
syn match asmIdentifier "[a-z_][a-z0-9_]*"
syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
" Various #'s as defined by GAS ref manual sec 3.6.2.1
" Technically, the first decNumber def is actually octal,
" Technically, the first asmDecimal def is actually octal,
" since the value of 0-7 octal is the same as 0-7 decimal,
" I (Kevin) prefer to map it as decimal:
syn match decNumber "0\+[1-7]\=[\t\n$,; ]"
syn match decNumber "[1-9]\d*"
syn match octNumber "0[0-7][0-7]\+"
syn match hexNumber "0[xX][0-9a-fA-F]\+"
syn match binNumber "0[bB][0-1]*"
syn match asmDecimal "\<0\+[1-7]\=\>" display
syn match asmDecimal "\<[1-9]\d*\>" display
syn match asmOctal "\<0[0-7][0-7]\+\>" display
syn match asmHexadecimal "\<0[xX][0-9a-fA-F]\+\>" display
syn match asmBinary "\<0[bB][0-1]\+\>" display
syn keyword asmTodo contained TODO
syn match asmFloat "\<\d\+\.\d*\%(e[+-]\=\d\+\)\=\>" display
syn match asmFloat "\.\d\+\%(e[+-]\=\d\+\)\=\>" display
syn match asmFloat "\<\d\%(e[+-]\=\d\+\)\>" display
syn match asmFloat "[+-]\=Inf\>\|\<NaN\>" display
syn match asmFloat "\%(0[edfghprs]\)[+-]\=\d*\%(\.\d\+\)\%(e[+-]\=\d\+\)\=" display
syn match asmFloat "\%(0[edfghprs]\)[+-]\=\d\+\%(\.\d\+\)\=\%(e[+-]\=\d\+\)\=" display
" Avoid fighting the hexadecimal match for unicorn-like '0x' prefixed floats
syn match asmFloat "\%(0x\)[+-]\=\d*\%(\.\d\+\)\%(e[+-]\=\d\+\)\=" display
" Allow all characters to be escaped (and in strings) as these vary across
" architectures [See sec 3.6.1.1 Strings]
syn match asmCharacterEscape "\\." contained
syn match asmCharacter "'\\\=." contains=asmCharacterEscape
syn match asmStringEscape "\\\_." contained
syn match asmStringEscape "\\\%(\o\{3}\|00[89]\)" contained display
syn match asmStringEscape "\\x\x\+" contained display
syn region asmString start="\"" end="\"" skip="\\\\\|\\\"" contains=asmStringEscape
syn keyword asmTodo contained TODO FIXME XXX NOTE
" GAS supports one type of multi line comments:
syn region asmComment start="/\*" end="\*/" contains=asmTodo
syn region asmComment start="/\*" end="\*/" contains=asmTodo,@Spell
" GAS (undocumentedly?) supports C++ style comments. Unlike in C/C++ however,
" a backslash ending a C++ style comment does not extend the comment to the
" next line (hence the syntax region does not define 'skip="\\$"')
syn region asmComment start="//" end="$" keepend contains=asmTodo
syn region asmComment start="//" end="$" keepend contains=asmTodo,@Spell
" Line comment characters depend on the target architecture and command line
" options and some comments may double as logical line number directives or
@@ -69,7 +88,7 @@ syn region asmComment start="//" end="$" keepend contains=asmTodo
" frequently used features of the most popular architectures (and also the
" non-GNU assembly languages that use this syntax file because their asm files
" are also named *.asm), the following are used as line comment characters:
syn match asmComment "[#;!|].*" contains=asmTodo
syn match asmComment "[#;!|].*" contains=asmTodo,@Spell
" Side effects of this include:
" - When `;' is used to separate statements on the same line (many targets
@@ -96,35 +115,50 @@ syn match asmMacro "\.endm"
" with '.', including the GCC auto-generated '.L' labels.
syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*"
syn case match
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
" The default methods for highlighting. Can be overridden later
hi def link asmSection Special
hi def link asmLabel Label
hi def link asmComment Comment
hi def link asmTodo Todo
hi def link asmSection Special
hi def link asmLabel Label
hi def link asmComment Comment
hi def link asmTodo Todo
hi def link asmDirective Statement
hi def link asmInclude Include
hi def link asmCond PreCondit
hi def link asmMacro Macro
hi def link asmInclude Include
hi def link asmCond PreCondit
hi def link asmMacro Macro
hi def link hexNumber Number
hi def link decNumber Number
hi def link octNumber Number
hi def link binNumber Number
if exists('g:asm_legacy_syntax_groups')
hi def link hexNumber Number
hi def link decNumber Number
hi def link octNumber Number
hi def link binNumber Number
hi def link asmHexadecimal hexNumber
hi def link asmDecimal decNumber
hi def link asmOctal octNumber
hi def link asmBinary binNumber
else
hi def link asmHexadecimal Number
hi def link asmDecimal Number
hi def link asmOctal Number
hi def link asmBinary Number
endif
hi def link asmFloat Float
hi def link asmString String
hi def link asmStringEscape Special
hi def link asmCharacter Character
hi def link asmCharacterEscape Special
hi def link asmIdentifier Identifier
hi def link asmType Type
hi def link asmType Type
let b:current_syntax = "asm"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
" vim: nowrap sw=2 sts=2 ts=8 noet

View File

@@ -1,19 +1,21 @@
" Vim syntax file
" Language: Hitachi H-8300h specific syntax for GNU Assembler
" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2002 Sep 19
" Language: Hitachi H-8300h specific syntax for GNU Assembler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2020 Oct 31
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
runtime! syntax/asm.vim
syn case ignore
syn match asmDirective "\.h8300[h]*"
syn match asmDirective "\.h8300[hs]n\="
"h8300[h] registers
syn match asmReg "e\=r[0-7][lh]\="
syn match asmRegister "e\=r\o[lh]\="
"h8300[h] opcodes - order is important!
syn match asmOpcode "add\.[lbw]"
@@ -37,32 +39,20 @@ syn match asmOpcode "sha[lr]\.[lbw]"
syn match asmOpcode "shl[lr]\.[lbw]"
syn match asmOpcode "sub\.[lbw]"
syn match asmOpcode "xor\.[lbw]"
syn keyword asmOpcode "andc" "band" "bcc" "bclr" "bcs" "beq" "bf" "bge" "bgt"
syn keyword asmOpcode "bhi" "bhs" "biand" "bild" "bior" "bist" "bixor" "bmi"
syn keyword asmOpcode "bne" "bnot" "bnp" "bor" "bpl" "bpt" "bra" "brn" "bset"
syn keyword asmOpcode "bsr" "btst" "bst" "bt" "bvc" "bvs" "bxor" "cmp" "daa"
syn keyword asmOpcode "das" "eepmov" "eepmovw" "inc" "jmp" "jsr" "ldc" "movfpe"
syn keyword asmOpcode "movtpe" "mov" "nop" "orc" "rte" "rts" "sleep" "stc"
syn keyword asmOpcode "sub" "trapa" "xorc"
syn keyword asmOpcode andc band bcc bclr bcs beq bf bge bgt
syn keyword asmOpcode bhi bhs biand bild bior bist bixor bmi
syn keyword asmOpcode bne bnot bnp bor bpl bpt bra brn bset
syn keyword asmOpcode bsr btst bst bt bvc bvs bxor cmp daa
syn keyword asmOpcode das eepmov eepmovw inc jmp jsr ldc movfpe
syn keyword asmOpcode movtpe mov nop orc rte rts sleep stc
syn keyword asmOpcode sub trapa xorc
syn case match
" Read the general asm syntax
runtime! syntax/asm.vim
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link asmOpcode Statement
hi def link asmRegister Identifier
" My default-color overrides:
"hi asmOpcode ctermfg=yellow
"hi asmReg ctermfg=lightmagenta
hi def link asmOpcode Statement
hi def link asmRegister Identifier
let b:current_syntax = "asmh8300"
" vim: ts=8
" vim: nowrap sw=2 sts=2 ts=8 noet

View File

@@ -1,7 +1,8 @@
" Vim syntax file
" Language: awk, nawk, gawk, mawk
" Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2020 Aug 18
" Language: awk, nawk, gawk, mawk
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2020 Aug 18
" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
" The AWK Programming Language, Addison-Wesley, 1988

View File

@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2020 Apr 27
" Last Change: 2020 Oct 28
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim
" Standard syntax initialization
@@ -21,20 +21,20 @@ let s:cpo = &cpo
set cpo-=C
let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
\ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
\ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
\ 'sid', 'rc-buggy',
\
\ 'trusty', 'xenial', 'bionic', 'eoan', 'focal', 'groovy', 'devel'
\ 'trusty', 'xenial', 'bionic', 'focal', 'groovy', 'hippo', 'devel'
\ ]
let s:unsupported = [
\ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
\
\ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
\ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
\ 'disco'
\ 'disco', 'eoan'
\ ]
let &cpo=s:cpo

View File

@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2018 Aug 11
" Last Change: 2020 Oct 26
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcontrol.vim
" Standard syntax initialization
@@ -47,22 +47,24 @@ exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs)
unlet s:kernels s:archs s:pairs
" Keep in sync with https://metadata.ftp-master.org/sections.822
" curl -q https://metadata.ftp-master.debian.org/sections.822 2>/dev/null| grep-dctrl -n --not -FSection -sSection / -
let s:sections = [
\ 'admin', 'cli-mono', 'comm', 'database', 'debian-installer', 'debug'
\, 'devel', 'doc', 'editors', 'education', 'electronics', 'embedded'
\, 'fonts', 'games', 'gnome', 'gnustep', 'gnu-r', 'golang', 'graphics'
\, 'fonts', 'games', 'gnome', 'gnu-r', 'gnustep', 'golang', 'graphics'
\, 'hamradio', 'haskell', 'httpd', 'interpreters', 'introspection'
\, 'java\%(script\)\=', 'kde', 'kernel', 'libs', 'libdevel', 'lisp'
\, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net'
\, 'news', 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python'
\, 'ruby', 'rust', 'science', 'shells', 'sound', 'text', 'tex'
\, 'java', 'javascript', 'kde', 'kernel', 'libdevel', 'libs', 'lisp'
\, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net', 'news'
\, 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python', 'raku'
\, 'ruby', 'rust', 'science', 'shells', 'sound', 'tasks', 'tex', 'text'
\, 'utils', 'vcs', 'video', 'web', 'x11', 'xfce', 'zope'
\ ]
syn keyword debcontrolMultiArch contained no foreign allowed same
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
syn keyword debcontrolPriority contained extra important optional required standard
exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\%('.join(s:sections, '\|').'\)"'
exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\<\%('.join(s:sections, '\|').'\)\>"'
syn keyword debcontrolPackageType contained udeb deb
syn match debcontrolVariable contained "\${.\{-}}"
syn keyword debcontrolDmUpload contained yes

View File

@@ -2,7 +2,7 @@
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
" Last Change: 2020 Apr 27
" Last Change: 2020 Oct 26
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
" Standard syntax initialization
@@ -23,20 +23,20 @@ let s:cpo = &cpo
set cpo-=C
let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
\ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
\ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
\ 'sid', 'rc-buggy',
\
\ 'trusty', 'xenial', 'bionic', 'eoan', 'focal', 'groovy', 'devel'
\ 'trusty', 'xenial', 'bionic', 'focal', 'groovy', 'hippo', 'devel'
\ ]
let s:unsupported = [
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
\
\ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
\ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
\ 'disco'
\ 'disco', 'eoan'
\ ]
let &cpo=s:cpo

View File

@@ -1,6 +1,6 @@
" Vim syntax file
" Language: ELF
" Maintainer: Christian V. J. Br<EFBFBD>ssow <cvjb@cvjb.de>
" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
" Last Change: Son 22 Jun 2003 20:43:14 CEST
" Filenames: *.ab,*.am
" URL: http://www.cvjb.de/comp/vim/elf.vim

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: FORTH
" Current Maintainer: Johan Kotlinski <kotlinski@gmail.com>
" Previous Maintainer: Christian V. J. Br<EFBFBD>ssow <cvjb@cvjb.de>
" Previous Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
" Last Change: 2018-03-29
" Filenames: *.fs,*.ft
" URL: https://github.com/jkotlinski/forth.vim

View File

@@ -8,10 +8,10 @@
" older Fortran 77 syntax file by Mario Eusebio and Preben Guldberg.
" Since then, useful suggestions and contributions have been made, in order, by:
" Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
" Walter Dieudonn<EFBFBD>, Alexander Wagner, Roman Bertle, Charles Rendleman,
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann,
" Stefano Zaghi, Vishnu V. Krishnan, Judica<EFBFBD>l Grasset, Takuma Yoshida,
" Eisuke Kawashima, and Andr<EFBFBD> Chalella.`
" Stefano Zaghi, Vishnu V. Krishnan, Judicaël Grasset, Takuma Yoshida,
" Eisuke Kawashima, and André Chalella.`
if exists("b:current_syntax")
finish

View File

@@ -1,6 +1,6 @@
" VIM syntax file
" Language: groff
" Maintainer: Alejandro L<EFBFBD>pez-Valencia <dradul@yahoo.com>
" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
" URL: http://dradul.tripod.com/vim
" Last Change: 2003-05-08-12:41:13 GMT-5.

View File

@@ -1,6 +1,6 @@
" Vim syntax file
" Language: initng .i files
" Maintainer: Elan Ruusam<EFBFBD>e <glen@pld-linux.org>
" Maintainer: Elan Ruusamäe <glen@pld-linux.org>
" URL: http://glen.alkohol.ee/pld/initng/
" License: GPL v2
" Version: 0.13

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Inno Setup File (iss file) and My InnoSetup extension
" Maintainer: Jason Mills (jmills@cs.mun.ca)
" Previous Maintainer: Dominique St<EFBFBD>phan (dominique@mggen.com)
" Previous Maintainer: Dominique Stéphan (dominique@mggen.com)
" Last Change: 2019 Sep 27
"
" Todo:

View File

@@ -1,6 +1,6 @@
" Vim syntax file
" Language: Lout
" Maintainer: Christian V. J. Br<EFBFBD>ssow <cvjb@cvjb.de>
" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
" Last Change: So 12 Feb 2012 15:15:03 CET
" Filenames: *.lout,*.lt
" URL: http://www.cvjb.de/comp/vim/lout.vim

View File

@@ -1,6 +1,6 @@
" Vim syntax file
" Language: MMIX
" Maintainer: Dirk H<EFBFBD>sken, <huesken@informatik.uni-tuebingen.de>
" Maintainer: Dirk Hüsken, <huesken@informatik.uni-tuebingen.de>
" Last Change: 2012 Jun 01
" (Dominique Pelle added @Spell)
" Filenames: *.mms

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: MOO
" Maintainer: Timo Frenay <timo@frenay.net>
" Last Change: 2001 Oct 06
" Last Change: 2020 Oct 19
" Note: Requires Vim 6.0 or above
" quit when a syntax file was already loaded
@@ -95,7 +95,7 @@ if exists("moo_unknown_builtin_functions")
syn keyword mooKnownBuiltinFunction abs acos add_property add_verb asin atan binary_hash boot_player buffered_output_length callers caller_perms call_function ceil children chparent clear_property connected_players connected_seconds connection_name connection_option connection_options cos cosh create crypt ctime db_disk_size decode_binary delete_property delete_verb disassemble dump_database encode_binary equal eval exp floatstr floor flush_input force_input function_info idle_seconds index is_clear_property is_member is_player kill_task length listappend listdelete listen listeners listinsert listset log log10 match max max_object memory_usage min move notify object_bytes open_network_connection output_delimiters parent pass players properties property_info queued_tasks queue_info raise random read recycle renumber reset_max_object resume rindex rmatch seconds_left server_log server_version setadd setremove set_connection_option set_player_flag set_property_info set_task_perms set_verb_args set_verb_code set_verb_info shutdown sin sinh sqrt strcmp string_hash strsub substitute suspend tan tanh task_id task_stack ticks_left time tofloat toint toliteral tonum toobj tostr trunc typeof unlisten valid value_bytes value_hash verbs verb_args verb_code verb_info contained
endif
"<EFBFBD>Enclosed expressions
" Enclosed expressions
syn match mooUnenclosedError display ~[')\]|}]~
syn match mooParenthesesError display ~[';\]|}]~ contained
syn region mooParentheses start=~(~ end=~)~ transparent contains=@mooEnclosedContents,mooParenthesesError

View File

@@ -1,6 +1,6 @@
" VIM syntax file
" Language: nroff/groff
" Maintainer: Pedro Alejandro L<EFBFBD>pez-Valencia <palopezv@gmail.com>
" Maintainer: Pedro Alejandro López-Valencia <palopezv@gmail.com>
" URL: http://vorbote.wordpress.com/
" Last Change: 2012 Feb 2
"
@@ -8,7 +8,7 @@
"
" ACKNOWLEDGEMENTS:
"
" My thanks to J<EFBFBD>r<EFBFBD>me Pl<EFBFBD>t <Jerome.Plut@ens.fr>, who was the
" My thanks to Jérôme Plût <Jerome.Plut@ens.fr>, who was the
" creator and maintainer of this syntax file for several years.
" May I be as good at it as he has been.
"

View File

@@ -2,7 +2,7 @@
" Language: Pascal
" Version: 2.8
" Last Change: 2004/10/17 17:47:30
" Maintainer: Xavier Cr<EFBFBD>gut <xavier.cregut@enseeiht.fr>
" Maintainer: Xavier Crégut <xavier.cregut@enseeiht.fr>
" Previous Maintainer: Mario Eusebio <bio@dq.fct.unl.pt>
" Contributors: Tim Chase <tchase@csc.com>,

View File

@@ -1,26 +1,36 @@
" syntax file for Protocol Buffers - Google's data interchange format
"
" Protocol Buffers - Google's data interchange format
" Copyright 2008 Google Inc. All rights reserved.
" https://developers.google.com/protocol-buffers/
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to deal
" in the Software without restriction, including without limitation the rights
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
" copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are
" met:
"
" The above copyright notice and this permission notice shall be included in
" all copies or substantial portions of the Software.
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above
" copyright notice, this list of conditions and the following disclaimer
" in the documentation and/or other materials provided with the
" distribution.
" * Neither the name of Google Inc. nor the names of its
" contributors may be used to endorse or promote products derived from
" this software without specific prior written permission.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
" THE SOFTWARE.
"
" http://code.google.com/p/protobuf/
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" This is the Vim syntax file for Google Protocol Buffers as found at
" https://github.com/protocolbuffers/protobuf
" Last update: 2020 Oct 29
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -33,10 +43,10 @@ syn keyword protoTodo contained TODO FIXME XXX
syn cluster protoCommentGrp contains=protoTodo
syn keyword protoSyntax syntax import option
syn keyword protoStructure package message group
syn keyword protoStructure package message group oneof
syn keyword protoRepeat optional required repeated
syn keyword protoDefault default
syn keyword protoExtend extend extensions to max
syn keyword protoExtend extend extensions to max reserved
syn keyword protoRPC service rpc returns
syn keyword protoType int32 int64 uint32 uint64 sint32 sint64
@@ -48,10 +58,10 @@ syn keyword protoBool true false
syn match protoInt /-\?\<\d\+\>/
syn match protoInt /\<0[xX]\x+\>/
syn match protoFloat /\<-\?\d*\(\.\d*\)\?/
syn region protoComment start="\/\*" end="\*\/" contains=@protoCommentGrp
syn region protoComment start="//" skip="\\$" end="$" keepend contains=@protoCommentGrp
syn region protoString start=/"/ skip=/\\./ end=/"/
syn region protoString start=/'/ skip=/\\./ end=/'/
syn region protoComment start="\/\*" end="\*\/" contains=@pbCommentGrp,@Spell
syn region protoComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp,@Spell
syn region protoString start=/"/ skip=/\\./ end=/"/ contains=@Spell
syn region protoString start=/'/ skip=/\\./ end=/'/ contains=@Spell
hi def link protoTodo Todo

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: "Robots.txt" files
" Robots.txt files indicate to WWW robots which parts of a web site should not be accessed.
" Maintainer: Dominique St<EFBFBD>phan (dominique@mggen.com)
" Maintainer: Dominique Stéphan (dominique@mggen.com)
" URL: http://www.mggen.com/vim/syntax/robots.zip
" Last change: 2001 May 09

View File

@@ -2,7 +2,7 @@
" Language: RPL/2
" Version: 0.15.15 against RPL/2 version 4.00pre7i
" Last Change: 2012 Feb 03 by Thilo Six
" Maintainer: Jo<EFBFBD>l BERTRAND <rpl2@free.fr>
" Maintainer: Joël BERTRAND <rpl2@free.fr>
" URL: http://www.makalis.fr/~bertrand/rpl2/download/vim/indent/rpl.vim
" Credits: Nothing

View File

@@ -7,7 +7,7 @@
" .hlp (windows help files) use compiled rtf files
" rtf documentation at http://night.primate.wisc.edu/software/RTF/
"
" Maintainer: Dominique St<EFBFBD>phan (dominique@mggen.com)
" Maintainer: Dominique Stéphan (dominique@mggen.com)
" URL: http://www.mggen.com/vim/syntax/rtf.zip
" Last change: 2001 Mai 02

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" This file works only for Vim6.x
" Language: Tilde
" Maintainer: Tobias Rundstr<EFBFBD>m <tobi@tildesoftware.net>
" Maintainer: Tobias Rundström <tobi@tildesoftware.net>
" URL: http://www.tildesoftware.net
" CVS: $Id: tilde.vim,v 1.1 2004/06/13 19:31:51 vimboss Exp $

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: TypeScript and TypeScriptReact
" Maintainer: Bram Moolenaar, Herrington Darkholme
" Last Change: 2019 Nov 30
" Last Change: 2020 Oct 27
" Based On: Herrington Darkholme's yats.vim
" Changes: See https:github.com/HerringtonDarkholme/yats.vim
" Credits: See yats.vim on github
@@ -21,15 +21,14 @@ if main_syntax == 'typescript' || main_syntax == 'typescriptreact'
setlocal iskeyword+=$
" syntax cluster htmlJavaScript contains=TOP
endif
" For private field added from TypeScript 3.8
setlocal iskeyword+=#
" lowest priority on least used feature
syntax match typescriptLabel /[a-zA-Z_$]\k*:/he=e-1 contains=typescriptReserved nextgroup=@typescriptStatement skipwhite skipempty
" other keywords like return,case,yield uses containedin
syntax region typescriptBlock matchgroup=typescriptBraces start=/{/ end=/}/ contains=@typescriptStatement,@typescriptComments fold
"runtime syntax/basic/identifiers.vim
syntax cluster afterIdentifier contains=
\ typescriptDotNotation,
\ typescriptFuncCallArg,
@@ -60,7 +59,56 @@ syntax region typescriptFuncCallArg contained matchgroup=typescriptPa
syntax region typescriptEventFuncCallArg contained matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptEventExpression
syntax region typescriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=typescriptASCII,@events
"runtime syntax/basic/literal.vim
syntax region typescriptDestructureString
\ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/
\ contains=typescriptASCII
\ nextgroup=typescriptDestructureAs
\ contained skipwhite skipempty
syntax cluster typescriptVariableDeclarations
\ contains=typescriptVariableDeclaration,@typescriptDestructures
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
\ contained skipwhite skipempty
syntax cluster typescriptDestructureVariables contains=
\ typescriptRestOrSpread,
\ typescriptDestructureComma,
\ typescriptDestructureLabel,
\ typescriptDestructureVariable,
\ @typescriptDestructures
syntax match typescriptDestructureVariable /[A-Za-z_$]\k*/ contained
\ nextgroup=typescriptDefaultParam
\ contained skipwhite skipempty
syntax match typescriptDestructureLabel /[A-Za-z_$]\k*\ze\_s*:/
\ nextgroup=typescriptDestructureAs
\ contained skipwhite skipempty
syntax match typescriptDestructureAs /:/
\ nextgroup=typescriptDestructureVariable,@typescriptDestructures
\ contained skipwhite skipempty
syntax match typescriptDestructureComma /,/ contained
syntax cluster typescriptDestructures contains=
\ typescriptArrayDestructure,
\ typescriptObjectDestructure
syntax region typescriptArrayDestructure matchgroup=typescriptBraces
\ start=/\[/ end=/]/
\ contains=@typescriptDestructureVariables,@typescriptComments
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
\ transparent contained skipwhite skipempty fold
syntax region typescriptObjectDestructure matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contains=typescriptDestructureString,@typescriptDestructureVariables,@typescriptComments
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
\ transparent contained skipwhite skipempty fold
"Syntax in the JavaScript code
" String
@@ -77,15 +125,15 @@ syntax region typescriptString
\ contains=typescriptSpecial,@Spell
\ extend
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)"
" From vim runtime
" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}]+me=e-1 nextgroup=typescriptDotNotation oneline
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}:]+me=e-1 nextgroup=typescriptDotNotation oneline
syntax region typescriptTemplate
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
\ contains=typescriptTemplateSubstitution
\ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell
\ nextgroup=@typescriptSymbols
\ skipwhite skipempty
@@ -100,18 +148,16 @@ syntax region typescriptArray matchgroup=typescriptBraces
syntax match typescriptNumber /\<0[bB][01][01_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
syntax match typescriptNumber /\d[0-9_]*\.\d[0-9_]*\|\d[0-9_]*\|\.\d[0-9]*/
\ nextgroup=typescriptExponent,@typescriptSymbols skipwhite skipempty
syntax match typescriptExponent /[eE][+-]\=\d[0-9]*\>/
\ nextgroup=@typescriptSymbols skipwhite skipempty contained
syntax match typescriptNumber /\<\%(\d[0-9_]*\%(\.\d[0-9_]*\)\=\|\.\d[0-9_]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/
\ nextgroup=typescriptSymbols skipwhite skipempty
" runtime syntax/basic/object.vim
syntax region typescriptObjectLiteral matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName,typescriptObjectAsyncKeyword
\ fold contained
syntax keyword typescriptObjectAsyncKeyword async contained
syntax match typescriptObjectLabel contained /\k\+\_s*/
\ nextgroup=typescriptObjectColon,@typescriptCallImpl
\ skipwhite skipempty
@@ -136,7 +182,6 @@ syntax match typescriptObjectSpread /\.\.\./ contained containedin=typescriptObj
syntax match typescriptObjectColon contained /:/ nextgroup=@typescriptValue skipwhite skipempty
"runtime syntax/basic/symbols.vim
" + - ^ ~
syntax match typescriptUnaryOp /[+\-~!]/
\ nextgroup=@typescriptValue
@@ -153,10 +198,12 @@ syntax match typescriptBinaryOp contained /===\?/ nextgroup=@typescriptValue s
syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
" 4: <<=, <<, <=, <
syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
" 3: ||, |=, |
syntax match typescriptBinaryOp contained /|\(|\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
" 3: &&, &=, &
syntax match typescriptBinaryOp contained /&\(&\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
" 3: ||, |=, |, ||=
syntax match typescriptBinaryOp contained /||\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
" 4: &&, &=, &, &&=
syntax match typescriptBinaryOp contained /&&\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
" 2: ??, ??=
syntax match typescriptBinaryOp contained /??=\?/ nextgroup=@typescriptValue skipwhite skipempty
" 2: *=, *
syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
" 2: %=, %
@@ -177,11 +224,18 @@ syntax match typescriptBinaryOp contained /\*\*=\?/ nextgroup=@typescriptValue
syntax cluster typescriptSymbols contains=typescriptBinaryOp,typescriptKeywordOp,typescriptTernary,typescriptAssign,typescriptCastKeyword
" runtime syntax/basic/reserved.vim
"runtime syntax/basic/keyword.vim
"Import
syntax keyword typescriptImport from as import
syntax keyword typescriptImport from as
syntax keyword typescriptImport import
\ nextgroup=typescriptImportType
\ skipwhite
syntax keyword typescriptImportType type
\ contained
syntax keyword typescriptExport export
\ nextgroup=typescriptExportType
\ skipwhite
syntax match typescriptExportType /\<type\s*{\@=/
\ contained skipwhite skipempty skipnl
syntax keyword typescriptModule namespace module
"this
@@ -199,16 +253,12 @@ syntax keyword typescriptIdentifier arguments this super
\ nextgroup=@afterIdentifier
syntax keyword typescriptVariable let var
\ nextgroup=typescriptVariableDeclaration
\ skipwhite skipempty skipnl
\ nextgroup=@typescriptVariableDeclarations
\ skipwhite skipempty
syntax keyword typescriptVariable const
\ nextgroup=typescriptEnum,typescriptVariableDeclaration
\ skipwhite
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
\ contained skipwhite skipempty skipnl
\ nextgroup=typescriptEnum,@typescriptVariableDeclarations
\ skipwhite skipempty
syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
\ nextgroup=typescriptBlock
@@ -271,7 +321,6 @@ syntax cluster typescriptAmbients contains=
\ typescriptEnumKeyword,typescriptEnum,
\ typescriptModule
"runtime syntax/basic/doc.vim
"Syntax coloring for Node.js shebang line
syntax match shellbang "^#!.*node\>"
syntax match shellbang "^#!.*iojs\>"
@@ -279,8 +328,9 @@ syntax match shellbang "^#!.*iojs\>"
"JavaScript comments
syntax keyword typescriptCommentTodo TODO FIXME XXX TBD
syntax match typescriptMagicComment "@ts-\%(ignore\|expect-error\)\>"
syntax match typescriptLineComment "//.*"
\ contains=@Spell,typescriptCommentTodo,typescriptRef
\ contains=@Spell,typescriptCommentTodo,typescriptRef,typescriptMagicComment
syntax region typescriptComment
\ start="/\*" end="\*/"
\ contains=@Spell,typescriptCommentTodo extend
@@ -349,24 +399,27 @@ syntax region typescriptDocLinkTag contained matchgroup=typescriptDo
syntax cluster typescriptDocs contains=typescriptDocParamType,typescriptDocNamedParamType,typescriptDocParam
if main_syntax == "typescript"
if exists("main_syntax") && main_syntax == "typescript"
syntax sync clear
syntax sync ccomment typescriptComment minlines=200
endif
syntax case match
"runtime syntax/basic/type.vim
" Types
syntax match typescriptOptionalMark /?/ contained
syntax cluster typescriptTypeParameterCluster contains=
\ typescriptTypeParameter,
\ typescriptGenericDefault
syntax region typescriptTypeParameters matchgroup=typescriptTypeBrackets
\ start=/</ end=/>/
\ contains=typescriptTypeParameter
\ contains=@typescriptTypeParameterCluster
\ contained
syntax match typescriptTypeParameter /\K\k*/
\ nextgroup=typescriptConstraint,typescriptGenericDefault
\ nextgroup=typescriptConstraint
\ contained skipwhite skipnl
syntax keyword typescriptConstraint extends
@@ -409,6 +462,7 @@ syntax cluster typescriptPrimaryType contains=
\ typescriptTupleType,
\ typescriptTypeQuery,
\ typescriptStringLiteralType,
\ typescriptTemplateLiteralType,
\ typescriptReadonlyArrayKeyword,
\ typescriptAssertType
@@ -417,6 +471,17 @@ syntax region typescriptStringLiteralType contained
\ nextgroup=typescriptUnion
\ skipwhite skipempty
syntax region typescriptTemplateLiteralType contained
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
\ contains=typescriptTemplateSubstitutionType
\ nextgroup=typescriptTypeOperator
\ skipwhite skipempty
syntax region typescriptTemplateSubstitutionType matchgroup=typescriptTemplateSB
\ start=/\${/ end=/}/
\ contains=@typescriptType
\ contained
syntax region typescriptParenthesizedType matchgroup=typescriptParens
\ start=/(/ end=/)/
\ contains=@typescriptType
@@ -439,7 +504,7 @@ syntax region typescriptObjectType matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contains=@typescriptTypeMember,typescriptEndColons,@typescriptComments,typescriptAccessibilityModifier,typescriptReadonlyModifier
\ nextgroup=@typescriptTypeOperator
\ contained skipwhite fold
\ contained skipwhite skipnl fold
syntax cluster typescriptTypeMember contains=
\ @typescriptCallSignature,
@@ -447,16 +512,21 @@ syntax cluster typescriptTypeMember contains=
\ typescriptIndexSignature,
\ @typescriptMembers
syntax match typescriptTupleLable /\K\k*?\?:/
\ contained
syntax region typescriptTupleType matchgroup=typescriptBraces
\ start=/\[/ end=/\]/
\ contains=@typescriptType,@typescriptComments
\ contains=@typescriptType,@typescriptComments,typescriptRestOrSpread,typescriptTupleLable
\ contained skipwhite
syntax cluster typescriptTypeOperator
\ contains=typescriptUnion,typescriptTypeBracket
\ contains=typescriptUnion,typescriptTypeBracket,typescriptConstraint,typescriptConditionalType
syntax match typescriptUnion /|\|&/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
syntax match typescriptConditionalType /?\|:/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
syntax cluster typescriptFunctionType contains=typescriptGenericFunc,typescriptFuncType
syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets
\ start=/</ end=/>/
@@ -511,6 +581,7 @@ syntax match typescriptTypeAnnotation /:/
syntax cluster typescriptParameterList contains=
\ typescriptTypeAnnotation,
\ typescriptAccessibilityModifier,
\ typescriptReadonlyModifier,
\ typescriptOptionalMark,
\ typescriptRestOrSpread,
\ typescriptFuncComma,
@@ -550,10 +621,9 @@ syntax keyword typescriptReadonlyArrayKeyword readonly
\ nextgroup=@typescriptPrimaryType
\ skipwhite
" extension
if get(g:, 'yats_host_keyword', 1)
"runtime syntax/yats.vim
"runtime syntax/yats/typescript.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Error EvalError
syntax keyword typescriptGlobal containedin=typescriptIdentifierName InternalError
@@ -584,7 +654,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptGlobalMethod
hi def link typescriptGlobalMethod Structure
"runtime syntax/yats/es6-number.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Number nextgroup=typescriptGlobalNumberDot,typescriptFuncCallArg
syntax match typescriptGlobalNumberDot /\./ contained nextgroup=typescriptNumberStaticProp,typescriptNumberStaticMethod,typescriptProp
syntax keyword typescriptNumberStaticProp contained EPSILON MAX_SAFE_INTEGER MAX_VALUE
@@ -599,7 +668,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptNumberMethod
hi def link typescriptNumberMethod Keyword
"runtime syntax/yats/es6-string.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName String nextgroup=typescriptGlobalStringDot,typescriptFuncCallArg
syntax match typescriptGlobalStringDot /\./ contained nextgroup=typescriptStringStaticMethod,typescriptProp
syntax keyword typescriptStringStaticMethod contained fromCharCode fromCodePoint raw nextgroup=typescriptFuncCallArg
@@ -615,7 +683,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptStringMethod
hi def link typescriptStringMethod Keyword
"runtime syntax/yats/es6-array.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Array nextgroup=typescriptGlobalArrayDot,typescriptFuncCallArg
syntax match typescriptGlobalArrayDot /\./ contained nextgroup=typescriptArrayStaticMethod,typescriptProp
syntax keyword typescriptArrayStaticMethod contained from isArray of nextgroup=typescriptFuncCallArg
@@ -629,7 +696,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptArrayMethod
hi def link typescriptArrayMethod Keyword
"runtime syntax/yats/es6-object.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Object nextgroup=typescriptGlobalObjectDot,typescriptFuncCallArg
syntax match typescriptGlobalObjectDot /\./ contained nextgroup=typescriptObjectStaticMethod,typescriptProp
syntax keyword typescriptObjectStaticMethod contained create defineProperties defineProperty nextgroup=typescriptFuncCallArg
@@ -646,7 +712,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptObjectMethod
hi def link typescriptObjectMethod Keyword
"runtime syntax/yats/es6-symbol.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Symbol nextgroup=typescriptGlobalSymbolDot,typescriptFuncCallArg
syntax match typescriptGlobalSymbolDot /\./ contained nextgroup=typescriptSymbolStaticProp,typescriptSymbolStaticMethod,typescriptProp
syntax keyword typescriptSymbolStaticProp contained length iterator match replace
@@ -657,13 +722,11 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptSymbolStaticMethod contained for keyFor nextgroup=typescriptFuncCallArg
hi def link typescriptSymbolStaticMethod Keyword
"runtime syntax/yats/es6-function.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function
syntax keyword typescriptFunctionMethod contained apply bind call nextgroup=typescriptFuncCallArg
syntax cluster props add=typescriptFunctionMethod
hi def link typescriptFunctionMethod Keyword
"runtime syntax/yats/es6-math.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Math nextgroup=typescriptGlobalMathDot,typescriptFuncCallArg
syntax match typescriptGlobalMathDot /\./ contained nextgroup=typescriptMathStaticProp,typescriptMathStaticMethod,typescriptProp
syntax keyword typescriptMathStaticProp contained E LN10 LN2 LOG10E LOG2E PI SQRT1_2
@@ -677,7 +740,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptMathStaticMethod contained sinh sqrt tan tanh trunc nextgroup=typescriptFuncCallArg
hi def link typescriptMathStaticMethod Keyword
"runtime syntax/yats/es6-date.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Date nextgroup=typescriptGlobalDateDot,typescriptFuncCallArg
syntax match typescriptGlobalDateDot /\./ contained nextgroup=typescriptDateStaticMethod,typescriptProp
syntax keyword typescriptDateStaticMethod contained UTC now parse nextgroup=typescriptFuncCallArg
@@ -699,13 +761,11 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptDateMethod
hi def link typescriptDateMethod Keyword
"runtime syntax/yats/es6-json.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName JSON nextgroup=typescriptGlobalJSONDot,typescriptFuncCallArg
syntax match typescriptGlobalJSONDot /\./ contained nextgroup=typescriptJSONStaticMethod,typescriptProp
syntax keyword typescriptJSONStaticMethod contained parse stringify nextgroup=typescriptFuncCallArg
hi def link typescriptJSONStaticMethod Keyword
"runtime syntax/yats/es6-regexp.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName RegExp nextgroup=typescriptGlobalRegExpDot,typescriptFuncCallArg
syntax match typescriptGlobalRegExpDot /\./ contained nextgroup=typescriptRegExpStaticProp,typescriptProp
syntax keyword typescriptRegExpStaticProp contained lastIndex
@@ -717,7 +777,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptRegExpMethod
hi def link typescriptRegExpMethod Keyword
"runtime syntax/yats/es6-map.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Map WeakMap
syntax keyword typescriptES6MapProp contained size
syntax cluster props add=typescriptES6MapProp
@@ -727,7 +786,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptES6MapMethod
hi def link typescriptES6MapMethod Keyword
"runtime syntax/yats/es6-set.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Set WeakSet
syntax keyword typescriptES6SetProp contained size
syntax cluster props add=typescriptES6SetProp
@@ -737,7 +795,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptES6SetMethod
hi def link typescriptES6SetMethod Keyword
"runtime syntax/yats/es6-proxy.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Proxy
syntax keyword typescriptProxyAPI contained getOwnPropertyDescriptor getOwnPropertyNames
syntax keyword typescriptProxyAPI contained defineProperty deleteProperty freeze seal
@@ -745,7 +802,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptProxyAPI contained iterate ownKeys apply construct
hi def link typescriptProxyAPI Keyword
"runtime syntax/yats/es6-promise.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Promise nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg
syntax match typescriptGlobalPromiseDot /\./ contained nextgroup=typescriptPromiseStaticMethod,typescriptProp
syntax keyword typescriptPromiseStaticMethod contained resolve reject all race nextgroup=typescriptFuncCallArg
@@ -754,7 +810,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptPromiseMethod
hi def link typescriptPromiseMethod Keyword
"runtime syntax/yats/es6-reflect.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Reflect
syntax keyword typescriptReflectMethod contained apply construct defineProperty deleteProperty nextgroup=typescriptFuncCallArg
syntax keyword typescriptReflectMethod contained enumerate get getOwnPropertyDescriptor nextgroup=typescriptFuncCallArg
@@ -763,14 +818,12 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptReflectMethod
hi def link typescriptReflectMethod Keyword
"runtime syntax/yats/ecma-402.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Intl
syntax keyword typescriptIntlMethod contained Collator DateTimeFormat NumberFormat nextgroup=typescriptFuncCallArg
syntax keyword typescriptIntlMethod contained PluralRules nextgroup=typescriptFuncCallArg
syntax cluster props add=typescriptIntlMethod
hi def link typescriptIntlMethod Keyword
"runtime syntax/yats/node.vim
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName global process
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName console Buffer
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName module exports
@@ -788,7 +841,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptTestGlobal containedin=typescriptIdentifierName afterAll
syntax keyword typescriptTestGlobal containedin=typescriptIdentifierName expect assert
"runtime syntax/yats/web.vim
syntax keyword typescriptBOM containedin=typescriptIdentifierName AbortController
syntax keyword typescriptBOM containedin=typescriptIdentifierName AbstractWorker AnalyserNode
syntax keyword typescriptBOM containedin=typescriptIdentifierName App Apps ArrayBuffer
@@ -1038,7 +1090,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptBOM containedin=typescriptIdentifierName XMLHttpRequestEventTarget
hi def link typescriptBOM Structure
"runtime syntax/yats/web-window.vim
syntax keyword typescriptBOMWindowProp containedin=typescriptIdentifierName applicationCache
syntax keyword typescriptBOMWindowProp containedin=typescriptIdentifierName closed
syntax keyword typescriptBOMWindowProp containedin=typescriptIdentifierName Components
@@ -1145,7 +1196,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptBOMWindowCons containedin=typescriptIdentifierName XMLSerializer
hi def link typescriptBOMWindowCons Structure
"runtime syntax/yats/web-navigator.vim
syntax keyword typescriptBOMNavigatorProp contained battery buildID connection cookieEnabled
syntax keyword typescriptBOMNavigatorProp contained doNotTrack maxTouchPoints oscpu
syntax keyword typescriptBOMNavigatorProp contained productSub push serviceWorker
@@ -1164,7 +1214,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptServiceWorkerMethod
hi def link typescriptServiceWorkerMethod Keyword
"runtime syntax/yats/web-location.vim
syntax keyword typescriptBOMLocationProp contained href protocol host hostname port
syntax keyword typescriptBOMLocationProp contained pathname search hash username password
syntax keyword typescriptBOMLocationProp contained origin
@@ -1174,7 +1223,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptBOMLocationMethod
hi def link typescriptBOMLocationMethod Keyword
"runtime syntax/yats/web-history.vim
syntax keyword typescriptBOMHistoryProp contained length current next previous state
syntax keyword typescriptBOMHistoryProp contained scrollRestoration
syntax cluster props add=typescriptBOMHistoryProp
@@ -1183,7 +1231,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptBOMHistoryMethod
hi def link typescriptBOMHistoryMethod Keyword
"runtime syntax/yats/web-console.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName console
syntax keyword typescriptConsoleMethod contained count dir error group groupCollapsed nextgroup=typescriptFuncCallArg
syntax keyword typescriptConsoleMethod contained groupEnd info log time timeEnd trace nextgroup=typescriptFuncCallArg
@@ -1191,7 +1238,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptConsoleMethod
hi def link typescriptConsoleMethod Keyword
"runtime syntax/yats/web-xhr.vim
syntax keyword typescriptXHRGlobal containedin=typescriptIdentifierName XMLHttpRequest
hi def link typescriptXHRGlobal Structure
syntax keyword typescriptXHRProp contained onreadystatechange readyState response
@@ -1204,7 +1250,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptXHRMethod
hi def link typescriptXHRMethod Keyword
"runtime syntax/yats/web-blob.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Blob BlobBuilder
syntax keyword typescriptGlobal containedin=typescriptIdentifierName File FileReader
syntax keyword typescriptGlobal containedin=typescriptIdentifierName FileReaderSync
@@ -1236,7 +1281,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptURLStaticMethod contained createObjectURL revokeObjectURL nextgroup=typescriptFuncCallArg
hi def link typescriptURLStaticMethod Keyword
"runtime syntax/yats/web-crypto.vim
syntax keyword typescriptCryptoGlobal containedin=typescriptIdentifierName crypto
hi def link typescriptCryptoGlobal Structure
syntax keyword typescriptSubtleCryptoMethod contained encrypt decrypt sign verify nextgroup=typescriptFuncCallArg
@@ -1250,7 +1294,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptCryptoMethod
hi def link typescriptCryptoMethod Keyword
"runtime syntax/yats/web-fetch.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Headers Request
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Response
syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName fetch nextgroup=typescriptFuncCallArg
@@ -1274,7 +1317,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptResponseMethod
hi def link typescriptResponseMethod Keyword
"runtime syntax/yats/web-service-worker.vim
syntax keyword typescriptServiceWorkerProp contained controller ready
syntax cluster props add=typescriptServiceWorkerProp
hi def link typescriptServiceWorkerProp Keyword
@@ -1287,7 +1329,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptCacheMethod
hi def link typescriptCacheMethod Keyword
"runtime syntax/yats/web-encoding.vim
syntax keyword typescriptEncodingGlobal containedin=typescriptIdentifierName TextEncoder
syntax keyword typescriptEncodingGlobal containedin=typescriptIdentifierName TextDecoder
hi def link typescriptEncodingGlobal Structure
@@ -1298,21 +1339,18 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptEncodingMethod
hi def link typescriptEncodingMethod Keyword
"runtime syntax/yats/web-geo.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Geolocation
syntax keyword typescriptGeolocationMethod contained getCurrentPosition watchPosition nextgroup=typescriptFuncCallArg
syntax keyword typescriptGeolocationMethod contained clearWatch nextgroup=typescriptFuncCallArg
syntax cluster props add=typescriptGeolocationMethod
hi def link typescriptGeolocationMethod Keyword
"runtime syntax/yats/web-network.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName NetworkInformation
syntax keyword typescriptBOMNetworkProp contained downlink downlinkMax effectiveType
syntax keyword typescriptBOMNetworkProp contained rtt type
syntax cluster props add=typescriptBOMNetworkProp
hi def link typescriptBOMNetworkProp Keyword
"runtime syntax/yats/web-payment.vim
syntax keyword typescriptGlobal containedin=typescriptIdentifierName PaymentRequest
syntax keyword typescriptPaymentMethod contained show abort canMakePayment nextgroup=typescriptFuncCallArg
syntax cluster props add=typescriptPaymentMethod
@@ -1340,7 +1378,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptPaymentShippingOptionProp
hi def link typescriptPaymentShippingOptionProp Keyword
"runtime syntax/yats/dom-node.vim
syntax keyword typescriptDOMNodeProp contained attributes baseURI baseURIObject childNodes
syntax keyword typescriptDOMNodeProp contained firstChild lastChild localName namespaceURI
syntax keyword typescriptDOMNodeProp contained nextSibling nodeName nodePrincipal
@@ -1364,7 +1401,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptDOMNodeType contained DOCUMENT_FRAGMENT_NODE NOTATION_NODE
hi def link typescriptDOMNodeType Keyword
"runtime syntax/yats/dom-elem.vim
syntax keyword typescriptDOMElemAttrs contained accessKey clientHeight clientLeft
syntax keyword typescriptDOMElemAttrs contained clientTop clientWidth id innerHTML
syntax keyword typescriptDOMElemAttrs contained length onafterscriptexecute onbeforescriptexecute
@@ -1387,7 +1423,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax keyword typescriptDOMElemFuncs contained getAttribute
hi def link typescriptDOMElemFuncs Keyword
"runtime syntax/yats/dom-document.vim
syntax keyword typescriptDOMDocProp contained activeElement body cookie defaultView
syntax keyword typescriptDOMDocProp contained designMode dir domain embeds forms head
syntax keyword typescriptDOMDocProp contained images lastModified links location plugins
@@ -1419,7 +1454,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptDOMDocMethod
hi def link typescriptDOMDocMethod Keyword
"runtime syntax/yats/dom-event.vim
syntax keyword typescriptDOMEventTargetMethod contained addEventListener removeEventListener nextgroup=typescriptEventFuncCallArg
syntax keyword typescriptDOMEventTargetMethod contained dispatchEvent waitUntil nextgroup=typescriptEventFuncCallArg
syntax cluster props add=typescriptDOMEventTargetMethod
@@ -1480,7 +1514,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptDOMEventMethod
hi def link typescriptDOMEventMethod Keyword
"runtime syntax/yats/dom-storage.vim
syntax keyword typescriptDOMStorage contained sessionStorage localStorage
hi def link typescriptDOMStorage Keyword
syntax keyword typescriptDOMStorageProp contained length
@@ -1491,7 +1524,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptDOMStorageMethod
hi def link typescriptDOMStorageMethod Keyword
"runtime syntax/yats/dom-form.vim
syntax keyword typescriptDOMFormProp contained acceptCharset action elements encoding
syntax keyword typescriptDOMFormProp contained enctype length method name target
syntax cluster props add=typescriptDOMFormProp
@@ -1500,7 +1532,6 @@ if get(g:, 'yats_host_keyword', 1)
syntax cluster props add=typescriptDOMFormMethod
hi def link typescriptDOMFormMethod Keyword
"runtime syntax/yats/css.vim
syntax keyword typescriptDOMStyle contained alignContent alignItems alignSelf animation
syntax keyword typescriptDOMStyle contained animationDelay animationDirection animationDuration
syntax keyword typescriptDOMStyle contained animationFillMode animationIterationCount
@@ -1575,8 +1606,6 @@ if get(g:, 'yats_host_keyword', 1)
let typescript_props = 1
"runtime syntax/yats/event.vim
syntax keyword typescriptAnimationEvent contained animationend animationiteration
syntax keyword typescriptAnimationEvent contained animationstart beginEvent endEvent
syntax keyword typescriptAnimationEvent contained repeatEvent
@@ -1710,14 +1739,12 @@ if get(g:, 'yats_host_keyword', 1)
endif
" patch
"runtime syntax/basic/patch.vim
" patch for generated code
syntax keyword typescriptGlobal Promise
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
syntax keyword typescriptGlobal Map WeakMap
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
"runtime syntax/basic/members.vim
syntax keyword typescriptConstructor contained constructor
\ nextgroup=@typescriptCallSignature
\ skipwhite skipempty
@@ -1725,7 +1752,7 @@ syntax keyword typescriptConstructor contained constructor
syntax cluster memberNextGroup contains=typescriptMemberOptionality,typescriptTypeAnnotation,@typescriptCallSignature
syntax match typescriptMember /\K\k*/
syntax match typescriptMember /#\?\K\k*/
\ nextgroup=@memberNextGroup
\ contained skipwhite
@@ -1765,7 +1792,6 @@ syntax region typescriptComputedMember contained matchgroup=typescriptPropert
\ nextgroup=@memberNextGroup
\ skipwhite skipempty
"runtime syntax/basic/class.vim
"don't add typescriptMembers to nextgroup, let outer scope match it
" so we won't match abstract method outside abstract class
syntax keyword typescriptAbstract abstract
@@ -1781,7 +1807,7 @@ syntax match typescriptClassName contained /\K\k*/
syntax region typescriptClassTypeParameter
\ start=/</ end=/>/
\ contains=typescriptTypeParameter
\ contains=@typescriptTypeParameterCluster
\ nextgroup=typescriptClassBlock,typescriptClassExtends
\ contained skipwhite skipnl
@@ -1813,7 +1839,7 @@ syntax match typescriptInterfaceName contained /\k\+/
\ skipwhite skipnl
syntax region typescriptInterfaceTypeParameter
\ start=/</ end=/>/
\ contains=typescriptTypeParameter
\ contains=@typescriptTypeParameterCluster
\ nextgroup=typescriptObjectType,typescriptInterfaceExtends
\ contained
\ skipwhite skipnl
@@ -1832,7 +1858,6 @@ syntax region typescriptInterfaceTypeArguments matchgroup=typescriptTypeBrackets
syntax match typescriptInterfaceComma /,/ contained nextgroup=typescriptInterfaceHeritage skipwhite skipnl
"runtime syntax/basic/cluster.vim
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
syntax cluster typescriptStatement
\ contains=typescriptBlock,typescriptVariable,
@@ -1872,7 +1897,6 @@ syntax cluster typescriptValue
syntax cluster typescriptEventExpression contains=typescriptArrowFuncDef,typescriptParenExp,@typescriptValue,typescriptRegexpString,@typescriptEventTypes,typescriptOperator,typescriptGlobal,jsxRegion
"runtime syntax/basic/function.vim
syntax keyword typescriptAsyncFuncKeyword async
\ nextgroup=typescriptFuncKeyword,typescriptArrowFuncDef
\ skipwhite
@@ -1894,7 +1918,7 @@ syntax match typescriptFuncName contained /\K\k*/
\ skipwhite
" destructuring ({ a: ee }) =>
syntax match typescriptArrowFuncDef contained /({\_[^}]*}\(:\_[^)]\)\?)\s*=>/
syntax match typescriptArrowFuncDef contained /(\(\s*\({\_[^}]*}\|\k\+\)\(:\_[^)]\)\?,\?\)\+)\s*=>/
\ contains=typescriptArrowFuncArg,typescriptArrowFunc
\ nextgroup=@typescriptExpression,typescriptBlock
\ skipwhite skipempty
@@ -1913,7 +1937,7 @@ syntax match typescriptArrowFuncDef contained /\K\k*\s*=>/
\ skipwhite skipempty
" TODO: optimize this pattern
syntax region typescriptArrowFuncDef contained start=/(\_[^)]*):/ end=/=>/
syntax region typescriptArrowFuncDef contained start=/(\_[^(^)]*):/ end=/=>/
\ contains=typescriptArrowFuncArg,typescriptArrowFunc,typescriptTypeAnnotation
\ nextgroup=@typescriptExpression,typescriptBlock
\ skipwhite skipempty keepend
@@ -1925,7 +1949,7 @@ syntax region typescriptArrowFuncArg contained start=/<\|(/ end=/\ze=>
syntax region typescriptReturnAnnotation contained start=/:/ end=/{/me=e-1 contains=@typescriptType nextgroup=typescriptBlock
syntax region typescriptFuncImpl contained start=/function/ end=/{/me=e-1
syntax region typescriptFuncImpl contained start=/function\>/ end=/{/me=e-1
\ contains=typescriptFuncKeyword
\ nextgroup=typescriptBlock
@@ -1941,9 +1965,8 @@ syntax region typescriptParamImpl matchgroup=typescriptParens
\ nextgroup=typescriptReturnAnnotation,typescriptBlock
\ contained skipwhite skipnl
"runtime syntax/basic/decorator.vim
syntax match typescriptDecorator /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
\ nextgroup=typescriptArgumentList,typescriptTypeArguments
\ nextgroup=typescriptFuncCallArg,typescriptTypeArguments
\ contains=@_semantic,typescriptDotNotation
" Define the default highlighting.
@@ -1957,6 +1980,7 @@ hi def link typescriptComment Comment
hi def link typescriptLineComment Comment
hi def link typescriptDocComment Comment
hi def link typescriptCommentTodo Todo
hi def link typescriptMagicComment SpecialComment
hi def link typescriptRef Include
hi def link typescriptDocNotation SpecialComment
hi def link typescriptDocTags SpecialComment
@@ -1970,9 +1994,11 @@ hi def link typescriptDocParamType Type
hi def link typescriptString String
hi def link typescriptSpecial Special
hi def link typescriptStringLiteralType String
hi def link typescriptTemplateLiteralType String
hi def link typescriptStringMember String
hi def link typescriptTemplate String
hi def link typescriptEventString String
hi def link typescriptDestructureString String
hi def link typescriptASCII Special
hi def link typescriptTemplateSB Label
hi def link typescriptRegexpString String
@@ -1986,6 +2012,7 @@ hi def link typescriptDefault typescriptCase
hi def link typescriptBranch Conditional
hi def link typescriptIdentifier Structure
hi def link typescriptVariable Identifier
hi def link typescriptDestructureVariable PreProc
hi def link typescriptEnumKeyword Identifier
hi def link typescriptRepeat Repeat
hi def link typescriptForOperator Repeat
@@ -1997,14 +2024,17 @@ hi def link typescriptCastKeyword Special
hi def link typescriptType Type
hi def link typescriptNull Boolean
hi def link typescriptNumber Number
hi def link typescriptExponent Number
hi def link typescriptBoolean Boolean
hi def link typescriptObjectLabel typescriptLabel
hi def link typescriptDestructureLabel Function
hi def link typescriptLabel Label
hi def link typescriptTupleLable Label
hi def link typescriptStringProperty String
hi def link typescriptImport Special
hi def link typescriptImportType Special
hi def link typescriptAmbientDeclaration Special
hi def link typescriptExport Special
hi def link typescriptExportType Special
hi def link typescriptModule Special
hi def link typescriptTry Special
hi def link typescriptExceptions Special
@@ -2013,6 +2043,7 @@ hi def link typescriptMember Function
hi def link typescriptMethodAccessor Operator
hi def link typescriptAsyncFuncKeyword Keyword
hi def link typescriptObjectAsyncKeyword Keyword
hi def link typescriptAsyncFor Keyword
hi def link typescriptFuncKeyword Keyword
hi def link typescriptAsyncFunc Keyword

View File

@@ -2,7 +2,7 @@
" This is a GENERATED FILE. Please always refer to source file at the URI below.
" Language: XKB (X Keyboard Extension) components
" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
" Last Change: 2020 Oct 06
" Last Change: 2020 Oct 18
" URL: http://trific.ath.cx/Ftp/vim/syntax/xkb.vim
" Setup
@@ -41,7 +41,7 @@ syn match xkbPhysicalKey "<\w\+>"
syn keyword xkbPreproc augment include replace
syn keyword xkbConstant False True
syn keyword xkbModif override replace
syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width
syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width
syn keyword xkbFunction AnyOf ISOLock LatchGroup LatchMods LockControls LockGroup LockMods LockPointerButton MovePtr NoAction PointerButton SetControls SetGroup SetMods SetPtrDflt Terminate
syn keyword xkbTModif default hidden partial virtual
syn keyword xkbSect alphanumeric_keys alternate_group function_keys keypad_keys modifier_keys xkb_compatibility xkb_geometry xkb_keycodes xkb_keymap xkb_semantics xkb_symbols xkb_types

View File

@@ -264,11 +264,6 @@ For building 64 bit binaries you also need to install the SDK:
"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
You don't need the examples and documentation.
If you get an error that Win32.mak can't be found, you have to set the
variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC
puts include files in the following directory:
set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
2. MSYS2 with MinGW
===================

View File

@@ -1055,17 +1055,23 @@ install.exe: dosinst.c dosinst.h version.h
uninstall.exe: uninstall.c dosinst.h version.h
$(CC) $(CFLAGS) -o uninstall.exe uninstall.c $(LIB) -lole32
$(OBJ): | $(OUTDIR)
$(EXEOBJG): | $(OUTDIR)
$(EXEOBJC): | $(OUTDIR)
ifeq ($(VIMDLL),yes)
$(TARGET): $(OUTDIR) $(OBJ)
$(TARGET): $(OBJ)
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
$(GVIMEXE): $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll
$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
$(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
$(VIMEXE): $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll
$(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
$(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
else
$(TARGET): $(OUTDIR) $(OBJ)
$(TARGET): $(OBJ)
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
endif
@@ -1280,7 +1286,7 @@ $(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS)
$(CC) -c $(CFLAGS) $< -o $@
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak | $(OUTDIR)
ifneq (sh.exe, $(SHELL))
@echo creating $(PATHDEF_SRC)
@echo '/* pathdef.c */' > $(PATHDEF_SRC)

View File

@@ -15,11 +15,7 @@
# This will build the console version of Vim with no additional interfaces.
# To add features, define any of the following:
#
# For MSVC 11, if you want to include Win32.mak, you need to specify
# where the file is, e.g.:
# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
#
# !!!! After changing features do "nmake clean" first !!!!
# !!!! After changing any features do "nmake clean" first !!!!
#
# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE)
#
@@ -209,9 +205,6 @@ OBJDIR = $(OBJDIR)V
OBJDIR = $(OBJDIR)d
!endif
# If you include Win32.mak, it requires that CPU be set appropriately.
# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
!ifdef PROCESSOR_ARCHITECTURE
# We're on Windows NT or using VC 6+
! ifdef CPU
@@ -251,18 +244,7 @@ NODEBUG = 1
MAKEFLAGS_GVIMEXT = DEBUG=yes
!endif
# Get all sorts of useful, standard macros from the Platform SDK,
# if SDK_INCLUDE_DIR is set or USE_WIN32MAK is set to "yes".
!ifdef SDK_INCLUDE_DIR
! include $(SDK_INCLUDE_DIR)\Win32.mak
!elseif "$(USE_WIN32MAK)"=="yes"
! include <Win32.mak>
!else
link = link
!endif
# Check VC version.
!if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul]

View File

@@ -657,7 +657,7 @@ do_argfile(exarg_T *eap, int argn)
#endif
// split window or create new tab page first
if (*eap->cmd == 's' || cmdmod.tab != 0)
if (*eap->cmd == 's' || cmdmod.cmod_tab != 0)
{
if (win_split(0, 0) == FAIL)
return;
@@ -878,7 +878,7 @@ do_arg_all(
alist_T *alist; // argument list to be used
buf_T *buf;
tabpage_T *tpnext;
int had_tab = cmdmod.tab;
int had_tab = cmdmod.cmod_tab;
win_T *old_curwin, *last_curwin;
tabpage_T *old_curtab, *last_curtab;
win_T *new_curwin = NULL;
@@ -1116,7 +1116,7 @@ do_arg_all(
// When ":tab" was used open a new tab for a new window repeatedly.
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
cmdmod.tab = 9999;
cmdmod.cmod_tab = 9999;
}
// Remove the "lock" on the argument list.

View File

@@ -149,6 +149,7 @@ static struct event_name
{"InsertChange", EVENT_INSERTCHANGE},
{"InsertEnter", EVENT_INSERTENTER},
{"InsertLeave", EVENT_INSERTLEAVE},
{"InsertLeavePre", EVENT_INSERTLEAVEPRE},
{"InsertCharPre", EVENT_INSERTCHARPRE},
{"MenuPopup", EVENT_MENUPOPUP},
{"OptionSet", EVENT_OPTIONSET},
@@ -1432,9 +1433,9 @@ aucmd_prepbuf(
// window. Expect a few side effects...
win = curwin;
aco->save_curwin = curwin;
aco->save_curwin_id = curwin->w_id;
aco->save_curbuf = curbuf;
aco->save_prevwin = prevwin;
aco->save_prevwin_id = prevwin == NULL ? 0 : prevwin->w_id;
if (win != NULL)
{
// There is a window for "buf" in the current tab page, make it the
@@ -1480,7 +1481,7 @@ aucmd_prepbuf(
curwin = aucmd_win;
}
curbuf = buf;
aco->new_curwin = curwin;
aco->new_curwin_id = curwin->w_id;
set_bufref(&aco->new_curbuf, curbuf);
}
@@ -1492,7 +1493,8 @@ aucmd_prepbuf(
aucmd_restbuf(
aco_save_T *aco) // structure holding saved values
{
int dummy;
int dummy;
win_T *save_curwin;
if (aco->use_aucmd_win)
{
@@ -1532,8 +1534,9 @@ win_found:
(void)win_comp_pos(); // recompute window positions
unblock_autocmds();
if (win_valid(aco->save_curwin))
curwin = aco->save_curwin;
save_curwin = win_find_by_id(aco->save_curwin_id);
if (save_curwin != NULL)
curwin = save_curwin;
else
// Hmm, original window disappeared. Just use the first one.
curwin = firstwin;
@@ -1542,9 +1545,7 @@ win_found:
// May need to restore insert mode for a prompt buffer.
entering_window(curwin);
#endif
if (win_valid(aco->save_prevwin))
prevwin = aco->save_prevwin;
prevwin = win_find_by_id(aco->save_prevwin_id);
#ifdef FEAT_EVAL
vars_clear(&aucmd_win->w_vars->dv_hashtab); // free all w: variables
hash_init(&aucmd_win->w_vars->dv_hashtab); // re-use the hashtab
@@ -1570,13 +1571,15 @@ win_found:
}
else
{
// restore curwin
if (win_valid(aco->save_curwin))
// Restore curwin. Use the window ID, a window may have been closed
// and the memory re-used for another one.
save_curwin = win_find_by_id(aco->save_curwin_id);
if (save_curwin != NULL)
{
// Restore the buffer which was previously edited by curwin, if
// it was changed, we are still the same window and the buffer is
// valid.
if (curwin == aco->new_curwin
if (curwin->w_id == aco->new_curwin_id
&& curbuf != aco->new_curbuf.br_buf
&& bufref_valid(&aco->new_curbuf)
&& aco->new_curbuf.br_buf->b_ml.ml_mfp != NULL)
@@ -1591,10 +1594,9 @@ win_found:
++curbuf->b_nwindows;
}
curwin = aco->save_curwin;
curwin = save_curwin;
curbuf = curwin->w_buffer;
if (win_valid(aco->save_prevwin))
prevwin = aco->save_prevwin;
prevwin = win_find_by_id(aco->save_prevwin_id);
// In case the autocommand moves the cursor to a position that
// does not exist in curbuf.
check_cursor();

View File

@@ -80,6 +80,7 @@ blob_copy(blob_T *from, typval_T *to)
len = 0;
}
to->vval.v_blob->bv_ga.ga_len = len;
to->vval.v_blob->bv_ga.ga_maxlen = len;
}
return ret;
}

View File

@@ -673,7 +673,7 @@ aucmd_abort:
buf->b_nwindows = nwindows;
buf_freeall(buf, (del_buf ? BFA_DEL : 0)
+ (wipe_buf ? BFA_WIPE : 0)
+ (wipe_buf ? BFA_WIPE : 0)
+ (ignore_abort ? BFA_IGNORE_ABORT : 0));
// Autocommands may have deleted the buffer.
@@ -1005,6 +1005,22 @@ free_buffer_stuff(
VIM_CLEAR(buf->b_start_fenc);
}
/*
* Free one wininfo_T.
*/
void
free_wininfo(wininfo_T *wip)
{
if (wip->wi_optset)
{
clear_winopt(&wip->wi_opt);
#ifdef FEAT_FOLDING
deleteFoldRecurse(&wip->wi_folds);
#endif
}
vim_free(wip);
}
/*
* Free the b_wininfo list for buffer "buf".
*/
@@ -1017,14 +1033,7 @@ clear_wininfo(buf_T *buf)
{
wip = buf->b_wininfo;
buf->b_wininfo = wip->wi_next;
if (wip->wi_optset)
{
clear_winopt(&wip->wi_opt);
#ifdef FEAT_FOLDING
deleteFoldRecurse(&wip->wi_folds);
#endif
}
vim_free(wip);
free_wininfo(wip);
}
}
@@ -1444,7 +1453,7 @@ do_buffer(
if (!forceit && bufIsChanged(buf))
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
{
dialog_changed(buf, FALSE);
if (!bufref_valid(&bufref))
@@ -1634,7 +1643,7 @@ do_buffer(
if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit))
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
{
bufref_T bufref;
@@ -1689,7 +1698,7 @@ set_curbuf(buf_T *buf, int action)
bufref_T prevbufref;
setpcmark();
if (!cmdmod.keepalt)
if ((cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
curwin->w_alt_fnum = curbuf->b_fnum; // remember alternate file
buflist_altfpos(curwin); // remember curpos
@@ -1974,7 +1983,8 @@ buflist_new(
{
vim_free(ffname);
if (lnum != 0)
buflist_setfpos(buf, curwin, lnum, (colnr_T)0, FALSE);
buflist_setfpos(buf, (flags & BLN_NOCURWIN) ? NULL : curwin,
lnum, (colnr_T)0, FALSE);
if ((flags & BLN_NOOPT) == 0)
// copy the options now, if 'cpo' doesn't have 's' and not done
@@ -2144,7 +2154,7 @@ buflist_new(
if (top_file_num < 0) // wrap around (may cause duplicates)
{
emsg(_("W14: Warning: List of file names overflow"));
if (emsg_silent == 0)
if (emsg_silent == 0 && !in_assert_fails)
{
out_flush();
ui_delay(3001L, TRUE); // make sure it is noticed
@@ -2908,7 +2918,7 @@ buflist_nr2name(
void
buflist_setfpos(
buf_T *buf,
win_T *win,
win_T *win, // may be NULL when using :badd
linenr_T lnum,
colnr_T col,
int copy_options)
@@ -2950,7 +2960,7 @@ buflist_setfpos(
wip->wi_fpos.lnum = lnum;
wip->wi_fpos.col = col;
}
if (copy_options)
if (copy_options && win != NULL)
{
// Save the window-specific option values.
copy_winopt(&win->w_onebuf_opt, &wip->wi_opt);
@@ -2997,6 +3007,7 @@ wininfo_other_tab_diff(wininfo_T *wip)
/*
* Find info for the current window in buffer "buf".
* If not found, return the info for the most recently used window.
* When "need_options" is TRUE skip entries where wi_optset is FALSE.
* When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in
* another tab page.
* Returns NULL when there isn't any info.
@@ -3004,6 +3015,7 @@ wininfo_other_tab_diff(wininfo_T *wip)
static wininfo_T *
find_wininfo(
buf_T *buf,
int need_options,
int skip_diff_buffer UNUSED)
{
wininfo_T *wip;
@@ -3013,18 +3025,25 @@ find_wininfo(
#ifdef FEAT_DIFF
&& (!skip_diff_buffer || !wininfo_other_tab_diff(wip))
#endif
)
&& (!need_options || wip->wi_optset))
break;
// If no wininfo for curwin, use the first in the list (that doesn't have
// 'diff' set and is in another tab page).
// If "need_options" is TRUE skip entries that don't have options set,
// unless the window is editing "buf", so we can copy from the window
// itself.
if (wip == NULL)
{
#ifdef FEAT_DIFF
if (skip_diff_buffer)
{
FOR_ALL_BUF_WININFO(buf, wip)
if (!wininfo_other_tab_diff(wip))
if (!wininfo_other_tab_diff(wip)
&& (!need_options || wip->wi_optset
|| (wip->wi_win != NULL
&& wip->wi_win->w_buffer == buf)))
break;
}
else
@@ -3050,7 +3069,7 @@ get_winopts(buf_T *buf)
clearFolding(curwin);
#endif
wip = find_wininfo(buf, TRUE);
wip = find_wininfo(buf, TRUE, TRUE);
if (wip != NULL && wip->wi_win != NULL
&& wip->wi_win != curwin && wip->wi_win->w_buffer == buf)
{
@@ -3097,7 +3116,7 @@ buflist_findfpos(buf_T *buf)
wininfo_T *wip;
static pos_T no_position = {1, 0, 0};
wip = find_wininfo(buf, FALSE);
wip = find_wininfo(buf, FALSE, FALSE);
if (wip != NULL)
return &(wip->wi_fpos);
else
@@ -3435,7 +3454,7 @@ setaltfname(
// Create a buffer. 'buflisted' is not set if it's a new buffer
buf = buflist_new(ffname, sfname, lnum, 0);
if (buf != NULL && !cmdmod.keepalt)
if (buf != NULL && (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
curwin->w_alt_fnum = buf->b_fnum;
return buf;
}
@@ -3998,6 +4017,32 @@ free_titles(void)
#endif // FEAT_TITLE
#if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO)
/*
* Used for building in the status line.
*/
typedef struct
{
char_u *stl_start;
int stl_minwid;
int stl_maxwid;
enum {
Normal,
Empty,
Group,
Middle,
Highlight,
TabPage,
Trunc
} stl_type;
} stl_item_T;
static size_t stl_items_len = 20; // Initial value, grows as needed.
static stl_item_T *stl_items = NULL;
static int *stl_groupitem = NULL;
static stl_hlrec_T *stl_hltab = NULL;
static stl_hlrec_T *stl_tabtab = NULL;
/*
* Build a string from the status line items in "fmt".
* Return length of string in screen cells.
@@ -4021,8 +4066,8 @@ build_stl_str_hl(
int use_sandbox UNUSED, // "fmt" was set insecurely, use sandbox
int fillchar,
int maxwidth,
struct stl_hlrec *hltab, // return: HL attributes (can be NULL)
struct stl_hlrec *tabtab) // return: tab page nrs (can be NULL)
stl_hlrec_T **hltab, // return: HL attributes (can be NULL)
stl_hlrec_T **tabtab) // return: tab page nrs (can be NULL)
{
linenr_T lnum;
size_t len;
@@ -4050,24 +4095,7 @@ build_stl_str_hl(
int curitem;
int group_end_userhl;
int group_start_userhl;
int groupitem[STL_MAX_ITEM];
int groupdepth;
struct stl_item
{
char_u *start;
int minwid;
int maxwid;
enum
{
Normal,
Empty,
Group,
Middle,
Highlight,
TabPage,
Trunc
} type;
} item[STL_MAX_ITEM];
int minwid;
int maxwid;
int zeropad;
@@ -4077,10 +4105,18 @@ build_stl_str_hl(
char_u buf_tmp[TMPLEN];
char_u win_tmp[TMPLEN];
char_u *usefmt = fmt;
struct stl_hlrec *sp;
stl_hlrec_T *sp;
int save_must_redraw = must_redraw;
int save_redr_type = curwin->w_redr_type;
if (stl_items == NULL)
{
stl_items = ALLOC_MULT(stl_item_T, stl_items_len);
stl_groupitem = ALLOC_MULT(int, stl_items_len);
stl_hltab = ALLOC_MULT(stl_hlrec_T, stl_items_len);
stl_tabtab = ALLOC_MULT(stl_hlrec_T, stl_items_len);
}
#ifdef FEAT_EVAL
/*
* When the format starts with "%!" then evaluate it as an expression and
@@ -4143,16 +4179,30 @@ build_stl_str_hl(
prevchar_isitem = FALSE;
for (s = usefmt; *s; )
{
if (curitem == STL_MAX_ITEM)
if (curitem == (int)stl_items_len)
{
// There are too many items. Add the error code to the statusline
// to give the user a hint about what went wrong.
if (p + 6 < out + outlen)
{
mch_memmove(p, " E541", (size_t)5);
p += 5;
}
break;
size_t new_len = stl_items_len * 3 / 2;
stl_item_T *new_items;
int *new_groupitem;
stl_hlrec_T *new_hlrec;
new_items = vim_realloc(stl_items, sizeof(stl_item_T) * new_len);
if (new_items == NULL)
break;
stl_items = new_items;
new_groupitem = vim_realloc(stl_groupitem, sizeof(int) * new_len);
if (new_groupitem == NULL)
break;
stl_groupitem = new_groupitem;
new_hlrec = vim_realloc(stl_hltab, sizeof(stl_hlrec_T) * new_len);
if (new_hlrec == NULL)
break;
stl_hltab = new_hlrec;
new_hlrec = vim_realloc(stl_tabtab, sizeof(stl_hlrec_T) * new_len);
if (new_hlrec == NULL)
break;
stl_tabtab = new_hlrec;
stl_items_len = new_len;
}
if (*s != NUL && *s != '%')
@@ -4185,15 +4235,15 @@ build_stl_str_hl(
s++;
if (groupdepth > 0)
continue;
item[curitem].type = Middle;
item[curitem++].start = p;
stl_items[curitem].stl_type = Middle;
stl_items[curitem++].stl_start = p;
continue;
}
if (*s == STL_TRUNCMARK)
{
s++;
item[curitem].type = Trunc;
item[curitem++].start = p;
stl_items[curitem].stl_type = Trunc;
stl_items[curitem++].stl_start = p;
continue;
}
if (*s == ')')
@@ -4203,83 +4253,85 @@ build_stl_str_hl(
continue;
groupdepth--;
t = item[groupitem[groupdepth]].start;
t = stl_items[stl_groupitem[groupdepth]].stl_start;
*p = NUL;
l = vim_strsize(t);
if (curitem > groupitem[groupdepth] + 1
&& item[groupitem[groupdepth]].minwid == 0)
if (curitem > stl_groupitem[groupdepth] + 1
&& stl_items[stl_groupitem[groupdepth]].stl_minwid == 0)
{
// remove group if all items are empty and highlight group
// doesn't change
group_start_userhl = group_end_userhl = 0;
for (n = groupitem[groupdepth] - 1; n >= 0; n--)
for (n = stl_groupitem[groupdepth] - 1; n >= 0; n--)
{
if (item[n].type == Highlight)
if (stl_items[n].stl_type == Highlight)
{
group_start_userhl = group_end_userhl = item[n].minwid;
group_start_userhl = group_end_userhl =
stl_items[n].stl_minwid;
break;
}
}
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
{
if (item[n].type == Normal)
if (stl_items[n].stl_type == Normal)
break;
if (item[n].type == Highlight)
group_end_userhl = item[n].minwid;
if (stl_items[n].stl_type == Highlight)
group_end_userhl = stl_items[n].stl_minwid;
}
if (n == curitem && group_start_userhl == group_end_userhl)
{
// empty group
p = t;
l = 0;
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
{
// do not use the highlighting from the removed group
if (item[n].type == Highlight)
item[n].type = Empty;
if (stl_items[n].stl_type == Highlight)
stl_items[n].stl_type = Empty;
// adjust the start position of TabPage to the next
// item position
if (item[n].type == TabPage)
item[n].start = p;
if (stl_items[n].stl_type == TabPage)
stl_items[n].stl_start = p;
}
}
}
if (l > item[groupitem[groupdepth]].maxwid)
if (l > stl_items[stl_groupitem[groupdepth]].stl_maxwid)
{
// truncate, remove n bytes of text at the start
if (has_mbyte)
{
// Find the first character that should be included.
n = 0;
while (l >= item[groupitem[groupdepth]].maxwid)
while (l >= stl_items[stl_groupitem[groupdepth]].stl_maxwid)
{
l -= ptr2cells(t + n);
n += (*mb_ptr2len)(t + n);
}
}
else
n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1;
n = (long)(p - t) - stl_items[stl_groupitem[groupdepth]]
.stl_maxwid + 1;
*t = '<';
mch_memmove(t + 1, t + n, (size_t)(p - (t + n)));
p = p - n + 1;
// Fill up space left over by half a double-wide char.
while (++l < item[groupitem[groupdepth]].minwid)
while (++l < stl_items[stl_groupitem[groupdepth]].stl_minwid)
*p++ = fillchar;
// correct the start of the items for the truncation
for (l = groupitem[groupdepth] + 1; l < curitem; l++)
for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
{
item[l].start -= n;
if (item[l].start < t)
item[l].start = t;
stl_items[l].stl_start -= n;
if (stl_items[l].stl_start < t)
stl_items[l].stl_start = t;
}
}
else if (abs(item[groupitem[groupdepth]].minwid) > l)
else if (abs(stl_items[stl_groupitem[groupdepth]].stl_minwid) > l)
{
// fill
n = item[groupitem[groupdepth]].minwid;
n = stl_items[stl_groupitem[groupdepth]].stl_minwid;
if (n < 0)
{
// fill by appending characters
@@ -4295,8 +4347,8 @@ build_stl_str_hl(
if (p + l >= out + outlen)
l = (long)((out + outlen) - p - 1);
p += l;
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
item[n].start += l;
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
stl_items[n].stl_start += l;
for ( ; l > 0; l--)
*t++ = fillchar;
}
@@ -4325,9 +4377,9 @@ build_stl_str_hl(
}
if (*s == STL_USER_HL)
{
item[curitem].type = Highlight;
item[curitem].start = p;
item[curitem].minwid = minwid > 9 ? 1 : minwid;
stl_items[curitem].stl_type = Highlight;
stl_items[curitem].stl_start = p;
stl_items[curitem].stl_minwid = minwid > 9 ? 1 : minwid;
s++;
curitem++;
continue;
@@ -4341,9 +4393,10 @@ build_stl_str_hl(
// %X ends the close label, go back to the previously
// define tab label nr.
for (n = curitem - 1; n >= 0; --n)
if (item[n].type == TabPage && item[n].minwid >= 0)
if (stl_items[n].stl_type == TabPage
&& stl_items[n].stl_minwid >= 0)
{
minwid = item[n].minwid;
minwid = stl_items[n].stl_minwid;
break;
}
}
@@ -4351,9 +4404,9 @@ build_stl_str_hl(
// close nrs are stored as negative values
minwid = - minwid;
}
item[curitem].type = TabPage;
item[curitem].start = p;
item[curitem].minwid = minwid;
stl_items[curitem].stl_type = TabPage;
stl_items[curitem].stl_start = p;
stl_items[curitem].stl_minwid = minwid;
s++;
curitem++;
continue;
@@ -4371,11 +4424,11 @@ build_stl_str_hl(
minwid = (minwid > 50 ? 50 : minwid) * l;
if (*s == '(')
{
groupitem[groupdepth++] = curitem;
item[curitem].type = Group;
item[curitem].start = p;
item[curitem].minwid = minwid;
item[curitem].maxwid = maxwid;
stl_groupitem[groupdepth++] = curitem;
stl_items[curitem].stl_type = Group;
stl_items[curitem].stl_start = p;
stl_items[curitem].stl_minwid = minwid;
stl_items[curitem].stl_maxwid = maxwid;
s++;
curitem++;
continue;
@@ -4628,9 +4681,9 @@ build_stl_str_hl(
++s;
if (*s == '#')
{
item[curitem].type = Highlight;
item[curitem].start = p;
item[curitem].minwid = -syn_namen2id(t, (int)(s - t));
stl_items[curitem].stl_type = Highlight;
stl_items[curitem].stl_start = p;
stl_items[curitem].stl_minwid = -syn_namen2id(t, (int)(s - t));
curitem++;
}
if (*s != NUL)
@@ -4638,8 +4691,8 @@ build_stl_str_hl(
continue;
}
item[curitem].start = p;
item[curitem].type = Normal;
stl_items[curitem].stl_start = p;
stl_items[curitem].stl_type = Normal;
if (str != NULL && *str)
{
t = str;
@@ -4738,7 +4791,7 @@ build_stl_str_hl(
p += STRLEN(p);
}
else
item[curitem].type = Empty;
stl_items[curitem].stl_type = Empty;
if (opt == STL_VIM_EXPR)
vim_free(str);
@@ -4765,16 +4818,16 @@ build_stl_str_hl(
else
{
for ( ; l < itemcnt; l++)
if (item[l].type == Trunc)
if (stl_items[l].stl_type == Trunc)
{
// Truncate at %< item.
s = item[l].start;
s = stl_items[l].stl_start;
break;
}
if (l == itemcnt)
{
// No %< item, truncate first item.
s = item[0].start;
s = stl_items[0].stl_start;
l = 0;
}
}
@@ -4800,7 +4853,7 @@ build_stl_str_hl(
else
s = out + maxwidth - 1;
for (l = 0; l < itemcnt; l++)
if (item[l].start > s)
if (stl_items[l].stl_start > s)
break;
itemcnt = l;
*s++ = '>';
@@ -4834,10 +4887,10 @@ build_stl_str_hl(
--n; // count the '<'
for (; l < itemcnt; l++)
{
if (item[l].start - n >= s)
item[l].start -= n;
if (stl_items[l].stl_start - n >= s)
stl_items[l].stl_start -= n;
else
item[l].start = s;
stl_items[l].stl_start = s;
}
}
width = maxwidth;
@@ -4846,16 +4899,16 @@ build_stl_str_hl(
{
// Apply STL_MIDDLE if any
for (l = 0; l < itemcnt; l++)
if (item[l].type == Middle)
if (stl_items[l].stl_type == Middle)
break;
if (l < itemcnt)
{
p = item[l].start + maxwidth - width;
STRMOVE(p, item[l].start);
for (s = item[l].start; s < p; s++)
p = stl_items[l].stl_start + maxwidth - width;
STRMOVE(p, stl_items[l].stl_start);
for (s = stl_items[l].stl_start; s < p; s++)
*s = fillchar;
for (l++; l < itemcnt; l++)
item[l].start += maxwidth - width;
stl_items[l].stl_start += maxwidth - width;
width = maxwidth;
}
}
@@ -4863,13 +4916,14 @@ build_stl_str_hl(
// Store the info about highlighting.
if (hltab != NULL)
{
sp = hltab;
*hltab = stl_hltab;
sp = stl_hltab;
for (l = 0; l < itemcnt; l++)
{
if (item[l].type == Highlight)
if (stl_items[l].stl_type == Highlight)
{
sp->start = item[l].start;
sp->userhl = item[l].minwid;
sp->start = stl_items[l].stl_start;
sp->userhl = stl_items[l].stl_minwid;
sp++;
}
}
@@ -4880,13 +4934,14 @@ build_stl_str_hl(
// Store the info about tab pages labels.
if (tabtab != NULL)
{
sp = tabtab;
*tabtab = stl_tabtab;
sp = stl_tabtab;
for (l = 0; l < itemcnt; l++)
{
if (item[l].type == TabPage)
if (stl_items[l].stl_type == TabPage)
{
sp->start = item[l].start;
sp->userhl = item[l].minwid;
sp->start = stl_items[l].stl_start;
sp->userhl = stl_items[l].stl_minwid;
sp++;
}
}
@@ -5068,7 +5123,7 @@ ex_buffer_all(exarg_T *eap)
int r;
int count; // Maximum number of windows to open.
int all; // When TRUE also load inactive buffers.
int had_tab = cmdmod.tab;
int had_tab = cmdmod.cmod_tab;
tabpage_T *tpnext;
if (eap->addr_count == 0) // make as many windows as possible
@@ -5099,7 +5154,7 @@ ex_buffer_all(exarg_T *eap)
{
wpnext = wp->w_next;
if ((wp->w_buffer->b_nwindows > 1
|| ((cmdmod.split & WSP_VERT)
|| ((cmdmod.cmod_split & WSP_VERT)
? wp->w_height + wp->w_status_height < Rows - p_ch
- tabline_height()
: wp->w_width != Columns)
@@ -5220,7 +5275,7 @@ ex_buffer_all(exarg_T *eap)
#endif
// When ":tab" was used open a new tab for a new window repeatedly.
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
cmdmod.tab = 9999;
cmdmod.cmod_tab = 9999;
}
--autocmd_no_enter;
win_enter(firstwin, FALSE); // back to first window
@@ -5515,8 +5570,8 @@ bt_nofile(buf_T *buf)
bt_dontwrite(buf_T *buf)
{
return buf != NULL && (buf->b_p_bt[0] == 'n'
|| buf->b_p_bt[0] == 't'
|| buf->b_p_bt[0] == 'p');
|| buf->b_p_bt[0] == 't'
|| buf->b_p_bt[0] == 'p');
}
#if defined(FEAT_QUICKFIX) || defined(PROTO)
@@ -5547,7 +5602,7 @@ buf_hide(buf_T *buf)
case 'd': return FALSE; // "delete"
case 'h': return TRUE; // "hide"
}
return (p_hid || cmdmod.hide);
return (p_hid || (cmdmod.cmod_flags & CMOD_HIDE));
}
/*
@@ -5593,10 +5648,21 @@ buf_spname(buf_T *buf)
}
if (buf->b_fname == NULL)
return (char_u *)_("[No Name]");
return buf_get_fname(buf);
return NULL;
}
/*
* Get "buf->b_fname", use "[No Name]" if it is NULL.
*/
char_u *
buf_get_fname(buf_T *buf)
{
if (buf->b_fname == NULL)
return (char_u *)_("[No Name]");
return buf->b_fname;
}
/*
* Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
*/

View File

@@ -883,7 +883,7 @@ buf_write(
#endif
)
{
if (buf != NULL && cmdmod.lockmarks)
if (buf != NULL && (cmdmod.cmod_flags & CMOD_LOCKMARKS))
{
// restore the original '[ and '] positions
buf->b_op_start = orig_start;
@@ -967,7 +967,7 @@ buf_write(
fname = buf->b_sfname;
}
if (cmdmod.lockmarks)
if (cmdmod.cmod_flags & CMOD_LOCKMARKS)
{
// restore the original '[ and '] positions
buf->b_op_start = orig_start;

View File

@@ -115,7 +115,7 @@ changed(void)
// Wait two seconds, to make sure the user reads this unexpected
// message. Since we could be anywhere, call wait_return() now,
// and don't let the emsg() set msg_scroll.
if (need_wait_return && emsg_silent == 0)
if (need_wait_return && emsg_silent == 0 && !in_assert_fails)
{
out_flush();
ui_delay(2002L, TRUE);
@@ -453,7 +453,7 @@ changed_common(
#endif
// set the '. mark
if (!cmdmod.keepjumps)
if ((cmdmod.cmod_flags & CMOD_KEEPJUMPS) == 0)
{
curbuf->b_last_change.lnum = lnum;
curbuf->b_last_change.col = col;

View File

@@ -304,7 +304,7 @@ add_to_history(
if (hislen == 0) // no history
return;
if (cmdmod.keeppatterns && histype == HIST_SEARCH)
if ((cmdmod.cmod_flags & CMOD_KEEPPATTERNS) && histype == HIST_SEARCH)
return;
// Searches inside the same mapping overwrite each other, so that only

View File

@@ -22,6 +22,7 @@ static dict_T *first_dict = NULL;
/*
* Allocate an empty header for a dictionary.
* Caller should take care of the reference count.
*/
dict_T *
dict_alloc(void)
@@ -950,7 +951,7 @@ failret:
return FAIL;
}
*arg = skipwhite(*arg + 1);
*arg = *arg + 1;
if (evaluate)
rettv_dict_set(rettv, d);

View File

@@ -775,7 +775,7 @@ diff_write(buf_T *buf, diffin_T *din)
{
int r;
char_u *save_ff;
int save_lockmarks;
int save_cmod_flags;
if (din->din_fname == NULL)
return diff_write_buffer(buf, din);
@@ -783,14 +783,14 @@ diff_write(buf_T *buf, diffin_T *din)
// Always use 'fileformat' set to "unix".
save_ff = buf->b_p_ff;
buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
save_lockmarks = cmdmod.lockmarks;
save_cmod_flags = cmdmod.cmod_flags;
// Writing the buffer is an implementation detail of performing the diff,
// so it shouldn't update the '[ and '] marks.
cmdmod.lockmarks = TRUE;
cmdmod.cmod_flags |= CMOD_LOCKMARKS;
r = buf_write(buf, din->din_fname, NULL,
(linenr_T)1, buf->b_ml.ml_line_count,
NULL, FALSE, FALSE, FALSE, TRUE);
cmdmod.lockmarks = save_lockmarks;
cmdmod.cmod_flags = save_cmod_flags;
free_string_option(buf->b_p_ff);
buf->b_p_ff = save_ff;
return r;
@@ -1187,13 +1187,13 @@ ex_diffpatch(exarg_T *eap)
#endif
#ifdef FEAT_BROWSE
char_u *browseFile = NULL;
int browse_flag = cmdmod.browse;
int save_cmod_flags = cmdmod.cmod_flags;
#endif
stat_T st;
char_u *esc_name = NULL;
#ifdef FEAT_BROWSE
if (cmdmod.browse)
if (cmdmod.cmod_flags & CMOD_BROWSE)
{
browseFile = do_browse(0, (char_u *)_("Patch file"),
eap->arg, NULL, NULL,
@@ -1201,7 +1201,7 @@ ex_diffpatch(exarg_T *eap)
if (browseFile == NULL)
return; // operation cancelled
eap->arg = browseFile;
cmdmod.browse = FALSE; // don't let do_ecmd() browse again
cmdmod.cmod_flags &= ~CMOD_BROWSE; // don't let do_ecmd() browse again
}
#endif
@@ -1310,7 +1310,7 @@ ex_diffpatch(exarg_T *eap)
need_mouse_correct = TRUE;
#endif
// don't use a new tab page, each tab page has its own diffs
cmdmod.tab = 0;
cmdmod.cmod_tab = 0;
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
{
@@ -1355,7 +1355,7 @@ theend:
vim_free(esc_name);
#ifdef FEAT_BROWSE
vim_free(browseFile);
cmdmod.browse = browse_flag;
cmdmod.cmod_flags = save_cmod_flags;
#endif
}
@@ -1377,7 +1377,7 @@ ex_diffsplit(exarg_T *eap)
set_fraction(curwin);
// don't use a new tab page, each tab page has its own diffs
cmdmod.tab = 0;
cmdmod.cmod_tab = 0;
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
{

View File

@@ -1873,6 +1873,7 @@ win_line(
char_u *prev_ptr, *p;
int len;
hlf_T spell_hlf = HLF_COUNT;
if (has_mbyte)
{
prev_ptr = ptr - mb_l;
@@ -2454,6 +2455,7 @@ win_line(
wp->w_wrow = row;
did_wcol = TRUE;
curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
curwin->w_flags &= ~(WFLAG_WCOL_OFF_ADDED | WFLAG_WROW_OFF_ADDED);
}
#endif
@@ -2778,10 +2780,14 @@ win_line(
// Also highlight the 'colorcolumn' if 'breakindent' and/or 'showbreak'
// options are set
vcol_save_attr = -1;
if ((draw_state == WL_LINE ||
if (((draw_state == WL_LINE ||
draw_state == WL_BRI ||
draw_state == WL_SBR) && !lnum_in_visual_area
&& search_attr == 0 && area_attr == 0)
# ifdef FEAT_DIFF
&& filler_todo <= 0
# endif
)
{
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
&& lnum != wp->w_cursor.lnum)

View File

@@ -1031,6 +1031,15 @@ doESCkey:
case K_IGNORE: // Something mapped to nothing
break;
case K_COMMAND: // <Cmd>command<CR>
do_cmdline(NULL, getcmdkeycmd, NULL, 0);
#ifdef FEAT_TERMINAL
if (term_use_loop())
// Started a terminal that gets the input, exit Insert mode.
goto doESCkey;
#endif
break;
case K_CURSORHOLD: // Didn't type something for a while.
ins_apply_autocmds(EVENT_CURSORHOLDI);
did_cursorhold = TRUE;
@@ -3607,13 +3616,16 @@ ins_esc(
undisplay_dollar();
}
if (cmdchar != 'r' && cmdchar != 'v')
ins_apply_autocmds(EVENT_INSERTLEAVEPRE);
// When an autoindent was removed, curswant stays after the
// indent
if (restart_edit == NUL && (colnr_T)temp == curwin->w_cursor.col)
curwin->w_set_curswant = TRUE;
// Remember the last Insert position in the '^ mark.
if (!cmdmod.keepjumps)
if ((cmdmod.cmod_flags & CMOD_KEEPJUMPS) == 0)
curbuf->b_last_insert = curwin->w_cursor;
/*
@@ -3943,8 +3955,11 @@ ins_bs(
#endif
((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
|| (!can_bs(BS_START)
&& (arrow_used
|| (curwin->w_cursor.lnum == Insstart_orig.lnum
&& ((arrow_used
#ifdef FEAT_JOB_CHANNEL
&& !bt_prompt(curbuf)
#endif
) || (curwin->w_cursor.lnum == Insstart_orig.lnum
&& curwin->w_cursor.col <= Insstart_orig.col)))
|| (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
&& curwin->w_cursor.col <= ai_col)

View File

@@ -27,8 +27,8 @@ EXTERN char e_assert_fails_second_arg[]
INIT(= N_("E856: \"assert_fails()\" second argument must be a string or a list with one or two strings"));
EXTERN char e_cannot_index_special_variable[]
INIT(= N_("E909: Cannot index a special variable"));
EXTERN char e_missing_let_str[]
INIT(= N_("E1100: Missing :let: %s"));
EXTERN char e_missing_var_str[]
INIT(= N_("E1100: Missing :var: %s"));
EXTERN char e_variable_not_found_str[]
INIT(= N_("E1001: Variable not found: %s"));
EXTERN char e_syntax_error_at_str[]
@@ -89,8 +89,8 @@ EXTERN char e_compiling_def_function_failed[]
INIT(= N_("E1028: Compiling :def function failed"));
EXTERN char e_expected_str_but_got_str[]
INIT(= N_("E1029: Expected %s but got %s"));
EXTERN char e_using_string_as_number[]
INIT(= N_("E1030: Using a String as a Number"));
EXTERN char e_using_string_as_number_str[]
INIT(= N_("E1030: Using a String as a Number: \"%s\""));
EXTERN char e_cannot_use_void_value[]
INIT(= N_("E1031: Cannot use void value"));
EXTERN char e_missing_catch_or_finally[]
@@ -282,4 +282,22 @@ EXTERN char e_endblock_without_block[]
INIT(= N_("E1128: } without {"));
EXTERN char e_throw_with_empty_string[]
INIT(= N_("E1129: Throw with empty string"));
EXTERN char e_cannot_add_to_null_list[]
INIT(= N_("E1130: Cannot add to null list"));
EXTERN char e_cannot_add_to_null_blob[]
INIT(= N_("E1131: Cannot add to null blob"));
EXTERN char e_missing_function_argument[]
INIT(= N_("E1132: Missing function argument"));
EXTERN char e_cannot_extend_null_dict[]
INIT(= N_("E1133: Cannot extend a null dict"));
EXTERN char e_cannot_extend_null_list[]
INIT(= N_("E1134: Cannot extend a null list"));
EXTERN char e_using_string_as_bool_str[]
INIT(= N_("E1135: Using a String as a Bool: \"%s\""));
#endif
EXTERN char e_cmd_mapping_must_end_with_cr[]
INIT(=N_("E1135: <Cmd> mapping must end with <CR>"));
EXTERN char e_cmd_mapping_must_end_with_cr_before_second_cmd[]
INIT(=N_("E1136: <Cmd> mapping must end with <CR> before second <Cmd>"));
EXTERN char e_cmd_maping_must_not_include_str_key[]
INIT(= N_("E1137: <Cmd> mapping must not include %s key"));

View File

@@ -368,12 +368,12 @@ eval_to_string_skip(
* Return FAIL for an error, OK otherwise.
*/
int
skip_expr(char_u **pp)
skip_expr(char_u **pp, evalarg_T *evalarg)
{
typval_T rettv;
*pp = skipwhite(*pp);
return eval1(pp, &rettv, NULL);
return eval1(pp, &rettv, evalarg);
}
/*
@@ -474,9 +474,10 @@ skip_expr_concatenate(
* Return pointer to allocated memory, or NULL for failure.
*/
char_u *
eval_to_string(
eval_to_string_eap(
char_u *arg,
int convert)
int convert,
exarg_T *eap)
{
typval_T tv;
char_u *retval;
@@ -484,8 +485,10 @@ eval_to_string(
#ifdef FEAT_FLOAT
char_u numbuf[NUMBUFLEN];
#endif
evalarg_T evalarg;
if (eval0(arg, &tv, NULL, &EVALARG_EVALUATE) == FAIL)
fill_evalarg_from_eap(&evalarg, eap, eap != NULL && eap->skip);
if (eval0(arg, &tv, NULL, &evalarg) == FAIL)
retval = NULL;
else
{
@@ -512,11 +515,19 @@ eval_to_string(
retval = vim_strsave(tv_get_string(&tv));
clear_tv(&tv);
}
clear_evalarg(&EVALARG_EVALUATE, NULL);
clear_evalarg(&evalarg, NULL);
return retval;
}
char_u *
eval_to_string(
char_u *arg,
int convert)
{
return eval_to_string_eap(arg, convert, NULL);
}
/*
* Call eval_to_string() without using current local variables and using
* textwinlock. When "use_sandbox" is TRUE use the sandbox.
@@ -2679,6 +2690,9 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
return OK;
}
/*
* Make a copy of blob "tv1" and append blob "tv2".
*/
void
eval_addblob(typval_T *tv1, typval_T *tv2)
{
@@ -2699,6 +2713,9 @@ eval_addblob(typval_T *tv1, typval_T *tv2)
}
}
/*
* Make a copy of list "tv1" and append list "tv2".
*/
int
eval_addlist(typval_T *tv1, typval_T *tv2)
{
@@ -2777,8 +2794,10 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
#ifdef FEAT_FLOAT
&& (op == '.' || rettv->v_type != VAR_FLOAT)
#endif
)
&& evaluate)
{
int error = FALSE;
// For "list + ...", an illegal use of the first operand as
// a number cannot be determined before evaluating the 2nd
// operand: if this is also a list, all is ok.
@@ -2786,7 +2805,9 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
// we know that the first operand needs to be a string or number
// without evaluating the 2nd operand. So check before to avoid
// side effects after an error.
if (evaluate && tv_get_string_chk(rettv) == NULL)
if (op != '.')
tv_get_number_chk(rettv, &error);
if ((op == '.' && tv_get_string_chk(rettv) == NULL) || error)
{
clear_tv(rettv);
return FAIL;
@@ -3245,7 +3266,7 @@ eval7(
* Lambda: {arg, arg -> expr}
* Dictionary: {'key': val, 'key': val}
*/
case '{': ret = get_lambda_tv(arg, rettv, evalarg);
case '{': ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
if (ret == NOTDONE)
ret = eval_dict(arg, rettv, evalarg, FALSE);
break;
@@ -3417,7 +3438,15 @@ eval7_leader(
}
#ifdef FEAT_FLOAT
if (rettv->v_type == VAR_FLOAT)
f = !f;
{
if (in_vim9script())
{
rettv->v_type = VAR_BOOL;
val = f == 0.0 ? VVAL_TRUE : VVAL_FALSE;
}
else
f = !f;
}
else
#endif
{
@@ -3533,7 +3562,7 @@ eval_lambda(
*arg += 2;
rettv->v_type = VAR_UNKNOWN;
ret = get_lambda_tv(arg, rettv, evalarg);
ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
if (ret != OK)
return FAIL;
else if (**arg != '(')

View File

@@ -717,17 +717,19 @@ get_buffer_lines(
void
f_getbufline(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
linenr_T end;
linenr_T lnum = 1;
linenr_T end = 1;
buf_T *buf;
buf = tv_get_buf_from_arg(&argvars[0]);
lnum = tv_get_lnum_buf(&argvars[1], buf);
if (argvars[2].v_type == VAR_UNKNOWN)
end = lnum;
else
end = tv_get_lnum_buf(&argvars[2], buf);
if (buf != NULL)
{
lnum = tv_get_lnum_buf(&argvars[1], buf);
if (argvars[2].v_type == VAR_UNKNOWN)
end = lnum;
else
end = tv_get_lnum_buf(&argvars[2], buf);
}
get_buffer_lines(buf, lnum, end, TRUE, rettv);
}

File diff suppressed because it is too large Load Diff

View File

@@ -146,7 +146,6 @@ static struct vimvar
{VV_NAME("echospace", VAR_NUMBER), VV_RO},
{VV_NAME("argv", VAR_LIST), VV_RO},
{VV_NAME("collate", VAR_STRING), VV_RO},
{VV_NAME("disallow_let", VAR_NUMBER), 0}, // TODO: remove
};
// shorthand
@@ -243,9 +242,6 @@ evalvars_init(void)
set_vim_var_nr(VV_ECHOSPACE, sc_col - 1);
// TODO: remove later
set_vim_var_nr(VV_DISALLOW_LET, 1);
// Default for v:register is not 0 but '"'. This is adjusted once the
// clipboard has been setup by calling reset_reg_var().
set_reg_var(0);
@@ -749,8 +745,7 @@ ex_let(exarg_T *eap)
ex_finally(eap);
return;
}
if (get_vim_var_nr(VV_DISALLOW_LET)
&& eap->cmdidx == CMD_let && vim9script)
if (eap->cmdidx == CMD_let && vim9script)
{
emsg(_(e_cannot_use_let_in_vim9_script));
return;
@@ -1986,7 +1981,13 @@ get_user_var_name(expand_T *xp, int idx)
}
// b: variables
ht = &curbuf->b_vars->dv_hashtab;
ht =
#ifdef FEAT_CMDWIN
// In cmdwin, the alternative buffer should be used.
(cmdwin_type != 0 && get_cmdline_type() == NUL) ?
&prevwin->w_buffer->b_vars->dv_hashtab :
#endif
&curbuf->b_vars->dv_hashtab;
if (bdone < ht->ht_used)
{
if (bdone++ == 0)
@@ -1999,7 +2000,13 @@ get_user_var_name(expand_T *xp, int idx)
}
// w: variables
ht = &curwin->w_vars->dv_hashtab;
ht =
#ifdef FEAT_CMDWIN
// In cmdwin, the alternative window should be used.
(cmdwin_type != 0 && get_cmdline_type() == NUL) ?
&prevwin->w_vars->dv_hashtab :
#endif
&curwin->w_vars->dv_hashtab;
if (wdone < ht->ht_used)
{
if (wdone++ == 0)
@@ -2546,7 +2553,22 @@ eval_variable(
ret = FAIL;
}
else if (rettv != NULL)
{
// If a list or dict variable wasn't initialized, do it now.
if (tv->v_type == VAR_DICT && tv->vval.v_dict == NULL)
{
tv->vval.v_dict = dict_alloc();
if (tv->vval.v_dict != NULL)
++tv->vval.v_dict->dv_refcount;
}
else if (tv->v_type == VAR_LIST && tv->vval.v_list == NULL)
{
tv->vval.v_list = list_alloc();
if (tv->vval.v_list != NULL)
++tv->vval.v_list->lv_refcount;
}
copy_tv(tv, rettv);
}
}
name[len] = cc;
@@ -3582,9 +3604,11 @@ var_redir_start(char_u *name, int append)
tv.v_type = VAR_STRING;
tv.vval.v_string = (char_u *)"";
if (append)
set_var_lval(redir_lval, redir_endp, &tv, TRUE, 0, (char_u *)".");
set_var_lval(redir_lval, redir_endp, &tv, TRUE,
ASSIGN_NO_DECL, (char_u *)".");
else
set_var_lval(redir_lval, redir_endp, &tv, TRUE, 0, (char_u *)"=");
set_var_lval(redir_lval, redir_endp, &tv, TRUE,
ASSIGN_NO_DECL, (char_u *)"=");
clear_lval(redir_lval);
if (called_emsg > called_emsg_before)
{

View File

@@ -7,30 +7,30 @@ static const unsigned short cmdidxs1[26] =
{
/* a */ 0,
/* b */ 19,
/* c */ 42,
/* d */ 108,
/* e */ 133,
/* f */ 156,
/* g */ 173,
/* h */ 179,
/* i */ 188,
/* j */ 207,
/* k */ 209,
/* l */ 214,
/* m */ 276,
/* n */ 294,
/* o */ 314,
/* p */ 326,
/* q */ 365,
/* r */ 368,
/* s */ 388,
/* t */ 457,
/* u */ 502,
/* v */ 513,
/* w */ 533,
/* x */ 547,
/* y */ 557,
/* z */ 558
/* c */ 43,
/* d */ 109,
/* e */ 134,
/* f */ 157,
/* g */ 174,
/* h */ 180,
/* i */ 189,
/* j */ 208,
/* k */ 210,
/* l */ 215,
/* m */ 277,
/* n */ 295,
/* o */ 315,
/* p */ 327,
/* q */ 366,
/* r */ 369,
/* s */ 389,
/* t */ 458,
/* u */ 503,
/* v */ 514,
/* w */ 534,
/* x */ 548,
/* y */ 558,
/* z */ 559
};
/*
@@ -42,7 +42,7 @@ static const unsigned short cmdidxs1[26] =
static const unsigned char cmdidxs2[26][26] =
{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */
/* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 7, 15, 0, 16, 0, 0, 0, 0, 0 },
/* b */ { 2, 0, 0, 4, 5, 7, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0 },
/* b */ { 2, 0, 0, 5, 6, 8, 0, 0, 0, 0, 0, 9, 10, 11, 12, 13, 0, 14, 0, 0, 0, 0, 23, 0, 0, 0 },
/* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 37, 40, 46, 56, 58, 59, 60, 0, 62, 0, 65, 0, 0, 0 },
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 8, 18, 0, 19, 0, 0, 20, 0, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0 },
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 17, 0, 18, 0, 0 },
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
static const int command_count = 573;
static const int command_count = 574;

View File

@@ -277,6 +277,7 @@ linelen(int *has_tab)
static char_u *sortbuf1;
static char_u *sortbuf2;
static int sort_lc; // sort using locale
static int sort_ic; // ignore case
static int sort_nr; // sort on number
static int sort_rx; // sort on regex instead of skipping it
@@ -307,7 +308,13 @@ typedef struct
} st_u;
} sorti_T;
static int sort_compare(const void *s1, const void *s2);
static int
string_compare(const void *s1, const void *s2)
{
if (sort_lc)
return strcoll((char *)s1, (char *)s2);
return sort_ic ? STRICMP(s1, s2) : STRCMP(s1, s2);
}
static int
sort_compare(const void *s1, const void *s2)
@@ -350,8 +357,7 @@ sort_compare(const void *s1, const void *s2)
l2.st_u.line.end_col_nr - l2.st_u.line.start_col_nr + 1);
sortbuf2[l2.st_u.line.end_col_nr - l2.st_u.line.start_col_nr] = 0;
result = sort_ic ? STRICMP(sortbuf1, sortbuf2)
: STRCMP(sortbuf1, sortbuf2);
result = string_compare(sortbuf1, sortbuf2);
}
// If two lines have the same value, preserve the original line order.
@@ -398,7 +404,7 @@ ex_sort(exarg_T *eap)
if (nrs == NULL)
goto sortend;
sort_abort = sort_ic = sort_rx = sort_nr = 0;
sort_abort = sort_ic = sort_lc = sort_rx = sort_nr = 0;
#ifdef FEAT_FLOAT
sort_flt = 0;
#endif
@@ -409,6 +415,8 @@ ex_sort(exarg_T *eap)
;
else if (*p == 'i')
sort_ic = TRUE;
else if (*p == 'l')
sort_lc = TRUE;
else if (*p == 'r')
sort_rx = TRUE;
else if (*p == 'n')
@@ -614,8 +622,7 @@ ex_sort(exarg_T *eap)
change_occurred = TRUE;
s = ml_get(get_lnum);
if (!unique || i == 0
|| (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
if (!unique || i == 0 || string_compare(s, sortbuf1) != 0)
{
// Copy the line into a buffer, it may become invalid in
// ml_append(). And it's needed for "unique".
@@ -744,7 +751,7 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
foldMoveRange(&win->w_folds, line1, line2, dest);
}
#endif
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
curbuf->b_op_start.lnum = dest - num_lines + 1;
curbuf->b_op_end.lnum = dest;
@@ -759,13 +766,13 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
foldMoveRange(&win->w_folds, dest + 1, line1 - 1, line2);
}
#endif
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
curbuf->b_op_start.lnum = dest + 1;
curbuf->b_op_end.lnum = dest + num_lines;
}
}
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
mark_adjust_nofold(last_line - num_lines + 1, last_line,
-(last_line - dest - extra), 0L);
@@ -815,7 +822,7 @@ ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
char_u *p;
count = line2 - line1 + 1;
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
curbuf->b_op_start.lnum = n + 1;
curbuf->b_op_end.lnum = n + count;
@@ -1062,7 +1069,7 @@ do_filter(
int shell_flags = 0;
pos_T orig_start = curbuf->b_op_start;
pos_T orig_end = curbuf->b_op_end;
int save_lockmarks = cmdmod.lockmarks;
int save_cmod_flags = cmdmod.cmod_flags;
#ifdef FEAT_FILTERPIPE
int stmp = p_stmp;
#endif
@@ -1072,7 +1079,7 @@ do_filter(
// Temporarily disable lockmarks since that's needed to propagate changed
// regions of the buffer for foldUpdate(), linecount, etc.
cmdmod.lockmarks = 0;
cmdmod.cmod_flags &= ~CMOD_LOCKMARKS;
cursor_save = curwin->w_cursor;
linecount = line2 - line1 + 1;
@@ -1241,11 +1248,22 @@ do_filter(
if (do_in)
{
if (cmdmod.keepmarks || vim_strchr(p_cpo, CPO_REMMARK) == NULL)
if ((cmdmod.cmod_flags & CMOD_KEEPMARKS)
|| vim_strchr(p_cpo, CPO_REMMARK) == NULL)
{
if (read_linecount >= linecount)
// move all marks from old lines to new lines
mark_adjust(line1, line2, linecount, 0L);
else if (save_cmod_flags & CMOD_LOCKMARKS)
{
// Move marks from the lines below the new lines down by
// the number of lines lost.
// Move marks from the lines that will be deleted to the
// new lines and below.
mark_adjust(line2 + 1, (linenr_T)MAXLNUM,
linecount - read_linecount, 0L);
mark_adjust(line1, line2, linecount, 0L);
}
else
{
// move marks from old lines to new lines, delete marks
@@ -1307,13 +1325,13 @@ error:
filterend:
cmdmod.lockmarks = save_lockmarks;
cmdmod.cmod_flags = save_cmod_flags;
if (curbuf != old_curbuf)
{
--no_wait_return;
emsg(_("E135: *Filter* Autocommands must not change current buffer"));
}
else if (cmdmod.lockmarks)
else if (cmdmod.cmod_flags & CMOD_LOCKMARKS)
{
curbuf->b_op_start = orig_start;
curbuf->b_op_end = orig_end;
@@ -1543,6 +1561,9 @@ make_filter_cmd(
int is_fish_shell;
char_u *shell_name = get_isolated_shell_name();
if (shell_name == NULL)
return NULL;
// Account for fish's different syntax for subshells
is_fish_shell = (fnamecmp(shell_name, "fish") == 0);
vim_free(shell_name);
@@ -1769,7 +1790,7 @@ rename_buffer(char_u *new_fname)
if (xfname != NULL && *xfname != NUL)
{
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
if (buf != NULL && !cmdmod.keepalt)
if (buf != NULL && (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
curwin->w_alt_fnum = buf->b_fnum;
}
vim_free(fname);
@@ -1866,7 +1887,7 @@ do_write(exarg_T *eap)
ffname = eap->arg;
#ifdef FEAT_BROWSE
if (cmdmod.browse && !exiting)
if ((cmdmod.cmod_flags & CMOD_BROWSE) && !exiting)
{
browse_file = do_browse(BROWSE_SAVE, (char_u *)_("Save As"), ffname,
NULL, NULL, NULL, curbuf);
@@ -1942,7 +1963,7 @@ do_write(exarg_T *eap)
&& !p_wa)
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if (p_confirm || cmdmod.confirm)
if (p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
{
if (vim_dialog_yesno(VIM_QUESTION, NULL,
(char_u *)_("Write partial file?"), 2) != VIM_YES)
@@ -2091,7 +2112,7 @@ check_overwrite(
}
#endif
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if (p_confirm || cmdmod.confirm)
if (p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
{
char_u buff[DIALOG_MSG_SIZE];
@@ -2142,7 +2163,7 @@ check_overwrite(
if (r)
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if (p_confirm || cmdmod.confirm)
if (p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
{
char_u buff[DIALOG_MSG_SIZE];
@@ -2229,12 +2250,13 @@ do_wqall(exarg_T *eap)
}
#ifdef FEAT_BROWSE
// ":browse wall": ask for file name if there isn't one
if (buf->b_ffname == NULL && cmdmod.browse)
if (buf->b_ffname == NULL && (cmdmod.cmod_flags & CMOD_BROWSE))
browse_save_fname(buf);
#endif
if (buf->b_ffname == NULL)
{
semsg(_("E141: No file name for buffer %ld"), (long)buf->b_fnum);
semsg(_("E141: No file name for buffer %ld"),
(long)buf->b_fnum);
++error;
}
else if (check_readonly(&eap->forceit, buf)
@@ -2297,7 +2319,8 @@ check_readonly(int *forceit, buf_T *buf)
&& check_file_readonly(buf->b_ffname, 0777))))
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
&& buf->b_fname != NULL)
{
char_u buff[DIALOG_MSG_SIZE];
@@ -2436,6 +2459,7 @@ theend:
* ECMD_OLDBUF: use existing buffer if it exists
* ECMD_FORCEIT: ! used for Ex command
* ECMD_ADDBUF: don't edit, just add to buffer list
* ECMD_ALTBUF: like ECMD_ADDBUF and also set the alternate file
* oldwin: Should be "curwin" when editing a new buffer in the current
* window, NULL when splitting the window first. When not NULL info
* of the previous buffer for "oldwin" is stored.
@@ -2501,7 +2525,7 @@ do_ecmd(
else
{
#ifdef FEAT_BROWSE
if (cmdmod.browse && !exiting)
if ((cmdmod.cmod_flags & CMOD_BROWSE) && !exiting)
{
if (
# ifdef FEAT_GUI
@@ -2532,7 +2556,8 @@ do_ecmd(
fname_case(sfname, 0); // set correct case for sfname
#endif
if ((flags & ECMD_ADDBUF) && (ffname == NULL || *ffname == NUL))
if ((flags & (ECMD_ADDBUF | ECMD_ALTBUF))
&& (ffname == NULL || *ffname == NUL))
goto theend;
if (ffname == NULL)
@@ -2561,7 +2586,7 @@ do_ecmd(
*/
if ( ((!other_file && !(flags & ECMD_OLDBUF))
|| (curbuf->b_nwindows == 1
&& !(flags & (ECMD_HIDE | ECMD_ADDBUF))))
&& !(flags & (ECMD_HIDE | ECMD_ADDBUF | ECMD_ALTBUF))))
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
| (other_file ? 0 : CCGD_MULTWIN)
| ((flags & ECMD_FORCEIT) ? CCGD_FORCEIT : 0)
@@ -2610,9 +2635,9 @@ do_ecmd(
*/
if (other_file)
{
if (!(flags & ECMD_ADDBUF))
if (!(flags & (ECMD_ADDBUF | ECMD_ALTBUF)))
{
if (!cmdmod.keepalt)
if ((cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
curwin->w_alt_fnum = curbuf->b_fnum;
if (oldwin != NULL)
buflist_altfpos(oldwin);
@@ -2622,9 +2647,12 @@ do_ecmd(
buf = buflist_findnr(fnum);
else
{
if (flags & ECMD_ADDBUF)
if (flags & (ECMD_ADDBUF | ECMD_ALTBUF))
{
linenr_T tlnum = 1L;
// Default the line number to zero to avoid that a wininfo item
// is added for the current window.
linenr_T tlnum = 0;
buf_T *newbuf;
if (command != NULL)
{
@@ -2632,7 +2660,12 @@ do_ecmd(
if (tlnum <= 0)
tlnum = 1L;
}
(void)buflist_new(ffname, sfname, tlnum, BLN_LISTED);
// Add BLN_NOCURWIN to avoid a new wininfo items are assocated
// with the current window.
newbuf = buflist_new(ffname, sfname, tlnum,
BLN_LISTED | BLN_NOCURWIN);
if (newbuf != NULL && (flags & ECMD_ALTBUF))
curwin->w_alt_fnum = newbuf->b_fnum;
goto theend;
}
buf = buflist_new(ffname, sfname, 0L,
@@ -2790,7 +2823,7 @@ do_ecmd(
}
else // !other_file
{
if ((flags & ECMD_ADDBUF) || check_fname() == FAIL)
if ((flags & (ECMD_ADDBUF | ECMD_ALTBUF)) || check_fname() == FAIL)
goto theend;
oldbuf = (flags & ECMD_OLDBUF);
@@ -3299,14 +3332,14 @@ ex_append(exarg_T *eap)
// eap->line2 pointed to the end of the buffer and nothing was appended)
// "end" is set to lnum when something has been appended, otherwise
// it is the same than "start" -- Acevedo
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
curbuf->b_op_start.lnum = (eap->line2 < curbuf->b_ml.ml_line_count) ?
eap->line2 + 1 : curbuf->b_ml.ml_line_count;
if (eap->cmdidx != CMD_append)
--curbuf->b_op_start.lnum;
curbuf->b_op_end.lnum = (eap->line2 < lnum)
? lnum : curbuf->b_op_start.lnum;
? lnum : curbuf->b_op_start.lnum;
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
}
curwin->w_cursor.lnum = lnum;
@@ -3729,7 +3762,7 @@ ex_substitute(exarg_T *eap)
ex_may_print(eap);
}
if (!cmdmod.keeppatterns)
if ((cmdmod.cmod_flags & CMOD_KEEPPATTERNS) == 0)
save_re_pat(RE_SUBST, pat, p_magic);
// put pattern in history
add_to_history(HIST_SEARCH, pat, TRUE, NUL);
@@ -4619,7 +4652,7 @@ outofmem:
if (sub_nsubs > start_nsubs)
{
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set the '[ and '] marks.
curbuf->b_op_start.lnum = eap->line1;
@@ -5108,7 +5141,7 @@ ex_drop(exarg_T *eap)
if (ARGCOUNT == 0)
return;
if (cmdmod.tab)
if (cmdmod.cmod_tab)
{
// ":tab drop file ...": open a tab for each argument that isn't
// edited in a window yet. It's like ":tab all" but without closing
@@ -5247,7 +5280,7 @@ ex_oldfiles(exarg_T *eap UNUSED)
got_int = FALSE;
# ifdef FEAT_BROWSE_CMD
if (cmdmod.browse)
if (cmdmod.cmod_flags & CMOD_BROWSE)
{
quit_more = FALSE;
nr = prompt_for_number(FALSE);
@@ -5262,7 +5295,7 @@ ex_oldfiles(exarg_T *eap UNUSED)
p = expand_env_save(p);
eap->arg = p;
eap->cmdidx = CMD_edit;
cmdmod.browse = FALSE;
cmdmod.cmod_flags &= ~CMOD_BROWSE;
do_exedit(eap, NULL);
vim_free(p);
}

View File

@@ -178,6 +178,9 @@ EXCMD(CMD_ball, "ball", ex_buffer_all,
EXCMD(CMD_badd, "badd", ex_edit,
EX_NEEDARG|EX_FILE1|EX_CMDARG|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_balt, "balt", ex_edit,
EX_NEEDARG|EX_FILE1|EX_CMDARG|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_bdelete, "bdelete", ex_bunload,
EX_BANG|EX_RANGE|EX_BUFNAME|EX_COUNT|EX_EXTRA|EX_TRLBAR,
ADDR_BUFFERS),
@@ -926,10 +929,10 @@ EXCMD(CMD_luafile, "luafile", ex_luafile,
EX_RANGE|EX_FILE1|EX_NEEDARG|EX_CMDWIN|EX_LOCK_OK|EX_RESTRICT,
ADDR_LINES),
EXCMD(CMD_lvimgrep, "lvimgrep", ex_vimgrep,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
ADDR_OTHER),
EXCMD(CMD_lvimgrepadd, "lvimgrepadd", ex_vimgrep,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
ADDR_OTHER),
EXCMD(CMD_lwindow, "lwindow", ex_cwindow,
EX_RANGE|EX_COUNT|EX_TRLBAR,
@@ -1670,10 +1673,10 @@ EXCMD(CMD_view, "view", ex_edit,
EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
ADDR_NONE),
EXCMD(CMD_vimgrep, "vimgrep", ex_vimgrep,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
ADDR_OTHER),
EXCMD(CMD_vimgrepadd, "vimgrepadd", ex_vimgrep,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
ADDR_OTHER),
EXCMD(CMD_vim9script, "vim9script", ex_vim9script,
EX_CMDWIN|EX_LOCK_OK,
@@ -1883,12 +1886,6 @@ struct exarg
void *cookie; // argument for getline()
#ifdef FEAT_EVAL
cstack_T *cstack; // condition stack for ":if" etc.
#endif
long verbose_save; // saved value of p_verbose
int save_msg_silent; // saved value of msg_silent
int did_esilent; // how many times emsg_silent was incremented
#ifdef HAVE_SANDBOX
int did_sandbox; // when TRUE did ++sandbox
#endif
};

View File

@@ -86,7 +86,7 @@ check_changed(buf_T *buf, int flags)
&& (!(flags & CCGD_AW) || autowrite(buf, forceit) == FAIL))
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
{
buf_T *buf2;
int count = 0;
@@ -96,7 +96,7 @@ check_changed(buf_T *buf, int flags)
if (bufIsChanged(buf2)
&& (buf2->b_ffname != NULL
# ifdef FEAT_BROWSE
|| cmdmod.browse
|| (cmdmod.cmod_flags & CMOD_BROWSE)
# endif
))
++count;
@@ -197,7 +197,7 @@ dialog_changed(
if (bufIsChanged(buf2)
&& (buf2->b_ffname != NULL
#ifdef FEAT_BROWSE
|| cmdmod.browse
|| (cmdmod.cmod_flags & CMOD_BROWSE)
#endif
)
&& !buf2->b_p_ro)
@@ -347,7 +347,7 @@ check_changed_any(
/*
* When ":confirm" used, don't give an error message.
*/
if (!(p_confirm || cmdmod.confirm))
if (!(p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)))
#endif
{
// There must be a wait_return for this message, do_buffer()

View File

@@ -640,7 +640,7 @@ do_cmdline(
struct dbg_stuff debug_saved; // saved things for debug mode
int initial_trylevel;
msglist_T **saved_msg_list = NULL;
msglist_T *private_msg_list;
msglist_T *private_msg_list = NULL;
// "fgetline" and "cookie" passed to do_one_cmd()
char_u *(*cmd_getline)(int, void *, int, getline_opt_T);
@@ -664,7 +664,6 @@ do_cmdline(
// BufWritePost autocommands are executed after a write error.
saved_msg_list = msg_list;
msg_list = &private_msg_list;
private_msg_list = NULL;
#endif
// It's possible to create an endless loop with ":execute", catch that
@@ -1712,7 +1711,6 @@ do_one_cmd(
char *errormsg = NULL; // error message
char_u *after_modifier = NULL;
exarg_T ea; // Ex command arguments
int save_msg_scroll = msg_scroll;
cmdmod_T save_cmdmod;
int save_reg_executing = reg_executing;
int ni; // set when Not Implemented
@@ -1721,6 +1719,7 @@ do_one_cmd(
#ifdef FEAT_EVAL
int may_have_range;
int vim9script = in_vim9script();
int did_set_expr_line = FALSE;
#endif
CLEAR_FIELD(ea);
@@ -1763,8 +1762,9 @@ do_one_cmd(
ea.cstack = cstack;
starts_with_colon = *skipwhite(ea.cmd) == ':';
#endif
if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL)
if (parse_command_modifiers(&ea, &errormsg, &cmdmod, FALSE) == FAIL)
goto doend;
apply_cmdmod(&cmdmod);
after_modifier = ea.cmd;
@@ -1782,24 +1782,44 @@ do_one_cmd(
*/
cmd = ea.cmd;
#ifdef FEAT_EVAL
// In Vim9 script a colon is required before the range.
may_have_range = !vim9script || starts_with_colon;
// In Vim9 script a colon is required before the range. This may also be
// after command modifiers.
if (vim9script)
{
may_have_range = FALSE;
for (p = ea.cmd; p >= *cmdlinep; --p)
{
if (*p == ':')
may_have_range = TRUE;
if (p < ea.cmd && !VIM_ISWHITE(*p))
break;
}
}
else
may_have_range = TRUE;
if (may_have_range)
#endif
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
#ifdef FEAT_EVAL
if (vim9script && !starts_with_colon)
if (vim9script && !may_have_range)
{
if (ea.cmd == cmd + 1 && *cmd == '$')
// should be "$VAR = val"
--ea.cmd;
else if (ea.cmd > cmd)
{
emsg(_(e_colon_required_before_a_range));
goto doend;
}
p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL);
if (ea.cmdidx == CMD_SIZE)
{
char_u *ar = skip_range(ea.cmd, TRUE, NULL);
// If a ':' before the range is missing, give a clearer error
// message.
if (ar > ea.cmd)
{
emsg(_(e_colon_required_before_a_range));
goto doend;
}
}
}
else
#endif
@@ -2316,8 +2336,9 @@ do_one_cmd(
// for '=' register: accept the rest of the line as an expression
if (ea.arg[-1] == '=' && ea.arg[0] != NUL)
{
set_expr_line(vim_strsave(ea.arg));
set_expr_line(vim_strsave(ea.arg), &ea);
ea.arg += STRLEN(ea.arg);
did_set_expr_line = TRUE;
}
#endif
ea.arg = skipwhite(ea.arg);
@@ -2516,12 +2537,12 @@ do_one_cmd(
// The :try command saves the emsg_silent flag, reset it here when
// ":silent! try" was used, it should only apply to :try itself.
if (ea.cmdidx == CMD_try && ea.did_esilent > 0)
if (ea.cmdidx == CMD_try && cmdmod.cmod_did_esilent > 0)
{
emsg_silent -= ea.did_esilent;
emsg_silent -= cmdmod.cmod_did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
ea.did_esilent = 0;
cmdmod.cmod_did_esilent = 0;
}
/*
@@ -2596,17 +2617,15 @@ doend:
do_errthrow(cstack,
(ea.cmdidx != CMD_SIZE && !IS_USER_CMDIDX(ea.cmdidx))
? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
if (did_set_expr_line)
set_expr_line(NULL, NULL);
#endif
undo_cmdmod(&ea, save_msg_scroll);
undo_cmdmod(&cmdmod);
cmdmod = save_cmdmod;
reg_executing = save_reg_executing;
#ifdef HAVE_SANDBOX
if (ea.did_sandbox)
--sandbox;
#endif
if (ea.nextcmd && *ea.nextcmd == NUL) // not really a next command
ea.nextcmd = NULL;
@@ -2638,26 +2657,31 @@ ex_errmsg(char *msg, char_u *arg)
/*
* Parse and skip over command modifiers:
* - update eap->cmd
* - store flags in "cmdmod".
* - store flags in "cmod".
* - Set ex_pressedreturn for an empty command line.
* - set msg_silent for ":silent"
* - set 'eventignore' to "all" for ":noautocmd"
* - set p_verbose for ":verbose"
* - Increment "sandbox" for ":sandbox"
* When "skip_only" is TRUE the global variables are not changed, except for
* "cmdmod".
* When "skip_only" is FALSE then undo_cmdmod() must be called later to free
* any cmod_filter_regmatch.regprog.
* Call apply_cmdmod() to get the side effects of the modifiers:
* - Increment "sandbox" for ":sandbox"
* - set p_verbose for ":verbose"
* - set msg_silent for ":silent"
* - set 'eventignore' to "all" for ":noautocmd"
* Return FAIL when the command is not to be executed.
* May set "errormsg" to an error message.
*/
int
parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
parse_command_modifiers(
exarg_T *eap,
char **errormsg,
cmdmod_T *cmod,
int skip_only)
{
char_u *p;
int starts_with_colon = FALSE;
CLEAR_FIELD(cmdmod);
eap->verbose_save = -1;
eap->save_msg_silent = -1;
CLEAR_POINTER(cmod);
// Repeat until no more command modifiers are found.
for (;;)
@@ -2696,51 +2720,51 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
// When adding an entry, also modify cmd_exists().
case 'a': if (!checkforcmd(&eap->cmd, "aboveleft", 3))
break;
cmdmod.split |= WSP_ABOVE;
cmod->cmod_split |= WSP_ABOVE;
continue;
case 'b': if (checkforcmd(&eap->cmd, "belowright", 3))
{
cmdmod.split |= WSP_BELOW;
cmod->cmod_split |= WSP_BELOW;
continue;
}
if (checkforcmd(&eap->cmd, "browse", 3))
{
#ifdef FEAT_BROWSE_CMD
cmdmod.browse = TRUE;
cmod->cmod_flags |= CMOD_BROWSE;
#endif
continue;
}
if (!checkforcmd(&eap->cmd, "botright", 2))
break;
cmdmod.split |= WSP_BOT;
cmod->cmod_split |= WSP_BOT;
continue;
case 'c': if (!checkforcmd(&eap->cmd, "confirm", 4))
break;
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
cmdmod.confirm = TRUE;
cmod->cmod_flags |= CMOD_CONFIRM;
#endif
continue;
case 'k': if (checkforcmd(&eap->cmd, "keepmarks", 3))
{
cmdmod.keepmarks = TRUE;
cmod->cmod_flags |= CMOD_KEEPMARKS;
continue;
}
if (checkforcmd(&eap->cmd, "keepalt", 5))
{
cmdmod.keepalt = TRUE;
cmod->cmod_flags |= CMOD_KEEPALT;
continue;
}
if (checkforcmd(&eap->cmd, "keeppatterns", 5))
{
cmdmod.keeppatterns = TRUE;
cmod->cmod_flags |= CMOD_KEEPPATTERNS;
continue;
}
if (!checkforcmd(&eap->cmd, "keepjumps", 5))
break;
cmdmod.keepjumps = TRUE;
cmod->cmod_flags |= CMOD_KEEPJUMPS;
continue;
case 'f': // only accept ":filter {pat} cmd"
@@ -2752,14 +2776,14 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
break;
if (*p == '!')
{
cmdmod.filter_force = TRUE;
cmod->cmod_filter_force = TRUE;
p = skipwhite(p + 1);
if (*p == NUL || ends_excmd(*p))
break;
}
#ifdef FEAT_EVAL
// Avoid that "filter(arg)" is recognized.
if (in_vim9script() && !VIM_ISWHITE(*p))
if (in_vim9script() && !VIM_ISWHITE(p[-1]))
break;
#endif
if (skip_only)
@@ -2771,9 +2795,9 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
break;
if (!skip_only)
{
cmdmod.filter_regmatch.regprog =
cmod->cmod_filter_regmatch.regprog =
vim_regcomp(reg_pat, RE_MAGIC);
if (cmdmod.filter_regmatch.regprog == NULL)
if (cmod->cmod_filter_regmatch.regprog == NULL)
break;
}
eap->cmd = p;
@@ -2785,71 +2809,48 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|| *p == NUL || ends_excmd(*p))
break;
eap->cmd = p;
cmdmod.hide = TRUE;
cmod->cmod_flags |= CMOD_HIDE;
continue;
case 'l': if (checkforcmd(&eap->cmd, "lockmarks", 3))
{
cmdmod.lockmarks = TRUE;
cmod->cmod_flags |= CMOD_LOCKMARKS;
continue;
}
if (!checkforcmd(&eap->cmd, "leftabove", 5))
break;
cmdmod.split |= WSP_ABOVE;
cmod->cmod_split |= WSP_ABOVE;
continue;
case 'n': if (checkforcmd(&eap->cmd, "noautocmd", 3))
{
if (cmdmod.save_ei == NULL && !skip_only)
{
// Set 'eventignore' to "all". Restore the
// existing option value later.
cmdmod.save_ei = vim_strsave(p_ei);
set_string_option_direct((char_u *)"ei", -1,
(char_u *)"all", OPT_FREE, SID_NONE);
}
cmod->cmod_flags |= CMOD_NOAUTOCMD;
continue;
}
if (!checkforcmd(&eap->cmd, "noswapfile", 3))
break;
cmdmod.noswapfile = TRUE;
cmod->cmod_flags |= CMOD_NOSWAPFILE;
continue;
case 'r': if (!checkforcmd(&eap->cmd, "rightbelow", 6))
break;
cmdmod.split |= WSP_BELOW;
cmod->cmod_split |= WSP_BELOW;
continue;
case 's': if (checkforcmd(&eap->cmd, "sandbox", 3))
{
#ifdef HAVE_SANDBOX
if (!skip_only)
{
if (!eap->did_sandbox)
++sandbox;
eap->did_sandbox = TRUE;
}
#endif
cmod->cmod_flags |= CMOD_SANDBOX;
continue;
}
if (!checkforcmd(&eap->cmd, "silent", 3))
break;
if (!skip_only)
{
if (eap->save_msg_silent == -1)
eap->save_msg_silent = msg_silent;
++msg_silent;
}
cmod->cmod_flags |= CMOD_SILENT;
if (*eap->cmd == '!' && !VIM_ISWHITE(eap->cmd[-1]))
{
// ":silent!", but not "silent !cmd"
eap->cmd = skipwhite(eap->cmd + 1);
if (!skip_only)
{
++emsg_silent;
++eap->did_esilent;
}
cmod->cmod_flags |= CMOD_ERRSILENT;
}
continue;
@@ -2861,7 +2862,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
ADDR_TABS, eap->skip,
skip_only, FALSE, 1);
if (tabnr == MAXLNUM)
cmdmod.tab = tabpage_index(curtab) + 1;
cmod->cmod_tab = tabpage_index(curtab) + 1;
else
{
if (tabnr < 0 || tabnr > LAST_TAB_NR)
@@ -2869,7 +2870,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
*errormsg = _(e_invrange);
return FAIL;
}
cmdmod.tab = tabnr + 1;
cmod->cmod_tab = tabnr + 1;
}
}
eap->cmd = p;
@@ -2877,35 +2878,25 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
}
if (!checkforcmd(&eap->cmd, "topleft", 2))
break;
cmdmod.split |= WSP_TOP;
cmod->cmod_split |= WSP_TOP;
continue;
case 'u': if (!checkforcmd(&eap->cmd, "unsilent", 3))
break;
if (!skip_only)
{
if (eap->save_msg_silent == -1)
eap->save_msg_silent = msg_silent;
msg_silent = 0;
}
cmod->cmod_flags |= CMOD_UNSILENT;
continue;
case 'v': if (checkforcmd(&eap->cmd, "vertical", 4))
{
cmdmod.split |= WSP_VERT;
cmod->cmod_split |= WSP_VERT;
continue;
}
if (!checkforcmd(&p, "verbose", 4))
break;
if (!skip_only)
{
if (eap->verbose_save < 0)
eap->verbose_save = p_verbose;
if (vim_isdigit(*eap->cmd))
p_verbose = atoi((char *)eap->cmd);
else
p_verbose = 1;
}
if (vim_isdigit(*eap->cmd))
cmod->cmod_verbose = atoi((char *)eap->cmd);
else
cmod->cmod_verbose = 1;
eap->cmd = p;
continue;
}
@@ -2916,42 +2907,104 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
}
/*
* Undo and free contents of "cmdmod".
* Apply the command modifiers. Saves current state in "cmdmod", call
* undo_cmdmod() later.
*/
void
undo_cmdmod(exarg_T *eap, int save_msg_scroll)
apply_cmdmod(cmdmod_T *cmod)
{
if (eap->verbose_save >= 0)
p_verbose = eap->verbose_save;
if (cmdmod.save_ei != NULL)
#ifdef HAVE_SANDBOX
if ((cmod->cmod_flags & CMOD_SANDBOX) && !cmod->cmod_did_sandbox)
{
// Restore 'eventignore' to the value before ":noautocmd".
set_string_option_direct((char_u *)"ei", -1, cmdmod.save_ei,
OPT_FREE, SID_NONE);
free_string_option(cmdmod.save_ei);
++sandbox;
cmod->cmod_did_sandbox = TRUE;
}
#endif
if (cmod->cmod_verbose > 0)
{
if (cmod->cmod_verbose_save == 0)
cmod->cmod_verbose_save = p_verbose + 1;
p_verbose = cmod->cmod_verbose;
}
if (cmdmod.filter_regmatch.regprog != NULL)
vim_regfree(cmdmod.filter_regmatch.regprog);
if ((cmod->cmod_flags & (CMOD_SILENT | CMOD_UNSILENT))
&& cmod->cmod_save_msg_silent == 0)
{
cmod->cmod_save_msg_silent = msg_silent + 1;
cmod->cmod_save_msg_scroll = msg_scroll;
}
if (cmod->cmod_flags & CMOD_SILENT)
++msg_silent;
if (cmod->cmod_flags & CMOD_UNSILENT)
msg_silent = 0;
if (eap->save_msg_silent != -1)
if (cmod->cmod_flags & CMOD_ERRSILENT)
{
++emsg_silent;
++cmod->cmod_did_esilent;
}
if ((cmod->cmod_flags & CMOD_NOAUTOCMD) && cmod->cmod_save_ei == NULL)
{
// Set 'eventignore' to "all".
// First save the existing option value for restoring it later.
cmod->cmod_save_ei = vim_strsave(p_ei);
set_string_option_direct((char_u *)"ei", -1,
(char_u *)"all", OPT_FREE, SID_NONE);
}
}
/*
* Undo and free contents of "cmod".
*/
void
undo_cmdmod(cmdmod_T *cmod)
{
if (cmod->cmod_verbose_save > 0)
{
p_verbose = cmod->cmod_verbose_save - 1;
cmod->cmod_verbose_save = 0;
}
#ifdef HAVE_SANDBOX
if (cmod->cmod_did_sandbox)
{
--sandbox;
cmod->cmod_did_sandbox = FALSE;
}
#endif
if (cmod->cmod_save_ei != NULL)
{
// Restore 'eventignore' to the value before ":noautocmd".
set_string_option_direct((char_u *)"ei", -1, cmod->cmod_save_ei,
OPT_FREE, SID_NONE);
free_string_option(cmod->cmod_save_ei);
cmod->cmod_save_ei = NULL;
}
vim_regfree(cmod->cmod_filter_regmatch.regprog);
if (cmod->cmod_save_msg_silent > 0)
{
// messages could be enabled for a serious error, need to check if the
// counters don't become negative
if (!did_emsg || msg_silent > eap->save_msg_silent)
msg_silent = eap->save_msg_silent;
emsg_silent -= eap->did_esilent;
if (!did_emsg || msg_silent > cmod->cmod_save_msg_silent - 1)
msg_silent = cmod->cmod_save_msg_silent - 1;
emsg_silent -= cmod->cmod_did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
// Restore msg_scroll, it's set by file I/O commands, even when no
// message is actually displayed.
msg_scroll = save_msg_scroll;
msg_scroll = cmod->cmod_save_msg_scroll;
// "silent reg" or "silent echo x" inside "redir" leaves msg_col
// somewhere in the line. Put it back in the first column.
if (redirecting())
msg_col = 0;
cmod->cmod_save_msg_silent = 0;
cmod->cmod_did_esilent = 0;
}
}
@@ -3256,7 +3309,7 @@ find_ex_command(
// When followed by "=" or "+=" then it is an assignment.
++emsg_silent;
if (skip_expr(&after) == OK
if (skip_expr(&after, NULL) == OK
&& (*after == '='
|| (*after != NUL && after[1] == '=')))
eap->cmdidx = CMD_var;
@@ -4391,7 +4444,7 @@ expand_filename(
if (p[0] == '`' && p[1] == '=')
{
p += 2;
(void)skip_expr(&p);
(void)skip_expr(&p, NULL);
if (*p == '`')
++p;
continue;
@@ -4666,7 +4719,9 @@ separate_nextcmd(exarg_T *eap)
else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE))
{
p += 2;
(void)skip_expr(&p);
(void)skip_expr(&p, NULL);
if (*p == NUL) // stop at NUL after CTRL-V
break;
}
#endif
@@ -5109,7 +5164,8 @@ check_more(
if (message)
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
&& curbuf->b_fname != NULL)
{
char_u buff[DIALOG_MSG_SIZE];
@@ -5429,7 +5485,7 @@ ex_win_close(
if (need_hide && !buf_hide(buf) && !forceit)
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
{
bufref_T bufref;
@@ -6085,7 +6141,7 @@ ex_splitview(exarg_T *eap)
#endif
#ifdef FEAT_BROWSE
char_u dot_path[] = ".";
int browse_flag = cmdmod.browse;
int save_cmod_flags = cmdmod.cmod_flags;
#endif
int use_tab = eap->cmdidx == CMD_tabedit
|| eap->cmdidx == CMD_tabfind
@@ -6101,7 +6157,7 @@ ex_splitview(exarg_T *eap)
#ifdef FEAT_QUICKFIX
// A ":split" in the quickfix window works like ":new". Don't want two
// quickfix windows. But it's OK when doing ":tab split".
if (bt_quickfix(curbuf) && cmdmod.tab == 0)
if (bt_quickfix(curbuf) && cmdmod.cmod_tab == 0)
{
if (eap->cmdidx == CMD_split)
eap->cmdidx = CMD_new;
@@ -6124,7 +6180,7 @@ ex_splitview(exarg_T *eap)
# endif
#endif
#ifdef FEAT_BROWSE
if (cmdmod.browse
if ((cmdmod.cmod_flags & CMOD_BROWSE)
&& eap->cmdidx != CMD_vnew
&& eap->cmdidx != CMD_new)
{
@@ -6150,7 +6206,7 @@ ex_splitview(exarg_T *eap)
eap->arg = fname;
}
}
cmdmod.browse = FALSE; // Don't browse again in do_ecmd().
cmdmod.cmod_flags &= ~CMOD_BROWSE; // Don't browse again in do_ecmd().
#endif
/*
@@ -6158,7 +6214,7 @@ ex_splitview(exarg_T *eap)
*/
if (use_tab)
{
if (win_new_tabpage(cmdmod.tab != 0 ? cmdmod.tab
if (win_new_tabpage(cmdmod.cmod_tab != 0 ? cmdmod.cmod_tab
: eap->addr_count == 0 ? 0
: (int)eap->line2 + 1) != FAIL)
{
@@ -6168,7 +6224,7 @@ ex_splitview(exarg_T *eap)
if (curwin != old_curwin
&& win_valid(old_curwin)
&& old_curwin->w_buffer != curbuf
&& !cmdmod.keepalt)
&& (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
old_curwin->w_alt_fnum = curbuf->b_fnum;
}
}
@@ -6177,11 +6233,7 @@ ex_splitview(exarg_T *eap)
{
// Reset 'scrollbind' when editing another file, but keep it when
// doing ":split" without arguments.
if (*eap->arg != NUL
# ifdef FEAT_BROWSE
|| cmdmod.browse
# endif
)
if (*eap->arg != NUL)
RESET_BINDING(curwin);
else
do_check_scrollbind(FALSE);
@@ -6189,7 +6241,7 @@ ex_splitview(exarg_T *eap)
}
# ifdef FEAT_BROWSE
cmdmod.browse = browse_flag;
cmdmod.cmod_flags = save_cmod_flags;
# endif
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
@@ -6362,7 +6414,7 @@ ex_resize(exarg_T *eap)
need_mouse_correct = TRUE;
# endif
n = atol((char *)eap->arg);
if (cmdmod.split & WSP_VERT)
if (cmdmod.cmod_split & WSP_VERT)
{
if (*eap->arg == '-' || *eap->arg == '+')
n += wp->w_width;
@@ -6454,7 +6506,7 @@ ex_open(exarg_T *eap)
}
/*
* ":edit", ":badd", ":visual".
* ":edit", ":badd", ":balt", ":visual".
*/
static void
ex_edit(exarg_T *eap)
@@ -6543,7 +6595,7 @@ do_exedit(
else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|| *eap->arg != NUL
#ifdef FEAT_BROWSE
|| cmdmod.browse
|| (cmdmod.cmod_flags & CMOD_BROWSE)
#endif
)
{
@@ -6569,7 +6621,8 @@ do_exedit(
+ (eap->forceit ? ECMD_FORCEIT : 0)
// after a split we can use an existing buffer
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0)
+ (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0)
, old_curwin == NULL ? curwin : NULL) == FAIL)
{
// Editing the file failed. If the window was split, close it.
@@ -6632,7 +6685,7 @@ do_exedit(
&& curwin != old_curwin
&& win_valid(old_curwin)
&& old_curwin->w_buffer != curbuf
&& !cmdmod.keepalt)
&& (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
old_curwin->w_alt_fnum = curbuf->b_fnum;
ex_no_reprint = TRUE;
@@ -6777,7 +6830,7 @@ ex_read(exarg_T *eap)
return;
#ifdef FEAT_BROWSE
if (cmdmod.browse)
if (cmdmod.cmod_flags & CMOD_BROWSE)
{
char_u *browseFile;
@@ -7217,8 +7270,8 @@ ex_wincmd(exarg_T *eap)
else if (!eap->skip)
{
// Pass flags on for ":vertical wincmd ]".
postponed_split_flags = cmdmod.split;
postponed_split_tab = cmdmod.tab;
postponed_split_flags = cmdmod.cmod_split;
postponed_split_tab = cmdmod.cmod_tab;
do_window(*eap->arg, eap->addr_count > 0 ? eap->line2 : 0L, xchar);
postponed_split_flags = 0;
postponed_split_tab = 0;
@@ -7621,7 +7674,7 @@ ex_redir(exarg_T *eap)
if (fname == NULL)
return;
#ifdef FEAT_BROWSE
if (cmdmod.browse)
if (cmdmod.cmod_flags & CMOD_BROWSE)
{
char_u *browseFile;
@@ -8095,6 +8148,9 @@ ex_startinsert(exarg_T *eap)
restart_edit = 'i';
curwin->w_curswant = 0; // avoid MAXCOL
}
if (VIsual_active)
showmode();
}
/*
@@ -8293,8 +8349,8 @@ ex_pedit(exarg_T *eap)
ex_stag(exarg_T *eap)
{
postponed_split = -1;
postponed_split_flags = cmdmod.split;
postponed_split_tab = cmdmod.tab;
postponed_split_flags = cmdmod.cmod_split;
postponed_split_tab = cmdmod.cmod_tab;
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
postponed_split_flags = 0;
postponed_split_tab = 0;
@@ -8420,7 +8476,7 @@ find_cmdline_var(char_u *src, int *usedlen)
* Evaluate cmdline variables.
*
* change '%' to curbuf->b_ffname
* '#' to curwin->w_altfile
* '#' to curwin->w_alt_fnum
* '<cword>' to word under the cursor
* '<cWORD>' to WORD under the cursor
* '<cexpr>' to C-expression under the cursor

View File

@@ -930,16 +930,22 @@ leave_block(cstack_T *cstack)
{
scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
int i;
int func_defined =
cstack->cs_flags[cstack->cs_idx] & CSF_FUNC_DEF;
for (i = cstack->cs_script_var_len[cstack->cs_idx];
i < si->sn_var_vals.ga_len; ++i)
{
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + i;
// sv_name is set to NULL if it was already removed. This happens
// when it was defined in an inner block and no functions were
// defined there.
if (sv->sv_name != NULL)
// Remove a variable declared inside the block, if it still
// exists, from sn_vars and move the value into sn_all_vars.
hide_script_var(si, i);
// exists, from sn_vars and move the value into sn_all_vars
// if "func_defined" is non-zero.
hide_script_var(si, i, func_defined);
}
// TODO: is this needed?

View File

@@ -142,6 +142,7 @@ restore_viewstate(viewstate_T *vs)
typedef struct {
pos_T search_start; // where 'incsearch' starts searching
pos_T save_cursor;
int winid; // window where this state is valid
viewstate_T init_viewstate;
viewstate_T old_viewstate;
pos_T match_start;
@@ -154,6 +155,7 @@ typedef struct {
static void
init_incsearch_state(incsearch_state_T *is_state)
{
is_state->winid = curwin->w_id;
is_state->match_start = curwin->w_cursor;
is_state->did_incsearch = FALSE;
is_state->incsearch_postponed = FALSE;
@@ -195,7 +197,7 @@ do_incsearch_highlighting(
int *patlen)
{
char_u *cmd;
cmdmod_T save_cmdmod = cmdmod;
cmdmod_T dummy_cmdmod;
char_u *p;
int delim_optional = FALSE;
int delim;
@@ -231,8 +233,8 @@ do_incsearch_highlighting(
ea.cmd = ccline.cmdbuff;
ea.addr_type = ADDR_LINES;
parse_command_modifiers(&ea, &dummy, TRUE);
cmdmod = save_cmdmod;
CLEAR_FIELD(dummy_cmdmod);
parse_command_modifiers(&ea, &dummy, &dummy_cmdmod, TRUE);
cmd = skip_range(ea.cmd, TRUE, NULL);
if (vim_strchr((char_u *)"sgvl", *cmd) == NULL)
@@ -1703,13 +1705,17 @@ getcmdline_int(
// Trigger SafeState if nothing is pending.
may_trigger_safestate(xpc.xp_numfiles <= 0);
cursorcmd(); // set the cursor on the right spot
// Get a character. Ignore K_IGNORE and K_NOP, they should not do
// anything, such as stop completion.
do
{
cursorcmd(); // set the cursor on the right spot
c = safe_vgetc();
while (c == K_IGNORE || c == K_NOP);
} while (c == K_IGNORE || c == K_NOP);
if (c == K_COMMAND
&& do_cmdline(NULL, getcmdkeycmd, NULL, DOCMD_NOWAIT) == OK)
goto cmdline_changed;
if (KeyTyped)
{
@@ -2323,6 +2329,11 @@ cmdline_not_changed:
#endif
cmdline_changed:
#ifdef FEAT_SEARCH_EXTRA
// If the window changed incremental search state is not valid.
if (is_state.winid != curwin->w_id)
init_incsearch_state(&is_state);
#endif
// Trigger CmdlineChanged autocommands.
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINECHANGED);
@@ -4163,8 +4174,8 @@ open_cmdwin(void)
pum_undisplay();
// don't use a new tab page
cmdmod.tab = 0;
cmdmod.noswapfile = 1;
cmdmod.cmod_tab = 0;
cmdmod.cmod_flags |= CMOD_NOSWAPFILE;
// Create a window for the command-line buffer.
if (win_split((int)p_cwh, WSP_BOT) == FAIL)

View File

@@ -2501,7 +2501,7 @@ failed:
check_cursor_lnum();
beginline(BL_WHITE | BL_FIX); // on first non-blank
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set '[ and '] marks to the newly read lines.
curbuf->b_op_start.lnum = from + 1;
@@ -4208,7 +4208,7 @@ buf_check_timestamp(
msg_puts_attr(mesg2, HL_ATTR(HLF_W) + MSG_HIST);
msg_clr_eos();
(void)msg_end();
if (emsg_silent == 0)
if (emsg_silent == 0 && !in_assert_fails)
{
out_flush();
#ifdef FEAT_GUI

View File

@@ -2213,11 +2213,11 @@ do_browse(
char_u *fname;
static char_u *last_dir = NULL; // last used directory
char_u *tofree = NULL;
int save_browse = cmdmod.browse;
int save_cmod_flags = cmdmod.cmod_flags;
// Must turn off browse to avoid that autocommands will get the
// flag too!
cmdmod.browse = FALSE;
cmdmod.cmod_flags &= ~CMOD_BROWSE;
if (title == NULL || *title == NUL)
{
@@ -2350,7 +2350,7 @@ do_browse(
}
vim_free(tofree);
cmdmod.browse = save_browse;
cmdmod.cmod_flags = save_cmod_flags;
return fname;
}

View File

@@ -640,7 +640,10 @@ foldCreate(linenr_T start, linenr_T end)
break;
}
}
i = (int)(fp - (fold_T *)gap->ga_data);
if (gap->ga_len == 0)
i = 0;
else
i = (int)(fp - (fold_T *)gap->ga_data);
}
if (ga_grow(gap, 1) == OK)
@@ -902,6 +905,8 @@ foldMoveTo(
// that moves the cursor is used.
lnum_off = 0;
gap = &curwin->w_folds;
if (gap->ga_len == 0)
break;
use_level = FALSE;
maybe_small = FALSE;
lnum_found = curwin->w_cursor.lnum;

View File

@@ -2155,7 +2155,8 @@ parse_queued_messages(void)
// Do not handle messages while redrawing, because it may cause buffers to
// change or be wiped while they are being redrawn.
if (updating_screen)
// Also bail out when parsing messages was explicitly disabled.
if (updating_screen || dont_parse_messages)
return;
// If memory allocation fails during startup we'll exit but curbuf or
@@ -3618,3 +3619,100 @@ input_available(void)
);
}
#endif
/*
* Function passed to do_cmdline() to get the command after a <Cmd> key from
* typeahead.
*/
char_u *
getcmdkeycmd(
int promptc UNUSED,
void *cookie UNUSED,
int indent UNUSED,
getline_opt_T do_concat UNUSED)
{
garray_T line_ga;
int c1 = -1;
int c2;
int cmod = 0;
int aborted = FALSE;
ga_init2(&line_ga, 1, 32);
// no mapping for these characters
no_mapping++;
got_int = FALSE;
while (c1 != NUL && !aborted)
{
if (ga_grow(&line_ga, 32) != OK)
{
aborted = TRUE;
break;
}
if (vgetorpeek(FALSE) == NUL)
{
// incomplete <Cmd> is an error, because there is not much the user
// could do in this state.
emsg(_(e_cmd_mapping_must_end_with_cr));
aborted = TRUE;
break;
}
// Get one character at a time.
c1 = vgetorpeek(TRUE);
// Get two extra bytes for special keys
if (c1 == K_SPECIAL)
{
c1 = vgetorpeek(TRUE);
c2 = vgetorpeek(TRUE);
if (c1 == KS_MODIFIER)
{
cmod = c2;
continue;
}
c1 = TO_SPECIAL(c1, c2);
}
if (got_int)
aborted = TRUE;
else if (c1 == '\r' || c1 == '\n')
c1 = NUL; // end the line
else if (c1 == ESC)
aborted = TRUE;
else if (c1 == K_COMMAND)
{
// give a nicer error message for this special case
emsg(_(e_cmd_mapping_must_end_with_cr_before_second_cmd));
aborted = TRUE;
}
else if (IS_SPECIAL(c1))
{
if (c1 == K_SNR)
{
ga_append(&line_ga, (char)K_SPECIAL);
ga_append(&line_ga, (char)KS_EXTRA);
ga_append(&line_ga, (char)KE_SNR);
}
else
{
semsg(e_cmd_maping_must_not_include_str_key,
get_special_key_name(c1, cmod));
aborted = TRUE;
}
}
else
ga_append(&line_ga, (char)c1);
cmod = 0;
}
no_mapping--;
if (aborted)
ga_clear(&line_ga);
return (char_u *)line_ga.ga_data;
}

View File

@@ -221,7 +221,6 @@ EXTERN int emsg_skip INIT(= 0); // don't display errors for
EXTERN int emsg_severe INIT(= FALSE); // use message of next of several
// emsg() calls for throw
// used by assert_fails()
EXTERN int emsg_assert_fails_used INIT(= FALSE);
EXTERN char_u *emsg_assert_fails_msg INIT(= NULL);
EXTERN long emsg_assert_fails_lnum INIT(= 0);
EXTERN char_u *emsg_assert_fails_context INIT(= NULL);
@@ -582,6 +581,12 @@ EXTERN int diff_need_scrollbind INIT(= FALSE);
// ('lines' and 'rows') must not be changed.
EXTERN int updating_screen INIT(= FALSE);
#ifdef MESSAGE_QUEUE
// While closing windows or buffers messages should not be handled to avoid
// using invalid windows or buffers.
EXTERN int dont_parse_messages INIT(= FALSE);
#endif
#ifdef FEAT_MENU
// The root of the menu hierarchy.
EXTERN vimmenu_T *root_menu INIT(= NULL);
@@ -1130,6 +1135,8 @@ EXTERN int emsg_silent INIT(= 0); // don't print error messages
EXTERN int emsg_noredir INIT(= 0); // don't redirect error messages
EXTERN int cmd_silent INIT(= FALSE); // don't echo the command line
EXTERN int in_assert_fails INIT(= FALSE); // assert_fails() active
EXTERN int swap_exists_action INIT(= SEA_NONE);
// For dialog when swap file already
// exists.
@@ -1698,7 +1705,7 @@ EXTERN char e_invalblob[] INIT(= N_("E978: Invalid operation for Blob"));
EXTERN char e_toomanyarg[] INIT(= N_("E118: Too many arguments for function: %s"));
EXTERN char e_toofewarg[] INIT(= N_("E119: Not enough arguments for function: %s"));
EXTERN char e_func_deleted[] INIT(= N_("E933: Function was deleted: %s"));
EXTERN char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: %s"));
EXTERN char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
EXTERN char e_listreq[] INIT(= N_("E714: List required"));
EXTERN char e_listblobreq[] INIT(= N_("E897: List or Blob required"));
EXTERN char e_list_end[] INIT(= N_("E697: Missing end of List ']': %s"));

View File

@@ -864,10 +864,10 @@ gui_shell_closed(void)
// Only exit when there are no changed files
exiting = TRUE;
# ifdef FEAT_BROWSE
cmdmod.browse = TRUE;
cmdmod.cmod_flags |= CMOD_BROWSE;
# endif
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
cmdmod.confirm = TRUE;
cmdmod.cmod_flags |= CMOD_CONFIRM;
# endif
// If there are changed buffers, present the user with a dialog if
// possible, otherwise give an error message.

View File

@@ -179,9 +179,9 @@ static void SFdrawLists(int doScroll);
static void SFdrawList(int n, int doScroll);
static void SFclearList(int n, int doScroll);
static char SFstatChar(stat_T *statBuf);
static void SFmotionList(Widget w, int n, XMotionEvent *event);
static void SFmotionList(Widget w, XtPointer np, XMotionEvent *event, Boolean *cont);
static void SFvSliderMovedCallback(Widget w, int n, int nw);
static Boolean SFworkProc(void);
static Boolean SFworkProc(void *);
static int SFcompareEntries(const void *p, const void *q);
////////////////// xstat.h
@@ -798,19 +798,22 @@ SFsetText(char *path)
static void
SFbuttonPressList(
Widget w UNUSED,
int n UNUSED,
XButtonPressedEvent *event UNUSED)
Widget w UNUSED,
XtPointer np UNUSED,
XEvent *event UNUSED,
Boolean *cont UNUSED)
{
SFbuttonPressed = 1;
}
static void
SFbuttonReleaseList(
Widget w,
int n,
XButtonReleasedEvent *event)
Widget w UNUSED,
XtPointer np,
XEvent *event UNUSED,
Boolean *cont UNUSED)
{
long n = (long)np;
SFDir *dir;
SFbuttonPressed = 0;
@@ -823,7 +826,7 @@ SFbuttonReleaseList(
dir = &(SFdirs[SFdirPtr + n]);
SFreplaceText(dir,
dir->entries[dir->vOrigin + SFcurrentInvert[n]].shown);
SFmotionList(w, n, (XMotionEvent *) event);
SFmotionList(w, (XtPointer)(long)n, (XMotionEvent *)event, 0);
}
}
@@ -1600,9 +1603,14 @@ SFnewInvertEntry(int n, XMotionEvent *event)
}
static void
SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event)
SFenterList(
Widget w UNUSED,
XtPointer np,
XEvent *event,
Boolean *cont UNUSED)
{
int nw;
long n = (long)np;
int nw;
// sanity
if (SFcurrentInvert[n] != -1)
@@ -1620,8 +1628,14 @@ SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event)
}
static void
SFleaveList(Widget w UNUSED, int n, XEvent *event UNUSED)
SFleaveList(
Widget w UNUSED,
XtPointer np,
XEvent *event UNUSED,
Boolean *cont UNUSED)
{
long n = (long)np;
if (SFcurrentInvert[n] != -1)
{
SFinvertEntry(n);
@@ -1630,8 +1644,13 @@ SFleaveList(Widget w UNUSED, int n, XEvent *event UNUSED)
}
static void
SFmotionList(Widget w UNUSED, int n, XMotionEvent *event)
SFmotionList(
Widget w UNUSED,
XtPointer np,
XMotionEvent *event UNUSED,
Boolean *cont UNUSED)
{
long n = (long)np;
int nw;
nw = SFnewInvertEntry(n, event);
@@ -1954,7 +1973,7 @@ SFpathAreaSelectedCallback(
}
static Boolean
SFworkProc(void)
SFworkProc(void *arg UNUSED)
{
SFDir *dir;
SFEntry *entry;

View File

@@ -810,7 +810,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
void
gui_mch_set_text_area_pos(int x, int y, int w, int h)
{
gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h);
gui_gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h);
}
@@ -1005,7 +1005,7 @@ gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max)
gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)
{
if (sb->id != NULL)
gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h);
gui_gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h);
}
int
@@ -1111,7 +1111,7 @@ gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
GtkAdjustment *adjustment;
gtk_widget_set_can_focus(sb->id, FALSE);
gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0);
gui_gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0);
adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id));

View File

@@ -11,7 +11,6 @@
* (C) 1998,1999 by Marcin Dalecki <martin@dalecki.de>
*
* Support for GTK+ 2 was added by:
*
* (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
* Daniel Elstner <daniel.elstner@gmx.net>
*
@@ -21,7 +20,6 @@
* long time.
*
* Support for GTK+ 3 was added by:
*
* 2016 Kazunobu Kuriyama <kazunobu.kuriyama@gmail.com>
*/
@@ -50,52 +48,40 @@ struct _GtkFormChild
};
static void gtk_form_class_init(GtkFormClass *klass);
static void gtk_form_init(GtkForm *form);
static void gtk_form_realize(GtkWidget *widget);
static void gtk_form_unrealize(GtkWidget *widget);
static void gtk_form_map(GtkWidget *widget);
static void gtk_form_size_request(GtkWidget *widget,
GtkRequisition *requisition);
static void gui_gtk_form_class_init(GtkFormClass *klass);
#if GTK_CHECK_VERSION(3,0,0)
static void gtk_form_get_preferred_width(GtkWidget *widget,
gint *minimal_width,
gint *natural_width);
static void gtk_form_get_preferred_height(GtkWidget *widget,
gint *minimal_height,
gint *natural_height);
#endif
static void gtk_form_size_allocate(GtkWidget *widget,
GtkAllocation *allocation);
#if GTK_CHECK_VERSION(3,0,0)
static gboolean gtk_form_draw(GtkWidget *widget,
cairo_t *cr);
static void gui_gtk_form_init(GtkForm *form);
#else
static gint gtk_form_expose(GtkWidget *widget,
GdkEventExpose *event);
static void gui_gtk_form_init(GtkForm *form, void *g_class);
#endif
static void gtk_form_remove(GtkContainer *container,
GtkWidget *widget);
static void gtk_form_forall(GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static void form_realize(GtkWidget *widget);
static void form_unrealize(GtkWidget *widget);
static void form_map(GtkWidget *widget);
static void form_size_request(GtkWidget *widget, GtkRequisition *requisition);
#if GTK_CHECK_VERSION(3,0,0)
static void form_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width);
static void form_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height);
#endif
static void form_size_allocate(GtkWidget *widget, GtkAllocation *allocation);
#if GTK_CHECK_VERSION(3,0,0)
static gboolean form_draw(GtkWidget *widget, cairo_t *cr);
#else
static gint form_expose(GtkWidget *widget, GdkEventExpose *event);
#endif
static void gtk_form_attach_child_window(GtkForm *form,
GtkFormChild *child);
static void gtk_form_realize_child(GtkForm *form,
GtkFormChild *child);
static void gtk_form_position_child(GtkForm *form,
GtkFormChild *child,
gboolean force_allocate);
static void gtk_form_position_children(GtkForm *form);
static void form_remove(GtkContainer *container, GtkWidget *widget);
static void form_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
static void gtk_form_send_configure(GtkForm *form);
static void form_attach_child_window(GtkForm *form, GtkFormChild *child);
static void form_realize_child(GtkForm *form, GtkFormChild *child);
static void form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate);
static void form_position_children(GtkForm *form);
static void gtk_form_child_map(GtkWidget *widget, gpointer user_data);
static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data);
static void form_send_configure(GtkForm *form);
static void form_child_map(GtkWidget *widget, gpointer user_data);
static void form_child_unmap(GtkWidget *widget, gpointer user_data);
#if !GTK_CHECK_VERSION(3,0,0)
static GtkWidgetClass *parent_class = NULL;
@@ -104,24 +90,25 @@ static GtkWidgetClass *parent_class = NULL;
// Public interface
GtkWidget *
gtk_form_new(void)
gui_gtk_form_new(void)
{
GtkForm *form;
#if GTK_CHECK_VERSION(3,0,0)
form = g_object_new(GTK_TYPE_FORM, NULL);
#else
form = gtk_type_new(gtk_form_get_type());
form = gtk_type_new(gui_gtk_form_get_type());
#endif
return GTK_WIDGET(form);
}
void
gtk_form_put(GtkForm *form,
GtkWidget *child_widget,
gint x,
gint y)
gui_gtk_form_put(
GtkForm *form,
GtkWidget *child_widget,
gint x,
gint y)
{
GtkFormChild *child;
@@ -151,22 +138,23 @@ gtk_form_put(GtkForm *form,
// that gtk_widget_set_parent() realizes the widget if it's visible
// and its parent is mapped.
if (gtk_widget_get_realized(GTK_WIDGET(form)))
gtk_form_attach_child_window(form, child);
form_attach_child_window(form, child);
gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
if (gtk_widget_get_realized(GTK_WIDGET(form))
&& !gtk_widget_get_realized(child_widget))
gtk_form_realize_child(form, child);
form_realize_child(form, child);
gtk_form_position_child(form, child, TRUE);
form_position_child(form, child, TRUE);
}
void
gtk_form_move(GtkForm *form,
GtkWidget *child_widget,
gint x,
gint y)
gui_gtk_form_move(
GtkForm *form,
GtkWidget *child_widget,
gint x,
gint y)
{
GList *tmp_list;
GtkFormChild *child;
@@ -181,14 +169,14 @@ gtk_form_move(GtkForm *form,
child->x = x;
child->y = y;
gtk_form_position_child(form, child, TRUE);
form_position_child(form, child, TRUE);
return;
}
}
}
void
gtk_form_freeze(GtkForm *form)
gui_gtk_form_freeze(GtkForm *form)
{
g_return_if_fail(GTK_IS_FORM(form));
@@ -196,7 +184,7 @@ gtk_form_freeze(GtkForm *form)
}
void
gtk_form_thaw(GtkForm *form)
gui_gtk_form_thaw(GtkForm *form)
{
g_return_if_fail(GTK_IS_FORM(form));
@@ -204,18 +192,19 @@ gtk_form_thaw(GtkForm *form)
{
if (!(--form->freeze_count))
{
gtk_form_position_children(form);
form_position_children(form);
gtk_widget_queue_draw(GTK_WIDGET(form));
}
}
}
// Basic Object handling procedures
#if GTK_CHECK_VERSION(3,0,0)
G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER)
G_DEFINE_TYPE(GtkForm, gui_gtk_form, GTK_TYPE_CONTAINER)
#else
GtkType
gtk_form_get_type(void)
gui_gtk_form_get_type(void)
{
static GtkType form_type = 0;
@@ -227,8 +216,8 @@ gtk_form_get_type(void)
form_info.type_name = "GtkForm";
form_info.object_size = sizeof(GtkForm);
form_info.class_size = sizeof(GtkFormClass);
form_info.class_init_func = (GtkClassInitFunc)gtk_form_class_init;
form_info.object_init_func = (GtkObjectInitFunc)gtk_form_init;
form_info.class_init_func = (GtkClassInitFunc)gui_gtk_form_class_init;
form_info.object_init_func = (GtkObjectInitFunc)gui_gtk_form_init;
form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
}
@@ -237,7 +226,7 @@ gtk_form_get_type(void)
#endif // !GTK_CHECK_VERSION(3,0,0)
static void
gtk_form_class_init(GtkFormClass *klass)
gui_gtk_form_class_init(GtkFormClass *klass)
{
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
@@ -249,28 +238,32 @@ gtk_form_class_init(GtkFormClass *klass)
parent_class = gtk_type_class(gtk_container_get_type());
#endif
widget_class->realize = gtk_form_realize;
widget_class->unrealize = gtk_form_unrealize;
widget_class->map = gtk_form_map;
widget_class->realize = form_realize;
widget_class->unrealize = form_unrealize;
widget_class->map = form_map;
#if GTK_CHECK_VERSION(3,0,0)
widget_class->get_preferred_width = gtk_form_get_preferred_width;
widget_class->get_preferred_height = gtk_form_get_preferred_height;
widget_class->get_preferred_width = form_get_preferred_width;
widget_class->get_preferred_height = form_get_preferred_height;
#else
widget_class->size_request = gtk_form_size_request;
widget_class->size_request = form_size_request;
#endif
widget_class->size_allocate = gtk_form_size_allocate;
widget_class->size_allocate = form_size_allocate;
#if GTK_CHECK_VERSION(3,0,0)
widget_class->draw = gtk_form_draw;
widget_class->draw = form_draw;
#else
widget_class->expose_event = gtk_form_expose;
widget_class->expose_event = form_expose;
#endif
container_class->remove = gtk_form_remove;
container_class->forall = gtk_form_forall;
container_class->remove = form_remove;
container_class->forall = form_forall;
}
static void
gtk_form_init(GtkForm *form)
gui_gtk_form_init(GtkForm *form
#if !GTK_CHECK_VERSION(3,0,0)
, void *g_class UNUSED
#endif
)
{
#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_has_window(GTK_WIDGET(form), TRUE);
@@ -285,7 +278,7 @@ gtk_form_init(GtkForm *form)
*/
static void
gtk_form_realize(GtkWidget *widget)
form_realize(GtkWidget *widget)
{
GList *tmp_list;
GtkForm *form;
@@ -353,10 +346,10 @@ gtk_form_realize(GtkWidget *widget)
{
GtkFormChild *child = tmp_list->data;
gtk_form_attach_child_window(form, child);
form_attach_child_window(form, child);
if (gtk_widget_get_visible(child->widget))
gtk_form_realize_child(form, child);
form_realize_child(form, child);
}
}
@@ -369,7 +362,7 @@ gtk_form_realize(GtkWidget *widget)
// Well, I reckon at least the gdk_window_show(form->bin_window)
// is necessary. GtkForm is anything but a usual container widget.
static void
gtk_form_map(GtkWidget *widget)
form_map(GtkWidget *widget)
{
GList *tmp_list;
GtkForm *form;
@@ -394,7 +387,7 @@ gtk_form_map(GtkWidget *widget)
}
static void
gtk_form_unrealize(GtkWidget *widget)
form_unrealize(GtkWidget *widget)
{
GList *tmp_list;
GtkForm *form;
@@ -416,10 +409,10 @@ gtk_form_unrealize(GtkWidget *widget)
if (child->window != NULL)
{
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(gtk_form_child_map),
FUNC2GENERIC(form_child_map),
child);
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(gtk_form_child_unmap),
FUNC2GENERIC(form_child_unmap),
child);
gdk_window_set_user_data(child->window, NULL);
@@ -432,8 +425,8 @@ gtk_form_unrealize(GtkWidget *widget)
}
#if GTK_CHECK_VERSION(3,0,0)
if (GTK_WIDGET_CLASS (gtk_form_parent_class)->unrealize)
(* GTK_WIDGET_CLASS (gtk_form_parent_class)->unrealize) (widget);
if (GTK_WIDGET_CLASS (gui_gtk_form_parent_class)->unrealize)
(* GTK_WIDGET_CLASS (gui_gtk_form_parent_class)->unrealize) (widget);
#else
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
@@ -441,7 +434,7 @@ gtk_form_unrealize(GtkWidget *widget)
}
static void
gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
form_size_request(GtkWidget *widget, GtkRequisition *requisition)
{
g_return_if_fail(GTK_IS_FORM(widget));
g_return_if_fail(requisition != NULL);
@@ -452,26 +445,26 @@ gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
#if GTK_CHECK_VERSION(3,0,0)
static void
gtk_form_get_preferred_width(GtkWidget *widget,
form_get_preferred_width(GtkWidget *widget,
gint *minimal_width,
gint *natural_width)
{
GtkRequisition requisition;
gtk_form_size_request(widget, &requisition);
form_size_request(widget, &requisition);
*minimal_width = requisition.width;
*natural_width = requisition.width;
}
static void
gtk_form_get_preferred_height(GtkWidget *widget,
form_get_preferred_height(GtkWidget *widget,
gint *minimal_height,
gint *natural_height)
{
GtkRequisition requisition;
gtk_form_size_request(widget, &requisition);
form_size_request(widget, &requisition);
*minimal_height = requisition.height;
*natural_height = requisition.height;
@@ -479,7 +472,7 @@ gtk_form_get_preferred_height(GtkWidget *widget,
#endif // GTK_CHECK_VERSION(3,0,0)
static void
gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
{
GList *tmp_list;
GtkForm *form;
@@ -507,7 +500,7 @@ gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
while (tmp_list)
{
GtkFormChild *child = tmp_list->data;
gtk_form_position_child(form, child, TRUE);
form_position_child(form, child, TRUE);
tmp_list = tmp_list->next;
}
@@ -524,7 +517,7 @@ gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
}
gtk_widget_set_allocation(widget, allocation);
if (need_reposition)
gtk_form_send_configure(form);
form_send_configure(form);
}
#if GTK_CHECK_VERSION(3,0,0)
@@ -538,7 +531,7 @@ gtk_form_render_background(GtkWidget *widget, cairo_t *cr)
}
static gboolean
gtk_form_draw(GtkWidget *widget, cairo_t *cr)
form_draw(GtkWidget *widget, cairo_t *cr)
{
GList *tmp_list = NULL;
GtkForm *form = NULL;
@@ -563,19 +556,19 @@ gtk_form_draw(GtkWidget *widget, cairo_t *cr)
// gtk_widget_draw() fails and the relevant scrollbar won't
// appear on the screen.
//
// Calling gtk_form_position_child() like this is one of ways
// Calling form_position_child() like this is one of ways
// to make sure of that.
gtk_form_position_child(form, formchild, TRUE);
form_position_child(form, formchild, TRUE);
gtk_form_render_background(formchild->widget, cr);
}
}
return GTK_WIDGET_CLASS(gtk_form_parent_class)->draw(widget, cr);
return GTK_WIDGET_CLASS(gui_gtk_form_parent_class)->draw(widget, cr);
}
#else // !GTK_CHECK_VERSION(3,0,0)
static gint
gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
form_expose(GtkWidget *widget, GdkEventExpose *event)
{
GList *tmp_list;
GtkForm *form;
@@ -598,7 +591,7 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
// Container method
static void
gtk_form_remove(GtkContainer *container, GtkWidget *widget)
form_remove(GtkContainer *container, GtkWidget *widget)
{
GList *tmp_list;
GtkForm *form;
@@ -625,9 +618,9 @@ gtk_form_remove(GtkContainer *container, GtkWidget *widget)
if (child->window)
{
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(&gtk_form_child_map), child);
FUNC2GENERIC(&form_child_map), child);
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(&gtk_form_child_unmap), child);
FUNC2GENERIC(&form_child_unmap), child);
// FIXME: This will cause problems for reparenting NO_WINDOW
// widgets out of a GtkForm
@@ -646,7 +639,7 @@ gtk_form_remove(GtkContainer *container, GtkWidget *widget)
}
static void
gtk_form_forall(GtkContainer *container,
form_forall(GtkContainer *container,
gboolean include_internals UNUSED,
GtkCallback callback,
gpointer callback_data)
@@ -673,7 +666,7 @@ gtk_form_forall(GtkContainer *container,
// Operations on children
static void
gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
form_attach_child_window(GtkForm *form, GtkFormChild *child)
{
if (child->window != NULL)
return; // been there, done that
@@ -734,9 +727,9 @@ gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
* alongside with the actual widget.
*/
g_signal_connect(G_OBJECT(child->widget), "map",
G_CALLBACK(&gtk_form_child_map), child);
G_CALLBACK(&form_child_map), child);
g_signal_connect(G_OBJECT(child->widget), "unmap",
G_CALLBACK(&gtk_form_child_unmap), child);
G_CALLBACK(&form_child_unmap), child);
}
else if (!gtk_widget_get_realized(child->widget))
{
@@ -745,15 +738,14 @@ gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
}
static void
gtk_form_realize_child(GtkForm *form, GtkFormChild *child)
form_realize_child(GtkForm *form, GtkFormChild *child)
{
gtk_form_attach_child_window(form, child);
form_attach_child_window(form, child);
gtk_widget_realize(child->widget);
}
static void
gtk_form_position_child(GtkForm *form, GtkFormChild *child,
gboolean force_allocate)
form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate)
{
gint x;
gint y;
@@ -826,16 +818,16 @@ gtk_form_position_child(GtkForm *form, GtkFormChild *child,
}
static void
gtk_form_position_children(GtkForm *form)
form_position_children(GtkForm *form)
{
GList *tmp_list;
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
gtk_form_position_child(form, tmp_list->data, FALSE);
form_position_child(form, tmp_list->data, FALSE);
}
void
gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
gui_gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
gint x, gint y, gint w, gint h)
{
#if GTK_CHECK_VERSION(3,0,0)
@@ -845,11 +837,11 @@ gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
widget->requisition.height = h;
#endif
gtk_form_move(form, widget, x, y);
gui_gtk_form_move(form, widget, x, y);
}
static void
gtk_form_send_configure(GtkForm *form)
form_send_configure(GtkForm *form)
{
GtkWidget *widget;
GdkEventConfigure event;
@@ -869,7 +861,7 @@ gtk_form_send_configure(GtkForm *form)
}
static void
gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
{
GtkFormChild *child;
@@ -880,7 +872,7 @@ gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
}
static void
gtk_form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data)
form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data)
{
GtkFormChild *child;

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