Compare commits

...

142 Commits

Author SHA1 Message Date
Kazuki Sakamoto e80371bfbb MacVim Snapshot 123
Binary targets macOS 10.8+

- Vim patch 8.0.0228

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6
- Ruby 2.0
2017-01-24 08:24:15 -08:00
Kazuki Sakamoto 43ac38d613 Merge remote-tracking branch 'vim/master' 2017-01-24 08:23:23 -08:00
Bram Moolenaar abbc448bc0 patch 8.0.0228: pasting in xterm on the command line has PasteStart
Problem:    When pasting test in an xterm on the command line it is surrounded
            by <PasteStart> and <PasteEnd>. (Johannes Kaltenbach)
Solution:   Add missing changes.
2017-01-24 15:57:55 +01:00
Bram Moolenaar 2aa5f696b9 patch 8.0.0227: crash with ff=dos when first line in file has no CR
Problem:    Crash when 'fileformat' is forced to "dos" and the first line in
            the file is empty and does not have a CR character.
Solution:   Don't check for CR before the start of the buffer.
2017-01-24 15:46:48 +01:00
Bram Moolenaar 1695f99d08 patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Problem:    The test for patch 8.0.0224 misses the CR characters and passes
            even without the fix. (Christian Brabandt)
Solution:   Use double quotes and \<CR>.
2017-01-24 13:18:43 +01:00
Bram Moolenaar 9957a10d0f patch 8.0.0225: put in Visual block mode terminates early
Problem:    When a block is visually selected and put is used on the end of
            the selection only one line is changed.
Solution:   Check for the end properly. (Christian Brabandt, neovim issue
            5781)
2017-01-23 21:53:53 +01:00
Bram Moolenaar 7a2699e868 patch 8.0.0224: change to 'fileformats' from autocmd does not take effect
Problem:    When 'fileformats' is changed in a BufReadPre auto command, it
            does not take effect in readfile(). (Gary Johnson)
Solution:   Check the value of 'fileformats' after executing auto commands.
            (Christian Brabandt)
2017-01-23 21:31:09 +01:00
Bram Moolenaar fffbf308dd patch 8.0.0223: Coverity warns for an uninitialized variable
Problem:    Coverity gets confused by the flags passed to find_tags() and
            warnts for an uninitialized variable.
Solution:   Disallow using cscope and help tags at the same time.
2017-01-23 20:47:12 +01:00
Kazuki Sakamoto 831e48f10b MacVim Snapshot 122
Binary targets macOS 10.8+

- Vim patch 8.0.0222

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6
- Ruby 2.0
2017-01-23 11:32:00 -08:00
Kazuki Sakamoto e091a4b25c Merge remote-tracking branch 'vim/master' 2017-01-22 20:47:59 -08:00
Bram Moolenaar c81299684b patch 8.0.0222: blockwise put on multi-byte character misplaced
Problem:    When a multi-byte character ends in a zero byte, putting blockwise
            text puts it before the character instead of after it.
Solution:   Use int instead of char for the character under the cursor.
            (Luchr, closes #1403)  Add a test.
2017-01-22 20:04:51 +01:00
Bram Moolenaar 6a8ede99dd patch 8.0.0221: unnecessary condition on PROTO
Problem:    Checking if PROTO is defined inside a function has no effect.
Solution:   Remove the check for PROTO. (Hirohito Higashi)
2017-01-22 19:49:12 +01:00
Bram Moolenaar 15eedf1d62 patch 8.0.0220: completion of highlight names misses a few values
Problem:    Completion for :match does not show "none" and other missing
            highlight names.
Solution:   Skip over cleared entries before checking the index to be at the
            end.
2017-01-22 19:25:33 +01:00
Bram Moolenaar 7a40ea2138 patch 8.0.0219: ubsan reports errors for overflow
Problem:    Ubsan reports errors for integer overflow.
Solution:   Define macros for minimum and maximum values.  Select an
            expression based on the value. (Mike Williams)
2017-01-22 18:34:57 +01:00
Bram Moolenaar 2b2207ba69 patch 8.0.0218: no completion for :cexpr and similar commands
Problem:    No command line completion for :cexpr, :cgetexpr, :caddexpr, etc.
Solution:   Make completion work. (Yegappan Lakshmanan)  Add a test.
2017-01-22 16:46:56 +01:00
Bram Moolenaar e2d74dbe19 patch 8.0.0217: build fails without cscope feature
Problem:    Build fails without the cscope feature.
Solution:   Add #ifdef.
2017-01-22 16:13:35 +01:00
Bram Moolenaar e2c6037da3 patch 8.0.0216: decoding js style json may fail
Problem:    When decoding JSON with a JS style object the JSON test may use a
            NULL pointer. (Coverity)
Solution:   Check for a NULL pointer.
2017-01-22 15:56:26 +01:00
Bram Moolenaar e362c3d2c3 patch 8.0.0215: NULL pointer use if cscope line looks like emacs tag
Problem:    When a Cscope line contains CTRL-L a NULL pointer may be used.
            (Coverity)
Solution:   Don't check for an emacs tag in a cscope line.
2017-01-22 15:40:00 +01:00
Bram Moolenaar d7a96151e0 patch 8.0.0214: leaking memory when syntax cluster id is unknown
Problem:    Leaking memory when syntax cluster id is unknown. (Coverity)
Solution:   Free the memory.
2017-01-22 15:28:55 +01:00
Bram Moolenaar ca24e2cfcf patch 8.0.0213: Netbeans specialKeys command does not check argument length
Problem:    The Netbeans "specialKeys" command does not check if the argument
            fits in the buffer. (Coverity)
Solution:   Add a length check.
2017-01-22 15:19:22 +01:00
Bram Moolenaar 423977d3ce patch 8.0.0212: buffer for key name may be too small
Problem:    The buffer used to store a key name theoreticaly could be too
            small. (Coverity)
Solution:   Count all possible modifier characters.  Add a check for the
            length just in case.
2017-01-22 15:05:12 +01:00
Kazuki Sakamoto 88c8df3f81 Merge remote-tracking branch 'vim/master' 2017-01-21 13:55:41 -08:00
Bram Moolenaar 560379d7ae patch 8.0.0211: cannot build without the multi-byte feature
Problem:    Build fails if the multi-byte feature is disabled.
Solution:   Change #ifdef around ins_char_bytes.
2017-01-21 22:50:00 +01:00
Kazuki Sakamoto 33ed6029da Merge remote-tracking branch 'vim/master' 2017-01-21 13:45:16 -08:00
Bram Moolenaar ec2da36ca4 patch 8.0.0210: no support for bracketed paste
Problem:    Vim does not support bracketed paste, as implemented by xterm and
            other terminals.
Solution:   Add t_BE, t_BD, t_PS and t_PE.
2017-01-21 20:04:22 +01:00
Bram Moolenaar 41baa7983a patch 8.0.0209: cursor binding does not work with :substitute
Problem:    When using :substitute with the "c" flag and 'cursorbind' is set
            the cursor is not updated in other windows.
Solution:   Call do_check_cursorbind(). (Masanori Misono)
2017-01-21 14:45:09 +01:00
Kazuki Sakamoto bf5eddebf1 Merge remote-tracking branch 'vim/master' 2017-01-20 17:31:07 -08:00
Bram Moolenaar 25b0e6b701 patch 8.0.0208: internally used commands end up in history
Problem:    Internally used commands for CTRL-Z and mouse click end up in
            history. (Matthew Malcomson)
Solution:   Use do_cmdline_cmd() instead of stuffing them in the readahead
            buffer. (James McCoy, closes #1395)
2017-01-20 21:51:53 +01:00
Bram Moolenaar 23c9e8b3bc patch 8.0.0207: leaking file descriptor when system() fails
Problem:    Leaking file descriptor when system() cannot find the buffer.
            (Coverity)
Solution:   Close the file descriptor.  (Dominique Pelle, closes #1398)
2017-01-20 19:59:54 +01:00
Kazuki Sakamoto a5f2cc0333 Merge remote-tracking branch 'vim/master' 2017-01-17 18:57:49 -08:00
Bram Moolenaar 8822744b4d patch 8.0.0206: test coverage for :retab insufficient
Problem:    Test coverage for :retab insufficient.
Solution:   Add test for :retab. (Dominique Pelle, closes #1391)
2017-01-17 22:16:00 +01:00
Bram Moolenaar 5e4e1b1299 patch 8.0.0205: wrong behavior after :undojoin
Problem:    After :undojoin some commands don't work properly, such as :redo.
            (Matthew Malcomson)
Solution:   Don't set curbuf->b_u_curhead. (closes #1390)
2017-01-17 22:09:45 +01:00
Bram Moolenaar eb46f8fa14 patch 8.0.0204: compiler warns for uninitialized variable
Problem:    Compiler warns for uninitialized variable. (Tony Mechelynck)
Solution:   When skipping set "id" to -1.
2017-01-17 19:48:53 +01:00
Bram Moolenaar 6e78e27b8a patch 8.0.0203: order of complication flags is sometimes wrong
Problem:    Order of complication flags is sometimes wrong.
Solution:   Put interface-specific flags before ALL_CFLAGS. (idea by Yousong
            Zhou, closes #1100)
2017-01-17 19:20:15 +01:00
Bram Moolenaar 4007ed4a5e patch 8.0.0202: no test for invalid syntax group name
Problem:    No test for invalid syntax group name.
Solution:   Add a test for group name error and warning.
2017-01-17 18:14:54 +01:00
Bram Moolenaar d61e8aaae5 patch 8.0.0201: completion of highlight groups includes cleared names
Problem:    When completing a group name for a highlight or syntax command
            cleared groups are included.
Solution:   Skip groups that have been cleared.
2017-01-17 17:44:46 +01:00
Bram Moolenaar 58f60ca2fc patch 8.0.0200: some syntax arguments are not tested
Problem:    Some syntax arguments are not tested.
Solution:   Add more syntax command tests.
2017-01-17 17:19:00 +01:00
Bram Moolenaar 6d721c7e10 patch 8.0.0199: compiler warnings for libcall
Problem:    Warning for an unused parameter when the libcall feature is
            disabled.  Warning for a function type cast when compiling with
            -pedantic.
Solution:   Add UNUSED.  Use a different type cast. (Damien Molinier)
2017-01-17 16:56:28 +01:00
Bram Moolenaar de318c5c35 patch 8.0.0198: some syntax arguments take effect even after "if 0"
Problem:    Some syntax arguments take effect even after "if 0". (Taylor
            Venable)
Solution:   Properly skip the syntax statements.  Make "syn case" and "syn
            conceal" report the current state.  Fix that "syn clear" didn't
            reset the conceal flag.  Add tests for :syntax skipping properly.
2017-01-17 16:27:10 +01:00
Bram Moolenaar 369b6f57c4 Update runtime files. 2017-01-17 12:22:32 +01:00
Bram Moolenaar 97d62d4321 patch 8.0.0197: system() test skips some parts for MS-Windows
Problem:    On MS-Windows the system() test skips a few parts.
Solution:   Swap single and double quotes for the command.
2017-01-16 22:53:57 +01:00
Bram Moolenaar c011a3d083 patch 8.0.0196: profile test is slo and does not work on MS-Windows
Problem:    The test for :profile is slow and does not work on MS-Windows.
Solution:   Use the "-es" argument. (Dominique Pelle)  Swap single and double
            quotes for system()
2017-01-16 22:37:42 +01:00
Bram Moolenaar a9d23c2087 patch 8.0.0195: fail to jump to static tag in current file
Problem:    Jumping to a tag that is a static item in the current file fails.
            (Kazunobu Kuriyama)
Solution:   Make sure the first byte of the tag key is not NUL. (Suggested by
            James McCoy, closes #1387)
2017-01-16 20:53:34 +01:00
Bram Moolenaar e32bbded64 patch 8.0.0194: profile tests fails if total and self time are equal
Problem:    Profile tests fails if total and self time are equal.
Solution:   Make one time optional.
2017-01-15 21:12:48 +01:00
Bram Moolenaar 1b9750d805 patch 8.0.0193: accidentally removed #ifdef
Problem:    Accidentally removed #ifdef.
Solution:   Put it back. (Masanori Misono)
2017-01-15 20:51:37 +01:00
Bram Moolenaar 42b8d916c7 patch 8.0.0192: cannot build with tiny features
Problem:    Build fails with tiny features.
Solution:   Change #ifdef for hash_clear().  Avoid warning for unused
            argument.
2017-01-15 17:18:57 +01:00
Bram Moolenaar 4f391796b7 patch 8.0.0191: can't build with Ruby on some systems
Problem:    Some systems do not have ruby_sysinit(), causing the build to
            fail.
Solution:   Clean up how ruby_sysinit() and NtInitialize() are used. (Taro
            Muraoka)
2017-01-15 16:59:07 +01:00
Bram Moolenaar 810f9c361c patch 8.0.0190: finding duplicate tags uses a slow linear search
Problem:    Detecting duplicate tags uses a slow linear search.
Solution:   Use a much faster hash table solution. (James McCoy, closes #1046)
            But don't add hi_keylen, it makes hash tables 50% bigger.
2017-01-15 16:52:51 +01:00
Bram Moolenaar 296b1f28ca patch 8.0.0189: profile commands are not tested
Problem:    There are no tests for the :profile command.
Solution:   Add tests. (Dominique Pelle, closes #1383)
2017-01-15 15:22:33 +01:00
Bram Moolenaar 9506cad7a1 patch 8.0.0188: redrawing for 'cursorbind' is inefficient
Problem:    Using NOT_VALID for redraw_later() to update the cursor
            line/column highlighting is not efficient.
Solution:   Call validate_cursor() when 'cul' or 'cuc' is set.
2017-01-15 13:53:49 +01:00
Kazuki Sakamoto d5069d644e Merge remote-tracking branch 'vim/master' 2017-01-14 19:01:41 -08:00
Bram Moolenaar fe6ce331d9 patch 8.0.0187: cant build with new Ruby version
Problem:    Building with a new Ruby version fails.
Solution:   Use ruby_sysinit() instead of NtInitialize(). (Tomas Volf,
            closes #1382)
2017-01-14 20:12:01 +01:00
Bram Moolenaar 5869cf060e patch 8.0.0186: confusing error message from assert_notequal()
Problem:    The error message from assert_notequal() is confusing.
Solution:   Only mention the expected value.
2017-01-14 20:06:14 +01:00
Bram Moolenaar fad609d067 patch 8.0.0185: system() test fails on MS-Windows
Problem:    The system() test fails on MS-Windows.
Solution:   Skip the test on MS-Windows.
2017-01-14 19:38:36 +01:00
Bram Moolenaar 2b7bc567b9 patch 8.0.0184: when an error is caught Vim still exits with non-zero result
Problem:    When in Ex mode and an error is caught by try-catch, Vim still
            exits with a non-zero exit code.
Solution:   Don't set ex_exitval when inside a try-catch. (partly by Christian
            Brabandt)
2017-01-14 19:24:52 +01:00
Bram Moolenaar 7173b47958 patch 8.0.0183: ubsan warns for unaligned address
Problem:    Ubsan warns for using a pointer that is not aligned.
Solution:   First copy the address. (Yegappan Lakshmanan)
2017-01-14 17:04:38 +01:00
Bram Moolenaar e47683a091 patch 8.0.0182: cursor ilne not update when 'cursorbind' is set
Problem:    When 'cursorbind' and 'cursorline' are set, but 'cursorcolumn' is
            not, then the cursor line highlighting is not updated. (Hirohito
            Higashi)
Solution:   Call redraw_later() with NOT_VALID.
2017-01-14 15:52:46 +01:00
Bram Moolenaar 519d7785f4 patch 8.0.0181: with cursorbind set cursor column highlighting is off
Problem:    When 'cursorbind' and 'cursorcolumn' are both on, the column
            highlignt in non-current windows is wrong.
Solution:   Add validate_cursor(). (Masanori Misono, closes #1372)
2017-01-14 14:54:33 +01:00
Bram Moolenaar 83381f7129 patch 8.0.0180: error E937 is used twice
Problem:    Error E937 is used both for duplicate key in JSON and for trying
            to delete a buffer that is in use.
Solution:   Rename the JSON error to E938. (Norio Takagi, closes #1376)
2017-01-14 14:36:08 +01:00
Bram Moolenaar 9be7c04e6c patch 8.0.0179: cannot have a local value for 'formatprg'
Problem:    'formatprg' is a global option but the value may depend on the
            type of buffer. (Sung Pae)
Solution:   Make 'formatprg' global-local. (closes #1380)
2017-01-14 14:28:30 +01:00
Kazuki Sakamoto 40bc4e9b8d Merge remote-tracking branch 'vim/master' 2017-01-13 21:21:49 -08:00
Bram Moolenaar 9b73c4a215 patch 8.0.0178: command count test fails on MS-Windows
Problem:    test_command_count may fail when a previous test interferes, seen
            on MS-Windows.
Solution:   Run it separately.
2017-01-13 22:30:08 +01:00
Bram Moolenaar e13b9afe12 patch 8.0.0177: BufEnter autocommand not fired for a directory
Problem:    When opening a buffer on a directory and inside a try/catch then
            the BufEnter event is not triggered.
Solution:   Return NOTDONE from readfile() for a directory and deal with the
            three possible return values. (Justin M. Keyes, closes #1375,
            closes #1353)
2017-01-13 22:01:02 +01:00
Kazuki Sakamoto 0bdef250b2 Merge remote-tracking branch 'vim/master' 2017-01-12 20:48:36 -08:00
Bram Moolenaar 70bcd7336f patch 8.0.0176: cannot use :change inside a function definition
Problem:    Using :change in between :function and :endfunction fails.
Solution:   Recognize :change inside a function. (ichizok, closes #1374)
2017-01-12 22:20:54 +01:00
Bram Moolenaar 972c3b8f1b patch 8.0.0175: setting language on MS-Windows does not always work
Problem:    Setting language in gvim on MS-Windows does not work when
            libintl.dll is dynamically linked with msvcrt.dll.
Solution:   Use putenv() from libintl as well. (Ken Takata, closes #1082)
2017-01-12 21:44:49 +01:00
Bram Moolenaar b8f7bd68f6 patch 8.0.0174: executing "locale -a" on MS-Windows needlessly
Problem:    For completion "locale -a" is executed on MS-Windows, even though
            it most likely won't work.
Solution:   Skip executing "locale -a" on MS-Windows. (Ken Takata)
2017-01-12 20:28:25 +01:00
Bram Moolenaar a1fa892939 patch 8.0.0173: build fails with EBCDIC defined
Problem:    When compiling with EBCDIC defined the build fails. (Yaroslav
            Kuzmin)
Solution:   Move sortFunctions() to the right file.  Avoid warning for
            redefining __SUSV3.
2017-01-12 20:06:33 +01:00
Kazuki Sakamoto 220f000f59 MacVim Snapshot 121
Binary targets macOS 10.8+

- Vim patch 8.0.0172

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6
- Ruby 2.0
2017-01-11 18:27:36 -08:00
Kazuki Sakamoto 9c4147192a Merge remote-tracking branch 'vim/master' 2017-01-11 18:27:00 -08:00
Bram Moolenaar 1d669c233c patch 8.0.0172: command line window does not work
Problem:    The command selected in the command line window is not executed.
            (Andrey Starodubtsev)
Solution:   Save and restore the command line at a lower level. (closes #1370)
2017-01-11 22:40:19 +01:00
Bram Moolenaar ee142add22 patch 8.0.0171: JS style JSON does not support single quotes
Problem:    JS style JSON does not support single quotes.
Solution:   Allow for single quotes. (Yasuhiro Matsumoto, closes #1371)
2017-01-11 21:50:08 +01:00
Bram Moolenaar e32abbe42c patch 8.0.0170: crash in channel test
Problem:    Channel test fails for using freed memory.
Solution:   Fix memory use in json_decode().
2017-01-10 22:57:34 +01:00
Bram Moolenaar 8b2f19536f patch 8.0.0169: json_decode() may run out of stack space
Problem:    For complicated string json_decode() may run out of stack space.
Solution:   Change the recursive solution into an iterative solution.
2017-01-10 19:44:18 +01:00
Bram Moolenaar 872004132f patch 8.0.0168: not all float functionality is tested
Problem:    Still some float functionality is not covered by tests.
Solution:   Add more tests. (Dominique Pelle, closes #1364)
2017-01-10 16:31:20 +01:00
Bram Moolenaar 08243d26d2 patch 8.0.0167: str2nr()/str2float() fail with negative values
Problem:    str2nr() and str2float() do not always work with negative values.
Solution:   Be more flexible about handling signs. (LemonBoy, closes #1332)
            Add more tests.
2017-01-10 16:12:29 +01:00
Bram Moolenaar 03c60c1573 patch 8.0.0166: JSON with a duplicate key gives an internal error
Problem:    JSON with a duplicate key gives an internal error. (Lcd)
Solution:   Give a normal error.  Avoid an error when parsing JSON from a
            remote client fails.
2017-01-10 15:15:37 +01:00
Bram Moolenaar f446b48ff0 patch 8.0.0165: ubsan warns for integer overflow
Problem:    Ubsan warns for integer overflow.
Solution:   Swap two conditions. (Dominique Pelle)
2017-01-10 13:55:14 +01:00
Bram Moolenaar caa55b65c2 patch 8.0.0164: outdated and misplaced comments
Problem:    Outdated and misplaced comments.
Solution:   Fix the comments.
2017-01-10 13:51:09 +01:00
Bram Moolenaar 68563937f5 Updated runtime files. 2017-01-10 13:31:15 +01:00
Kazuki Sakamoto 8be81c4e3b Merge remote-tracking branch 'vim/master' 2017-01-09 12:41:42 -08:00
Bram Moolenaar 6abda995a5 patch 8.0.0163: cannot build with Ruby 2.4
Problem:    Ruby 2.4 no longer supports rb_cFixnum.
Solution:   move rb_cFixnum into an #ifdef. (Kazuki Sakamoto, closes #1365)
2017-01-09 21:10:31 +01:00
Bram Moolenaar 009c7b2640 patch 8.0.0162: build error on Fedora 23
Problem:    Build error on Fedora 23 with small features and gnome2.
Solution:   Undefine ngettext(). (Hirohito Higashi)
2017-01-09 20:30:27 +01:00
Bram Moolenaar 4d0504019c patch 8.0.0161: can't build with small features
Problem:    Build fails when using small features.
Solution:   Update #ifdef for using save_ccline. (Hirohito Higashi)
2017-01-09 12:58:11 +01:00
Kazuki Sakamoto acc11d1692 Merge remote-tracking branch 'vim/master' 2017-01-08 16:41:27 -08:00
Bram Moolenaar de33011ec6 patch 8.0.0160: EMSG() is sometimes used where it should be IEMSG()
Problem:    EMSG() is sometimes used for internal errors.
Solution:   Change them to IEMSG(). (Dominique Pelle)  And a few more.
2017-01-08 20:50:52 +01:00
Bram Moolenaar c695cec469 patch 8.0.0159: crash on startup when updating tabline
Problem:    Using a NULL pointer when using feedkeys() to trigger drawing a
            tabline.
Solution:   Skip drawing a tabline if TabPageIdxs is NULL. (Dominique Pelle)
            Also fix recursing into getcmdline() from the cmd window.
2017-01-08 20:00:04 +01:00
Bram Moolenaar 6247361101 patch 8.0.0158: float funcion test fails on MS-Windows
Problem:    On MS-Windows some float functions return a different value when
            passed unusual values.  strtod() doesn't work for "inf" and "nan".
Solution:   Accept both results.  Fix str2float() for MS-Windows.  Also
            reorder assert function arguments.
2017-01-08 19:25:40 +01:00
Bram Moolenaar 2d02839050 patch 8.0.0157: no completion for :syntax spell and :syntax sync
Problem:    No command line completion for ":syntax spell" and ":syntax sync".
Solution:   Implement the completion. (Dominique Pelle)
2017-01-08 18:28:22 +01:00
Bram Moolenaar 453b576ee5 patch 8.0.0156: not enough test coverage for float functions
Problem:    Several float functions are not covered by tests.
Solution:   Add float tests. (Dominique Pelle)
2017-01-08 17:59:14 +01:00
Bram Moolenaar a216255a4f patch 8.0.0155: ubsan complains about NULL pointer
Problem:    When sorting zero elements a NULL pointer is passed to qsort(),
            which ubsan warns for.
Solution:   Don't call qsort() if there are no elements. (Dominique Pelle)
2017-01-08 17:46:20 +01:00
Bram Moolenaar 31f19ce0a0 patch 8.0.0154: system() test fails on OS/X
Problem:    system() test fails on OS/X.
Solution:   Deal with leading spaces.
2017-01-08 14:14:43 +01:00
Bram Moolenaar 9d9c356517 patch 8.0.0153: system() test fails on MS-Windows
Problem:    system() test fails on MS-Windows.
Solution:   Deal when extra space and CR.
2017-01-08 13:55:06 +01:00
Bram Moolenaar 04e94c7881 patch 8.0.0152: stray channellog created when running tests
Problem:    Running the channel test creates channellog.
Solution:   Delete the debug line.
2017-01-08 13:38:58 +01:00
Bram Moolenaar 12c4492dd3 patch 8.0.0151: passing buffer content to system() is clumsy
Problem:    To pass buffer content to system() and systemlist() one has to
            first create a string or list.
Solution:   Allow passing a buffer number. (LemonBoy, closes #1240)
2017-01-08 13:26:03 +01:00
Kazuki Sakamoto 386ade3ae2 Merge remote-tracking branch 'vim/master' 2017-01-07 19:29:26 -08:00
Bram Moolenaar 7069bf18e1 patch 8.0.0150: completion for :filter does not skip the pattern
Problem:    When the pattern of :filter does not have a separator then
            completion of the command fails.
Solution:   Skip over the pattern. (Ozaki Kiichi, clodes #1299)
2017-01-07 20:39:53 +01:00
Bram Moolenaar cbd4de44e8 patch 8.0.0149: :earlier does not work after reading the undo file
Problem:    ":earlier" and ":later" do not work after startup or reading the
            undo file.
Solution:   Use absolute time stamps instead of relative to the Vim start
            time. (Christian Brabandt, Pavel Juhas, closes #1300, closes
            #1254)
2017-01-07 16:14:57 +01:00
Bram Moolenaar c6aa475a27 patch 8.0.0148: wrong indent in C preprocessor with line continuation
Problem:    When a C preprocessor statement has two line continuations the
            following line does not have the right indent. (Ken Takata)
Solution:   Add the indent of the previous continuation line. (Hirohito
            Higashi)
2017-01-07 15:39:43 +01:00
Kazuki Sakamoto 1b14651629 Merge remote-tracking branch 'vim/master' 2017-01-06 22:27:32 -08:00
Bram Moolenaar 6e450a5754 patch 8.0.0147: searchpair() fails when 'magic' is off
Problem:    searchpair() does not work when 'magic' is off. (Chris Paul)
Solution:   Add \m in the pattern. (Christian Brabandt, closes #1341)
2017-01-06 20:03:58 +01:00
Bram Moolenaar 287266527a patch 8.0.0146: termguicolors uses wrong colors on MS-Windows with ConEmu
Problem:    When using 'termguicolors' on MS-Windows the RGB definition causes
            the colors to be wrong.
Solution:   Undefined RGB and use our own. (Gabriel Barta)
2017-01-06 18:16:19 +01:00
Bram Moolenaar 29891c4ed4 patch 8.0.0145: running tests on MS-Windows is noisy
Problem:    Running tests on MS-Windows is a little bit noisy.
Solution:   Redirect some output to "nul". (Ken Takata)
2017-01-06 18:00:12 +01:00
Bram Moolenaar aaeabfbca5 Only install coveralls when used. 2017-01-06 16:47:24 +01:00
Bram Moolenaar 14a612fa2e Better solution to make coveralls work again. 2017-01-06 16:35:04 +01:00
Bram Moolenaar 7034a83743 Tune travis config for coverage with gcc only. 2017-01-06 16:01:59 +01:00
Bram Moolenaar a4ce25bd98 Another attempt to make coveralls work. 2017-01-06 15:37:45 +01:00
Bram Moolenaar 294740d2ac Attempt to make coverage working again. 2017-01-06 15:28:44 +01:00
Bram Moolenaar 9269315f63 patch 8.0.0144: when using MSVC the GvimExt directory is cleaned twice
Problem:    When using MSVC the GvimExt directory is cleaned twice.
Solution:   Remove the lines. (Ken Takata)
2017-01-06 14:55:36 +01:00
Bram Moolenaar f845b87f2b patch 8.0.0143: line number of current buffer in getbufinfo() is wrong
Problem:    Line number of current buffer in getbufinfo() is wrong.
Solution:   For the current buffer use the current line number. (Ken Takata)
2017-01-06 14:04:54 +01:00
Kazuki Sakamoto 4374735576 Merge pull request #439 from zebHub/master
Three window level actions
2017-01-04 23:04:14 -08:00
Yousef El-Zebdeh 1e3514c02e Renamamed methods and inteface labels
Stay On Bottom > Stay in Back
Stay On Top > Stay in Front
These fit closer to Apple's terminology as seen with iOS simulator.
2017-01-05 06:24:09 +00:00
Kazuki Sakamoto 8133aa23f0 Fix Homebrew build 2017-01-04 22:15:43 -08:00
Kazuki Sakamoto 290ed88c0b Fix configure.ac for RUBY_CFLAGS 2017-01-04 20:33:11 -08:00
Kazuki Sakamoto f9ed667087 Fix configure for RUBY_CFLAGS 2017-01-04 20:25:57 -08:00
Yousef El-Zebdeh 263115a528 Three window level actions
Added three window level functions to MMAppController. These allow the
window to float on top, stay on bottom or revert back to normal status.

I have also added the commands to the Actions.plist. The commands were
added using the menu.vim file.
2017-01-05 02:40:56 +00:00
Kazuki Sakamoto 6127f5c9eb MacVim Snapshot 120
Binary targets macOS 10.8+

- Vim patch 8.0.0142

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6
- Ruby 2.0
2017-01-03 19:42:52 -08:00
Kazuki Sakamoto 921d522f70 Python 3.6 2017-01-02 18:16:50 -08:00
Kazuki Sakamoto a1a2788ffa Merge remote-tracking branch 'vim/master' 2017-01-02 18:16:44 -08:00
Bram Moolenaar 0cdb72aa38 patch 8.0.0142
Problem:    Normal colors are wrong with 'termguicolors'.
Solution:   Initialize to INVALCOLOR instead of zero. (Ben Jackson, closes
            #1344)
2017-01-02 21:37:40 +01:00
Bram Moolenaar bc2eada542 Updated runtime files. 2017-01-02 21:27:47 +01:00
Kazuki Sakamoto c6e15ba8e7 Merge remote-tracking branch 'vim/master' 2017-01-02 12:01:03 -08:00
Bram Moolenaar 269aec7e61 patch 8.0.0141
Problem:    Nested function test fails on AppVeyor.
Solution:   Disable the test on Windows for now.
2017-01-02 18:32:39 +01:00
Bram Moolenaar f8eb9c51e5 patch 8.0.0140
Problem:    Pasting inserted text in Visual mode does not work properly.
            (Matthew Malcomson)
Solution:   Stop Visual mode before stuffing the inserted text. (Christian
            Brabandt, from neovim #5709)
2017-01-02 17:31:24 +01:00
Bram Moolenaar 5e1e6d265d patch 8.0.0139
Problem:    Warning for unused argument.
Solution:   Add UNUSED.
2017-01-02 17:26:00 +01:00
Bram Moolenaar b094ff4b2b patch 8.0.0138
Problem:    Small build fails.
Solution:   Add #ifdef.
2017-01-02 16:16:39 +01:00
Bram Moolenaar 777b30f827 patch 8.0.0137
Problem:    When 'maxfuncdepth' is set above 200 the nesting is limited to
            200. (Brett Stahlman)
Solution:   Allow for Ex command recursion depending on 'maxfuncdepth'.
2017-01-02 15:26:27 +01:00
Bram Moolenaar 54b2bfa399 patch 8.0.0136
Problem:    When using indent folding and changing indent the wrong fold is
            opened. (Jonathan Fudger)
Solution:   Open the fold under the cursor a bit later. (Christian Brabandt)
2017-01-02 14:57:08 +01:00
Bram Moolenaar ded2782783 patch 8.0.0135
Problem:    An address relative to the current line, ":.,+3y", does not work
            properly on a closed fold. (Efraim Yawitz)
Solution:   Correct for including the closed fold. (Christian Brabandt)
2017-01-02 14:27:34 +01:00
Kazuki Sakamoto 4bf9153e6d Merge remote-tracking branch 'vim/master' 2016-12-15 01:41:13 -08:00
Bram Moolenaar c4bfedabe0 patch 8.0.0134
Problem:    Null pointer access reported by UBsan.
Solution:   Check curwin->w_buffer is not NULL. (Yegappan Lakshmanan)
2016-12-14 21:42:00 +01:00
Kazuki Sakamoto 7c0d06c170 Merge remote-tracking branch 'vim/master' 2016-12-11 20:33:11 -08:00
Bram Moolenaar fe38b494ff patch 8.0.0133
Problem:    "2;'(" causes ml_get errors in an empty buffer.  (Dominique Pelle)
Solution:   Check the cursor line earlier.
2016-12-11 21:34:23 +01:00
Bram Moolenaar 4c8980b717 patch 8.0.0132
Problem:    Test fails because of using :finish.
Solution:   Change to return.
2016-12-11 15:24:48 +01:00
Bram Moolenaar 73b484c4da patch 8.0.0131
Problem:    Not enough test coverage for syntax commands.
Solution:   Add more tests. (Dominique Pelle)
2016-12-11 15:11:17 +01:00
Kazuki Sakamoto f5464c4b19 Merge remote-tracking branch 'vim/master' 2016-12-09 22:19:55 -08:00
Bram Moolenaar 63de19e805 patch 8.0.0130
Problem:    Configure uses "ushort" while the Vim code doesn't.
Solution:   Use "unsigned short" instead. (Fredrik Fornwall, closes #1314)
2016-12-09 20:11:26 +01:00
Bram Moolenaar 0df3c7f2a0 patch 8.0.0129
Problem:    Parallel make still doesn't work. (Lewis Muir)
Solution:   Define OBJ_MAIN.
2016-12-09 19:57:14 +01:00
Bram Moolenaar 7089237885 patch 8.0.0128
Problem:    Display test fails on MS-Windows.
Solution:   Set 'isprint' to "@".
2016-12-09 19:51:49 +01:00
Bram Moolenaar 73fd498886 patch 8.0.0127
Problem:    Cancelling completion still inserts text when formatting is done
            for 'textwidth'. (lacygoill)
Solution:   Don't format when CTRL-E was typed. (Hirohito Higashi,
            closes #1312)
2016-12-09 19:36:56 +01:00
Bram Moolenaar 6270660611 patch 8.0.0126
Problem:    Display problem with 'foldcolumn' and a wide character.
            (esiegerman)
Solution:   Don't use "extra" but an allocated buffer. (Christian Brabandt,
            closes #1310)
2016-12-09 19:28:48 +01:00
Bram Moolenaar eaaa9bbda6 patch 8.0.0125
Problem:    Not enough testing for entering Ex commands.
Solution:   Add test for CTRL-\ e {expr}. (Dominique Pelle)
2016-12-09 18:42:20 +01:00
124 changed files with 3874 additions and 1203 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ env:
vi_cv_path_plain_lua=/usr/local/bin/lua
vi_cv_dll_name_perl=/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE/libperl.dylib
vi_cv_dll_name_python=/System/Library/Frameworks/Python.framework/Versions/2.7/Python
vi_cv_dll_name_python3=/usr/local/Frameworks/Python.framework/Versions/3.5/Python
vi_cv_dll_name_python3=/usr/local/Frameworks/Python.framework/Versions/3.6/Python
VIMCMD=src/MacVim/build/Release/MacVim.app/Contents/MacOS/Vim
"CONFOPT='--with-features=huge --enable-multibyte --enable-netbeans --with-tlib=ncurses --enable-cscope --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --enable-python3interp=dynamic --enable-rubyinterp=dynamic --enable-luainterp=dynamic --with-lua-prefix=/usr/local --enable-gui=macvim'"
+2 -2
View File
@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 27
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -33,7 +33,7 @@ files matching *.c. You can also use autocommands to implement advanced
features, such as editing compressed files (see |gzip-example|). The usual
place to put autocommands is in your .vimrc or .exrc file.
*E203* *E204* *E143* *E855*
*E203* *E204* *E143* *E855* *E937*
WARNING: Using autocommands is very powerful, and may lead to unexpected side
effects. Be careful not to destroy your text.
- It's a good idea to do some testing on an expendable copy of a file first.
+3 -3
View File
@@ -1,4 +1,4 @@
*channel.txt* For Vim version 8.0. Last change: 2016 Dec 01
*channel.txt* For Vim version 8.0. Last change: 2016 Dec 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -605,11 +605,11 @@ See |job_setoptions()| and |ch_setoptions()|.
*job-close_cb*
"close_cb": handler Callback for when the channel is closed. Same as
"close_cb" on |ch_open()|, see |close_cb|.
*job-exit_cb*
*job-drop*
"drop" Specifies when to drop messages. Same as "drop" on
|ch_open()|, see |channel-drop|. For "auto" the
exit_cb is not considered.
*job-exit_cb*
"exit_cb": handler Callback for when the job ends. The arguments are the
job and the exit status.
Vim checks up to 10 times per second for jobs that
+3 -3
View File
@@ -1060,10 +1060,10 @@ There are several ways to leave the command-line window:
Insert and in Normal mode.
CTRL-C Continue in Command-line mode. The command-line under the
cursor is used as the command-line. Works both in Insert and
in Normal mode. ":close" also works. There is no redraw,
thus the window will remain visible.
in Normal mode. There is no redraw, thus the window will
remain visible.
:quit Discard the command line and go back to Normal mode.
":exit", ":xit" and CTRL-\ CTRL-N also work.
":close", ":exit", ":xit" and CTRL-\ CTRL-N also work.
:qall Quit Vim, unless there are changes in some buffer.
:qall! Quit Vim, discarding changes to any buffer.
+2 -2
View File
@@ -1,4 +1,4 @@
*develop.txt* For Vim version 8.0. Last change: 2016 Jan 31
*develop.txt* For Vim version 8.0. Last change: 2017 Jan 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -177,7 +177,7 @@ The basic steps to make changes to the code:
5. Make a patch with "git diff". You can also create a pull request on
github, but it's the diff that matters.
6. Make a note about what changed, preferably mentioning the problem and the
solution. Send an email to the vim-dev maillist with an explanation and
solution. Send an email to the |vim-dev| maillist with an explanation and
include the diff. Or create a pull request on github.
+11 -4
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2016 Nov 29
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5229,6 +5229,7 @@ join({list} [, {sep}]) *join()*
js_decode({string}) *js_decode()*
This is similar to |json_decode()| with these differences:
- Object key names do not have to be in quotes.
- Strings can be in single quotes.
- Empty items in an array (between two commas) are allowed and
result in v:none items.
@@ -5255,6 +5256,7 @@ json_decode({string}) *json_decode()*
- A trailing comma in an array and object is ignored.
- More floating point numbers are recognized, e.g. "1." for
"1.0".
However, a duplicate key in an object is not allowed. *E938*
The result must be a valid Vim type:
- An empty object member name is not allowed.
- Duplicate object member names are not allowed.
@@ -7248,7 +7250,7 @@ strcharpart({src}, {start}[, {len}]) *strcharpart()*
Like |strpart()| but using character index and length instead
of byte index and length.
When a character index is used where a character does not
exist it is assumed to be one byte. For example: >
exist it is assumed to be one character. For example: >
strcharpart('abc', -1, 2)
< results in 'a'.
@@ -7561,7 +7563,11 @@ system({expr} [, {input}]) *system()* *E677*
If {input} is given and is a |List| it is written to the file
in a way |writefile()| does with {binary} set to "b" (i.e.
with a newline between each list item with newlines inside
list items converted to NULs).
list items converted to NULs).
When {input} is given and is a number that is a valid id for
an existing buffer then the content of the buffer is written
to the file line by line, each line terminated by a NL and
NULs characters where the text has a NL.
Pipes are not used, the 'shelltemp' option is not used.
@@ -7611,7 +7617,8 @@ systemlist({expr} [, {input}]) *systemlist()*
Same as |system()|, but returns a |List| with lines (parts of
output separated by NL) with NULs transformed into NLs. Output
is the same as |readfile()| will output with {binary} argument
set to "b".
set to "b". Note that on MS-Windows you may get trailing CR
characters.
Returns an empty string on error.
+3 -1
View File
@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 8.0. Last change: 2016 Sep 09
*filetype.txt* For Vim version 8.0. Last change: 2017 Jan 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -573,6 +573,8 @@ Man {number} {name}
Global mapping:
<Leader>K Displays the manual page for the word under the cursor.
<Plug>ManPreGetPage idem, allows for using a mapping: >
nmap <F1> <Plug>ManPreGetPage<CR>
Local mappings:
CTRL-] Jump to the manual page for the word under the cursor.
+4 -7
View File
@@ -96,21 +96,18 @@ mention that.
*mail-list* *maillist*
There are several mailing lists for Vim:
<vim@vim.org>
<vim@vim.org> *vim-use* *vim_use*
For discussions about using existing versions of Vim: Useful mappings,
questions, answers, where to get a specific version, etc. There are
quite a few people watching this list and answering questions, also
for beginners. Don't hesitate to ask your question here.
<vim-dev@vim.org> *vim-dev* *vimdev*
<vim-dev@vim.org> *vim-dev* *vim_dev* *vimdev*
For discussions about changing Vim: New features, porting, patches,
beta-test versions, etc.
<vim-announce@vim.org> *vim-announce*
<vim-announce@vim.org> *vim-announce* *vim_announce*
Announcements about new versions of Vim; also for beta-test versions
and ports to different systems. This is a read-only list.
<vim-multibyte@vim.org> *vim-multibyte*
For discussions about using and improving the multi-byte aspects of
Vim.
<vim-mac@vim.org> *vim-mac*
<vim-mac@vim.org> *vim-mac* *vim_mac*
For discussions about using and improving the Macintosh version of
Vim.
+4 -3
View File
@@ -1,4 +1,4 @@
*message.txt* For Vim version 8.0. Last change: 2016 Sep 01
*message.txt* For Vim version 8.0. Last change: 2017 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -129,8 +129,9 @@ closed properly. Mostly harmless.
Command too recursive
This happens when an Ex command executes an Ex command that executes an Ex
command, etc. This is only allowed 200 times. When it's more there probably
is an endless loop. Probably a |:execute| or |:source| command is involved.
command, etc. The limit is 200 or the value of 'maxfuncdepth', whatever is
larger. When it's more there probably is an endless loop. Probably a
|:execute| or |:source| command is involved.
*E254* >
Cannot allocate color {name}
+6 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2016 Nov 26
*options.txt* For Vim version 8.0. Last change: 2017 Jan 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3430,7 +3430,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'formatprg'* *'fp'*
'formatprg' 'fp' string (default "")
global
global or local to buffer |global-local|
{not in Vi}
The name of an external program that will be used to format the lines
selected with the |gq| operator. The program must take the input on
@@ -5173,6 +5173,8 @@ A jump table for the options with a short description can be found at |Q_op|.
catches endless recursion. When using a recursive function with
more depth, set 'maxfuncdepth' to a bigger number. But this will use
more memory, there is the danger of failing when memory is exhausted.
Increasing this limit above 200 also changes the maximum for Ex
command resursion, see |E169|.
See also |:function|.
*'maxmapdepth'* *'mmd'* *E223*
@@ -5294,7 +5296,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi} *E21*
When off the buffer contents cannot be changed. The 'fileformat' and
'fileencoding' options also can't be changed.
Can be reset with the |-M| command line argument.
Can be reset on startup with the |-M| command line argument.
*'modified'* *'mod'* *'nomodified'* *'nomod'*
'modified' 'mod' boolean (default off)
@@ -5989,6 +5991,7 @@ A jump table for the options with a short description can be found at |Q_op|.
buffer, unless the 'Z' flag is in 'cpoptions'.
{not in Vi:} When using the ":view" command the 'readonly' option is
set for the newly edited buffer.
See 'modifiable' for disallowing changes to the buffer.
*'redrawtime'* *'rdt'*
'redrawtime' 'rdt' number (default 2000)
+1 -1
View File
@@ -1,4 +1,4 @@
*logiPat.txt* Logical Patterns Jun 22, 2015
*pi_logipat.txt* Logical Patterns Jun 22, 2015
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
Copyright: (c) 2004-2015 by Charles E. Campbell *logiPat-copyright*
+3 -1
View File
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.0. Last change: 2016 Aug 21
*quickref.txt* For Vim version 8.0. Last change: 2016 Dec 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1076,6 +1076,8 @@ Short explanation of each option: *option-list*
|c_<Up>| <Up>/<Down> recall older/newer command-line that starts
with current command
|c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history
|c_CTRL-G| CTRL-G next match when 'incsearch' is active
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|:history| :his[tory] show older command-lines
Context-sensitive completion on the command-line:
+3 -2
View File
@@ -1,4 +1,4 @@
*starting.txt* For Vim version 8.0. Last change: 2016 Nov 24
*starting.txt* For Vim version 8.0. Last change: 2017 Jan 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -230,6 +230,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
the executable "view" has the same effect as the -R argument.
The 'updatecount' option will be set to 10000, meaning that
the swap file will not be updated automatically very often.
See |-M| for disallowing modifications.
*-m*
-m Modifications not allowed to be written. The 'write' option
@@ -1220,7 +1221,7 @@ There are several ways to exit Vim:
- Use `:cquit`. Also when there are changes.
When using `:cquit` or when there was an error message Vim exits with exit
code 1. Errors can be avoided by using `:silent!`.
code 1. Errors can be avoided by using `:silent!` or with `:catch`.
==============================================================================
8. Saving settings *save-settings*
+8 -2
View File
@@ -4539,6 +4539,8 @@ E933 eval.txt /*E933*
E934 sign.txt /*E934*
E935 eval.txt /*E935*
E936 autocmd.txt /*E936*
E937 autocmd.txt /*E937*
E938 eval.txt /*E938*
E94 windows.txt /*E94*
E95 message.txt /*E95*
E96 diff.txt /*E96*
@@ -7025,6 +7027,7 @@ job-callback channel.txt /*job-callback*
job-channel-overview channel.txt /*job-channel-overview*
job-close_cb channel.txt /*job-close_cb*
job-control channel.txt /*job-control*
job-drop channel.txt /*job-drop*
job-err_cb channel.txt /*job-err_cb*
job-err_io channel.txt /*job-err_io*
job-exit_cb channel.txt /*job-exit_cb*
@@ -7160,7 +7163,6 @@ logiPat-man pi_logipat.txt /*logiPat-man*
logiPat-manual pi_logipat.txt /*logiPat-manual*
logiPat-operators pi_logipat.txt /*logiPat-operators*
logiPat-pattern pi_logipat.txt /*logiPat-pattern*
logiPat.txt pi_logipat.txt /*logiPat.txt*
long-lines version5.txt /*long-lines*
love intro.txt /*love*
lowercase change.txt /*lowercase*
@@ -7877,6 +7879,7 @@ php3.vim syntax.txt /*php3.vim*
phtml.vim syntax.txt /*phtml.vim*
pi_getscript.txt pi_getscript.txt /*pi_getscript.txt*
pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
pi_logipat.txt pi_logipat.txt /*pi_logipat.txt*
pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
pi_paren.txt pi_paren.txt /*pi_paren.txt*
pi_spec.txt pi_spec.txt /*pi_spec.txt*
@@ -9219,16 +9222,19 @@ vim-dev intro.txt /*vim-dev*
vim-mac intro.txt /*vim-mac*
vim-modes intro.txt /*vim-modes*
vim-modes-intro intro.txt /*vim-modes-intro*
vim-multibyte intro.txt /*vim-multibyte*
vim-script-intro usr_41.txt /*vim-script-intro*
vim-use intro.txt /*vim-use*
vim-variable eval.txt /*vim-variable*
vim.vim syntax.txt /*vim.vim*
vim7 version7.txt /*vim7*
vim8 version8.txt /*vim8*
vim: options.txt /*vim:*
vim_announce intro.txt /*vim_announce*
vim_dev intro.txt /*vim_dev*
vim_did_enter-variable eval.txt /*vim_did_enter-variable*
vim_mac gui_mac.txt /*vim_mac*
vim_starting eval.txt /*vim_starting*
vim_use intro.txt /*vim_use*
vimball pi_vimball.txt /*vimball*
vimball-contents pi_vimball.txt /*vimball-contents*
vimball-extract pi_vimball.txt /*vimball-extract*
+18
View File
@@ -89,6 +89,18 @@ an external command (e.g., "!!"), the terminal will be put into Normal mode
for a moment. This means that you can stop the output to the screen by
hitting a printing key. Output resumes when you hit <BS>.
*xterm-bracketed-paste*
When the 't_BE' option is set then 't_BE' will be sent to the
terminal when entering "raw" mode and 't_BD' when leaving "raw" mode. The
terminal is then expected to put 't_PS' before pasted text and 't_PE' after
pasted text. This way Vim can separate text that is pasted from characters
that are typed. The pasted text is handled like when the middle mouse button
is used.
Note that in some situations Vim will not recognize the bracketed paste and
you will get the raw text. In other situations Vim will only get the first
pasted character and drop the rest, e.g. when using the "r" command.
*cs7-problem*
Note: If the terminal settings are changed after running Vim, you might have
an illegal combination of settings. This has been reported on Solaris 2.5
@@ -306,6 +318,10 @@ Added by Vim (there are no standard codes for these):
|xterm-true-color|
t_8b set background color (R, G, B) *t_8b* *'t_8b'*
|xterm-true-color|
t_BE enable bracketed paste mode *t_BE* *'t_BE'*
|xterm-bracketed-paste|
t_BD disable bracketed paste mode *t_BD* *'t_BD'*
|xterm-bracketed-paste|
KEY CODES
Note: Use the <> form if possible
@@ -398,6 +414,8 @@ Note: Use the <> form if possible
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
<Mouse> leader of mouse code *<Mouse>*
t_PS start of brackted paste |xterm-bracketed-paste| *t_PS* 't_PS'
t_PE end of bracketed paste |xterm-bracketed-paste| *t_PE* 't_PE'
Note about t_so and t_mr: When the termcap entry "so" is not present the
entry for "mr" is used. And vice versa. The same is done for "se" and "me".
+98 -52
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2016 Dec 01
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -29,17 +29,23 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
Issues can also be entered online: https://github.com/vim/vim/issues
Only use this for bug reports, not for questions! Those belong on the
maillist. Updates will be forwarded to the vim_dev maillist. Issues entered
there will not be repeated below, unless there is extra information.
maillist. Updates will be forwarded to the |vim_dev| maillist. Issues
entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
get_syn_options() does not respect skip in else part. (Zyx)
+channel:
- Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
- Add 'cwd' argument to start_job(): directory to change to in the child.
check for valid directory before forking.
Part of patch for environment, Yasuhiro Matsumoto, #1160
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
2016 Dec 11, #1320)
- Implement |job-term| ?
- Channel test fails with Motif. Sometimes kills the X11 server.
- When a message in the queue but there is no callback, drop it after a while?
@@ -70,8 +76,8 @@ Regexp problems:
- Issue 164: freeze on regexp search.
- Ignorecase not handled properly for multi-byte characters. (Axel Bender,
2013 Dec 11)
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski
Remark from Brett 2014 Jan 6 and 7.
- Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin
Szamotulski; Remark from Brett 2014 Jan 6 and 7.
- NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
- Does not work with NFA regexp engine:
\%u, \%x, \%o, \%d followed by a composing character
@@ -105,10 +111,8 @@ Regexp problems:
Make html indent file use javascript indent, now that it's not just cindent.
#1220
Use __sun instead of sun define check. #1296
Patch to use buffer id for system() and systemlist() (LemonBoy, 2016 Nov 7,
#1240)
Concatenation with null string causes an error: 'a'[1:0] .. 'b'
Might as well handle it like an empty string.
When using symbolic links, a package path will not be inserted at the right
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
@@ -116,38 +120,76 @@ position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
What if there is an invalid character?
Bug: ":earlier 100d" doesn't work after using undo file.
(Pavol Juhas, 2016 Nov 15, #1254)
Fix by Christian, but lacks a test.
Test by Pavol Juhas, Nov 22.
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
Make dict_add give a duplicate key error.
Should json_encode()/json_decode() restrict recursiveness?
Or avoid recursiveness.
Include rust files. (Klabnik, #1356)
Allow using json with empty key? Dict already has it.
Json string with trailing \u should be an error. (Lcd)
Patch to reset ex_exitvalue after catch. (Christian Brabandt, 2016 Oct 23)
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
2016 Oct 23 #1193)
Remarks from nuko8, 2016 Nov 2.
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
Patch to add command line completion for :cexpr commands. (Yegappan
Lakshmanan, 2016 Dec 13)
Patch for :pyx, run python commands depending on the supported version.
(Marc Weber, update from Ken Takata, 2016 Sep 19, 2017 Jan 6)
Patch to avoid warnings for overflow. (Mike Williams, 2016 Dec 16)
Update Dec 19.
When an item in the quickfix list has a file name that does not exist, behave
like the item was not a match for :cnext.
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
Also get E749 on exit.
Another example in #1309
Patch to fix vim_iswordp() works differently on chars <256 that are two bytes.
Ozaki Kiichi, 2016 Dec 11.
When deleting a mark or register, leave a tombstone, so that it's also deleted
when writing viminfo (and the delete was the most recent action). #1339
Relevant neovim patch:
https://github.com/neovim/neovim/pull/5717
test case:
https://github.com/neovim/neovim/pull/5717#issuecomment-264845481
Others:
https://github.com/neovim/neovim/issues/5713#issuecomment-265136186
https://github.com/neovim/neovim/pull/5737#issuecomment-266055165
Patch for better explanation of 'compatible' side effects.
https://github.com/vim/vim/pull/1161/files
Patch to add 'makeencoding', useful when the system encoding differs from
Vim's 'encoding' setting. (Ken Takata, 2017 Jan 6)
Patch to adjust marks when adding a new line to the end of buffer in diff
mode. (James McCoy, 2016 Dec 14, #1329)
Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
#1330)
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
Rule to use "^" for statusline does not work if a space is defined with
highlighting for both stl and stlnc. Patch by Ken Hamada (itchyny, 2016 Dec 11)
8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
Patch by Christian Wellenbrock, 2013 Jul 5.
Screen updated delayed when using CTRL-O u in Insert mode.
(Barlik, #1191) Perhaps because status message?
Patch to add buffer name argument to taglist().
Ordering of tags in result of taglist call. (Duncan McDougall, #1194)
Patch to fix that empty first tab is not in session.
(Hirohito Higashi, 2016 Nov 25, #1282)
@@ -164,14 +206,14 @@ Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11,
#1053) With patch, does it work?
Patch to make finding duplicate tags much faster, using a hashtab. (James
McCoy, 2016 Sept 14, #1046) Should work now. Updated Nov 12.
>
Use ADDR_OTHER instead of ADDR_LINES for many more commands.
Add tests for using number larger than number of lines in buffer.
Patch to make v:shell_error writable. (Christian Brabandt, 2016 Sep 27)
Is there another solution?
Useful to restore it. Is there another solution?
"ci[" does not look for next [ like ci" does look for next ".
(J.F. 2017 Jan 7)
On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
@@ -181,6 +223,10 @@ Patch for wrong cursor position on wrapped line, involving breakindent.
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
When adding an item to a new quickfix list make ":cnext" jump to that item.
Make a difference being at the first item and not having used :cnext at all.
(Afanasiy Fet, 2017 Jan 3)
Invalid behavior with NULL list. (Nikolai Pavlov, #768)
E.g. deepcopy(test_null_list())
@@ -189,6 +235,9 @@ Patch to make it possible to extend a list with itself.
Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24)
Patch to add new regexp classes :ident:, :keyword:, :fname:.
(ichizok, 2016 Jan 12, #1373)
Patch to add trim() function. (Bukn, 2016 Nov 25, #1280)
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
@@ -213,6 +262,9 @@ sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
#1350)
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
Add an argument to choose binary or non-binary (like readfile()), when omitted
use the current behavior.
@@ -235,12 +287,10 @@ execute() cannot be used with command completeion. (Daniel Hahler, 2016 Oct 1,
cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983)
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
Patch to order results from taglist(). (Duncan McDougall, 2016 Oct 25)
Patch for :pyx, run python commands depending on the supported version.
(Marc Weber, update from Ken Takata, 2016 Sep 19)
patch for 'spellcamelcase' option: spellcheck each CamelCased word.
(Ben Tucker, 2016 Dec 2)
When using ":diffput" through a mapping, undo in the target buffer isn't
synced. (Ryan Carney, 2016 Sep 14)
@@ -265,10 +315,23 @@ Jul 25, #948)
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
(Ken Takata, 2016 Oct 4)
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
Better help Aug 19.
Problem: applies to too many commands, such as :cbuffer.
Updated patch with three options, 2016 Sep 8.
Win32: When running ":make" and 'encoding' differs from the system locale,
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
Wu) Should we use 'termencoding' for this?
Patch to add 'systemencoding', convert between 'encoding' and this for file
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to
the system encoding (usually utf-8).
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
Patch to add context information to quickfix/location list. (Yegappan
Lakshmanan, 2016 Aug 25)
Lakshmanan, 2016 Aug 25, #1012)
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
Otherwise task flickers in taskbar.
@@ -399,13 +462,8 @@ Should use /usr/local/share/applications or /usr/share/applications.
Or use $XDG_DATA_DIRS.
Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4)
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
Better help Aug 19.
Problem: applies to too many commands, such as :cbuffer.
Updated patch with three options, 2016 Sep 8.
Win32: When running ":make" and 'encoding' differs from the system locale,
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
Wu) Should we use 'termencoding' for this?
Test object i{ and it do not behave the same. #1379
Do not include the linebreak at the start?
Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
@@ -420,6 +478,9 @@ Access to uninitialized memory in match_backref() regexp_nda.c:4882
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
In debug mode one can inspect variables, but not the function parameters
(starting with a:). (Luc Hermitte, 2017 Jan 4, #1352)
7 Add a watchpoint in the debug mode: An expression that breaks execution
when evaluating to non-zero. Add the "watchadd expr" command, stop when
the value of the expression changes. ":watchdel" deletes an item,
@@ -901,11 +962,6 @@ highlighted as the cursor line. (Alessandro Ivaldi, 2013 Jun 4)
Two highlighting bugs. (ZyX, 2013 Aug 18)
Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5)
May 17: with winlist() and tabpagelist().
May 19: with local variables.
May 28: with options
Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
28) With tests: Oct 9.
@@ -981,9 +1037,6 @@ Szamotulski, 2012 Nov 8)
Session file creation: 'autochdir' causes trouble. Keep it off until after
loading all files.
8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
Patch by Christian Wellenbrock, 2013 Jul 5.
MS-Windows resizing problems:
- Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun
20. Uses getWindowRect() instead of GetWindowPlacement()
@@ -1151,8 +1204,6 @@ right type.
string() can't parse back "inf" and "nan". Fix documentation or fix code?
(ZyX, 2010 Aug 23)
Make 'formatprg' global-local. (Sung Pae)
When doing "redir => s:foo" in a script and then "redir END" somewhere else
(e.g. in a function) it can't find s:foo.
When a script contains "redir => s:foo" but doesn't end redirection, a
@@ -1290,11 +1341,6 @@ Regexp engine performance:
7.2.274. (Christian Brabandt, 2010 May 27) Generally, folding with
'foldmethod' set to "syntax" is slow. Do profiling to find out why.
Patch to add 'systemencoding', convert between 'encoding' and this for file
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to
the system encoding (usually utf-8).
Problem producing tags file when hebrew.frx is present. It has a BOM.
Results in E670. (Tony Mechelynck, 2010 May 2)
+2 -2
View File
@@ -1,4 +1,4 @@
*usr_22.txt* For Vim version 8.0. Last change: 2012 Nov 15
*usr_22.txt* For Vim version 8.0. Last change: 2016 Dec 13
VIM USER MANUAL - by Bram Moolenaar
@@ -93,7 +93,7 @@ browser. This is what you get: >
o................Browsing with a Horizontal Split...........|netrw-o|
p................Use Preview Window.........................|netrw-p|
P................Edit in Previous Window....................|netrw-p|
q................Listing Bookmarks and History..............|netrw-q|
q................Listing Bookmarks and History..............|netrw-qb|
r................Reversing Sorting Order....................|netrw-r|
< (etc)
+8 -1
View File
@@ -1,4 +1,4 @@
*version8.txt* For Vim version 8.0. Last change: 2016 Nov 06
*version8.txt* For Vim version 8.0. Last change: 2017 Jan 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -181,6 +181,12 @@ Insert mode commands: ~
|i_CTRL-G_U| CTRL-G U don't break undo with next cursor movement
Cmdline mode commands: ~
|/_CTRL-G| CTRL-G move to the next match in 'incsearch' mode
|/_CTRL-T| CTRL-T move to the previous match in 'incsearch' mode
Options: ~
'belloff' do not ring the bell for these reasons
@@ -224,6 +230,7 @@ Ex commands: ~
Ex command modifiers: ~
|:keeppatterns| following command keeps search pattern history
|<mods>| supply command modifiers to user defined commands
New and extended functions: ~
+13 -4
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Oct 31
" Last Change: 2017 Jan 06
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -309,7 +309,10 @@ au BufNewFile,BufRead *.bl setf blank
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
" Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl
if has("fname_case")
autocmd BufRead,BufNewFile BUILD setfiletype bzl
endif
" C or lpc
au BufNewFile,BufRead *.c call s:FTlpc()
@@ -673,8 +676,14 @@ au BufNewFile,BufRead *.dtd setf dtd
" DTS/DSTI (device tree files)
au BufNewFile,BufRead *.dts,*.dtsi setf dts
" EDIF (*.edf,*.edif,*.edn,*.edo)
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
" EDIF (*.edf,*.edif,*.edn,*.edo) or edn
au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif
au BufNewFile,BufRead *.edn
\ if getline(1) =~ '^\s*(\s*edif\>' |
\ setf edif |
\ else |
\ setf clojure |
\ endif
" EditorConfig (close enough to dosini)
au BufNewFile,BufRead .editorconfig setf dosini
+2 -1
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Last Change: 2016 Jun 20
" Last Change: 2017 Jan 04
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -47,6 +47,7 @@ endif
if exists(":Man") != 2
com -nargs=+ Man call s:GetPage(<f-args>)
nmap <Leader>K :call <SID>PreGetPage(0)<CR>
nmap <Plug>ManPreGetPage :call <SID>PreGetPage(0)<CR>
endif
" Define functions only once.
+283 -113
View File
@@ -2,7 +2,7 @@
" Language: Javascript
" Maintainer: Chris Paul ( https://github.com/bounceme )
" URL: https://github.com/pangloss/vim-javascript
" Last Change: August 25, 2016
" Last Change: December 31, 2016
" Only load this indent file when no other was loaded.
if exists('b:did_indent')
@@ -12,11 +12,10 @@ let b:did_indent = 1
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent()
setlocal nolisp noautoindent nosmartindent
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e
setlocal cinoptions+=j1,J1
setlocal autoindent nolisp nosmartindent
setlocal indentkeys+=0],0)
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys< cinoptions<'
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
" Only define the function once.
if exists('*GetJavascriptIndent')
@@ -37,158 +36,329 @@ else
endfunction
endif
let s:line_pre = '^\s*\%(\%(\%(\/\*.\{-}\)\=\*\+\/\s*\)\=\)\@>'
let s:expr_case = s:line_pre . '\%(\%(case\>.\+\)\|default\)\s*:'
" searchpair() wrapper
if has('reltime')
function s:GetPair(start,end,flags,skip,time,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
endfunction
else
function s:GetPair(start,end,flags,skip,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
endfunction
endif
" Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)'
" Regex of syntax group names that are strings or documentation.
let s:syng_comment = '\%(comment\|doc\)'
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template'
let s:syng_str = 'string\|template'
let s:syng_com = 'comment\|doc'
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
if has('reltime')
function s:GetPair(start,end,flags,time)
return searchpair(a:start,'',a:end,a:flags,s:skip_expr,max([prevnonblank(v:lnum) - 2000,0]),a:time)
endfunction
else
function s:GetPair(start,end,flags,n)
return searchpair(a:start,'',a:end,a:flags,0,max([prevnonblank(v:lnum) - 2000,0]))
endfunction
endif
function s:skip_func()
if !s:free || search('\m`\|\*\/','nW',s:looksyn)
let s:free = !eval(s:skip_expr)
let s:looksyn = s:free ? line('.') : s:looksyn
return !s:free
endif
let s:looksyn = line('.')
return (search('\m\/','nbW',s:looksyn) || search('\m[''"]\|\\$','nW',s:looksyn)) && eval(s:skip_expr)
endfunction
let s:line_term = '\s*\%(\%(\/\%(\%(\*.\{-}\*\/\)\|\%(\*\+\)\)\)\s*\)\=$'
function s:alternatePair(stop)
let pos = getpos('.')[1:2]
while search('\m[][(){}]','bW',a:stop)
if !s:skip_func()
let idx = stridx('])}',s:looking_at())
if idx + 1
if !s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop)
break
endif
else
return
endif
endif
endwhile
call call('cursor',pos)
endfunction
function s:save_pos(f,...)
let l:pos = getpos('.')[1:2]
let ret = call(a:f,a:000)
call call('cursor',l:pos)
return ret
endfunction
function s:syn_at(l,c)
return synIDattr(synID(a:l,a:c,0),'name')
endfunction
function s:looking_at()
return getline('.')[col('.')-1]
endfunction
function s:token()
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
endfunction
function s:b_token()
if s:looking_at() =~ '\k'
call search('\m\<','cbW')
endif
return search('\m\S','bW')
endfunction
function s:previous_token()
let l:n = line('.')
while s:b_token()
if (s:looking_at() == '/' || line('.') != l:n && search('\m\/\/','nbW',
\ line('.'))) && s:syn_at(line('.'),col('.')) =~? s:syng_com
call search('\m\_[^/]\zs\/[/*]','bW')
else
return s:token()
endif
endwhile
return ''
endfunction
function s:others(p)
return "((line2byte(line('.')) + col('.')) <= ".(line2byte(a:p[0]) + a:p[1]).") || ".s:skip_expr
endfunction
function s:tern_skip(p)
return s:GetPair('{','}','nbW',s:others(a:p),200,a:p[0]) > 0
endfunction
function s:tern_col(p)
return s:GetPair('?',':\@<!::\@!','nbW',s:others(a:p)
\ .' || s:tern_skip('.string(a:p).')',200,a:p[0]) > 0
endfunction
function s:label_col()
let pos = getpos('.')[1:2]
let [s:looksyn,s:free] = pos
call s:alternatePair(0)
if s:save_pos('s:IsBlock')
let poss = getpos('.')[1:2]
return call('cursor',pos) || !s:tern_col(poss)
elseif s:looking_at() == ':'
return !s:tern_col([0,0])
endif
endfunction
" configurable regexes that define continuation lines, not including (, {, or [.
if !exists('g:javascript_opfirst')
let g:javascript_opfirst = '\%([<>,:?^%|*&]\|\/[^/*]\|\([-.+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
endif
if !exists('g:javascript_continuation')
let g:javascript_continuation = '\%([<=,.?/*:^%|&]\|+\@<!+\|-\@<!-\|=\@<!>\|\<in\%(stanceof\)\=\)'
endif
let s:opfirst = '^' . get(g:,'javascript_opfirst',
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
let s:continuation = get(g:,'javascript_continuation',
\ '\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$'
let g:javascript_opfirst = s:line_pre . g:javascript_opfirst
let g:javascript_continuation .= s:line_term
function s:OneScope(lnum,text,add)
return a:text =~# '\%(\<else\|\<do\|=>\)' . s:line_term ? 'no b' :
\ ((a:add && a:text =~ s:line_pre . '$' && search('\%' . s:PrevCodeLine(a:lnum - 1) . 'l.)' . s:line_term)) ||
\ cursor(a:lnum, match(a:text, ')' . s:line_term)) > -1) &&
\ s:GetPair('(', ')', 'cbW', 100) > 0 && search('\C\l\+\_s*\%#','bW') &&
\ (a:add || ((expand('<cword>') !=# 'while' || !s:GetPair('\C\<do\>', '\C\<while\>','nbW',100)) &&
\ (expand('<cword>') !=# 'each' || search('\C\<for\_s\+\%#','nbW')))) ? expand('<cword>') : ''
function s:continues(ln,con)
return !cursor(a:ln, match(' '.a:con,s:continuation)) &&
\ eval((['s:syn_at(line("."),col(".")) !~? "regex"'] +
\ repeat(['s:previous_token() != "."'],5) + [1])[
\ index(split('/ typeof in instanceof void delete'),s:token())])
endfunction
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
function s:IsBlock()
return getline(line('.'))[col('.')-1] == '{' && !search(
\ '\C\%(\<return\s*\|\%([-=~!<*+,.?^%|&\[(]\|=\@<!>\|\*\@<!\/\|\<\%(var\|const\|let\|import\|export\%(\_s\+default\)\=\|yield\|delete\|void\|t\%(ypeof\|hrow\)\|new\|in\%(stanceof\)\=\)\)\_s*\)\%#','bnW') &&
\ (!search(':\_s*\%#','bW') || (!s:GetPair('[({[]','[])}]','bW',200) || s:IsBlock()))
" get the line of code stripped of comments and move cursor to the last
" non-comment char.
function s:Trim(ln)
let pline = substitute(getline(a:ln),'\s*$','','')
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
while l:max && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
let pline = substitute(strpart(pline, 0, l:max),'\s*$','','')
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
endwhile
return cursor(a:ln,strlen(pline)) ? pline : pline
endfunction
" Auxiliary Functions {{{2
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
" Find line above 'lnum' that isn't empty or in a comment
function s:PrevCodeLine(lnum)
let l:lnum = prevnonblank(a:lnum)
while l:lnum
if synIDattr(synID(l:lnum,matchend(getline(l:lnum), '^\s*[^''"]'),0),'name') !~? s:syng_strcom
return l:lnum
let l:n = prevnonblank(a:lnum)
while l:n
if getline(l:n) =~ '^\s*\/[/*]'
if (stridx(getline(l:n),'`') > 0 || getline(l:n-1)[-1:] == '\') &&
\ s:syn_at(l:n,1) =~? s:syng_str
return l:n
endif
let l:n = prevnonblank(l:n-1)
elseif s:syn_at(l:n,1) =~? s:syng_com
let l:n = s:save_pos('eval',
\ 'cursor('.l:n.',1) + search(''\m\/\*'',"bW")')
else
return l:n
endif
let l:lnum = prevnonblank(l:lnum - 1)
endwhile
endfunction
" Check if line 'lnum' has a balanced amount of parentheses.
function s:Balanced(lnum)
let [open_0,open_2,open_4] = [0,0,0]
let l:open = 0
let l:line = getline(a:lnum)
let pos = match(l:line, '[][(){}]', 0)
while pos != -1
if synIDattr(synID(a:lnum,pos + 1,0),'name') !~? s:syng_strcom
let idx = stridx('(){}[]', l:line[pos])
if idx % 2 == 0
let open_{idx} = open_{idx} + 1
else
let open_{idx - 1} = open_{idx - 1} - 1
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
let l:open += match(' ' . l:line[pos],'[[({]')
if l:open < 0
return
endif
endif
let pos = match(l:line, '[][(){}]', pos + 1)
endwhile
return (!open_4 + !open_2 + !open_0) - 2
return !l:open
endfunction
function s:OneScope(lnum)
let pline = s:Trim(a:lnum)
let kw = 'else do'
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
call s:previous_token()
let kw = 'for if let while with'
if index(split('await each'),s:token()) + 1
call s:previous_token()
let kw = 'for'
endif
endif
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
\ s:save_pos('s:previous_token') != '.'
endfunction
" returns braceless levels started by 'i' and above lines * &sw. 'num' is the
" lineNr which encloses the entire context, 'cont' if whether line 'i' + 1 is
" a continued expression, which could have started in a braceless context
function s:iscontOne(i,num,cont)
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
let pind = a:num ? indent(l:num) + s:W : 0
let ind = indent(l:i) + (a:cont ? 0 : s:W)
while l:i >= l:num && (ind > pind || l:i == l:num)
if indent(l:i) < ind && s:OneScope(l:i)
let bL += s:W
let l:i = line('.')
elseif !a:cont || bL || ind < indent(a:i)
break
endif
let ind = min([ind, indent(l:i)])
let l:i = s:PrevCodeLine(l:i - 1)
endwhile
return bL
endfunction
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
function s:IsBlock()
if s:looking_at() == '{'
let l:n = line('.')
let char = s:previous_token()
let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : ''
if syn =~? 'xml\|jsx'
return char != '{'
elseif char =~ '\k'
return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof')
\ ,char) < (line('.') != l:n) || s:previous_token() == '.'
elseif char == '>'
return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow'
elseif char == ':'
return getline('.')[col('.')-2] != ':' && s:label_col()
endif
return syn =~? 'regex' || char !~ '[-=~!<*+,/?^%|&([]'
endif
endfunction
" }}}
function GetJavascriptIndent()
if !exists('b:js_cache')
let b:js_cache = [0,0,0]
endif
let b:js_cache = get(b:,'js_cache',[0,0,0])
" Get the current line.
let l:line = getline(v:lnum)
let syns = synIDattr(synID(v:lnum, 1, 0), 'name')
call cursor(v:lnum,1)
let l:line = getline('.')
let syns = s:syn_at(v:lnum, 1)
" start with strings,comments,etc.{{{2
if (l:line !~ '^[''"`]' && syns =~? '\%(string\|template\)') ||
\ (l:line !~ '^\s*[/*]' && syns =~? s:syng_comment)
" start with strings,comments,etc.
if syns =~? s:syng_com
if l:line =~ '^\s*\*'
return cindent(v:lnum)
elseif l:line !~ '^\s*\/[/*]'
return -1
endif
elseif syns =~? s:syng_str && l:line !~ '^[''"]'
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
let b:js_cache[0] = v:lnum
endif
return -1
endif
if l:line !~ '^\%(\/\*\|\s*\/\/\)' && syns =~? s:syng_comment
return cindent(v:lnum)
endif
let l:lnum = s:PrevCodeLine(v:lnum - 1)
if l:lnum == 0
return 0
if !l:lnum
return
endif
if (l:line =~# s:expr_case)
let cpo_switch = &cpo
set cpo+=%
let ind = cindent(v:lnum)
let &cpo = cpo_switch
return ind
let l:line = substitute(l:line,'^\s*','','')
if l:line[:1] == '/*'
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
endif
if l:line =~ '^\/[/*]'
let l:line = ''
endif
"}}}
" the containing paren, bracket, curly. Memoize, last lineNr either has the
" same scope or starts a new one, unless if it closed a scope.
call cursor(v:lnum,1)
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum && b:js_cache[0] &&
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum) > 0)
let num = b:js_cache[1]
elseif syns != '' && l:line[0] =~ '\s'
let pattern = syns =~? 'block' ? ['{','}'] : syns =~? 'jsparen' ? ['(',')'] :
\ syns =~? 'jsbracket'? ['\[','\]'] : ['[({[]','[])}]']
let num = s:GetPair(pattern[0],pattern[1],'bW',2000)
" the containing paren, bracket, or curly. Many hacks for performance
let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
call call('cursor',b:js_cache[1:])
else
let num = s:GetPair('[({[]','[])}]','bW',2000)
endif
let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')]
if l:line =~ s:line_pre . '[])}]'
return indent(num)
let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
if idx + 1
call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top)
elseif indent(v:lnum) && syns =~? 'block'
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
else
call s:alternatePair(top)
endif
endif
call cursor(b:js_cache[1],b:js_cache[2])
let swcase = getline(l:lnum) =~# s:expr_case
let pline = swcase ? getline(l:lnum) : substitute(getline(l:lnum), '\%(:\@<!\/\/.*\)$', '','')
let inb = num == 0 || num < l:lnum && ((l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term) || s:IsBlock())
let switch_offset = num == 0 || s:OneScope(num, strpart(getline(num),0,b:js_cache[2] - 1),1) !=# 'switch' ? 0 :
\ &cino !~ ':' || !has('float') ? s:sw() :
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:sw() : 1))
" most significant, find the indent amount
if inb && !swcase && ((l:line =~# g:javascript_opfirst || pline =~# g:javascript_continuation) ||
\ num < l:lnum && s:OneScope(l:lnum,pline,0) =~# '\<\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)\>' &&
\ l:line !~ s:line_pre . '{')
return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset
elseif num > 0
return indent(num) + s:sw() + switch_offset
if idx + 1 || l:line[:1] == '|}'
if idx == 2 && search('\m\S','bW',line('.')) && s:looking_at() == ')'
call s:GetPair('(',')','bW',s:skip_expr,200)
endif
return indent('.')
endif
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
let num = b:js_cache[1]
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
if !num || s:IsBlock()
let pline = s:save_pos('s:Trim',l:lnum)
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
let num = line('.')
if s:previous_token() ==# 'switch' && s:previous_token() != '.'
if &cino !~ ':' || !has('float')
let switch_offset = s:W
else
let cinc = matchlist(&cino,'.*:\(-\)\=\([0-9.]*\)\(s\)\=\C')
let switch_offset = float2nr(str2float(cinc[1].(strlen(cinc[2]) ? cinc[2] : strlen(cinc[3])))
\ * (strlen(cinc[3]) ? s:W : 1))
endif
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
return indent(num) + switch_offset
endif
endif
endif
if pline[-1:] !~ '[{;]'
if pline =~# ':\@<!:$'
call cursor(l:lnum,strlen(pline))
let isOp = s:tern_col(b:js_cache[1:2])
else
let isOp = l:line =~# s:opfirst || s:continues(l:lnum,pline)
endif
let bL = s:iscontOne(l:lnum,num,isOp)
let bL -= (bL && l:line[0] == '{') * s:W
endif
endif
" main return
if isOp
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
elseif num
return indent(num) + s:W + switch_offset + bL
endif
return bL
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
+3 -1
View File
@@ -1,5 +1,5 @@
" Maintainer: Benjamin Linskey <vim@benlinskey.com>
" Last Changed: 2016 July 20
" Last Changed: 2016 December 5
" URL: https://github.com/blinskey/vim-armenian-keymaps
let b:keymap_name = "hy"
@@ -98,6 +98,8 @@ f ֆ
7 .
8 «
9 »
* (
( )
\\ '
| ՞
+3 -1
View File
@@ -1,5 +1,5 @@
" Maintainer: Benjamin Linskey <vim@benlinskey.com>
" Last Changed: 2016 July 20
" Last Changed: 2016 December 5
" URL: https://github.com/blinskey/vim-armenian-keymaps
let b:keymap_name = "hy"
@@ -98,6 +98,8 @@ f ֆ
7 .
8 «
9 »
* (
( )
\\ '
| ՞
+6
View File
@@ -80,6 +80,9 @@ if has("gui_macvim")
an <silent> 9998.350 Window.Select\ Previous\ Tab :tabprevious<CR>
an 9998.360 Window.-SEP2- <Nop>
an <silent> 9998.370 Window.Bring\ All\ To\ Front <Nop>
an <silent> 9998.380 Window.Stay\ in\ Front <Nop>
an <silent> 9998.390 Window.Stay\ in\ Back <Nop>
an <silent> 9998.400 Window.Stay\ Level\ Normal <Nop>
endif
" Help menu
@@ -1255,6 +1258,9 @@ if has("gui_macvim")
macm Window.Select\ Next\ Tab key=<D-}>
macm Window.Select\ Previous\ Tab key=<D-{>
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
macm Window.Stay\ in\ Front action=stayInFront:
macm Window.Stay\ in\ Back action=stayInBack:
macm Window.Stay\ Level\ Normal action=stayLevelNormal:
macm Help.MacVim\ Help key=<D-?>
macm Help.MacVim\ Website action=openWebsite:
+3 -2
View File
@@ -6,7 +6,8 @@
" Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim
" Last Change: 2015 Apr.17
" Last Change: 2017 Jan 14
" cssClassName updated by Ryuichi Hayashida Jan 2016
" quit when a syntax file was already loaded
if !exists("main_syntax")
@@ -56,7 +57,7 @@ syn match cssSelectorOp2 "[~|^$*]\?=" contained
syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
" .class and #id
syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot
syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
syn match cssClassNameDot contained '\.'
try
+2 -2
View File
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2016 Aug 30
" Last Change: 2016 Nov 12
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim
" Standard syntax initialization
@@ -21,7 +21,7 @@ let binNMU='binary-only=yes'
syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"'
exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"'
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
syn match debchangelogVersion contained "(.\{-})"
syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
+1 -1
View File
@@ -38,7 +38,7 @@ unlet s:kernels s:archs s:pairs
syn match debcontrolMultiArch contained "\%(no\|foreign\|allowed\|same\)"
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|kde|kernel|libs|libdevel|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|science|shells|sound|text|tex|utils|vcs|video|web|x11|xfce|zope)"
syn match debcontrolSection contained "\v((contrib|non-free|non-US/main|non-US/contrib|non-US/non-free|restricted|universe|multiverse)/)?(admin|cli-mono|comm|database|debian-installer|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnustep|gnu-r|graphics|hamradio|haskell|httpd|interpreters|introspection|java|javascript|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|utils|vcs|video|web|x11|xfce|zope)"
syn match debcontrolPackageType contained "u\?deb"
syn match debcontrolVariable contained "\${.\{-}}"
syn match debcontrolDmUpload contained "\cyes"
+2 -2
View File
@@ -2,7 +2,7 @@
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
" Last Change: 2016 Sep 27
" Last Change: 2016 Nov 12
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
" Standard syntax initialization
@@ -25,7 +25,7 @@ let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
\ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
\
\ 'precise', 'trusty', 'xenial', 'yakkety', 'devel'
\ 'precise', 'trusty', 'xenial', 'yakkety', 'zesty', 'devel'
\ ]
let s:unsupported = [
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
+18 -5
View File
@@ -1,9 +1,10 @@
" Vim syntax file
" Language: HTML
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/html.vim
" Last Change: 2015 Jan 07
" included patch from David Felix
" Language: HTML
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
" Last Change: 2017 Jan 04
" included patch from Jorge Maldonado Ventura
" Please check :help html.vim for some comments and a description of the options
@@ -53,6 +54,14 @@ syn keyword htmlTagName contained abbr acronym bdo button col label
syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
" new html 5 tags
syn keyword htmlTagName contained article aside audio bdi canvas datalist
syn keyword htmlTagName contained details embed figcaption figure
syn keyword htmlTagName contained footer header hgroup main mark
syn keyword htmlTagName contained menuitem meter nav output picture
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
syn keyword htmlTagName contained slot source template time track video wbr
" legal arg names
syn keyword htmlArg contained action
syn keyword htmlArg contained align alink alt archive background bgcolor
@@ -87,6 +96,10 @@ syn keyword htmlArg contained multiple nohref nowrap object profile readonly
syn keyword htmlArg contained rules scheme scope span standby style
syn keyword htmlArg contained summary tabindex valuetype version
" html 5 arg names
syn keyword htmlArg contained contenteditable contextmenu draggable dropzone
syn keyword htmlArg contained hidden spellcheck title translate
" special characters
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
+20 -20
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: php PHP 3/4/5/7
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
" Last Change: Jul 27, 2016
" Last Change: Dec 11, 2016
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
@@ -495,7 +495,7 @@ syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,
" Highlighting for __autoload slightly different from line above
syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
\ __autoload
highlight link phpSpecialFunction phpOperator
hi def link phpSpecialFunction phpOperator
" Highlighting for PHP5's built-in classes
" - built-in classes harvested from get_declared_classes() in 5.1.4
@@ -518,14 +518,14 @@ syntax keyword phpClasses containedin=ALLBUT,phpComment,phpStringDouble,phpStrin
\ DOMCharacterData DOMAttr DOMElement DOMText DOMComment DOMTypeinfo DOMUserDataHandler
\ DOMLocator DOMConfiguration DOMCdataSection DOMDocumentType DOMNotation DOMEntity
\ DOMEntityReference DOMProcessingInstruction DOMStringExtend DOMXPath
highlight link phpClasses phpFunctions
hi def link phpClasses phpFunctions
" Highlighting for PHP5's built-in interfaces
" - built-in classes harvested from get_declared_interfaces() in 5.1.4
syntax keyword phpInterfaces containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
\ Iterator IteratorAggregate RecursiveIterator OuterIterator SeekableIterator
\ Traversable ArrayAccess Serializable Countable SplObserver SplSubject Reflector
highlight link phpInterfaces phpConstant
hi def link phpInterfaces phpConstant
" option defaults:
if ! exists('php_special_functions')
@@ -553,7 +553,7 @@ endif
if php_alt_assignByReference
" special highlighting for '=&' operator
syntax match phpAssignByRef /=\s*&/ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle
highlight link phpAssignByRef Type
hi def link phpAssignByRef Type
endif
if php_alt_comparisons
@@ -565,7 +565,7 @@ if php_alt_comparisons
syntax case ignore
syntax keyword phpComparison instanceof contained containedin=phpRegion
hi link phpComparison Statement
hi def link phpComparison Statement
endif
" ================================================================
@@ -645,21 +645,21 @@ hi def link phpTodo Todo
hi def link phpDocTodo Todo
hi def link phpMemberSelector Structure
if exists("php_oldStyle")
hi phpIntVar guifg=Red ctermfg=DarkRed
hi phpEnvVar guifg=Red ctermfg=DarkRed
hi phpOperator guifg=SeaGreen ctermfg=DarkGreen
hi phpVarSelector guifg=SeaGreen ctermfg=DarkGreen
hi phpRelation guifg=SeaGreen ctermfg=DarkGreen
hi phpIdentifier guifg=DarkGray ctermfg=Brown
hi phpIdentifierSimply guifg=DarkGray ctermfg=Brown
hi def phpIntVar guifg=Red ctermfg=DarkRed
hi def phpEnvVar guifg=Red ctermfg=DarkRed
hi def phpOperator guifg=SeaGreen ctermfg=DarkGreen
hi def phpVarSelector guifg=SeaGreen ctermfg=DarkGreen
hi def phpRelation guifg=SeaGreen ctermfg=DarkGreen
hi def phpIdentifier guifg=DarkGray ctermfg=Brown
hi def phpIdentifierSimply guifg=DarkGray ctermfg=Brown
else
hi def link phpIntVar Identifier
hi def link phpEnvVar Identifier
hi def link phpOperator Operator
hi def link phpVarSelector Operator
hi def link phpRelation Operator
hi def link phpIdentifier Identifier
hi def link phpIdentifierSimply Identifier
hi def link phpIntVar Identifier
hi def link phpEnvVar Identifier
hi def link phpOperator Operator
hi def link phpVarSelector Operator
hi def link phpRelation Operator
hi def link phpIdentifier Identifier
hi def link phpIdentifierSimply Identifier
endif
+3 -2
View File
@@ -5,8 +5,8 @@
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Contributor: Karsten Hopp <karsten@redhat.com>
" Contributor: Dean, Adam Kenneth <adam.ken.dean@hpe.com>
" Last Change: 2016 Aug 11
" SSH Version: 7.3p1
" Last Change: 2016 Dec 28
" SSH Version: 7.4p1
"
" Setup
@@ -181,6 +181,7 @@ syn keyword sshconfigKeyword IPQoS
syn keyword sshconfigKeyword IdentitiesOnly
syn keyword sshconfigKeyword IdentityFile
syn keyword sshconfigKeyword IgnoreUnknown
syn keyword sshconfigKeyword Include
syn keyword sshconfigKeyword IPQoS
syn keyword sshconfigKeyword KbdInteractiveAuthentication
syn keyword sshconfigKeyword KbdInteractiveDevices
+3 -2
View File
@@ -6,8 +6,8 @@
" Contributor: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Contributor: Karsten Hopp <karsten@redhat.com>
" Originally: 2009-07-09
" Last Change: 2016 Mar 1
" SSH Version: 7.2
" Last Change: 2016 Dec 28
" SSH Version: 7.4p1
"
" Setup
@@ -161,6 +161,7 @@ syn keyword sshdconfigKeyword Compression
syn keyword sshdconfigKeyword DebianBanner
syn keyword sshdconfigKeyword DenyGroups
syn keyword sshdconfigKeyword DenyUsers
syn keyword sshdconfigKeyword DisableForwarding
syn keyword sshdconfigKeyword ForceCommand
syn keyword sshdconfigKeyword GSSAPIAuthentication
syn keyword sshdconfigKeyword GSSAPICleanupCredentials
+6 -6
View File
@@ -123,7 +123,7 @@ NOTE : En avan
Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER
** Appuyez A pour ajouter du text. **
** Appuyez A pour ajouter du texte. **
1. Déplacez le curseur sur la première ligne ci-dessous marquée --->.
Peu importe sur quel caractère se trouve le curseur sur cette ligne.
@@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au d
2. Puis tapez le caractère % .
3. Le curseur se déplacera sur la parenthèse out crochet correspondant.
3. Le curseur se déplacera sur la parenthèse ou crochet correspondant.
4. Tapez % pour replacer le curseur sur la parenthèse ou crochet
correspondant.
@@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y ,
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte
à cet endroit avec p .
---> a) ceci est le premier élément.
b)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Leçon 6.4 : RÉGLAGE DES OPTIONS
Leçon 6.5 : RÉGLAGE DES OPTIONS
** Réglons une option afin que la recherche et la substitution ignore la
** Réglons une option afin que la recherche et la substitution ignorent la
casse des caractères. **
1. Recherchez 'ignore' en tapant : /ignore <Entrée>
@@ -1034,5 +1034,5 @@ NOTE : Le compl
Dernières mises à jour par Dominique Pellé.
E-mail : dominique.pelle@gmail.com
Last Change : 2016 Nov 08
Last Change : 2017 Jan 16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+6 -6
View File
@@ -123,7 +123,7 @@ NOTE : En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par
Leçon 1.5 : ÉDITION DE TEXTE - AJOUTER
** Appuyez A pour ajouter du text. **
** Appuyez A pour ajouter du texte. **
1. Déplacez le curseur sur la première ligne ci-dessous marquée --->.
Peu importe sur quel caractère se trouve le curseur sur cette ligne.
@@ -574,7 +574,7 @@ NOTE : Quand la recherche atteint la fin du fichier, elle reprend au début
2. Puis tapez le caractère % .
3. Le curseur se déplacera sur la parenthèse out crochet correspondant.
3. Le curseur se déplacera sur la parenthèse ou crochet correspondant.
4. Tapez % pour replacer le curseur sur la parenthèse ou crochet
correspondant.
@@ -854,17 +854,17 @@ NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les
5. Tapez p pour coller le texte. Puis tapez : un second <Échap> .
6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y ,
déplacez-vous à la fin de la ligne suivant avec j$ et collez le texte
déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte
à cet endroit avec p .
---> a) ceci est le premier élément.
b)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Leçon 6.4 : RÉGLAGE DES OPTIONS
Leçon 6.5 : RÉGLAGE DES OPTIONS
** Réglons une option afin que la recherche et la substitution ignore la
** Réglons une option afin que la recherche et la substitution ignorent la
casse des caractères. **
1. Recherchez 'ignore' en tapant : /ignore <Entrée>
@@ -1034,5 +1034,5 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
Dernières mises à jour par Dominique Pellé.
E-mail : dominique.pelle@gmail.com
Last Change : 2016 Nov 08
Last Change : 2017 Jan 16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+6
View File
@@ -72,5 +72,11 @@
<string></string>
<key>zoomAll:</key>
<string></string>
<key>stayInFront:</key>
<string></string>
<key>stayInBack:</key>
<string></string>
<key>stayLevelNormal:</key>
<string></string>
</dict>
</plist>
+1 -1
View File
@@ -1255,7 +1255,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>119</string>
<string>123</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
+3
View File
@@ -53,5 +53,8 @@
- (IBAction)openWebsite:(id)sender;
- (IBAction)showVimHelp:(id)sender;
- (IBAction)zoomAll:(id)sender;
- (IBAction)stayInFront:(id)sender;
- (IBAction)stayInBack:(id)sender;
- (IBAction)stayLevelNormal:(id)sender;
@end
+21
View File
@@ -1196,6 +1196,27 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSApp makeWindowsPerform:@selector(performZoom:) inOrder:YES];
}
- (IBAction)stayInFront:(id)sender
{
ASLogDebug(@"Stay in Front");
NSWindow *keyWindow = [NSApp keyWindow];
[keyWindow setLevel:NSFloatingWindowLevel];
}
- (IBAction)stayInBack:(id)sender
{
ASLogDebug(@"Stay in Back");
NSWindow *keyWindow = [NSApp keyWindow];
[keyWindow setLevel:kCGDesktopIconWindowLevel +1];
}
- (IBAction)stayLevelNormal:(id)sender
{
ASLogDebug(@"Stay level normal");
NSWindow *keyWindow = [NSApp keyWindow];
[keyWindow setLevel:NSNormalWindowLevel];
}
- (IBAction)coreTextButtonClicked:(id)sender
{
ASLogDebug(@"Toggle CoreText renderer");
-3
View File
@@ -1123,9 +1123,6 @@ clean:
cd GvimExt
$(MAKE) /NOLOGO -f Makefile clean
cd ..
cd GvimExt
$(MAKE) /NOLOGO -f Makefile clean
cd ..
- if exist testdir\*.out del testdir\*.out
test:
+33 -14
View File
@@ -1695,12 +1695,14 @@ OBJ_COMMON = \
$(WSDEBUG_OBJ)
# The files included by tests are not in OBJ_COMMON.
OBJ = $(OBJ_COMMON) \
OBJ_MAIN = \
objects/json.o \
objects/main.o \
objects/memfile.o \
objects/message.o
OBJ = $(OBJ_COMMON) $(OBJ_MAIN)
OBJ_JSON_TEST = \
objects/memfile.o \
objects/message.o \
@@ -1722,7 +1724,11 @@ OBJ_MESSAGE_TEST = \
MESSAGE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MESSAGE_TEST)
ALL_OBJ = $(OBJ_COMMON) $(OBJ_JSON_TEST) $(OBJ_MEMFILE_TEST) $(OBJ_MESSAGE_TEST)
ALL_OBJ = $(OBJ_COMMON) \
$(OBJ_MAIN) \
$(OBJ_JSON_TEST) \
$(OBJ_MEMFILE_TEST) \
$(OBJ_MESSAGE_TEST)
PRO_AUTO = \
@@ -1888,7 +1894,9 @@ myself:
# The normal command to compile a .c file to its .o file.
CCC = $(CC) -c -I$(srcdir) $(ALL_CFLAGS)
# Without or with ALL_CFLAGS.
CCC_NF = $(CC) -c -I$(srcdir)
CCC = $(CCC_NF) $(ALL_CFLAGS)
# Link the target for normal use or debugging.
@@ -2102,6 +2110,8 @@ test_arglist \
test_delete \
test_diffmode \
test_digraph \
test_functions \
test_display \
test_ex_undo \
test_execute_func \
test_expand \
@@ -2114,8 +2124,10 @@ test_arglist \
test_fileformat \
test_filter_cmd \
test_filter_map \
test_float_func \
test_fnameescape \
test_fnamemodify \
test_fold \
test_glob2regpat \
test_gf \
test_gn \
@@ -2154,10 +2166,13 @@ test_arglist \
test_partial \
test_perl \
test_popup \
test_profile \
test_put \
test_quickfix \
test_regexp_latin \
test_regexp_utf8 \
test_reltime \
test_retab \
test_ruby \
test_search \
test_searchpos \
@@ -2173,6 +2188,7 @@ test_arglist \
test_substitute \
test_syn_attr \
test_syntax \
test_system \
test_tabline \
test_tabpage \
test_tagcase \
@@ -2879,7 +2895,9 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
# commands understand putting object files in another directory, it must be
# specified for each file separately.
objects objects/.dirstamp:
objects: objects/.dirstamp
objects/.dirstamp:
mkdir -p objects
touch objects/.dirstamp
@@ -2985,7 +3003,7 @@ objects/gui_gtk_f.o: gui_gtk_f.c
$(CCC) -o $@ gui_gtk_f.c
objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c
$(CCC) $(PERL_CFLAGS) -o $@ auto/gui_gtk_gresources.c
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/gui_gtk_gresources.c
objects/gui_gtk_x11.o: gui_gtk_x11.c
$(CCC) -o $@ gui_gtk_x11.c
@@ -3021,7 +3039,7 @@ objects/if_xcmdsrv.o: if_xcmdsrv.c
$(CCC) -o $@ if_xcmdsrv.c
objects/if_lua.o: if_lua.c
$(CCC) $(LUA_CFLAGS) -o $@ if_lua.c
$(CCC_NF) $(LUA_CFLAGS) $(ALL_CFLAGS) -o $@ if_lua.c
objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
@@ -3030,27 +3048,28 @@ mzscheme_base.c:
$(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
objects/if_perl.o: auto/if_perl.c
$(CCC) $(PERL_CFLAGS) -o $@ auto/if_perl.c
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ auto/if_perl.c
objects/if_perlsfio.o: if_perlsfio.c
$(CCC) $(PERL_CFLAGS) -o $@ if_perlsfio.c
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c
objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c
$(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/getpath.c \
$(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) -o $@ \
$(PYTHON_CONFDIR)/getpath.c \
-I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \
$(PYTHON_GETPATH_CFLAGS)
objects/if_python.o: if_python.c if_py_both.h
$(CCC) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c
$(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c
objects/if_python3.o: if_python3.c if_py_both.h
$(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c
$(CCC_NF) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python3.c
objects/if_ruby.o: if_ruby.c
$(CCC) $(RUBY_CFLAGS) -o $@ if_ruby.c
$(CCC_NF) $(RUBY_CFLAGS) $(ALL_CFLAGS) -o $@ if_ruby.c
objects/if_tcl.o: if_tcl.c
$(CCC) $(TCL_CFLAGS) -o $@ if_tcl.c
$(CCC_NF) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ if_tcl.c
objects/integration.o: integration.c
$(CCC) -o $@ integration.c
@@ -3107,7 +3126,7 @@ objects/ops.o: ops.c
$(CCC) -o $@ ops.c
objects/option.o: option.c
$(CCC) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) -o $@ option.c
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c
objects/os_beos.o: os_beos.c
$(CCC) -o $@ os_beos.c
+10 -4
View File
@@ -7233,6 +7233,12 @@ $as_echo "$rubyhdrdir" >&6; }
rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG['rubyarchhdrdir'] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG['arch']"`
if test -d "$rubyarchdir"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
else
dnl rbconfig says darwin15 but 10.12 SDK has darwin16
rubyarchdir=${rubyarchdir/darwin15/darwin16}
if test -d "$rubyarchdir"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
fi
fi
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'].gsub(/\./, '')[0,2]"`
if test "X$rubyversion" = "X"; then
@@ -7251,7 +7257,7 @@ $as_echo "$rubyhdrdir" >&6; }
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
RUBY_LIBS="-framework Ruby"
RUBY_CFLAGS="-DRUBY_VERSION=$rubyversion"
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
librubyarg=
fi
@@ -7502,7 +7508,7 @@ $as_echo_n "checking whether compiling with process communication is possible...
/* Check bitfields */
struct nbbuf {
unsigned int initDone:1;
ushort signmaplen;
unsigned short signmaplen;
};
int
@@ -12118,8 +12124,8 @@ if test "x$vim_cv_getcwd_broken" = "xyes" ; then
fi
for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
for ac_func in fchdir fchown fsync getcwd getpseudotty \
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat \
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
+8 -5
View File
@@ -113,16 +113,19 @@ read_buffer(
* it can be changed there. */
if (!readonlymode && !bufempty())
changed();
else if (retval != FAIL)
else if (retval == OK)
unchanged(curbuf, FALSE);
#ifdef FEAT_AUTOCMD
if (retval == OK)
{
# ifdef FEAT_EVAL
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
curbuf, &retval);
# else
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
# endif
}
#endif
}
return retval;
@@ -294,7 +297,7 @@ open_buffer(
#endif
)
changed();
else if (retval != FAIL && !read_stdin && !read_fifo)
else if (retval == OK && !read_stdin && !read_fifo)
unchanged(curbuf, FALSE);
save_file_ff(curbuf); /* keep this fileformat */
@@ -328,7 +331,7 @@ open_buffer(
# endif
#endif
if (retval != FAIL)
if (retval == OK)
{
#ifdef FEAT_AUTOCMD
/*
+13 -3
View File
@@ -731,7 +731,14 @@ channel_open(
channel_free(channel);
return NULL;
}
memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
{
char *p;
/* When using host->h_addr directly ubsan warns for it to not be
* aligned. First copy the pointer to aviod that. */
memcpy(&p, &host->h_addr, sizeof(p));
memcpy((char *)&server.sin_addr, p, host->h_length);
}
/* On Mac and Solaris a zero timeout almost never works. At least wait
* one millisecond. Let's do it for all systems, because we don't know why
@@ -1588,7 +1595,7 @@ invoke_callback(channel_T *channel, char_u *callback, partial_T *partial,
int dummy;
if (safe_to_invoke_callback == 0)
EMSG("INTERNAL: Invoking callback when it is not safe");
IEMSG("INTERNAL: Invoking callback when it is not safe");
argv[0].v_type = VAR_CHANNEL;
argv[0].vval.v_channel = channel;
@@ -1917,9 +1924,12 @@ channel_parse_json(channel_T *channel, ch_part_T part)
/* When a message is incomplete we wait for a short while for more to
* arrive. After the delay drop the input, otherwise a truncated string
* or list will make us hang. */
* or list will make us hang.
* Do not generate error messages, they will be written in a channel log. */
++emsg_silent;
status = json_decode(&reader, &listtv,
chanpart->ch_mode == MODE_JS ? JSON_JS : 0);
--emsg_silent;
if (status == OK)
{
/* Only accept the response when it is a list with at least two
+32 -6
View File
@@ -887,7 +887,7 @@ vim_isIDc(int c)
/*
* return TRUE if 'c' is a keyword character: Letters and characters from
* 'iskeyword' option for current buffer.
* 'iskeyword' option for the current buffer.
* For multi-byte characters mb_get_class() is used (builtin rules).
*/
int
@@ -1901,7 +1901,11 @@ vim_str2nr(
n += 2; /* skip over "0b" */
while ('0' <= *ptr && *ptr <= '1')
{
un = 2 * un + (unsigned long)(*ptr - '0');
/* avoid ubsan error for overflow */
if (un < UVARNUM_MAX / 2)
un = 2 * un + (unsigned long)(*ptr - '0');
else
un = UVARNUM_MAX;
++ptr;
if (n++ == maxlen)
break;
@@ -1912,7 +1916,11 @@ vim_str2nr(
/* octal */
while ('0' <= *ptr && *ptr <= '7')
{
un = 8 * un + (uvarnumber_T)(*ptr - '0');
/* avoid ubsan error for overflow */
if (un < UVARNUM_MAX / 8)
un = 8 * un + (uvarnumber_T)(*ptr - '0');
else
un = UVARNUM_MAX;
++ptr;
if (n++ == maxlen)
break;
@@ -1925,7 +1933,11 @@ vim_str2nr(
n += 2; /* skip over "0x" */
while (vim_isxdigit(*ptr))
{
un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
/* avoid ubsan error for overflow */
if (un < UVARNUM_MAX / 16)
un = 16 * un + (uvarnumber_T)hex2nr(*ptr);
else
un = UVARNUM_MAX;
++ptr;
if (n++ == maxlen)
break;
@@ -1936,7 +1948,11 @@ vim_str2nr(
/* decimal */
while (VIM_ISDIGIT(*ptr))
{
un = 10 * un + (uvarnumber_T)(*ptr - '0');
/* avoid ubsan error for overflow */
if (un < UVARNUM_MAX / 10)
un = 10 * un + (uvarnumber_T)(*ptr - '0');
else
un = UVARNUM_MAX;
++ptr;
if (n++ == maxlen)
break;
@@ -1950,9 +1966,19 @@ vim_str2nr(
if (nptr != NULL)
{
if (negative) /* account for leading '-' for decimal numbers */
*nptr = -(varnumber_T)un;
{
/* avoid ubsan error for overflow */
if (un > VARNUM_MAX)
*nptr = VARNUM_MIN;
else
*nptr = -(varnumber_T)un;
}
else
{
if (un > VARNUM_MAX)
un = VARNUM_MAX;
*nptr = (varnumber_T)un;
}
}
if (unptr != NULL)
*unptr = un;
+8 -2
View File
@@ -1904,6 +1904,12 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
rubyarchdir=`$vi_cv_path_ruby -r rbconfig -e "print ($ruby_rbconfig::CONFIG.has_key? 'rubyarchhdrdir') ? $ruby_rbconfig::CONFIG[['rubyarchhdrdir']] : '$rubyhdrdir/'+$ruby_rbconfig::CONFIG[['arch']]"`
if test -d "$rubyarchdir"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
else
dnl rbconfig says darwin15 but 10.12 SDK has darwin16
rubyarchdir=${rubyarchdir/darwin15/darwin16}
if test -d "$rubyarchdir"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyarchdir"
fi
fi
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"`
if test "X$rubyversion" = "X"; then
@@ -1924,7 +1930,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
dnl On Mac OS X it is safer to just use the -framework flag
RUBY_LIBS="-framework Ruby"
dnl Don't include the -I flag when -framework is set
RUBY_CFLAGS="-DRUBY_VERSION=$rubyversion"
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
librubyarg=
fi
@@ -2053,7 +2059,7 @@ if test "$enable_channel" = "yes"; then
/* Check bitfields */
struct nbbuf {
unsigned int initDone:1;
ushort signmaplen;
unsigned short signmaplen;
};
], [
/* Check creating a socket. */
+106 -6
View File
@@ -309,6 +309,7 @@ static int dont_sync_undo = FALSE; /* CTRL-G U prevents syncing undo for
* "cmdchar" can be:
* 'i' normal insert command
* 'a' normal append command
* K_PS bracketed paste
* 'R' replace command
* 'r' "r<CR>" command: insert one <CR>. Note: count can be > 1, for redo,
* but still only one <CR> is inserted. The <Esc> is not used for redo.
@@ -782,10 +783,14 @@ edit(
dont_sync_undo = TRUE;
else
dont_sync_undo = FALSE;
do
{
c = safe_vgetc();
} while (c == K_IGNORE);
if (cmdchar == K_PS)
/* Got here from normal mode when bracketed paste started. */
c = K_PS;
else
do
{
c = safe_vgetc();
} while (c == K_IGNORE);
#ifdef FEAT_AUTOCMD
/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
@@ -1025,7 +1030,7 @@ doESCkey:
case Ctrl_Z: /* suspend when 'insertmode' set */
if (!p_im)
goto normalchar; /* insert CTRL-Z as normal char */
stuffReadbuff((char_u *)":st\r");
do_cmdline_cmd((char_u *)"stop");
c = Ctrl_O;
/*FALLTHROUGH*/
@@ -1202,6 +1207,16 @@ doESCkey:
break;
# endif
#endif
case K_PS:
bracketed_paste(PASTE_INSERT, FALSE, NULL);
if (cmdchar == K_PS)
/* invoked from normal mode, bail out */
goto doESCkey;
break;
case K_PE:
/* Got K_PE without K_PS, ignore. */
break;
#ifdef FEAT_GUI_TABLINE
case K_TABLINE:
case K_TABMENU:
@@ -3889,7 +3904,7 @@ ins_compl_prep(int c)
if (prev_col > 0)
dec_cursor();
/* only format when something was inserted */
if (!arrow_used && !ins_need_undo)
if (!arrow_used && !ins_need_undo && c != Ctrl_E)
insertchar(NUL, 0, -1);
if (prev_col > 0
&& ml_get_curline()[curwin->w_cursor.col] != NUL)
@@ -9457,6 +9472,91 @@ ins_mousescroll(int dir)
}
#endif
/*
* Handle receiving P_PS: start paste mode. Inserts the following text up to
* P_PE literally.
* When "drop" is TRUE then consume the text and drop it.
*/
int
bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
{
int c;
char_u buf[NUMBUFLEN + MB_MAXBYTES];
int idx = 0;
char_u *end = find_termcode((char_u *)"PE");
int ret_char = -1;
int save_allow_keys = allow_keys;
/* If the end code is too long we can't detect it, read everything. */
if (STRLEN(end) >= NUMBUFLEN)
end = NULL;
++no_mapping;
allow_keys = 0;
for (;;)
{
/* When the end is not defined read everything. */
if (end == NULL && vpeekc() == NUL)
break;
c = plain_vgetc();
#ifdef FEAT_MBYTE
if (has_mbyte)
idx += (*mb_char2bytes)(c, buf + idx);
else
#endif
buf[idx++] = c;
buf[idx] = NUL;
if (end != NUL && STRNCMP(buf, end, idx) == 0)
{
if (end[idx] == NUL)
break; /* Found the end of paste code. */
continue;
}
if (!drop)
{
switch (mode)
{
case PASTE_CMDLINE:
put_on_cmdline(buf, idx, TRUE);
break;
case PASTE_EX:
if (gap != NULL && ga_grow(gap, idx) == OK)
{
mch_memmove((char *)gap->ga_data + gap->ga_len,
buf, (size_t)idx);
gap->ga_len += idx;
}
break;
case PASTE_INSERT:
if (stop_arrow() == OK)
{
ins_char_bytes(buf, idx);
AppendToRedobuffLit(buf, idx);
}
break;
case PASTE_ONE_CHAR:
if (ret_char == -1)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
ret_char = (*mb_ptr2char)(buf);
else
#endif
ret_char = buf[0];
}
break;
}
}
idx = 0;
}
--no_mapping;
allow_keys = save_allow_keys;
return ret_char;
}
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
static void
ins_tabline(int c)
+62 -28
View File
@@ -242,14 +242,38 @@ static void list_one_var(dictitem_T *v, char_u *prefix, int *first);
static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first);
static char_u *find_option_end(char_u **arg, int *opt_flags);
#ifdef EBCDIC
static int compare_func_name(const void *s1, const void *s2);
static void sortFunctions();
#endif
/* for VIM_VERSION_ defines */
#include "version.h"
#if defined(EBCDIC) || defined(PROTO)
/*
* Compare struct fst by function name.
*/
static int
compare_func_name(const void *s1, const void *s2)
{
struct fst *p1 = (struct fst *)s1;
struct fst *p2 = (struct fst *)s2;
return STRCMP(p1->f_name, p2->f_name);
}
/*
* Sort the function table by function name.
* The sorting of the table above is ASCII dependant.
* On machines using EBCDIC we have to sort it.
*/
static void
sortFunctions(void)
{
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
}
#endif
/*
* Initialize the global and v: variables.
*/
@@ -270,7 +294,7 @@ eval_init(void)
p = &vimvars[i];
if (STRLEN(p->vv_name) > 16)
{
EMSG("INTERNAL: name too long, increase size of dictitem16_T");
IEMSG("INTERNAL: name too long, increase size of dictitem16_T");
getout(1);
}
STRCPY(p->vv_di.di_key, p->vv_name);
@@ -4085,21 +4109,12 @@ eval6(
{
if (n2 == 0) /* give an error message? */
{
#ifdef FEAT_NUM64
if (n1 == 0)
n1 = -0x7fffffffffffffffLL - 1; /* similar to NaN */
n1 = VARNUM_MIN; /* similar to NaN */
else if (n1 < 0)
n1 = -0x7fffffffffffffffLL;
n1 = -VARNUM_MAX;
else
n1 = 0x7fffffffffffffffLL;
#else
if (n1 == 0)
n1 = -0x7fffffffL - 1L; /* similar to NaN */
else if (n1 < 0)
n1 = -0x7fffffffL;
else
n1 = 0x7fffffffL;
#endif
n1 = VARNUM_MAX;
}
else
n1 = n1 / n2;
@@ -5971,6 +5986,22 @@ string2float(
char *s = (char *)text;
float_T f;
/* MS-Windows does not deal with "inf" and "nan" properly. */
if (STRNICMP(text, "inf", 3) == 0)
{
*value = INFINITY;
return 3;
}
if (STRNICMP(text, "-inf", 3) == 0)
{
*value = -INFINITY;
return 4;
}
if (STRNICMP(text, "nan", 3) == 0)
{
*value = NAN;
return 3;
}
f = strtod(s, &s);
*value = f;
return (int)((char_u *)s - text);
@@ -9216,6 +9247,8 @@ fill_assert_error(
{
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
ga_concat(gap, (char_u *)"Pattern ");
else if (atype == ASSERT_NOTEQUAL)
ga_concat(gap, (char_u *)"Expected not equal to ");
else
ga_concat(gap, (char_u *)"Expected ");
if (exp_str == NULL)
@@ -9225,16 +9258,17 @@ fill_assert_error(
}
else
ga_concat_esc(gap, exp_str);
if (atype == ASSERT_MATCH)
ga_concat(gap, (char_u *)" does not match ");
else if (atype == ASSERT_NOTMATCH)
ga_concat(gap, (char_u *)" does match ");
else if (atype == ASSERT_NOTEQUAL)
ga_concat(gap, (char_u *)" differs from ");
else
ga_concat(gap, (char_u *)" but got ");
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
vim_free(tofree);
if (atype != ASSERT_NOTEQUAL)
{
if (atype == ASSERT_MATCH)
ga_concat(gap, (char_u *)" does not match ");
else if (atype == ASSERT_NOTMATCH)
ga_concat(gap, (char_u *)" does match ");
else
ga_concat(gap, (char_u *)" but got ");
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
vim_free(tofree);
}
}
}
+58 -60
View File
@@ -923,34 +923,6 @@ get_expr_name(expand_T *xp, int idx)
#endif /* FEAT_CMDL_COMPL */
#if defined(EBCDIC) || defined(PROTO)
/*
* Compare struct fst by function name.
*/
static int
compare_func_name(const void *s1, const void *s2)
{
struct fst *p1 = (struct fst *)s1;
struct fst *p2 = (struct fst *)s2;
return STRCMP(p1->f_name, p2->f_name);
}
/*
* Sort the function table by function name.
* The sorting of the table above is ASCII dependant.
* On machines using EBCDIC we have to sort it.
*/
static void
sortFunctions(void)
{
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
}
#endif
/*
* Find internal function in table above.
* Return index, or -1 if not found
@@ -3332,21 +3304,12 @@ f_float2nr(typval_T *argvars, typval_T *rettv)
if (get_float_arg(argvars, &f) == OK)
{
# ifdef FEAT_NUM64
if (f < -0x7fffffffffffffffLL)
rettv->vval.v_number = -0x7fffffffffffffffLL;
else if (f > 0x7fffffffffffffffLL)
rettv->vval.v_number = 0x7fffffffffffffffLL;
if (f < -VARNUM_MAX)
rettv->vval.v_number = -VARNUM_MAX;
else if (f > VARNUM_MAX)
rettv->vval.v_number = VARNUM_MAX;
else
rettv->vval.v_number = (varnumber_T)f;
# else
if (f < -0x7fffffff)
rettv->vval.v_number = -0x7fffffff;
else if (f > 0x7fffffff)
rettv->vval.v_number = 0x7fffffff;
else
rettv->vval.v_number = (varnumber_T)f;
# endif
}
}
@@ -3973,7 +3936,8 @@ get_buffer_info(buf_T *buf)
dict_add_nr_str(dict, "bufnr", buf->b_fnum, NULL);
dict_add_nr_str(dict, "name", 0L,
buf->b_ffname != NULL ? buf->b_ffname : (char_u *)"");
dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL);
dict_add_nr_str(dict, "lnum", buf == curbuf ? curwin->w_cursor.lnum
: buflist_findlnum(buf), NULL);
dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
@@ -4258,7 +4222,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
{
if (argvars[0].v_type == VAR_UNKNOWN)
/* getchar(): blocking wait. */
n = safe_vgetc();
n = plain_vgetc();
else if (get_tv_number_chk(&argvars[0], &error) == 1)
/* getchar(1): only check if char avail */
n = vpeekc_any();
@@ -4267,7 +4231,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
n = 0;
else
/* getchar(0) and char avail: return char */
n = safe_vgetc();
n = plain_vgetc();
if (n == K_IGNORE)
continue;
@@ -6836,8 +6800,7 @@ f_json_decode(typval_T *argvars, typval_T *rettv)
reader.js_buf = get_tv_string(&argvars[0]);
reader.js_fill = NULL;
reader.js_used = 0;
if (json_decode_all(&reader, rettv, 0) != OK)
EMSG(_(e_invarg));
json_decode_all(&reader, rettv, 0);
}
/*
@@ -6906,10 +6869,8 @@ f_len(typval_T *argvars, typval_T *rettv)
}
}
static void libcall_common(typval_T *argvars, typval_T *rettv, int type);
static void
libcall_common(typval_T *argvars, typval_T *rettv, int type)
libcall_common(typval_T *argvars UNUSED, typval_T *rettv, int type)
{
#ifdef FEAT_LIBCALL
char_u *string_in;
@@ -9535,15 +9496,15 @@ do_searchpair(
/* Make two search patterns: start/end (pat2, for in nested pairs) and
* start/middle/end (pat3, for the top pair). */
pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 15));
pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 23));
pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 17));
pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 25));
if (pat2 == NULL || pat3 == NULL)
goto theend;
sprintf((char *)pat2, "\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat);
sprintf((char *)pat2, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat);
if (*mpat == NUL)
STRCPY(pat3, pat2);
else
sprintf((char *)pat3, "\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)",
sprintf((char *)pat3, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)",
spat, epat, mpat);
if (flags & SP_START)
options |= SEARCH_START;
@@ -11093,10 +11054,13 @@ f_sqrt(typval_T *argvars, typval_T *rettv)
f_str2float(typval_T *argvars, typval_T *rettv)
{
char_u *p = skipwhite(get_tv_string(&argvars[0]));
int isneg = (*p == '-');
if (*p == '+')
if (*p == '+' || *p == '-')
p = skipwhite(p + 1);
(void)string2float(p, &rettv->vval.v_float);
if (isneg)
rettv->vval.v_float *= -1;
rettv->v_type = VAR_FLOAT;
}
#endif
@@ -11111,6 +11075,7 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
char_u *p;
varnumber_T n;
int what;
int isneg;
if (argvars[1].v_type != VAR_UNKNOWN)
{
@@ -11123,7 +11088,8 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
}
p = skipwhite(get_tv_string(&argvars[0]));
if (*p == '+')
isneg = (*p == '-');
if (*p == '+' || *p == '-')
p = skipwhite(p + 1);
switch (base)
{
@@ -11133,7 +11099,11 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
default: what = 0;
}
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0);
rettv->vval.v_number = n;
if (isneg)
rettv->vval.v_number = -n;
else
rettv->vval.v_number = n;
}
#ifdef HAVE_STRFTIME
@@ -11843,7 +11813,6 @@ get_cmd_output_as_rettv(
char_u *res = NULL;
char_u *p;
char_u *infile = NULL;
char_u buf[NUMBUFLEN];
int err = FALSE;
FILE *fd;
list_T *list = NULL;
@@ -11857,7 +11826,7 @@ get_cmd_output_as_rettv(
if (argvars[1].v_type != VAR_UNKNOWN)
{
/*
* Write the string to a temp file, to be used for input of the shell
* Write the text to a temp file, to be used for input of the shell
* command.
*/
if ((infile = vim_tempname('i', TRUE)) == NULL)
@@ -11872,14 +11841,43 @@ get_cmd_output_as_rettv(
EMSG2(_(e_notopen), infile);
goto errret;
}
if (argvars[1].v_type == VAR_LIST)
if (argvars[1].v_type == VAR_NUMBER)
{
linenr_T lnum;
buf_T *buf;
buf = buflist_findnr(argvars[1].vval.v_number);
if (buf == NULL)
{
EMSGN(_(e_nobufnr), argvars[1].vval.v_number);
fclose(fd);
goto errret;
}
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; lnum++)
{
for (p = ml_get_buf(buf, lnum, FALSE); *p != NUL; ++p)
if (putc(*p == '\n' ? NUL : *p, fd) == EOF)
{
err = TRUE;
break;
}
if (putc(NL, fd) == EOF)
{
err = TRUE;
break;
}
}
}
else if (argvars[1].v_type == VAR_LIST)
{
if (write_list(fd, argvars[1].vval.v_list, TRUE) == FAIL)
err = TRUE;
}
else
{
size_t len;
size_t len;
char_u buf[NUMBUFLEN];
p = get_tv_string_buf_chk(&argvars[1], buf);
if (p == NULL)
+7 -2
View File
@@ -1313,7 +1313,7 @@ do_filter(
if (otmp != NULL)
{
if (readfile(otmp, NULL, line2, (linenr_T)0, (linenr_T)MAXLNUM,
eap, READ_FILTER) == FAIL)
eap, READ_FILTER) != OK)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (!aborting())
@@ -3967,7 +3967,8 @@ do_ecmd(
* <VN> We could instead free the synblock
* and re-attach to buffer, perhaps.
*/
if (curwin->w_s == &(curwin->w_buffer->b_s))
if (curwin->w_buffer != NULL
&& curwin->w_s == &(curwin->w_buffer->b_s))
curwin->w_s = &(buf->b_s);
#endif
curwin->w_buffer = buf;
@@ -5262,6 +5263,10 @@ do_sub(exarg_T *eap)
setmouse(); /* disable mouse in xterm */
#endif
curwin->w_cursor.col = regmatch.startpos[0].col;
#ifdef FEAT_CURSORBIND
if (curwin->w_p_crb)
do_check_cursorbind();
#endif
/* When 'cpoptions' contains "u" don't sync undo when
* asking for confirmation. */
+18 -16
View File
@@ -5164,24 +5164,10 @@ ex_language(exarg_T *eap)
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
static char_u **locales = NULL; /* Array of all available locales */
# ifndef WIN32
static int did_init_locales = FALSE;
static void init_locales(void);
static char_u **find_locales(void);
/*
* Lazy initialization of all available locales.
*/
static void
init_locales(void)
{
if (!did_init_locales)
{
did_init_locales = TRUE;
locales = find_locales();
}
}
/* Return an array of strings for all available locales + NULL for the
* last element. Return NULL in case of error. */
static char_u **
@@ -5222,6 +5208,22 @@ find_locales(void)
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
return (char_u **)locales_ga.ga_data;
}
# endif
/*
* Lazy initialization of all available locales.
*/
static void
init_locales(void)
{
# ifndef WIN32
if (!did_init_locales)
{
did_init_locales = TRUE;
locales = find_locales();
}
# endif
}
# if defined(EXITFREE) || defined(PROTO)
void
+49 -16
View File
@@ -137,7 +137,7 @@ static int getargopt(exarg_T *eap);
#endif
static int check_more(int, int);
static linenr_T get_address(exarg_T *, char_u **, int addr_type, int skip, int to_other_file);
static linenr_T get_address(exarg_T *, char_u **, int addr_type, int skip, int to_other_file, int address_count);
static void get_flags(exarg_T *eap);
#if !defined(FEAT_PERL) \
|| !defined(FEAT_PYTHON) || !defined(FEAT_PYTHON3) \
@@ -794,8 +794,13 @@ do_cmdline(
#endif
/* It's possible to create an endless loop with ":execute", catch that
* here. The value of 200 allows nested function calls, ":source", etc. */
if (call_depth == 200)
* here. The value of 200 allows nested function calls, ":source", etc.
* Allow 200 or 'maxfuncdepth', whatever is larger. */
if (call_depth >= 200
#ifdef FEAT_EVAL
&& call_depth >= p_mfd
#endif
)
{
EMSG(_("E169: Command too recursive"));
#ifdef FEAT_EVAL
@@ -1798,6 +1803,7 @@ do_one_cmd(
cmdmod_T save_cmdmod;
int ni; /* set when Not Implemented */
char_u *cmd;
int address_count = 1;
vim_memset(&ea, 0, sizeof(ea));
ea.line1 = 1;
@@ -2022,7 +2028,7 @@ do_one_cmd(
{
#ifdef FEAT_WINDOWS
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
ea.skip, FALSE);
ea.skip, FALSE, 1);
if (tabnr == MAXLNUM)
cmdmod.tab = tabpage_index(curtab) + 1;
else
@@ -2182,7 +2188,7 @@ do_one_cmd(
}
ea.cmd = skipwhite(ea.cmd);
lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip,
ea.addr_count == 0);
ea.addr_count == 0, address_count++);
if (ea.cmd == NULL) /* error detected */
goto doend;
if (lnum == MAXLNUM)
@@ -2284,7 +2290,11 @@ do_one_cmd(
if (*ea.cmd == ';')
{
if (!ea.skip)
{
curwin->w_cursor.lnum = ea.line2;
/* don't leave the cursor on an illegal line */
check_cursor_lnum();
}
}
else if (*ea.cmd != ',')
break;
@@ -2300,9 +2310,6 @@ do_one_cmd(
ea.addr_count = 0;
}
/* Don't leave the cursor on an illegal line (caused by ';') */
check_cursor_lnum();
/*
* 5. Parse the command.
*/
@@ -3871,7 +3878,6 @@ set_one_cmd_context(
case CMD_cfdo:
case CMD_confirm:
case CMD_debug:
case CMD_filter:
case CMD_folddoclosed:
case CMD_folddoopen:
case CMD_hide:
@@ -3896,6 +3902,16 @@ set_one_cmd_context(
case CMD_windo:
return arg;
case CMD_filter:
if (*arg != NUL)
arg = skip_vimgrep_pat(arg, NULL, NULL);
if (arg == NULL || *arg == NUL)
{
xp->xp_context = EXPAND_NOTHING;
return NULL;
}
return skipwhite(arg);
#ifdef FEAT_CMDL_COMPL
# ifdef FEAT_SEARCH_EXTRA
case CMD_match:
@@ -4100,6 +4116,12 @@ set_one_cmd_context(
case CMD_echoerr:
case CMD_call:
case CMD_return:
case CMD_cexpr:
case CMD_caddexpr:
case CMD_cgetexpr:
case CMD_lexpr:
case CMD_laddexpr:
case CMD_lgetexpr:
set_context_for_expression(xp, arg, ea.cmdidx);
break;
@@ -4379,7 +4401,8 @@ get_address(
char_u **ptr,
int addr_type, /* flag: one of ADDR_LINES, ... */
int skip, /* only skip the address, don't use it */
int to_other_file) /* flag: may jump to other file */
int to_other_file, /* flag: may jump to other file */
int address_count UNUSED) /* 1 for first address, >1 after comma */
{
int c;
int i;
@@ -4655,10 +4678,20 @@ get_address(
|| addr_type == ADDR_BUFFERS)
lnum = compute_buffer_local_count(
addr_type, lnum, (i == '-') ? -1 * n : n);
else if (i == '-')
lnum -= n;
else
lnum += n;
{
#ifdef FEAT_FOLDING
/* Relative line addressing, need to adjust for folded lines
* now, but only do it after the first address. */
if (addr_type == ADDR_LINES && (i == '-' || i == '+')
&& address_count >= 2)
(void)hasFolding(lnum, NULL, &lnum);
#endif
if (i == '-')
lnum -= n;
else
lnum += n;
}
}
} while (*cmd == '/' || *cmd == '?');
@@ -7588,7 +7621,7 @@ ex_all(exarg_T *eap)
#endif /* FEAT_WINDOWS */
static void
ex_hide(exarg_T *eap)
ex_hide(exarg_T *eap UNUSED)
{
/* ":hide" or ":hide | cmd": hide current window */
#ifdef FEAT_WINDOWS
@@ -8849,7 +8882,7 @@ ex_read(exarg_T *eap)
eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0);
}
if (i == FAIL)
if (i != OK)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (!aborting())
@@ -9319,7 +9352,7 @@ ex_copymove(exarg_T *eap)
{
long n;
n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE);
n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE, 1);
if (eap->arg == NULL) /* error detected */
{
eap->nextcmd = NULL;
+15 -7
View File
@@ -212,7 +212,8 @@ getcmdline(
#endif
expand_T xpc;
long *b_im_ptr = NULL;
#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) || defined(FEAT_SEARCH_EXTRA)
#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) \
|| defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CMDWIN)
/* Everything that may work recursively should save and restore the
* current command line in save_ccline. That includes update_screen(), a
* custom status line may invoke ":normal". */
@@ -1801,6 +1802,10 @@ getcmdline(
goto cmdline_not_changed;
#endif
case K_PS:
bracketed_paste(PASTE_CMDLINE, FALSE, NULL);
goto cmdline_changed;
default:
#ifdef UNIX
if (c == intr_char)
@@ -2373,8 +2378,7 @@ getexmodeline(
if (ga_grow(&line_ga, 40) == FAIL)
break;
/* Get one character at a time. Don't use inchar(), it can't handle
* special characters. */
/* Get one character at a time. */
prev_char = c1;
c1 = vgetc();
@@ -2389,6 +2393,12 @@ getexmodeline(
break;
}
if (c1 == K_PS)
{
bracketed_paste(PASTE_EX, FALSE, &line_ga);
goto redraw;
}
if (!escaped)
{
/* CR typed means "enter", which is NL */
@@ -6915,9 +6925,7 @@ ex_window(void)
redraw_later(SOME_VALID);
/* Save the command line info, can be used recursively. */
save_ccline = ccline;
ccline.cmdbuff = NULL;
ccline.cmdprompt = NULL;
save_cmdline(&save_ccline);
/* No Ex mode here! */
exmode_active = 0;
@@ -6964,7 +6972,7 @@ ex_window(void)
# endif
/* Restore the command line info. */
ccline = save_ccline;
restore_cmdline(&save_ccline);
cmdwin_type = 0;
exmode_active = save_exmode;
+22 -7
View File
@@ -210,7 +210,7 @@ filemess(
* READ_KEEP_UNDO don't clear undo info or read it from a file
* READ_FIFO read from fifo/socket instead of a file
*
* return FAIL for failure, OK otherwise
* return FAIL for failure, NOTDONE for directory (failure), or OK
*/
int
readfile(
@@ -274,9 +274,9 @@ readfile(
int msg_save = msg_scroll;
linenr_T read_no_eol_lnum = 0; /* non-zero lnum when last line of
* last read was missing the eol */
int try_mac = (vim_strchr(p_ffs, 'm') != NULL);
int try_dos = (vim_strchr(p_ffs, 'd') != NULL);
int try_unix = (vim_strchr(p_ffs, 'x') != NULL);
int try_mac;
int try_dos;
int try_unix;
int file_rewind = FALSE;
#ifdef FEAT_MBYTE
int can_retry;
@@ -450,13 +450,18 @@ readfile(
# endif
)
{
int retval = FAIL;
if (S_ISDIR(perm))
{
filemess(curbuf, fname, (char_u *)_("is a directory"), 0);
retval = NOTDONE;
}
else
filemess(curbuf, fname, (char_u *)_("is not a file"), 0);
msg_end();
msg_scroll = msg_save;
return FAIL;
return retval;
}
#endif
#if defined(MSWIN)
@@ -733,6 +738,10 @@ readfile(
curbuf->b_op_start.lnum = ((from == 0) ? 1 : from);
curbuf->b_op_start.col = 0;
try_mac = (vim_strchr(p_ffs, 'm') != NULL);
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
#ifdef FEAT_AUTOCMD
if (!read_buffer)
{
@@ -764,6 +773,11 @@ readfile(
else
apply_autocmds_exarg(EVENT_FILEREADPRE, sfname, sfname,
FALSE, NULL, eap);
/* autocommands may have changed it */
try_mac = (vim_strchr(p_ffs, 'm') != NULL);
try_dos = (vim_strchr(p_ffs, 'd') != NULL);
try_unix = (vim_strchr(p_ffs, 'x') != NULL);
if (msg_scrolled == n)
msg_scroll = m;
@@ -2237,8 +2251,9 @@ rewind_retry:
len = (colnr_T)(ptr - line_start + 1);
if (fileformat == EOL_DOS)
{
if (ptr[-1] == CAR) /* remove CR */
if (ptr > line_start && ptr[-1] == CAR)
{
/* remove CR before NL */
ptr[-1] = NUL;
--len;
}
@@ -7174,7 +7189,7 @@ buf_reload(buf_T *buf, int orig_mode)
#endif
if (readfile(buf->b_ffname, buf->b_fname, (linenr_T)0,
(linenr_T)0,
(linenr_T)MAXLNUM, &ea, flags) == FAIL)
(linenr_T)MAXLNUM, &ea, flags) != OK)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (!aborting())
+17 -12
View File
@@ -978,23 +978,22 @@ ins_typebuf(
addlen = (int)STRLEN(str);
/*
* Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
*/
if (offset == 0 && addlen <= typebuf.tb_off)
{
/*
* Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
*/
typebuf.tb_off -= addlen;
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
}
/*
* Need to allocate a new buffer.
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
* characters. We add some extra room to avoid having to allocate too
* often.
*/
else
{
/*
* Need to allocate a new buffer.
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
* characters. We add some extra room to avoid having to allocate too
* often.
*/
newoff = MAXMAPLEN + 4;
newlen = typebuf.tb_len + addlen + newoff + 4 * (MAXMAPLEN + 4);
if (newlen < 0) /* string is getting too long */
@@ -1818,6 +1817,12 @@ plain_vgetc(void)
{
c = safe_vgetc();
} while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
if (c == K_PS)
/* Only handle the first pasted character. Drop the rest, since we
* don't know what to do with it. */
c = bracketed_paste(PASTE_ONE_CHAR, FALSE, NULL);
return c;
}
@@ -1907,7 +1912,7 @@ vungetc(int c)
}
/*
* get a character:
* Get a character:
* 1. from the stuffbuffer
* This is used for abbreviated commands like "D" -> "d$".
* Also used to redo a command for ".".
@@ -2009,7 +2014,7 @@ vgetorpeek(int advance)
{
/* KeyTyped = FALSE; When the command that stuffed something
* was typed, behave like the stuffed command was typed.
* needed for CTRL-W CTRl-] to open a fold, for example. */
* needed for CTRL-W CTRL-] to open a fold, for example. */
KeyStuffed = TRUE;
}
if (typebuf.tb_no_abbr_cnt == 0)
+3
View File
@@ -51,6 +51,9 @@
# ifdef _
# undef _
# endif
# ifdef ngettext
# undef ngettext
# endif
# ifdef N_
# undef N_
# endif
+3
View File
@@ -35,6 +35,9 @@
# ifdef _
# undef _
# endif
# ifdef ngettext
# undef ngettext
# endif
# ifdef N_
# undef N_
# endif
-2
View File
@@ -70,7 +70,6 @@ hash_init(hashtab_T *ht)
ht->ht_mask = HT_INIT_SIZE - 1;
}
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
/*
* Free the array of a hash table. Does not free the items it contains!
* If "ht" is not freed then you should call hash_init() next!
@@ -104,7 +103,6 @@ hash_clear_all(hashtab_T *ht, int off)
}
hash_clear(ht);
}
#endif
/*
* Find "key" in hashtable "ht". "key" must not be NULL.
+1 -1
View File
@@ -207,7 +207,7 @@ set_context_in_cscope_cmd(
static void
do_cscope_general(
exarg_T *eap,
int make_split) /* whether to split window */
int make_split UNUSED) /* whether to split window */
{
cscmd_T *cmdp;
+10 -5
View File
@@ -312,6 +312,7 @@ static void ruby_vim_init(void);
# define ruby_init_loadpath dll_ruby_init_loadpath
# ifdef WIN3264
# define NtInitialize dll_NtInitialize
# define ruby_sysinit dll_ruby_sysinit
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
# define rb_w32_snprintf dll_rb_w32_snprintf
# endif
@@ -414,6 +415,7 @@ static void (*dll_ruby_init) (void);
static void (*dll_ruby_init_loadpath) (void);
# ifdef WIN3264
static void (*dll_NtInitialize) (int*, char***);
static void (*dll_ruby_sysinit) (int*, char***);
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
# endif
@@ -523,9 +525,10 @@ static struct
{
{"rb_assoc_new", (RUBY_PROC*)&dll_rb_assoc_new},
{"rb_cFalseClass", (RUBY_PROC*)&dll_rb_cFalseClass},
{"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum},
# if defined(USE_RUBY_INTEGER)
{"rb_cInteger", (RUBY_PROC*)&dll_rb_cInteger},
# else
{"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum},
# endif
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20
{"rb_cFloat", (RUBY_PROC*)&dll_rb_cFloat},
@@ -602,13 +605,11 @@ static struct
{"ruby_init", (RUBY_PROC*)&dll_ruby_init},
{"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
# ifdef WIN3264
{
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
"NtInitialize",
{"NtInitialize", (RUBY_PROC*)&dll_NtInitialize},
# else
"ruby_sysinit",
{"ruby_sysinit", (RUBY_PROC*)&dll_ruby_sysinit},
# endif
(RUBY_PROC*)&dll_NtInitialize},
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
{"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
# endif
@@ -870,7 +871,11 @@ static int ensure_ruby_initialized(void)
int argc = 1;
char *argv[] = {"gvim.exe"};
char **argvp = argv;
# ifdef RUBY19_OR_LATER
ruby_sysinit(&argc, &argvp);
# else
NtInitialize(&argc, &argvp);
# endif
#endif
{
#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
+436 -293
View File
@@ -378,176 +378,7 @@ json_skip_white(js_read_T *reader)
}
static int
json_decode_array(js_read_T *reader, typval_T *res, int options)
{
char_u *p;
typval_T item;
listitem_T *li;
int ret;
if (res != NULL && rettv_list_alloc(res) == FAIL)
{
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_NONE;
return FAIL;
}
++reader->js_used; /* consume the '[' */
while (TRUE)
{
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == NUL)
return MAYBE;
if (*p == ']')
{
++reader->js_used; /* consume the ']' */
break;
}
ret = json_decode_item(reader, res == NULL ? NULL : &item, options);
if (ret != OK)
return ret;
if (res != NULL)
{
li = listitem_alloc();
if (li == NULL)
{
clear_tv(&item);
return FAIL;
}
li->li_tv = item;
list_append(res->vval.v_list, li);
}
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == ',')
++reader->js_used;
else if (*p != ']')
{
if (*p == NUL)
return MAYBE;
return FAIL;
}
}
return OK;
}
static int
json_decode_object(js_read_T *reader, typval_T *res, int options)
{
char_u *p;
typval_T tvkey;
typval_T item;
dictitem_T *di;
char_u buf[NUMBUFLEN];
char_u *key = NULL;
int ret;
if (res != NULL && rettv_dict_alloc(res) == FAIL)
{
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_NONE;
return FAIL;
}
++reader->js_used; /* consume the '{' */
while (TRUE)
{
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == NUL)
return MAYBE;
if (*p == '}')
{
++reader->js_used; /* consume the '}' */
break;
}
if ((options & JSON_JS) && reader->js_buf[reader->js_used] != '"')
{
/* accept a key that is not in quotes */
key = p = reader->js_buf + reader->js_used;
while (*p != NUL && *p != ':' && *p > ' ')
++p;
tvkey.v_type = VAR_STRING;
tvkey.vval.v_string = vim_strnsave(key, (int)(p - key));
reader->js_used += (int)(p - key);
key = tvkey.vval.v_string;
}
else
{
ret = json_decode_item(reader, res == NULL ? NULL : &tvkey,
options);
if (ret != OK)
return ret;
if (res != NULL)
{
key = get_tv_string_buf_chk(&tvkey, buf);
if (key == NULL || *key == NUL)
{
clear_tv(&tvkey);
return FAIL;
}
}
}
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p != ':')
{
if (res != NULL)
clear_tv(&tvkey);
if (*p == NUL)
return MAYBE;
return FAIL;
}
++reader->js_used;
json_skip_white(reader);
ret = json_decode_item(reader, res == NULL ? NULL : &item, options);
if (ret != OK)
{
if (res != NULL)
clear_tv(&tvkey);
return ret;
}
if (res != NULL)
{
di = dictitem_alloc(key);
clear_tv(&tvkey);
if (di == NULL)
{
clear_tv(&item);
return FAIL;
}
di->di_tv = item;
di->di_tv.v_lock = 0;
if (dict_add(res->vval.v_dict, di) == FAIL)
{
dictitem_free(di);
return FAIL;
}
}
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == ',')
++reader->js_used;
else if (*p != '}')
{
if (*p == NUL)
return MAYBE;
return FAIL;
}
}
return OK;
}
static int
json_decode_string(js_read_T *reader, typval_T *res)
json_decode_string(js_read_T *reader, typval_T *res, int quote)
{
garray_T ga;
int len;
@@ -558,8 +389,8 @@ json_decode_string(js_read_T *reader, typval_T *res)
if (res != NULL)
ga_init2(&ga, 1, 200);
p = reader->js_buf + reader->js_used + 1; /* skip over " */
while (*p != '"')
p = reader->js_buf + reader->js_used + 1; /* skip over " or ' */
while (*p != quote)
{
/* The JSON is always expected to be utf-8, thus use utf functions
* here. The string is converted below if needed. */
@@ -673,7 +504,7 @@ json_decode_string(js_read_T *reader, typval_T *res)
}
reader->js_used = (int)(p - reader->js_buf);
if (*p == '"')
if (*p == quote)
{
++reader->js_used;
if (res != NULL)
@@ -711,11 +542,24 @@ json_decode_string(js_read_T *reader, typval_T *res)
return MAYBE;
}
typedef enum {
JSON_ARRAY, /* parsing items in an array */
JSON_OBJECT_KEY, /* parsing key of an object */
JSON_OBJECT /* parsing item in an object, after the key */
} json_decode_T;
typedef struct {
json_decode_T jd_type;
typval_T jd_tv; /* the list or dict */
typval_T jd_key_tv;
char_u *jd_key;
} json_dec_item_T;
/*
* Decode one item and put it in "res". If "res" is NULL only advance.
* Must already have skipped white space.
*
* Return FAIL for a decoding error.
* Return FAIL for a decoding error (and give an error).
* Return MAYBE for an incomplete message.
*/
static int
@@ -723,150 +567,441 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
{
char_u *p;
int len;
int retval;
garray_T stack;
typval_T item;
typval_T *cur_item;
json_dec_item_T *top_item;
char_u key_buf[NUMBUFLEN];
ga_init2(&stack, sizeof(json_dec_item_T), 100);
cur_item = res;
init_tv(&item);
if (res != NULL)
init_tv(res);
fill_numbuflen(reader);
p = reader->js_buf + reader->js_used;
switch (*p)
for (;;)
{
case '[': /* array */
return json_decode_array(reader, res, options);
case '{': /* object */
return json_decode_object(reader, res, options);
case '"': /* string */
return json_decode_string(reader, res);
case ',': /* comma: empty item */
if ((options & JSON_JS) == 0)
return FAIL;
/* FALLTHROUGH */
case NUL: /* empty */
if (res != NULL)
top_item = NULL;
if (stack.ga_len > 0)
{
top_item = ((json_dec_item_T *)stack.ga_data) + stack.ga_len - 1;
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == NUL)
{
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_NONE;
retval = MAYBE;
if (top_item->jd_type == JSON_OBJECT)
/* did get the key, clear it */
clear_tv(&top_item->jd_key_tv);
goto theend;
}
return OK;
default:
if (VIM_ISDIGIT(*p) || *p == '-')
if (top_item->jd_type == JSON_OBJECT_KEY
|| top_item->jd_type == JSON_ARRAY)
{
#ifdef FEAT_FLOAT
char_u *sp = p;
if (*sp == '-')
/* Check for end of object or array. */
if (*p == (top_item->jd_type == JSON_ARRAY ? ']' : '}'))
{
++sp;
if (*sp == NUL)
return MAYBE;
if (!VIM_ISDIGIT(*sp))
return FAIL;
}
sp = skipdigits(sp);
if (*sp == '.' || *sp == 'e' || *sp == 'E')
{
if (res == NULL)
++reader->js_used; /* consume the ']' or '}' */
--stack.ga_len;
if (stack.ga_len == 0)
{
float_T f;
len = string2float(p, &f);
retval = OK;
goto theend;
}
if (cur_item != NULL)
cur_item = &top_item->jd_tv;
goto item_end;
}
}
}
if (top_item != NULL && top_item->jd_type == JSON_OBJECT_KEY
&& (options & JSON_JS)
&& reader->js_buf[reader->js_used] != '"'
&& reader->js_buf[reader->js_used] != '\'')
{
char_u *key;
/* accept an object key that is not in quotes */
key = p = reader->js_buf + reader->js_used;
while (*p != NUL && *p != ':' && *p > ' ')
++p;
if (cur_item != NULL)
{
cur_item->v_type = VAR_STRING;
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
top_item->jd_key = cur_item->vval.v_string;
}
reader->js_used += (int)(p - key);
}
else
{
switch (*p)
{
case '[': /* start of array */
if (ga_grow(&stack, 1) == FAIL)
{
retval = FAIL;
break;
}
if (cur_item != NULL && rettv_list_alloc(cur_item) == FAIL)
{
cur_item->v_type = VAR_SPECIAL;
cur_item->vval.v_number = VVAL_NONE;
retval = FAIL;
break;
}
++reader->js_used; /* consume the '[' */
top_item = ((json_dec_item_T *)stack.ga_data)
+ stack.ga_len;
top_item->jd_type = JSON_ARRAY;
++stack.ga_len;
if (cur_item != NULL)
{
top_item->jd_tv = *cur_item;
cur_item = &item;
}
continue;
case '{': /* start of object */
if (ga_grow(&stack, 1) == FAIL)
{
retval = FAIL;
break;
}
if (cur_item != NULL && rettv_dict_alloc(cur_item) == FAIL)
{
cur_item->v_type = VAR_SPECIAL;
cur_item->vval.v_number = VVAL_NONE;
retval = FAIL;
break;
}
++reader->js_used; /* consume the '{' */
top_item = ((json_dec_item_T *)stack.ga_data)
+ stack.ga_len;
top_item->jd_type = JSON_OBJECT_KEY;
++stack.ga_len;
if (cur_item != NULL)
{
top_item->jd_tv = *cur_item;
cur_item = &top_item->jd_key_tv;
}
continue;
case '"': /* string */
retval = json_decode_string(reader, cur_item, *p);
break;
case '\'':
if (options & JSON_JS)
retval = json_decode_string(reader, cur_item, *p);
else
{
res->v_type = VAR_FLOAT;
len = string2float(p, &res->vval.v_float);
EMSG(_(e_invarg));
retval = FAIL;
}
}
else
#endif
{
varnumber_T nr;
break;
vim_str2nr(reader->js_buf + reader->js_used,
NULL, &len, 0, /* what */
&nr, NULL, 0);
if (res != NULL)
case ',': /* comma: empty item */
if ((options & JSON_JS) == 0)
{
res->v_type = VAR_NUMBER;
res->vval.v_number = nr;
EMSG(_(e_invarg));
retval = FAIL;
break;
}
/* FALLTHROUGH */
case NUL: /* empty */
if (cur_item != NULL)
{
cur_item->v_type = VAR_SPECIAL;
cur_item->vval.v_number = VVAL_NONE;
}
retval = OK;
break;
default:
if (VIM_ISDIGIT(*p) || *p == '-')
{
#ifdef FEAT_FLOAT
char_u *sp = p;
if (*sp == '-')
{
++sp;
if (*sp == NUL)
{
retval = MAYBE;
break;
}
if (!VIM_ISDIGIT(*sp))
{
EMSG(_(e_invarg));
retval = FAIL;
break;
}
}
sp = skipdigits(sp);
if (*sp == '.' || *sp == 'e' || *sp == 'E')
{
if (cur_item == NULL)
{
float_T f;
len = string2float(p, &f);
}
else
{
cur_item->v_type = VAR_FLOAT;
len = string2float(p, &cur_item->vval.v_float);
}
}
else
#endif
{
varnumber_T nr;
vim_str2nr(reader->js_buf + reader->js_used,
NULL, &len, 0, /* what */
&nr, NULL, 0);
if (cur_item != NULL)
{
cur_item->v_type = VAR_NUMBER;
cur_item->vval.v_number = nr;
}
}
reader->js_used += len;
retval = OK;
break;
}
if (STRNICMP((char *)p, "false", 5) == 0)
{
reader->js_used += 5;
if (cur_item != NULL)
{
cur_item->v_type = VAR_SPECIAL;
cur_item->vval.v_number = VVAL_FALSE;
}
retval = OK;
break;
}
if (STRNICMP((char *)p, "true", 4) == 0)
{
reader->js_used += 4;
if (cur_item != NULL)
{
cur_item->v_type = VAR_SPECIAL;
cur_item->vval.v_number = VVAL_TRUE;
}
retval = OK;
break;
}
if (STRNICMP((char *)p, "null", 4) == 0)
{
reader->js_used += 4;
if (cur_item != NULL)
{
cur_item->v_type = VAR_SPECIAL;
cur_item->vval.v_number = VVAL_NULL;
}
retval = OK;
break;
}
#ifdef FEAT_FLOAT
if (STRNICMP((char *)p, "NaN", 3) == 0)
{
reader->js_used += 3;
if (cur_item != NULL)
{
cur_item->v_type = VAR_FLOAT;
cur_item->vval.v_float = NAN;
}
retval = OK;
break;
}
if (STRNICMP((char *)p, "Infinity", 8) == 0)
{
reader->js_used += 8;
if (cur_item != NULL)
{
cur_item->v_type = VAR_FLOAT;
cur_item->vval.v_float = INFINITY;
}
retval = OK;
break;
}
#endif
/* check for truncated name */
len = (int)(reader->js_end - (reader->js_buf + reader->js_used));
if (
(len < 5 && STRNICMP((char *)p, "false", len) == 0)
#ifdef FEAT_FLOAT
|| (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)
|| (len < 3 && STRNICMP((char *)p, "NaN", len) == 0)
#endif
|| (len < 4 && (STRNICMP((char *)p, "true", len) == 0
|| STRNICMP((char *)p, "null", len) == 0)))
retval = MAYBE;
else
retval = FAIL;
break;
}
/* We are finished when retval is FAIL or MAYBE and when at the
* toplevel. */
if (retval == FAIL)
break;
if (retval == MAYBE || stack.ga_len == 0)
goto theend;
if (top_item != NULL && top_item->jd_type == JSON_OBJECT_KEY
&& cur_item != NULL)
{
top_item->jd_key = get_tv_string_buf_chk(cur_item, key_buf);
if (top_item->jd_key == NULL || *top_item->jd_key == NUL)
{
clear_tv(cur_item);
EMSG(_(e_invarg));
retval = FAIL;
goto theend;
}
}
}
item_end:
top_item = ((json_dec_item_T *)stack.ga_data) + stack.ga_len - 1;
switch (top_item->jd_type)
{
case JSON_ARRAY:
if (res != NULL)
{
listitem_T *li = listitem_alloc();
if (li == NULL)
{
clear_tv(cur_item);
retval = FAIL;
goto theend;
}
li->li_tv = *cur_item;
list_append(top_item->jd_tv.vval.v_list, li);
}
if (cur_item != NULL)
cur_item = &item;
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == ',')
++reader->js_used;
else if (*p != ']')
{
if (*p == NUL)
retval = MAYBE;
else
{
EMSG(_(e_invarg));
retval = FAIL;
}
goto theend;
}
break;
case JSON_OBJECT_KEY:
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p != ':')
{
if (cur_item != NULL)
clear_tv(cur_item);
if (*p == NUL)
retval = MAYBE;
else
{
EMSG(_(e_invarg));
retval = FAIL;
}
goto theend;
}
++reader->js_used;
json_skip_white(reader);
top_item->jd_type = JSON_OBJECT;
if (cur_item != NULL)
cur_item = &item;
break;
case JSON_OBJECT:
if (cur_item != NULL
&& dict_find(top_item->jd_tv.vval.v_dict,
top_item->jd_key, -1) != NULL)
{
EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
top_item->jd_key);
clear_tv(&top_item->jd_key_tv);
clear_tv(cur_item);
retval = FAIL;
goto theend;
}
if (cur_item != NULL)
{
dictitem_T *di = dictitem_alloc(top_item->jd_key);
clear_tv(&top_item->jd_key_tv);
if (di == NULL)
{
clear_tv(cur_item);
retval = FAIL;
goto theend;
}
di->di_tv = *cur_item;
di->di_tv.v_lock = 0;
if (dict_add(top_item->jd_tv.vval.v_dict, di) == FAIL)
{
dictitem_free(di);
retval = FAIL;
goto theend;
}
}
reader->js_used += len;
return OK;
}
if (STRNICMP((char *)p, "false", 5) == 0)
{
reader->js_used += 5;
if (res != NULL)
json_skip_white(reader);
p = reader->js_buf + reader->js_used;
if (*p == ',')
++reader->js_used;
else if (*p != '}')
{
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_FALSE;
if (*p == NUL)
retval = MAYBE;
else
{
EMSG(_(e_invarg));
retval = FAIL;
}
goto theend;
}
return OK;
}
if (STRNICMP((char *)p, "true", 4) == 0)
{
reader->js_used += 4;
if (res != NULL)
{
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_TRUE;
}
return OK;
}
if (STRNICMP((char *)p, "null", 4) == 0)
{
reader->js_used += 4;
if (res != NULL)
{
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_NULL;
}
return OK;
}
#ifdef FEAT_FLOAT
if (STRNICMP((char *)p, "NaN", 3) == 0)
{
reader->js_used += 3;
if (res != NULL)
{
res->v_type = VAR_FLOAT;
res->vval.v_float = NAN;
}
return OK;
}
if (STRNICMP((char *)p, "Infinity", 8) == 0)
{
reader->js_used += 8;
if (res != NULL)
{
res->v_type = VAR_FLOAT;
res->vval.v_float = INFINITY;
}
return OK;
}
#endif
/* check for truncated name */
len = (int)(reader->js_end - (reader->js_buf + reader->js_used));
if (
(len < 5 && STRNICMP((char *)p, "false", len) == 0)
#ifdef FEAT_FLOAT
|| (len < 8 && STRNICMP((char *)p, "Infinity", len) == 0)
|| (len < 3 && STRNICMP((char *)p, "NaN", len) == 0)
#endif
|| (len < 4 && (STRNICMP((char *)p, "true", len) == 0
|| STRNICMP((char *)p, "null", len) == 0)))
return MAYBE;
break;
top_item->jd_type = JSON_OBJECT_KEY;
if (cur_item != NULL)
cur_item = &top_item->jd_key_tv;
break;
}
}
/* Get here when parsing failed. */
if (res != NULL)
{
clear_tv(res);
res->v_type = VAR_SPECIAL;
res->vval.v_number = VVAL_NONE;
}
return FAIL;
EMSG(_(e_invarg));
theend:
ga_clear(&stack);
return retval;
}
/*
@@ -884,10 +1019,17 @@ json_decode_all(js_read_T *reader, typval_T *res, int options)
json_skip_white(reader);
ret = json_decode_item(reader, res, options);
if (ret != OK)
{
if (ret == MAYBE)
EMSG(_(e_invarg));
return FAIL;
}
json_skip_white(reader);
if (reader->js_buf[reader->js_used] != NUL)
{
EMSG(_(e_trailing));
return FAIL;
}
return OK;
}
@@ -914,7 +1056,8 @@ json_decode(js_read_T *reader, typval_T *res, int options)
/*
* Decode the JSON from "reader" to find the end of the message.
* "options" can be JSON_JS or zero;
* "options" can be JSON_JS or zero.
* This is only used for testing.
* Return FAIL if the message has a decoding error.
* Return MAYBE if the message is truncated, need to read more.
* This only works reliable if the message contains an object, array or
+7 -1
View File
@@ -107,6 +107,12 @@ test_decode_find_end(void)
reader.js_buf = (char_u *)" { ";
assert(json_find_end(&reader, 0) == MAYBE);
/* JS object with white space */
reader.js_buf = (char_u *)" { a : 123 } ";
assert(json_find_end(&reader, JSON_JS) == OK);
reader.js_buf = (char_u *)" { a : ";
assert(json_find_end(&reader, JSON_JS) == MAYBE);
/* array without white space */
reader.js_buf = (char_u *)"[\"a\",123]";
assert(json_find_end(&reader, 0) == OK);
@@ -181,7 +187,7 @@ test_fill_called_on_string(void)
reader.js_buf = (char_u *)" \"foo";
reader.js_end = reader.js_buf + STRLEN(reader.js_buf);
reader.js_cookie = " \"foobar\" ";
assert(json_decode_string(&reader, NULL) == OK);
assert(json_decode_string(&reader, NULL, '"') == OK);
}
#endif
+5 -2
View File
@@ -398,6 +398,8 @@ enum key_extra
#define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
#define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
#define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . or ,*/
#define K_PS TERMCAP2KEY('P', 'S') /* paste start */
#define K_PE TERMCAP2KEY('P', 'E') /* paste end */
#define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
#define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */
@@ -494,9 +496,10 @@ enum key_extra
/*
* The length of the longest special key name, including modifiers.
* Current longest is <M-C-S-T-4-MiddleRelease> (length includes '<' and '>').
* Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and
* '>').
*/
#define MAX_KEY_NAME_LEN 25
#define MAX_KEY_NAME_LEN 32
/* Maximum length of a special key event as tokens. This includes modifiers.
* The longest event is something like <M-C-S-T-4-LeftDrag> which would be the
+1 -1
View File
@@ -885,7 +885,7 @@ failret:
}
/*
* Write list of strings to file
* Write "list" of strings to file "fd".
*/
int
write_list(FILE *fd, list_T *list, int binary)
+1 -42
View File
@@ -4583,47 +4583,6 @@ static HINSTANCE hMsvcrtDLL = 0;
# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
# endif
/*
* Get the address of 'funcname' which is imported by 'hInst' DLL.
*/
static void *
get_iconv_import_func(HINSTANCE hInst, const char *funcname)
{
PBYTE pImage = (PBYTE)hInst;
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
PIMAGE_NT_HEADERS pPE;
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
PIMAGE_IMPORT_BY_NAME pImpName;
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
return NULL;
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
if (pPE->Signature != IMAGE_NT_SIGNATURE)
return NULL;
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
.VirtualAddress);
for (; pImpDesc->FirstThunk; ++pImpDesc)
{
if (!pImpDesc->OriginalFirstThunk)
continue;
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
for (; pIAT->u1.Function; ++pIAT, ++pINT)
{
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
continue;
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
+ (UINT_PTR)(pINT->u1.AddressOfData));
if (strcmp((char *)pImpName->Name, funcname) == 0)
return (void *)pIAT->u1.Function;
}
}
return NULL;
}
/*
* Try opening the iconv.dll and return TRUE if iconv() can be used.
*/
@@ -4671,7 +4630,7 @@ iconv_enabled(int verbose)
iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open");
iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close");
iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl");
iconv_errno = get_iconv_import_func(hIconvDLL, "_errno");
iconv_errno = get_dll_import_func(hIconvDLL, "_errno");
if (iconv_errno == NULL)
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno");
if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
+1 -1
View File
@@ -1519,7 +1519,7 @@ ml_recover(void)
line_count = pp->pb_pointer[idx].pe_line_count;
if (readfile(curbuf->b_ffname, NULL, lnum,
pp->pb_pointer[idx].pe_old_lnum - 1,
line_count, NULL, 0) == FAIL)
line_count, NULL, 0) != OK)
cannot_open = TRUE;
else
lnum += line_count;
+2 -2
View File
@@ -578,8 +578,6 @@ emsg(char_u *s)
return TRUE;
called_emsg = TRUE;
if (emsg_silent == 0)
ex_exitval = 1;
/*
* If "emsg_severe" is TRUE: When an error exception is to be thrown,
@@ -642,6 +640,8 @@ emsg(char_u *s)
return TRUE;
}
ex_exitval = 1;
/* Reset msg_silent, an error causes messages to be switched back on. */
msg_silent = 0;
cmd_silent = FALSE;
+27 -18
View File
@@ -2177,16 +2177,19 @@ ins_bytes_len(char_u *p, int len)
void
ins_char(int c)
{
#if defined(FEAT_MBYTE) || defined(PROTO)
char_u buf[MB_MAXBYTES + 1];
int n;
int n = 1;
#ifdef FEAT_MBYTE
n = (*mb_char2bytes)(c, buf);
/* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
* Happens for CTRL-Vu9900. */
if (buf[0] == 0)
buf[0] = '\n';
#else
buf[0] = c;
#endif
ins_char_bytes(buf, n);
}
@@ -2195,7 +2198,6 @@ ins_char(int c)
ins_char_bytes(char_u *buf, int charlen)
{
int c = buf[0];
#endif
int newlen; /* nr of bytes inserted */
int oldlen; /* nr of bytes deleted (0 when not replacing) */
char_u *p;
@@ -2218,11 +2220,7 @@ ins_char_bytes(char_u *buf, int charlen)
/* The lengths default to the values for when not replacing. */
oldlen = 0;
#ifdef FEAT_MBYTE
newlen = charlen;
#else
newlen = 1;
#endif
if (State & REPLACE_FLAG)
{
@@ -4461,6 +4459,9 @@ vim_setenv(char_u *name, char_u *val)
{
sprintf((char *)envbuf, "%s=%s", name, val);
putenv((char *)envbuf);
# ifdef libintl_putenv
libintl_putenv((char *)envbuf);
# endif
}
#endif
#ifdef FEAT_GETTEXT
@@ -5428,7 +5429,6 @@ static int skip_label(linenr_T, char_u **pp);
static int cin_first_id_amount(void);
static int cin_get_equal_amount(linenr_T lnum);
static int cin_ispreproc(char_u *);
static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump);
static int cin_iscomment(char_u *);
static int cin_islinecomment(char_u *);
static int cin_isterminated(char_u *, int, int);
@@ -6008,13 +6008,18 @@ cin_ispreproc(char_u *s)
* Return TRUE if line "*pp" at "*lnump" is a preprocessor statement or a
* continuation line of a preprocessor statement. Decrease "*lnump" to the
* start and return the line in "*pp".
* Put the amount of indent in "*amount".
*/
static int
cin_ispreproc_cont(char_u **pp, linenr_T *lnump)
cin_ispreproc_cont(char_u **pp, linenr_T *lnump, int *amount)
{
char_u *line = *pp;
linenr_T lnum = *lnump;
int retval = FALSE;
int candidate_amount = *amount;
if (*line != NUL && line[STRLEN(line) - 1] == '\\')
candidate_amount = get_indent_lnum(lnum);
for (;;)
{
@@ -6033,6 +6038,8 @@ cin_ispreproc_cont(char_u **pp, linenr_T *lnump)
if (lnum != *lnump)
*pp = ml_get(*lnump);
if (retval)
*amount = candidate_amount;
return retval;
}
@@ -7396,7 +7403,7 @@ get_c_indent(void)
l = skipwhite(ml_get(lnum));
if (cin_nocode(l)) /* skip comment lines */
continue;
if (cin_ispreproc_cont(&l, &lnum))
if (cin_ispreproc_cont(&l, &lnum, &amount))
continue; /* ignore #define, #if, etc. */
curwin->w_cursor.lnum = lnum;
@@ -7809,10 +7816,10 @@ get_c_indent(void)
*/
if (curwin->w_cursor.lnum <= ourscope)
{
/* we reached end of scope:
* if looking for a enum or structure initialization
/* We reached end of scope:
* If looking for a enum or structure initialization
* go further back:
* if it is an initializer (enum xxx or xxx =), then
* If it is an initializer (enum xxx or xxx =), then
* don't add ind_continuation, otherwise it is a variable
* declaration:
* int x,
@@ -7851,7 +7858,8 @@ get_c_indent(void)
/*
* Skip preprocessor directives and blank lines.
*/
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum,
&amount))
continue;
if (cin_nocode(l))
@@ -7968,7 +7976,8 @@ get_c_indent(void)
}
/* Skip preprocessor directives and blank lines. */
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum,
&amount))
continue;
/* Finally the actual check for "namespace". */
@@ -8144,7 +8153,7 @@ get_c_indent(void)
* unlocked it)
*/
l = ml_get_curline();
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum)
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount)
|| cin_nocode(l))
continue;
@@ -8865,7 +8874,7 @@ term_again:
/*
* Skip preprocessor directives and blank lines.
*/
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount))
continue;
if (cin_nocode(l))
@@ -8966,7 +8975,7 @@ term_again:
{
look = ml_get(--curwin->w_cursor.lnum);
if (!(cin_nocode(look) || cin_ispreproc_cont(
&look, &curwin->w_cursor.lnum)))
&look, &curwin->w_cursor.lnum, &amount)))
break;
}
if (curwin->w_cursor.lnum > 0
+12 -3
View File
@@ -403,7 +403,7 @@ incl(pos_T *lp)
int
dec_cursor(void)
{
return dec(&curwin->w_cursor);
return dec(&curwin->w_cursor);
}
int
@@ -2162,6 +2162,7 @@ static struct modmasktable
/* 'A' must be the last one */
{MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A'},
{0, 0, NUL}
/* NOTE: when adding an entry, update MAX_KEY_NAME_LEN! */
};
/*
@@ -2294,6 +2295,8 @@ static struct key_name_entry
{K_XDOWN, (char_u *)"xDown"},
{K_XLEFT, (char_u *)"xLeft"},
{K_XRIGHT, (char_u *)"xRight"},
{K_PS, (char_u *)"PasteStart"},
{K_PE, (char_u *)"PasteEnd"},
{K_F1, (char_u *)"F1"},
{K_F2, (char_u *)"F2"},
@@ -2435,6 +2438,7 @@ static struct key_name_entry
{K_SWIPEDOWN, (char_u *)"SwipeDown"},
#endif
{0, NULL}
/* NOTE: When adding a long name update MAX_KEY_NAME_LEN. */
};
#define KEY_NAMES_TABLE_LEN (sizeof(key_names_table) / sizeof(struct key_name_entry))
@@ -2663,8 +2667,13 @@ get_special_key_name(int c, int modifiers)
}
else /* use name of special key */
{
STRCPY(string + idx, key_names_table[table_idx].name);
idx = (int)STRLEN(string);
size_t len = STRLEN(key_names_table[table_idx].name);
if (len + idx + 2 <= MAX_KEY_NAME_LEN)
{
STRCPY(string + idx, key_names_table[table_idx].name);
idx += (int)len;
}
}
string[idx++] = '>';
string[idx] = NUL;
+4
View File
@@ -2870,6 +2870,10 @@ do_check_cursorbind(void)
restart_edit_save = restart_edit;
restart_edit = TRUE;
check_cursor();
# ifdef FEAT_SYN_HL
if (curwin->w_p_cul || curwin->w_p_cuc)
validate_cursor();
# endif
restart_edit = restart_edit_save;
# ifdef FEAT_MBYTE
/* Correct cursor for multi-byte character. */
+9 -5
View File
@@ -2332,7 +2332,8 @@ special_keys(char_u *args)
char *save_str = nb_unquote(args, NULL);
char *tok = strtok(save_str, " ");
char *sep;
char keybuf[64];
#define KEYBUFLEN 64
char keybuf[KEYBUFLEN];
char cmdbuf[256];
while (tok != NULL)
@@ -2359,10 +2360,13 @@ special_keys(char_u *args)
tok++;
}
strcpy(&keybuf[i], tok);
vim_snprintf(cmdbuf, sizeof(cmdbuf),
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
if (strlen(tok) + i < KEYBUFLEN)
{
strcpy(&keybuf[i], tok);
vim_snprintf(cmdbuf, sizeof(cmdbuf),
"<silent><%s> :nbkey %s<CR>", keybuf, keybuf);
do_map(0, (char_u *)cmdbuf, NORMAL, FALSE);
}
tok = strtok(NULL, " ");
}
vim_free(save_str);
+18 -7
View File
@@ -426,6 +426,7 @@ static const struct nv_cmd
#ifdef FEAT_AUTOCMD
{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
#endif
{K_PS, nv_edit, 0, 0},
};
/* Number of commands in nv_cmds[]. */
@@ -1984,7 +1985,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
op_formatexpr(oap); /* use expression */
else
#endif
if (*p_fp != NUL)
if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
op_colon(oap); /* use external command */
else
op_format(oap, FALSE); /* use internal function */
@@ -2197,10 +2198,12 @@ op_colon(oparg_T *oap)
}
else if (oap->op_type == OP_FORMAT)
{
if (*p_fp == NUL)
stuffReadbuff((char_u *)"fmt");
else
if (*curbuf->b_p_fp != NUL)
stuffReadbuff(curbuf->b_p_fp);
else if (*p_fp != NUL)
stuffReadbuff(p_fp);
else
stuffReadbuff((char_u *)"fmt");
stuffReadbuff((char_u *)"\n']");
}
@@ -2982,9 +2985,9 @@ do_mouse(
if (State & INSERT)
stuffcharReadbuff(Ctrl_O);
if (curwin->w_llist_ref == NULL) /* quickfix window */
stuffReadbuff((char_u *)":.cc\n");
do_cmdline_cmd((char_u *)".cc");
else /* location list window */
stuffReadbuff((char_u *)":.ll\n");
do_cmdline_cmd((char_u *)".ll");
got_click = FALSE; /* ignore drag&release now */
}
#endif
@@ -3858,7 +3861,7 @@ add_to_showcmd(int c)
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
# endif
K_IGNORE,
K_IGNORE, K_PS,
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
@@ -9047,6 +9050,7 @@ nv_esc(cmdarg_T *cap)
/*
* Handle "A", "a", "I", "i" and <Insert> commands.
* Also handle K_PS, start bracketed paste.
*/
static void
nv_edit(cmdarg_T *cap)
@@ -9074,6 +9078,9 @@ nv_edit(cmdarg_T *cap)
/* Only give this error when 'insertmode' is off. */
EMSG(_(e_modifiable));
clearop(cap->oap);
if (cap->cmdchar == K_PS)
/* drop the pasted text */
bracketed_paste(PASTE_INSERT, TRUE, NULL);
}
else if (!checkclearopq(cap->oap))
{
@@ -9105,6 +9112,7 @@ nv_edit(cmdarg_T *cap)
break;
case 'a': /* "a"ppend is like "i"nsert on the next character. */
case K_PS: /* bracketed paste works like "a"ppend */
#ifdef FEAT_VIRTUALEDIT
/* increment coladd when in virtual space, increment the
* column otherwise, also to append after an unprintable char */
@@ -9135,6 +9143,9 @@ nv_edit(cmdarg_T *cap)
invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
}
else if (cap->cmdchar == K_PS)
/* drop the pasted text */
bracketed_paste(PASTE_INSERT, TRUE, NULL);
}
/*
+15 -7
View File
@@ -259,11 +259,6 @@ op_shift(oparg_T *oap, int curs_top, int amount)
}
changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
#ifdef FEAT_FOLDING
/* The cursor line is not in a closed fold */
foldOpenCursor();
#endif
if (oap->block_mode)
{
curwin->w_cursor.lnum = oap->start.lnum;
@@ -277,6 +272,12 @@ op_shift(oparg_T *oap, int curs_top, int amount)
else
--curwin->w_cursor.lnum; /* put cursor on last line, for ":>" */
#ifdef FEAT_FOLDING
/* The cursor line is not in a closed fold */
foldOpenCursor();
#endif
if (oap->line_count > p_report)
{
if (oap->op_type == OP_RSHIFT)
@@ -3350,6 +3351,8 @@ do_put(
*/
if (regname == '.')
{
if (VIsual_active)
stuffcharReadbuff(VIsual_mode);
(void)stuff_inserted((dir == FORWARD ? (count == -1 ? 'o' : 'a') :
(count == -1 ? 'O' : 'i')), count, FALSE);
/* Putting the text is done later, so can't really move the cursor to
@@ -3547,7 +3550,7 @@ do_put(
*/
if (y_type == MBLOCK)
{
char c = gchar_cursor();
int c = gchar_cursor();
colnr_T endcol2 = 0;
if (dir == FORWARD && c != NUL)
@@ -3771,6 +3774,11 @@ do_put(
*/
if (y_type == MCHAR && y_size == 1)
{
linenr_T end = curbuf->b_visual.vi_end.lnum;
if (curbuf->b_visual.vi_end.lnum < curbuf->b_visual.vi_start.lnum)
end = curbuf->b_visual.vi_start.lnum;
do {
totlen = count * yanklen;
if (totlen > 0)
@@ -3798,7 +3806,7 @@ do_put(
}
if (VIsual_active)
lnum++;
} while (VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum);
} while (VIsual_active && lnum <= end);
if (VIsual_active) /* reset lnum to the last visual line */
lnum--;
+12 -1
View File
@@ -107,6 +107,7 @@
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
# define PV_BEXPR OPT_BOTH(OPT_BUF(BV_BEXPR))
#endif
#define PV_FP OPT_BOTH(OPT_BUF(BV_FP))
#ifdef FEAT_EVAL
# define PV_FEX OPT_BUF(BV_FEX)
#endif
@@ -1270,7 +1271,7 @@ static struct vimoption options[] =
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
(char_u *)0L} SCRIPTID_INIT},
{"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
(char_u *)&p_fp, PV_NONE,
(char_u *)&p_fp, PV_FP,
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
{"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF,
#ifdef HAVE_FSYNC
@@ -3107,6 +3108,8 @@ static struct vimoption options[] =
p_term("t_ZR", T_CZR)
p_term("t_8f", T_8F)
p_term("t_8b", T_8B)
p_term("t_BE", T_BE)
p_term("t_BD", T_BD)
/* terminal key codes are not in here */
@@ -5574,6 +5577,7 @@ check_buf_options(buf_T *buf)
#if defined(FEAT_CRYPT)
check_string_option(&buf->b_p_cm);
#endif
check_string_option(&buf->b_p_fp);
#if defined(FEAT_EVAL)
check_string_option(&buf->b_p_fex);
#endif
@@ -10358,6 +10362,9 @@ unset_global_local_option(char_u *name, void *from)
clear_string_option(&buf->b_p_tsr);
break;
#endif
case PV_FP:
clear_string_option(&buf->b_p_fp);
break;
#ifdef FEAT_QUICKFIX
case PV_EFM:
clear_string_option(&buf->b_p_efm);
@@ -10411,6 +10418,7 @@ get_varp_scope(struct vimoption *p, int opt_flags)
{
switch ((int)p->indir)
{
case PV_FP: return (char_u *)&(curbuf->b_p_fp);
#ifdef FEAT_QUICKFIX
case PV_EFM: return (char_u *)&(curbuf->b_p_efm);
case PV_GP: return (char_u *)&(curbuf->b_p_gp);
@@ -10491,6 +10499,8 @@ get_varp(struct vimoption *p)
case PV_TSR: return *curbuf->b_p_tsr != NUL
? (char_u *)&(curbuf->b_p_tsr) : p->var;
#endif
case PV_FP: return *curbuf->b_p_fp != NUL
? (char_u *)&(curbuf->b_p_fp) : p->var;
#ifdef FEAT_QUICKFIX
case PV_EFM: return *curbuf->b_p_efm != NUL
? (char_u *)&(curbuf->b_p_efm) : p->var;
@@ -11059,6 +11069,7 @@ buf_copy_options(buf_T *buf, int flags)
buf->b_p_inde = vim_strsave(p_inde);
buf->b_p_indk = vim_strsave(p_indk);
#endif
buf->b_p_fp = empty_option;
#if defined(FEAT_EVAL)
buf->b_p_fex = vim_strsave(p_fex);
#endif
+1
View File
@@ -1051,6 +1051,7 @@ enum
, BV_EP
, BV_ET
, BV_FENC
, BV_FP
#ifdef FEAT_EVAL
, BV_BEXPR
, BV_FEX
+2 -2
View File
@@ -6940,7 +6940,7 @@ mch_libcall(
if (argstring != NULL)
{
# if defined(USE_DLOPEN)
ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname);
*(void **)(&ProcAdd) = dlsym(hinstLib, (const char *)funcname);
dlerr = (char *)dlerror();
# else
if (shl_findsym(&hinstLib, (const char *)funcname,
@@ -6962,7 +6962,7 @@ mch_libcall(
else
{
# if defined(USE_DLOPEN)
ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname);
*(void **)(&ProcAddI) = dlsym(hinstLib, (const char *)funcname);
dlerr = (char *)dlerror();
# else
if (shl_findsym(&hinstLib, (const char *)funcname,
+1 -1
View File
@@ -113,7 +113,7 @@
/* shared library access */
#if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
# ifdef __MVS__
# if defined(__MVS__) && !defined (__SUSV3)
/* needed to define RTLD_LAZY (Anthony Giorgio) */
# define __SUSV3
# endif
+113 -17
View File
@@ -425,6 +425,84 @@ vimLoadLib(char *name)
return dll;
}
#if defined(DYNAMIC_ICONV) || defined(DYNAMIC_GETTEXT) || defined(PROTO)
/*
* Get related information about 'funcname' which is imported by 'hInst'.
* If 'info' is 0, return the function address.
* If 'info' is 1, return the module name which the function is imported from.
*/
static void *
get_imported_func_info(HINSTANCE hInst, const char *funcname, int info)
{
PBYTE pImage = (PBYTE)hInst;
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hInst;
PIMAGE_NT_HEADERS pPE;
PIMAGE_IMPORT_DESCRIPTOR pImpDesc;
PIMAGE_THUNK_DATA pIAT; /* Import Address Table */
PIMAGE_THUNK_DATA pINT; /* Import Name Table */
PIMAGE_IMPORT_BY_NAME pImpName;
if (pDOS->e_magic != IMAGE_DOS_SIGNATURE)
return NULL;
pPE = (PIMAGE_NT_HEADERS)(pImage + pDOS->e_lfanew);
if (pPE->Signature != IMAGE_NT_SIGNATURE)
return NULL;
pImpDesc = (PIMAGE_IMPORT_DESCRIPTOR)(pImage
+ pPE->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]
.VirtualAddress);
for (; pImpDesc->FirstThunk; ++pImpDesc)
{
if (!pImpDesc->OriginalFirstThunk)
continue;
pIAT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->FirstThunk);
pINT = (PIMAGE_THUNK_DATA)(pImage + pImpDesc->OriginalFirstThunk);
for (; pIAT->u1.Function; ++pIAT, ++pINT)
{
if (IMAGE_SNAP_BY_ORDINAL(pINT->u1.Ordinal))
continue;
pImpName = (PIMAGE_IMPORT_BY_NAME)(pImage
+ (UINT_PTR)(pINT->u1.AddressOfData));
if (strcmp((char *)pImpName->Name, funcname) == 0)
{
switch (info)
{
case 0:
return (void *)pIAT->u1.Function;
case 1:
return (void *)(pImage + pImpDesc->Name);
default:
return NULL;
}
}
}
}
return NULL;
}
/*
* Get the module handle which 'funcname' in 'hInst' is imported from.
*/
HINSTANCE
find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname)
{
char *modulename;
modulename = (char *)get_imported_func_info(hInst, funcname, 1);
if (modulename != NULL)
return GetModuleHandleA(modulename);
return NULL;
}
/*
* Get the address of 'funcname' which is imported by 'hInst' DLL.
*/
void *
get_dll_import_func(HINSTANCE hInst, const char *funcname)
{
return get_imported_func_info(hInst, funcname, 0);
}
#endif
#if defined(DYNAMIC_GETTEXT) || defined(PROTO)
# ifndef GETTEXT_DLL
# define GETTEXT_DLL "libintl.dll"
@@ -436,6 +514,7 @@ static char *null_libintl_ngettext(const char *, const char *, unsigned long n);
static char *null_libintl_textdomain(const char *);
static char *null_libintl_bindtextdomain(const char *, const char *);
static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
static int null_libintl_putenv(const char *);
static HINSTANCE hLibintlDLL = NULL;
char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
@@ -446,6 +525,7 @@ char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
= null_libintl_bindtextdomain;
char *(*dyn_libintl_bind_textdomain_codeset)(const char *, const char *)
= null_libintl_bind_textdomain_codeset;
int (*dyn_libintl_putenv)(const char *) = null_libintl_putenv;
int
dyn_libintl_init(void)
@@ -463,6 +543,7 @@ dyn_libintl_init(void)
{"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
{NULL, NULL}
};
HINSTANCE hmsvcrt;
/* No need to initialize twice. */
if (hLibintlDLL)
@@ -507,6 +588,13 @@ dyn_libintl_init(void)
dyn_libintl_bind_textdomain_codeset =
null_libintl_bind_textdomain_codeset;
/* _putenv() function for the libintl.dll is optional. */
hmsvcrt = find_imported_module_by_funcname(hLibintlDLL, "getenv");
if (hmsvcrt != NULL)
dyn_libintl_putenv = (void *)GetProcAddress(hmsvcrt, "_putenv");
if (dyn_libintl_putenv == NULL || dyn_libintl_putenv == putenv)
dyn_libintl_putenv = null_libintl_putenv;
return 1;
}
@@ -521,6 +609,7 @@ dyn_libintl_end(void)
dyn_libintl_textdomain = null_libintl_textdomain;
dyn_libintl_bindtextdomain = null_libintl_bindtextdomain;
dyn_libintl_bind_textdomain_codeset = null_libintl_bind_textdomain_codeset;
dyn_libintl_putenv = null_libintl_putenv;
}
/*ARGSUSED*/
@@ -562,6 +651,13 @@ null_libintl_textdomain(const char *domainname)
return NULL;
}
/*ARGSUSED*/
int
null_libintl_putenv(const char *envstring)
{
return 0;
}
#endif /* DYNAMIC_GETTEXT */
/* This symbol is not defined in older versions of the SDK or Visual C++ */
@@ -4781,32 +4877,32 @@ mch_call_shell(
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
static HANDLE
job_io_file_open(
char_u *fname,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes)
char_u *fname,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes)
{
HANDLE h;
# ifdef FEAT_MBYTE
WCHAR *wn = NULL;
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
wn = enc_to_utf16(fname, NULL);
if (wn != NULL)
{
h = CreateFileW(wn, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition,
dwFlagsAndAttributes, NULL);
vim_free(wn);
}
wn = enc_to_utf16(fname, NULL);
if (wn != NULL)
{
h = CreateFileW(wn, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition,
dwFlagsAndAttributes, NULL);
vim_free(wn);
}
}
if (wn == NULL)
# endif
h = CreateFile((LPCSTR)fname, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition,
dwFlagsAndAttributes, NULL);
h = CreateFile((LPCSTR)fname, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition,
dwFlagsAndAttributes, NULL);
return h;
}
+25 -29
View File
@@ -5,7 +5,7 @@
#
# UNUA TRADUKISTO Dominique PELLE <dominique.pelle ĉe gmail.com>
# PROVLEGANTO(J) Felipe CASTRO <fefcas ĉe gmail.com>
# Antono MECHELYNCK <antoine.mechelynck ĉe skynet.be>
# Antono MECHELYNCK <antoine.mechelynck ĉe gmail.com>
# Yves NEVELSTEEN
#
# Uzitaj vortaroj kaj fakvortaroj:
@@ -23,8 +23,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Esperanto)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-26 20:54+0200\n"
"PO-Revision-Date: 2016-08-26 20:30+0200\n"
"POT-Creation-Date: 2017-01-16 00:30+0100\n"
"PO-Revision-Date: 2017-01-16 01:14+0100\n"
"Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"Language: eo\n"
@@ -66,6 +66,9 @@ msgstr "E83: Ne eblas disponigi bufron, nun uzas alian..."
msgid "E931: Buffer cannot be registered"
msgstr "E931: Bufro ne povas esti registrita"
msgid "E937: Attempt to delete a buffer that is in use"
msgstr "E937: Provo de forviŝo de bufro, kiu estas uzanta"
msgid "E515: No buffers were unloaded"
msgstr "E515: Neniu bufro estis malŝargita"
@@ -269,7 +272,7 @@ msgid "E918: buffer must be loaded: %s"
msgstr "E918: bufro devas esti ŝargita: %s"
msgid "E821: File is encrypted with unknown method"
msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
msgstr "E821: Dosiero estas ĉifrita per nekonata metodo"
msgid "Warning: Using a weak encryption method; see :help 'cm'"
msgstr "Averto: uzo de malfortika ĉifrada metodo; vidu :help 'cm'"
@@ -1963,6 +1966,9 @@ msgstr "E462: Ne eblis prepari por reŝargi \"%s\""
msgid "E321: Could not reload \"%s\""
msgstr "E321: Ne eblis reŝargi \"%s\""
msgid "--Deleted--"
msgstr "--Forviŝita--"
#, c-format
msgid "auto-removing autocommand: %s <buffer=%d>"
msgstr "aŭto-forviŝas aŭtokomandon: %s <bufro=%d>"
@@ -1972,12 +1978,12 @@ msgstr "aŭto-forviŝas aŭtokomandon: %s <bufro=%d>"
msgid "E367: No such group: \"%s\""
msgstr "E367: Ne ekzistas tia grupo: \"%s\""
msgid "E936: Cannot delete the current group"
msgstr "E936: Ne eblas forviŝi la aktualan grupon"
msgid "W19: Deleting augroup that is still in use"
msgstr "W19: Forviŝo de augroup kiu estas ankoraŭ uzata"
msgid "--Deleted--"
msgstr "--Forviŝita--"
#, c-format
msgid "E215: Illegal character after *: %s"
msgstr "E215: Nevalida signo post *: %s"
@@ -2834,6 +2840,10 @@ msgid "E251: VIM instance registry property is badly formed. Deleted!"
msgstr ""
"E251: Ecoj de registro de apero de VIM estas nevalide formata. Forviŝita!"
#, c-format
msgid "E938: Duplicate key in JSON: \"%s\""
msgstr "E938: Ripetita ŝlosilo en JSON: \"%s\""
#, c-format
msgid "E696: Missing comma in List: %s"
msgstr "E696: Mankas komo en Listo: %s"
@@ -3058,6 +3068,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal"
msgstr ""
"--not-a-term\t\tPreterpasi averton por enigo/eligo, kiu ne estas terminalo"
msgid "--ttyfail\t\tExit if input or output is not a terminal"
msgstr ""
"--ttyfail\t\tEliri se le eniro aŭ eliro ne estas terminalo"
msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
msgstr "-u <vimrc>\t\tUzi <vimrc> anstataŭ iun ajn .vimrc"
@@ -4454,9 +4468,6 @@ msgstr "ERARO DE ENIGO/ELIGO"
msgid "Message"
msgstr "Mesaĝo"
msgid "'columns' is not 80, cannot execute external commands"
msgstr "'columns' ne estas 80, ne eblas plenumi eksterajn komandojn"
msgid "E237: Printer selection failed"
msgstr "E237: Elekto de presilo malsukcesis"
@@ -5998,14 +6009,6 @@ msgstr "E133: \":return\" ekster funkcio"
msgid "E107: Missing parentheses: %s"
msgstr "E107: Mankas krampoj: %s"
#. Only MS VC 4.1 and earlier can do Win32s
msgid ""
"\n"
"MS-Windows 16/32-bit GUI version"
msgstr ""
"\n"
"Grafika versio MS-Vindozo 16/32-bitoj"
msgid ""
"\n"
"MS-Windows 64-bit GUI version"
@@ -6305,13 +6308,6 @@ msgstr "tajpu :help register<Enenklavo> por pliaj informoj "
msgid "menu Help->Sponsor/Register for information "
msgstr "menuo Helpo->Subteni/Registri por pliaj informoj "
msgid "WARNING: Windows 95/98/ME detected"
msgstr "AVERTO: Trovis Vindozon 95/98/ME"
# DP: atentu al la spacetoj: ĉiuj ĉenoj devas havi la saman longon
msgid "type :help windows95<Enter> for info on this"
msgstr "tajpu :help windows95<Enenklavo> por pliaj informoj "
msgid "Already only one window"
msgstr "Jam nur unu fenestro"
@@ -6465,6 +6461,10 @@ msgstr "E236: La tiparo \"%s\" ne estas egallarĝa"
msgid "E473: Internal error"
msgstr "E473: Interna eraro"
#, c-format
msgid "E685: Internal error: %s"
msgstr "E685: Interna eraro: %s"
msgid "Interrupted"
msgstr "Interrompita"
@@ -6745,10 +6745,6 @@ msgstr "E463: Regiono estas gardita, ne eblas ŝanĝi"
msgid "E744: NetBeans does not allow changes in read-only files"
msgstr "E744: NetBeans ne permesas ŝanĝojn en nurlegeblaj dosieroj"
#, c-format
msgid "E685: Internal error: %s"
msgstr "E685: Interna eraro: %s"
msgid "E363: pattern uses more memory than 'maxmempattern'"
msgstr "E363: ŝablono uzas pli da memoro ol 'maxmempattern'"
+27 -30
View File
@@ -6,7 +6,7 @@
# FIRST AUTHOR DindinX <David.Odin@bigfoot.com> 2000.
# SECOND AUTHOR Adrien Beau <version.francaise@free.fr> 2002, 2003.
# THIRD AUTHOR David Blanchet <david.blanchet@free.fr> 2006, 2008.
# FOURTH AUTHOR Dominique Pellé <dominique.pelle@gmail.com> 2008, 2016.
# FOURTH AUTHOR Dominique Pellé <dominique.pelle@gmail.com> 2008, 2017.
#
# Latest translation available at:
# http://dominique.pelle.free.fr/vim-fr.php
@@ -15,8 +15,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Français)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-26 20:54+0200\n"
"PO-Revision-Date: 2016-08-26 20:34+0200\n"
"POT-Creation-Date: 2017-01-16 00:30+0100\n"
"PO-Revision-Date: 2017-01-16 00:51+0100\n"
"Last-Translator: Dominique Pellé <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"Language: fr\n"
@@ -63,6 +63,9 @@ msgstr ""
msgid "E931: Buffer cannot be registered"
msgstr "E931: Le tampon ne peut pas être enregistré"
msgid "E937: Attempt to delete a buffer that is in use"
msgstr "E937: Tentative de suppression d'un tampon en cours d'utilisation"
msgid "E515: No buffers were unloaded"
msgstr "E515: Aucun tampon n'a été déchargé"
@@ -242,7 +245,7 @@ msgid "E898: socket() in channel_open()"
msgstr "E898: socket() dans channel_open()"
msgid "E903: received command with non-string argument"
msgstr "E903: commande reçue avec une argument qui n'est pas une chaîne"
msgstr "E903: commande reçue avec un argument qui n'est pas une chaîne"
msgid "E904: last argument for expr/call must be a number"
msgstr "E904: le dernier argument de expr/call doit être un nombre"
@@ -2150,6 +2153,9 @@ msgstr "E462: Impossible de pr
msgid "E321: Could not reload \"%s\""
msgstr "E321: Impossible de recharger \"%s\""
msgid "--Deleted--"
msgstr "--Effacé--"
#, c-format
msgid "auto-removing autocommand: %s <buffer=%d>"
msgstr "Autocommandes marquées pour auto-suppression : %s <tampon=%d>"
@@ -2159,12 +2165,12 @@ msgstr "Autocommandes marqu
msgid "E367: No such group: \"%s\""
msgstr "E367: Aucun groupe \"%s\""
msgid "E936: Cannot delete the current group"
msgstr "E936: Impossible de supprimer le groupe courant"
msgid "W19: Deleting augroup that is still in use"
msgstr "W19: Effacement d'augroup toujours en usage"
msgid "--Deleted--"
msgstr "--Effacé--"
#, c-format
msgid "E215: Illegal character after *: %s"
msgstr "E215: Caractère non valide après * : %s"
@@ -2854,7 +2860,7 @@ msgid "invalid expression"
msgstr "expression invalide"
msgid "expressions disabled at compile time"
msgstr "expressions désactivée lors de la compilation"
msgstr "expressions désactivées lors de la compilation"
msgid "hidden option"
msgstr "option cachée"
@@ -3041,6 +3047,10 @@ msgstr "E573: Id utilis
msgid "E251: VIM instance registry property is badly formed. Deleted!"
msgstr "E251: Entrée registre de l'instance de Vim mal formatée. Suppression !"
#, c-format
msgid "E938: Duplicate key in JSON: \"%s\""
msgstr "E938: Clé dupliquée dans le document JSON : \"%s\""
#, c-format
msgid "E696: Missing comma in List: %s"
msgstr "E696: Il manque une virgule dans la Liste %s"
@@ -3269,6 +3279,10 @@ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal"
msgstr ""
"--no-a-term\t\tAucun avertissement si l'entrée/sortie n'est pas un terminal"
msgid "--ttyfail\t\tExit if input or output is not a terminal"
msgstr ""
"--ttyfail\t\tQuitte si l'entrée ou la sortie ne sont pas un terminal"
msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
msgstr "-u <vimrc>\tUtiliser <vimrc> au lieu du vimrc habituel"
@@ -4682,9 +4696,6 @@ msgstr "ERREUR d'E/S"
msgid "Message"
msgstr "Message"
msgid "'columns' is not 80, cannot execute external commands"
msgstr "'columns' ne vaut pas 80, impossible d'exécuter des commandes externes"
msgid "E237: Printer selection failed"
msgstr "E237: La sélection de l'imprimante a échoué"
@@ -5625,7 +5636,7 @@ msgstr ""
#. This should have been checked when generating the .spl
#. * file.
msgid "E783: duplicate char in MAP entry"
msgstr "E783: caractères dupliqué dans l'entrée MAP"
msgstr "E783: caractère dupliqué dans l'entrée MAP"
msgid "No Syntax items defined for this buffer"
msgstr "Aucun élément de syntaxe défini pour ce tampon"
@@ -6264,14 +6275,6 @@ msgstr "E133: :return en dehors d'une fonction"
msgid "E107: Missing parentheses: %s"
msgstr "E107: Parenthèses manquantes : %s"
#. Only MS VC 4.1 and earlier can do Win32s
msgid ""
"\n"
"MS-Windows 16/32-bit GUI version"
msgstr ""
"\n"
"Version graphique MS-Windows 16/32 bits"
msgid ""
"\n"
"MS-Windows 64-bit GUI version"
@@ -6561,12 +6564,6 @@ msgstr "tapez :help register<Entr
msgid "menu Help->Sponsor/Register for information "
msgstr "menu Aide->Sponsor/Enregistrement pour plus d'info"
msgid "WARNING: Windows 95/98/ME detected"
msgstr "ALERTE: Windows 95/98/ME détecté"
msgid "type :help windows95<Enter> for info on this"
msgstr "tapez :help windows95<Entrée> pour plus d'information"
msgid "Already only one window"
msgstr "Il n'y a déjà plus qu'une fenêtre"
@@ -6727,6 +6724,10 @@ msgstr "E236: La police \"%s\" n'a pas une chasse (largeur) fixe"
msgid "E473: Internal error"
msgstr "E473: Erreur interne"
#, c-format
msgid "E685: Internal error: %s"
msgstr "E685: Erreur interne : %s"
msgid "Interrupted"
msgstr "Interrompu"
@@ -7011,10 +7012,6 @@ msgid "E744: NetBeans does not allow changes in read-only files"
msgstr ""
"E744: NetBeans n'autorise pas la modification des fichiers en lecture seule"
#, c-format
msgid "E685: Internal error: %s"
msgstr "E685: Erreur interne : %s"
msgid "E363: pattern uses more memory than 'maxmempattern'"
msgstr "E363: le motif utilise plus de mémoire que 'maxmempattern'"
+1
View File
@@ -38,6 +38,7 @@ void fixthisline(int (*get_the_indent)(void));
void fix_indent(void);
int in_cinkeys(int keytyped, int when, int line_is_empty);
int hkmap(int c);
int bracketed_paste(paste_mode_T mode, int drop, garray_T *gap);
void ins_scroll(void);
void ins_horscroll(void);
int ins_copychar(linenr_T lnum);
+2
View File
@@ -1,5 +1,7 @@
/* os_win32.c */
HINSTANCE vimLoadLib(char *name);
HINSTANCE find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname);
void *get_dll_import_func(HINSTANCE hInst, const char *funcname);
int dyn_libintl_init(void);
void dyn_libintl_end(void);
void PlatformId(void);
+6 -6
View File
@@ -50,7 +50,7 @@ enum
NFA_CONCAT, /* concatenate two previous items (postfix
* only) */
NFA_OR, /* \| (postfix only) */
NFA_STAR, /* greedy * (posfix only) */
NFA_STAR, /* greedy * (postfix only) */
NFA_STAR_NONGREEDY, /* non-greedy * (postfix only) */
NFA_QUEST, /* greedy \? (postfix only) */
NFA_QUEST_NONGREEDY, /* non-greedy \? (postfix only) */
@@ -1359,7 +1359,7 @@ nfa_regatom(void)
rc_did_emsg = TRUE;
return FAIL;
}
EMSGN("INTERNAL: Unknown character class char: %ld", c);
IEMSGN("INTERNAL: Unknown character class char: %ld", c);
return FAIL;
}
#ifdef FEAT_MBYTE
@@ -2169,7 +2169,7 @@ nfa_regpiece(void)
* maximum is much larger than the minimum and when the maximum is
* large. Bail out if we can use the other engine. */
if ((nfa_re_flags & RE_AUTO)
&& (maxval > minval + 200 || maxval > 500))
&& (maxval > 500 || maxval > minval + 200))
return FAIL;
/* Ignore previous call to nfa_regatom() */
@@ -4925,7 +4925,7 @@ check_char_class(int class, int c)
default:
/* should not be here :P */
EMSGN(_(e_ill_char_class), class);
IEMSGN(_(e_ill_char_class), class);
return FAIL;
}
return FAIL;
@@ -6688,7 +6688,7 @@ nfa_regmatch(
#ifdef DEBUG
if (c < 0)
EMSGN("INTERNAL: Negative state char: %ld", c);
IEMSGN("INTERNAL: Negative state char: %ld", c);
#endif
result = (c == curc);
@@ -7216,7 +7216,7 @@ nfa_regcomp(char_u *expr, int re_flags)
{
/* TODO: only give this error for debugging? */
if (post_ptr >= post_end)
EMSGN("Internal error: estimated max number of states insufficient: %ld", post_end - post_start);
IEMSGN("Internal error: estimated max number of states insufficient: %ld", post_end - post_start);
goto fail; /* Cascaded (syntax?) error */
}
+15 -7
View File
@@ -3649,13 +3649,19 @@ win_line(
draw_state = WL_FOLD;
if (fdc > 0)
{
/* Draw the 'foldcolumn'. */
fill_foldcolumn(extra, wp, FALSE, lnum);
n_extra = fdc;
p_extra = extra;
p_extra[n_extra] = NUL;
c_extra = NUL;
char_attr = hl_attr(HLF_FC);
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
* already be in use. */
p_extra_free = alloc(12 + 1);
if (p_extra_free != NULL)
{
fill_foldcolumn(p_extra_free, wp, FALSE, lnum);
n_extra = fdc;
p_extra_free[n_extra] = NUL;
p_extra = p_extra_free;
c_extra = NUL;
char_attr = hl_attr(HLF_FC);
}
}
}
#endif
@@ -10367,6 +10373,8 @@ draw_tabline(void)
#endif
);
if (ScreenLines == NULL)
return;
redraw_tabline = FALSE;
#ifdef FEAT_GUI_TABLINE
+19
View File
@@ -1133,25 +1133,43 @@ typedef long_u hash_T; /* Type for hi_hash */
# ifdef PROTO
typedef long varnumber_T;
typedef unsigned long uvarnumber_T;
#define VARNUM_MIN LONG_MIN
#define VARNUM_MAX LONG_MAX
#define UVARNUM_MAX ULONG_MAX
# else
typedef __int64 varnumber_T;
typedef unsigned __int64 uvarnumber_T;
#define VARNUM_MIN _I64_MIN
#define VARNUM_MAX _I64_MAX
#define UVARNUM_MAX _UI64_MAX
# endif
# elif defined(HAVE_STDINT_H)
typedef int64_t varnumber_T;
typedef uint64_t uvarnumber_T;
#define VARNUM_MIN INT64_MIN
#define VARNUM_MAX INT64_MAX
#define UVARNUM_MAX UINT64_MAX
# else
typedef long varnumber_T;
typedef unsigned long uvarnumber_T;
#define VARNUM_MIN LONG_MIN
#define VARNUM_MAX LONG_MAX
#define UVARNUM_MAX ULONG_MAX
# endif
#else
/* Use 32-bit Number. */
# if VIM_SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */
typedef long varnumber_T;
typedef unsigned long uvarnumber_T;
#define VARNUM_MIN LONG_MIN
#define VARNUM_MAX LONG_MAX
#define UVARNUM_MAX ULONG_MAX
# else
typedef int varnumber_T;
typedef unsigned int uvarnumber_T;
#define VARNUM_MIN INT_MIN
#define VARNUM_MAX INT_MAX
#define UVARNUM_MAX UINT_MAX
# endif
#endif
@@ -2100,6 +2118,7 @@ struct file_buffer
long_u b_p_inde_flags; /* flags for 'indentexpr' */
char_u *b_p_indk; /* 'indentkeys' */
#endif
char_u *b_p_fp; /* 'formatprg' */
#if defined(FEAT_EVAL)
char_u *b_p_fex; /* 'formatexpr' */
long_u b_p_fex_flags; /* flags for 'formatexpr' */
+111 -28
View File
@@ -22,6 +22,7 @@ struct hl_group
{
char_u *sg_name; /* highlight group name */
char_u *sg_name_u; /* uppercase of sg_name */
int sg_cleared; /* "hi clear" was used */
/* for normal terminals */
int sg_term; /* "term=" highlighting attributes */
char_u *sg_start; /* terminal string for start highl */
@@ -462,7 +463,7 @@ static void syn_clear_keyword(int id, hashtab_T *ht);
static void clear_keywtab(hashtab_T *ht);
static void add_keyword(char_u *name, int id, int flags, short *cont_in_list, short *next_list, int conceal_char);
static char_u *get_group_name(char_u *arg, char_u **name_end);
static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char);
static char_u *get_syn_options(char_u *arg, syn_opt_arg_T *opt, int *conceal_char, int skip);
static void syn_cmd_include(exarg_T *eap, int syncing);
static void syn_cmd_iskeyword(exarg_T *eap, int syncing);
static void syn_cmd_keyword(exarg_T *eap, int syncing);
@@ -481,7 +482,7 @@ static int syn_add_cluster(char_u *name);
static void init_syn_patterns(void);
static char_u *get_syn_pattern(char_u *arg, synpat_T *ci);
static void syn_cmd_sync(exarg_T *eap, int syncing);
static int get_id_list(char_u **arg, int keylen, short **list);
static int get_id_list(char_u **arg, int keylen, short **list, int skip);
static void syn_combine_list(short **clstr1, short **clstr2, int list_op);
static void syn_incl_toplevel(int id, int *flagsp);
@@ -3434,7 +3435,14 @@ syn_cmd_conceal(exarg_T *eap UNUSED, int syncing UNUSED)
return;
next = skiptowhite(arg);
if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2)
if (*arg == NUL)
{
if (curwin->w_s->b_syn_conceal)
MSG(_("syn conceal on"));
else
MSG(_("syn conceal off"));
}
else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2)
curwin->w_s->b_syn_conceal = TRUE;
else if (STRNICMP(arg, "off", 3) == 0 && next - arg == 3)
curwin->w_s->b_syn_conceal = FALSE;
@@ -3457,7 +3465,14 @@ syn_cmd_case(exarg_T *eap, int syncing UNUSED)
return;
next = skiptowhite(arg);
if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
if (*arg == NUL)
{
if (curwin->w_s->b_syn_ic)
MSG(_("syntax case ignore"));
else
MSG(_("syntax case match"));
}
else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
curwin->w_s->b_syn_ic = FALSE;
else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6)
curwin->w_s->b_syn_ic = TRUE;
@@ -3479,7 +3494,16 @@ syn_cmd_spell(exarg_T *eap, int syncing UNUSED)
return;
next = skiptowhite(arg);
if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
if (*arg == NUL)
{
if (curwin->w_s->b_syn_spell == SYNSPL_TOP)
MSG(_("syntax spell toplevel"));
else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP)
MSG(_("syntax spell notoplevel"));
else
MSG(_("syntax spell default"));
}
else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
curwin->w_s->b_syn_spell = SYNSPL_TOP;
else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10)
curwin->w_s->b_syn_spell = SYNSPL_NOTOP;
@@ -3556,6 +3580,9 @@ syntax_clear(synblock_T *block)
block->b_syn_ic = FALSE; /* Use case, by default */
block->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */
block->b_syn_containedin = FALSE;
#ifdef FEAT_CONCEAL
block->b_syn_conceal = FALSE;
#endif
/* free the keywords */
clear_keywtab(&block->b_keywtab);
@@ -4543,7 +4570,8 @@ get_group_name(
get_syn_options(
char_u *arg, /* next argument to be checked */
syn_opt_arg_T *opt, /* various things */
int *conceal_char UNUSED)
int *conceal_char UNUSED,
int skip) /* TRUE if skipping over command */
{
char_u *gname_start, *gname;
int syn_id;
@@ -4626,17 +4654,17 @@ get_syn_options(
EMSG(_("E395: contains argument not accepted here"));
return NULL;
}
if (get_id_list(&arg, 8, &opt->cont_list) == FAIL)
if (get_id_list(&arg, 8, &opt->cont_list, skip) == FAIL)
return NULL;
}
else if (flagtab[fidx].argtype == 2)
{
if (get_id_list(&arg, 11, &opt->cont_in_list) == FAIL)
if (get_id_list(&arg, 11, &opt->cont_in_list, skip) == FAIL)
return NULL;
}
else if (flagtab[fidx].argtype == 3)
{
if (get_id_list(&arg, 9, &opt->next_list) == FAIL)
if (get_id_list(&arg, 9, &opt->next_list, skip) == FAIL)
return NULL;
}
else if (flagtab[fidx].argtype == 11 && arg[5] == '=')
@@ -4846,7 +4874,10 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED)
if (rest != NULL)
{
syn_id = syn_check_group(arg, (int)(group_name_end - arg));
if (eap->skip)
syn_id = -1;
else
syn_id = syn_check_group(arg, (int)(group_name_end - arg));
if (syn_id != 0)
/* allocate a buffer, for removing backslashes in the keyword */
keyword_copy = alloc((unsigned)STRLEN(rest) + 1);
@@ -4868,7 +4899,8 @@ syn_cmd_keyword(exarg_T *eap, int syncing UNUSED)
p = keyword_copy;
for ( ; rest != NULL && !ends_excmd(*rest); rest = skipwhite(rest))
{
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char,
eap->skip);
if (rest == NULL || ends_excmd(*rest))
break;
/* Copy the keyword, removing backslashes, and add a NUL. */
@@ -4981,7 +5013,7 @@ syn_cmd_match(
syn_opt_arg.cont_list = NULL;
syn_opt_arg.cont_in_list = NULL;
syn_opt_arg.next_list = NULL;
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
/* get the pattern. */
init_syn_patterns();
@@ -4991,7 +5023,7 @@ syn_cmd_match(
syn_opt_arg.flags |= HL_HAS_EOL;
/* Get options after the pattern */
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
if (rest != NULL) /* all arguments are valid */
{
@@ -5117,7 +5149,7 @@ syn_cmd_region(
while (rest != NULL && !ends_excmd(*rest))
{
/* Check for option arguments */
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char);
rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, eap->skip);
if (rest == NULL || ends_excmd(*rest))
break;
@@ -5628,13 +5660,16 @@ syn_cmd_cluster(exarg_T *eap, int syncing UNUSED)
break;
clstr_list = NULL;
if (get_id_list(&rest, opt_len, &clstr_list) == FAIL)
if (get_id_list(&rest, opt_len, &clstr_list, eap->skip) == FAIL)
{
EMSG2(_(e_invarg2), rest);
break;
}
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
if (scl_id >= 0)
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
&clstr_list, list_op);
else
vim_free(clstr_list);
got_clstr = TRUE;
}
@@ -5931,8 +5966,9 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED)
get_id_list(
char_u **arg,
int keylen, /* length of keyword */
short **list) /* where to store the resulting list, if not
short **list, /* where to store the resulting list, if not
NULL, the list is silently skipped! */
int skip)
{
char_u *p = NULL;
char_u *end;
@@ -6000,7 +6036,8 @@ get_id_list(
}
if (count != 0)
{
EMSG2(_("E408: %s must be first in contains list"), name + 1);
EMSG2(_("E408: %s must be first in contains list"),
name + 1);
failed = TRUE;
vim_free(name);
break;
@@ -6015,7 +6052,10 @@ get_id_list(
}
else if (name[1] == '@')
{
id = syn_check_cluster(name + 2, (int)(end - p - 1));
if (skip)
id = -1;
else
id = syn_check_cluster(name + 2, (int)(end - p - 1));
}
else
{
@@ -6383,7 +6423,9 @@ syntax_present(win_T *win)
static enum
{
EXP_SUBCMD, /* expand ":syn" sub-commands */
EXP_CASE /* expand ":syn case" arguments */
EXP_CASE, /* expand ":syn case" arguments */
EXP_SPELL, /* expand ":syn spell" arguments */
EXP_SYNC /* expand ":syn sync" arguments */
} expand_what;
/*
@@ -6434,6 +6476,10 @@ set_context_in_syntax_cmd(expand_T *xp, char_u *arg)
xp->xp_context = EXPAND_NOTHING;
else if (STRNICMP(arg, "case", p - arg) == 0)
expand_what = EXP_CASE;
else if (STRNICMP(arg, "spell", p - arg) == 0)
expand_what = EXP_SPELL;
else if (STRNICMP(arg, "sync", p - arg) == 0)
expand_what = EXP_SYNC;
else if ( STRNICMP(arg, "keyword", p - arg) == 0
|| STRNICMP(arg, "region", p - arg) == 0
|| STRNICMP(arg, "match", p - arg) == 0
@@ -6445,8 +6491,6 @@ set_context_in_syntax_cmd(expand_T *xp, char_u *arg)
}
}
static char *(case_args[]) = {"match", "ignore", NULL};
/*
* Function given to ExpandGeneric() to obtain the list syntax names for
* expansion.
@@ -6454,9 +6498,31 @@ static char *(case_args[]) = {"match", "ignore", NULL};
char_u *
get_syntax_name(expand_T *xp UNUSED, int idx)
{
if (expand_what == EXP_SUBCMD)
return (char_u *)subcommands[idx].name;
return (char_u *)case_args[idx];
switch (expand_what)
{
case EXP_SUBCMD:
return (char_u *)subcommands[idx].name;
case EXP_CASE:
{
static char *case_args[] = {"match", "ignore", NULL};
return (char_u *)case_args[idx];
}
case EXP_SPELL:
{
static char *spell_args[] =
{"toplevel", "notoplevel", "default", NULL};
return (char_u *)spell_args[idx];
}
case EXP_SYNC:
{
static char *sync_args[] =
{"ccomment", "clear", "fromstart",
"linebreaks=", "linecont", "lines=", "match",
"maxlines=", "minlines=", "region", NULL};
return (char_u *)sync_args[idx];
}
}
return NULL;
}
#endif /* FEAT_CMDL_COMPL */
@@ -6704,8 +6770,10 @@ syntime_report(void)
}
}
/* sort on total time */
qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T),
/* Sort on total time. Skip if there are no items to avoid passing NULL
* pointer to qsort(). */
if (ga.ga_len > 1)
qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T),
syn_compare_syntime);
MSG_PUTS_TITLE(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"));
@@ -7265,6 +7333,7 @@ do_highlight(
#ifdef FEAT_EVAL
HL_TABLE()[from_id - 1].sg_scriptID = current_SID;
#endif
HL_TABLE()[from_id - 1].sg_cleared = FALSE;
redraw_all_later(SOME_VALID);
}
}
@@ -7973,6 +8042,7 @@ do_highlight(
error = TRUE;
break;
}
HL_TABLE()[idx].sg_cleared = FALSE;
/*
* When highlighting has been given for a group, don't link it.
@@ -8110,6 +8180,8 @@ hl_has_settings(int idx, int check_link)
static void
highlight_clear(int idx)
{
HL_TABLE()[idx].sg_cleared = TRUE;
HL_TABLE()[idx].sg_term = 0;
vim_free(HL_TABLE()[idx].sg_start);
HL_TABLE()[idx].sg_start = NULL;
@@ -8766,6 +8838,10 @@ hl_combine_attr(int char_attr, int prim_attr)
else
{
vim_memset(&new_en, 0, sizeof(new_en));
#ifdef FEAT_TERMGUICOLORS
new_en.ae_u.cterm.bg_rgb = INVALCOLOR;
new_en.ae_u.cterm.fg_rgb = INVALCOLOR;
#endif
if (char_attr <= HL_ALL)
new_en.ae_attr = char_attr;
}
@@ -9881,6 +9957,13 @@ highlight_list_two(int cnt, int attr)
char_u *
get_highlight_name(expand_T *xp UNUSED, int idx)
{
if (idx < 0)
return NULL;
/* Items are never removed from the table, skip the ones that were cleared.
*/
while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
++idx;
#ifdef FEAT_CMDL_COMPL
if (idx == highlight_ga.ga_len && include_none != 0)
return (char_u *)"none";
@@ -9893,7 +9976,7 @@ get_highlight_name(expand_T *xp UNUSED, int idx)
&& include_link != 0)
return (char_u *)"clear";
#endif
if (idx < 0 || idx >= highlight_ga.ga_len)
if (idx >= highlight_ga.ga_len)
return NULL;
return HL_TABLE()[idx].sg_name;
}
+198 -184
View File
@@ -35,19 +35,15 @@ typedef struct tag_pointers
} tagptrs_T;
/*
* The matching tags are first stored in ga_match[]. In which one depends on
* the priority of the match.
* At the end, the matches from ga_match[] are concatenated, to make a list
* The matching tags are first stored in one of the ht_match[] hash tables. In
* which one depends on the priority of the match.
* At the end, all the matches from ht_match[] are concatenated, to make a list
* sorted on priority.
*/
#define MT_ST_CUR 0 /* static match in current file */
#define MT_GL_CUR 1 /* global match in current file */
#define MT_GL_OTH 2 /* global match in other file */
#define MT_ST_OTH 3 /* static match in other file */
#define MT_IC_ST_CUR 4 /* icase static match in current file */
#define MT_IC_GL_CUR 5 /* icase global match in current file */
#define MT_IC_GL_OTH 6 /* icase global match in other file */
#define MT_IC_ST_OTH 7 /* icase static match in other file */
#define MT_IC_OFF 4 /* add for icase match */
#define MT_RE_OFF 8 /* add for regexp match */
#define MT_MASK 7 /* mask for printing priority */
@@ -1260,6 +1256,7 @@ prepare_pats(pat_T *pats, int has_re)
* TAG_REGEXP use "pat" as a regexp
* TAG_NOIC don't always ignore case
* TAG_KEEP_LANG keep language
* TAG_CSCOPE use cscope results for tags
*/
int
find_tags(
@@ -1341,12 +1338,9 @@ find_tags(
int is_etag; /* current file is emaces style */
#endif
struct match_found
{
int len; /* nr of chars of match[] to be compared */
char_u match[1]; /* actually longer */
} *mfp, *mfp2;
garray_T ga_match[MT_COUNT];
char_u *mfp;
hashtab_T ht_match[MT_COUNT];
hash_T hash = 0;
int match_count = 0; /* number of matches found */
char_u **matches;
int mtt;
@@ -1402,16 +1396,16 @@ find_tags(
vimconv.vc_type = CONV_NONE;
#endif
/*
* Allocate memory for the buffers that are used
*/
/*
* Allocate memory for the buffers that are used
*/
lbuf = alloc(lbuf_size);
tag_fname = alloc(MAXPATHL + 1);
#ifdef FEAT_EMACS_TAGS
ebuf = alloc(LSIZE);
#endif
for (mtt = 0; mtt < MT_COUNT; ++mtt)
ga_init2(&ga_match[mtt], (int)sizeof(struct match_found *), 100);
hash_init(&ht_match[mtt]);
/* check for out of memory situation */
if (lbuf == NULL || tag_fname == NULL
@@ -1430,6 +1424,14 @@ find_tags(
*/
if (help_only) /* want tags from help file */
curbuf->b_help = TRUE; /* will be restored later */
#ifdef FEAT_CSCOPE
else if (use_cscope)
{
/* Make sure we don't mix help and cscope, confuses Coverity. */
help_only = FALSE;
curbuf->b_help = FALSE;
}
#endif
orgpat.len = (int)STRLEN(pat);
#ifdef FEAT_MULTI_LANG
@@ -1759,8 +1761,13 @@ line_read_in:
/*
* Emacs tags line with CTRL-L: New file name on next line.
* The file name is followed by a ','.
* Remember etag file name in ebuf.
*/
if (*lbuf == Ctrl_L) /* remember etag file name in ebuf */
if (*lbuf == Ctrl_L
# ifdef FEAT_CSCOPE
&& !use_cscope
# endif
)
{
is_etag = 1; /* in case at the start */
state = TS_LINEAR;
@@ -2206,10 +2213,12 @@ parse_line:
}
/*
* If a match is found, add it to ga_match[].
* If a match is found, add it to ht_match[].
*/
if (match)
{
int len = 0;
#ifdef FEAT_CSCOPE
if (use_cscope)
{
@@ -2262,179 +2271,171 @@ parse_line:
}
/*
* Add the found match in ga_match[mtt], avoiding duplicates.
* Add the found match in ht_match[mtt].
* Store the info we need later, which depends on the kind of
* tags we are dealing with.
*/
if (ga_grow(&ga_match[mtt], 1) == OK)
if (help_only)
{
int len;
int heuristic;
if (help_only)
{
#ifdef FEAT_MULTI_LANG
# define ML_EXTRA 3
#else
# define ML_EXTRA 0
#endif
/*
* Append the help-heuristic number after the
* tagname, for sorting it later.
*/
*tagp.tagname_end = NUL;
len = (int)(tagp.tagname_end - tagp.tagname);
mfp = (struct match_found *)
alloc((int)sizeof(struct match_found) + len
+ 10 + ML_EXTRA);
if (mfp != NULL)
{
/* "len" includes the language and the NUL, but
* not the priority. */
mfp->len = len + ML_EXTRA + 1;
#define ML_HELP_LEN 6
p = mfp->match;
STRCPY(p, tagp.tagname);
#ifdef FEAT_MULTI_LANG
p[len] = '@';
STRCPY(p + len + 1, help_lang);
#endif
heuristic = help_heuristic(tagp.tagname,
match_re ? matchoff : 0, !match_no_ic);
#ifdef FEAT_MULTI_LANG
heuristic += help_pri;
#endif
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
heuristic);
}
*tagp.tagname_end = TAB;
}
else if (name_only)
/*
* Append the help-heuristic number after the tagname, for
* sorting it later. The heuristic is ignored for
* detecting duplicates.
* The format is {tagname}@{lang}NUL{heuristic}NUL
*/
*tagp.tagname_end = NUL;
len = (int)(tagp.tagname_end - tagp.tagname);
mfp = (char_u *)alloc((int)sizeof(char_u)
+ len + 10 + ML_EXTRA + 1);
if (mfp != NULL)
{
if (get_it_again)
int heuristic;
p = mfp;
STRCPY(p, tagp.tagname);
#ifdef FEAT_MULTI_LANG
p[len] = '@';
STRCPY(p + len + 1, help_lang);
#endif
heuristic = help_heuristic(tagp.tagname,
match_re ? matchoff : 0, !match_no_ic);
#ifdef FEAT_MULTI_LANG
heuristic += help_pri;
#endif
sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
heuristic);
}
*tagp.tagname_end = TAB;
}
else if (name_only)
{
if (get_it_again)
{
char_u *temp_end = tagp.command;
if (*temp_end == '/')
while (*temp_end && *temp_end != '\r'
&& *temp_end != '\n'
&& *temp_end != '$')
temp_end++;
if (tagp.command + 2 < temp_end)
{
char_u *temp_end = tagp.command;
if (*temp_end == '/')
while (*temp_end && *temp_end != '\r'
&& *temp_end != '\n'
&& *temp_end != '$')
temp_end++;
if (tagp.command + 2 < temp_end)
{
len = (int)(temp_end - tagp.command - 2);
mfp = (struct match_found *)alloc(
(int)sizeof(struct match_found) + len);
if (mfp != NULL)
{
mfp->len = len + 1; /* include the NUL */
p = mfp->match;
vim_strncpy(p, tagp.command + 2, len);
}
}
else
mfp = NULL;
get_it_again = FALSE;
len = (int)(temp_end - tagp.command - 2);
mfp = (char_u *)alloc(len + 2);
if (mfp != NULL)
vim_strncpy(mfp, tagp.command + 2, len);
}
else
{
len = (int)(tagp.tagname_end - tagp.tagname);
mfp = (struct match_found *)alloc(
(int)sizeof(struct match_found) + len);
if (mfp != NULL)
{
mfp->len = len + 1; /* include the NUL */
p = mfp->match;
vim_strncpy(p, tagp.tagname, len);
}
/* if wanted, re-read line to get long form too */
if (State & INSERT)
get_it_again = p_sft;
}
mfp = NULL;
get_it_again = FALSE;
}
else
{
/* Save the tag in a buffer.
* Emacs tag: <mtt><tag_fname><NUL><ebuf><NUL><lbuf>
* other tag: <mtt><tag_fname><NUL><NUL><lbuf>
* without Emacs tags: <mtt><tag_fname><NUL><lbuf>
*/
len = (int)STRLEN(tag_fname)
+ (int)STRLEN(lbuf) + 3;
#ifdef FEAT_EMACS_TAGS
if (is_etag)
len += (int)STRLEN(ebuf) + 1;
else
++len;
#endif
mfp = (struct match_found *)alloc(
(int)sizeof(struct match_found) + len);
len = (int)(tagp.tagname_end - tagp.tagname);
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
if (mfp != NULL)
{
mfp->len = len;
p = mfp->match;
p[0] = mtt;
STRCPY(p + 1, tag_fname);
#ifdef BACKSLASH_IN_FILENAME
/* Ignore differences in slashes, avoid adding
* both path/file and path\file. */
slash_adjust(p + 1);
#endif
s = p + 1 + STRLEN(tag_fname) + 1;
#ifdef FEAT_EMACS_TAGS
if (is_etag)
{
STRCPY(s, ebuf);
s += STRLEN(ebuf) + 1;
}
else
*s++ = NUL;
#endif
STRCPY(s, lbuf);
}
}
vim_strncpy(mfp, tagp.tagname, len);
if (mfp != NULL)
{
/*
* Don't add identical matches.
* This can take a lot of time when finding many
* matches, check for CTRL-C now and then.
* Add all cscope tags, because they are all listed.
*/
#ifdef FEAT_CSCOPE
if (use_cscope)
i = -1;
else
#endif
for (i = ga_match[mtt].ga_len; --i >= 0 && !got_int; )
{
mfp2 = ((struct match_found **)
(ga_match[mtt].ga_data))[i];
if (mfp2->len == mfp->len
&& memcmp(mfp2->match, mfp->match,
(size_t)mfp->len) == 0)
break;
fast_breakcheck();
}
if (i < 0)
{
((struct match_found **)(ga_match[mtt].ga_data))
[ga_match[mtt].ga_len++] = mfp;
++match_count;
}
else
vim_free(mfp);
/* if wanted, re-read line to get long form too */
if (State & INSERT)
get_it_again = p_sft;
}
}
else /* Out of memory! Just forget about the rest. */
else
{
retval = OK;
stop_searching = TRUE;
break;
#define TAG_SEP 0x01
size_t tag_fname_len = STRLEN(tag_fname);
#ifdef FEAT_EMACS_TAGS
size_t ebuf_len = 0;
#endif
/* Save the tag in a buffer.
* Use 0x01 to separate fields (Can't use NUL, because the
* hash key is terminated by NUL).
* Emacs tag: <mtt><tag_fname><0x01><ebuf><0x01><lbuf><NUL>
* other tag: <mtt><tag_fname><0x01><0x01><lbuf><NUL>
* without Emacs tags: <mtt><tag_fname><0x01><lbuf><NUL>
* Here <mtt> is the "mtt" value plus 1 to avoid NUL.
*/
len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3;
#ifdef FEAT_EMACS_TAGS
if (is_etag)
{
ebuf_len = STRLEN(ebuf);
len += (int)ebuf_len + 1;
}
else
++len;
#endif
mfp = (char_u *)alloc((int)sizeof(char_u) + len + 1);
if (mfp != NULL)
{
p = mfp;
p[0] = mtt + 1;
STRCPY(p + 1, tag_fname);
#ifdef BACKSLASH_IN_FILENAME
/* Ignore differences in slashes, avoid adding
* both path/file and path\file. */
slash_adjust(p + 1);
#endif
p[tag_fname_len + 1] = TAG_SEP;
s = p + 1 + tag_fname_len + 1;
#ifdef FEAT_EMACS_TAGS
if (is_etag)
{
STRCPY(s, ebuf);
s[ebuf_len] = TAG_SEP;
s += ebuf_len + 1;
}
else
*s++ = TAG_SEP;
#endif
STRCPY(s, lbuf);
}
}
if (mfp != NULL)
{
hashitem_T *hi;
/*
* Don't add identical matches.
* Add all cscope tags, because they are all listed.
* "mfp" is used as a hash key, there is a NUL byte to end
* the part matters for comparing, more bytes may follow
* after it. E.g. help tags store the priority after the
* NUL.
*/
#ifdef FEAT_CSCOPE
if (use_cscope)
hash++;
else
#endif
hash = hash_hash(mfp);
hi = hash_lookup(&ht_match[mtt], mfp, hash);
if (HASHITEM_EMPTY(hi))
{
if (hash_add_item(&ht_match[mtt], hi, mfp, hash)
== FAIL)
{
/* Out of memory! Just forget about the rest. */
retval = OK;
stop_searching = TRUE;
break;
}
else
++match_count;
}
else
/* duplicate tag, drop it */
vim_free(mfp);
}
}
#ifdef FEAT_CSCOPE
@@ -2532,7 +2533,7 @@ findtag_end:
#endif
/*
* Move the matches from the ga_match[] arrays into one list of
* Move the matches from the ht_match[] arrays into one list of
* matches. When retval == FAIL, free the matches.
*/
if (retval == FAIL)
@@ -2546,22 +2547,35 @@ findtag_end:
match_count = 0;
for (mtt = 0; mtt < MT_COUNT; ++mtt)
{
for (i = 0; i < ga_match[mtt].ga_len; ++i)
hashitem_T *hi;
long_u todo;
todo = (long)ht_match[mtt].ht_used;
for (hi = ht_match[mtt].ht_array; todo > 0; ++hi)
{
mfp = ((struct match_found **)(ga_match[mtt].ga_data))[i];
if (matches == NULL)
vim_free(mfp);
else
if (!HASHITEM_EMPTY(hi))
{
/* To avoid allocating memory again we turn the struct
* match_found into a string. For help the priority was not
* included in the length. */
mch_memmove(mfp, mfp->match,
(size_t)(mfp->len + (help_only ? ML_HELP_LEN : 0)));
matches[match_count++] = (char_u *)mfp;
mfp = hi->hi_key;
if (matches == NULL)
vim_free(mfp);
else
{
if (!name_only)
{
/* Change mtt back to zero-based. */
*mfp = *mfp - 1;
/* change the TAG_SEP back to NUL */
for (p = mfp + 1; *p != NUL; ++p)
if (*p == TAG_SEP)
*p = NUL;
}
matches[match_count++] = (char_u *)mfp;
}
todo--;
}
}
ga_clear(&ga_match[mtt]);
hash_clear(&ht_match[mtt]);
}
*matchesp = matches;
+23 -9
View File
@@ -857,6 +857,8 @@ static struct builtin_term builtin_termcaps[] =
{(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
{(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
# endif
{(int)KS_CBE, IF_EB("\033[?2004h", ESC_STR "[?2004h")},
{(int)KS_CBD, IF_EB("\033[?2004l", ESC_STR "[?2004l")},
{K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
{K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")},
@@ -902,13 +904,15 @@ static struct builtin_term builtin_termcaps[] =
{K_ZEND, IF_EB("\033[8;*~", ESC_STR "[8;*~")},
{K_PAGEUP, IF_EB("\033[5;*~", ESC_STR "[5;*~")},
{K_PAGEDOWN, IF_EB("\033[6;*~", ESC_STR "[6;*~")},
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
{K_KPLUS, IF_EB("\033O*k", ESC_STR "O*k")}, /* keypad plus */
{K_KMINUS, IF_EB("\033O*m", ESC_STR "O*m")}, /* keypad minus */
{K_KDIVIDE, IF_EB("\033O*o", ESC_STR "O*o")}, /* keypad / */
{K_KMULTIPLY, IF_EB("\033O*j", ESC_STR "O*j")}, /* keypad * */
{K_KENTER, IF_EB("\033O*M", ESC_STR "O*M")}, /* keypad Enter */
{K_KPOINT, IF_EB("\033O*n", ESC_STR "O*n")}, /* keypad . */
{K_KDEL, IF_EB("\033[3;*~", ESC_STR "[3;*~")}, /* keypad Del */
{K_PS, IF_EB("\033[200~", ESC_STR "[200~")}, /* paste start */
{K_PE, IF_EB("\033[201~", ESC_STR "[201~")}, /* paste end */
{BT_EXTRA_KEYS, ""},
{TERMCAP2KEY('k', '0'), IF_EB("\033[10;*~", ESC_STR "[10;*~")}, /* F0 */
@@ -1224,6 +1228,8 @@ static struct builtin_term builtin_termcaps[] =
{K_KMULTIPLY, "[KMULTIPLY]"},
{K_KENTER, "[KENTER]"},
{K_KPOINT, "[KPOINT]"},
{K_PS, "[PASTE-START]"},
{K_PE, "[PASTE-END]"},
{K_K0, "[K0]"},
{K_K1, "[K1]"},
{K_K2, "[K2]"},
@@ -1544,6 +1550,8 @@ set_termname(char_u *term)
{KS_CSI, "SI"}, {KS_CEI, "EI"},
{KS_U7, "u7"}, {KS_RBG, "RB"},
{KS_8F, "8f"}, {KS_8B, "8b"},
{KS_CBE, "BE"}, {KS_CBD, "BD"},
{KS_CPS, "PS"}, {KS_CPE, "PE"},
{(enum SpecialKey)0, NULL}
};
@@ -3146,6 +3154,7 @@ starttermcap(void)
{
out_str(T_TI); /* start termcap mode */
out_str(T_KS); /* start "keypad transmit" mode */
out_str(T_BE); /* enable bracketed paste mode */
out_flush();
termcap_active = TRUE;
screen_start(); /* don't know where cursor is now */
@@ -3195,6 +3204,7 @@ stoptermcap(void)
check_for_codes_from_term();
}
#endif
out_str(T_BD); /* disable bracketed paste mode */
out_str(T_KE); /* stop "keypad transmit" mode */
out_flush();
termcap_active = FALSE;
@@ -6075,8 +6085,12 @@ hex_digit(int c)
guicolor_T
gui_get_color_cmn(char_u *name)
{
/* On MS-Windows an RGB macro is available and it's different from ours,
* but does what is needed. */
/* On MS-Windows an RGB macro is available and it produces 0x00bbggrr color
* values as used by the MS-Windows GDI api. It should be used only for
* MS-Windows GDI builds. */
# if defined(RGB) && defined(WIN32) && !defined(FEAT_GUI)
# undef RGB
# endif
# ifndef RGB
# define RGB(r, g, b) ((r<<16) | (g<<8) | (b))
# endif
+10 -2
View File
@@ -89,10 +89,14 @@ enum SpecialKey
KS_OP, /* original color pair */
KS_U7, /* request cursor position */
KS_8F, /* set foreground color (RGB) */
KS_8B /* set background color (RGB) */
KS_8B, /* set background color (RGB) */
KS_CBE, /* enable bracketed paste mode */
KS_CBD, /* disable bracketed paste mode */
KS_CPS, /* start of brackted paste */
KS_CPE /* end of brackted paste */
};
#define KS_LAST KS_8B
#define KS_LAST KS_CPE
/*
* the terminal capabilities are stored in this array
@@ -170,6 +174,10 @@ extern char_u *(term_strings[]); /* current terminal strings */
#define T_U7 (term_str(KS_U7)) /* request cursor position */
#define T_8F (term_str(KS_8F)) /* set foreground color (RGB) */
#define T_8B (term_str(KS_8B)) /* set background color (RGB) */
#define T_BE (term_str(KS_CBE)) /* enable bracketed paste mode */
#define T_BD (term_str(KS_CBD)) /* disable bracketed paste mode */
#define T_PS (term_str(KS_CPS)) /* start of bracketed paste */
#define T_PE (term_str(KS_CPE)) /* end of bracketed paste */
#define TMODE_COOK 0 /* terminal mode for external cmds and Ex mode */
#define TMODE_SLEEP 1 /* terminal mode for sleeping (cooked but no echo) */
+6
View File
@@ -144,12 +144,15 @@ NEW_TESTS = test_arglist.res \
test_channel.res \
test_charsearch.res \
test_cmdline.res \
test_command_count.res \
test_crypt.res \
test_cscope.res \
test_diffmode.res \
test_digraph.res \
test_display.res \
test_farsi.res \
test_fnameescape.res \
test_fold.res \
test_gf.res \
test_gn.res \
test_gui.res \
@@ -172,7 +175,9 @@ NEW_TESTS = test_arglist.res \
test_normal.res \
test_packadd.res \
test_perl.res \
test_profile.res \
test_quickfix.res \
test_retab.res \
test_ruby.res \
test_search.res \
test_signs.res \
@@ -182,6 +187,7 @@ NEW_TESTS = test_arglist.res \
test_stat.res \
test_substitute.res \
test_syntax.res \
test_system.res \
test_textobjects.res \
test_undo.res \
test_usercommands.res \
+7 -7
View File
@@ -44,12 +44,12 @@ $(DOSTMP_INFILES): $(*B).in
# This moves test99.in to test99.in.bak temporarily.
$(TEST_OUTFILES): $(DOSTMP)\$(*B).in
-@if exist test.out DEL test.out
move $(*B).in $(*B).in.bak
copy $(DOSTMP)\$(*B).in $(*B).in
copy $(*B).ok test.ok
move $(*B).in $(*B).in.bak > nul
copy $(DOSTMP)\$(*B).in $(*B).in > nul
copy $(*B).ok test.ok > nul
$(VIMPROG) -u dos.vim $(NO_PLUGIN) -s dotest.in $(*B).in
-@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out
-@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in
-@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out > nul
-@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in > nul
-@if exist test.ok del test.ok
-@if exist Xdir1 rd /s /q Xdir1
-@if exist Xfind rd /s /q Xfind
@@ -58,10 +58,10 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in
$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+set ff=unix|f test.out|wq" \
$(DOSTMP)\$(*B).out
@diff test.out $*.ok & if errorlevel 1 \
( move /y test.out $*.failed \
( move /y test.out $*.failed > nul \
& del $(DOSTMP)\$(*B).out \
& echo $* FAILED >> test.log ) \
else ( move /y test.out $*.out )
else ( move /y test.out $*.out > nul )
# Must run test1 first to create small.vim.
# This rule must come after the one that copies the input files to dostmp to
+3 -3
View File
@@ -14,10 +14,10 @@ can. Use an old style test when it needs to run without the +eval feature.
TO ADD A NEW STYLE TEST:
1) Create a test_<subject>.vim file.
2) Add test_<subject>.vim to NEW_TESTS in Make_all.mak in alphabetical order.
3) Use make test_<subject>.res to run a single test in src/testdir/.
2) Add test_<subject>.res to NEW_TESTS in Make_all.mak in alphabetical order.
3) Also add an entry in src/Makefile.
4) Use make test_<subject>.res to run a single test in src/testdir/.
Use make test_<subject> to run a single test in src/.
4) Also add an entry in src/Makefile.
What you can use (see test_assert.vim for an example):
- Call assert_equal(), assert_true(), assert_false(), etc.
+19
View File
@@ -2317,6 +2317,25 @@ h,
i;
JSEND
STARTTEST
:set cin cino&
/start of define
=/end of define
ENDTEST
/* start of define */
{
}
#define AAA \
BBB\
CCC
#define CNT \
1 + \
2 + \
4
/* end of define */
STARTTEST
:g/^STARTTEST/.,/^ENDTEST/d
:1;/start of AUTO/,$wq! test.out
+14
View File
@@ -2080,3 +2080,17 @@ var a,
i;
JSEND
/* start of define */
{
}
#define AAA \
BBB\
CCC
#define CNT \
1 + \
2 + \
4
/* end of define */
+4 -4
View File
@@ -658,10 +658,10 @@ assert sys.stderr.closed()==False:NOT FAILED
assert sys.stdout.errors=="strict":NOT FAILED
assert sys.stderr.errors=="strict":NOT FAILED
assert sys.stdout.encoding==sys.stderr.encoding:NOT FAILED
sys.stdout.write(None):(<class 'TypeError'>, TypeError("Can't convert 'NoneType' object to str implicitly",))
sys.stdout.write(None):(<class 'TypeError'>, TypeError('argument must be str, bytes or bytearray, not None',))
>> OutputWriteLines
sys.stdout.writelines(None):(<class 'TypeError'>, TypeError("'NoneType' object is not iterable",))
sys.stdout.writelines([1]):(<class 'TypeError'>, TypeError("Can't convert 'int' object to str implicitly",))
sys.stdout.writelines([1]):(<class 'TypeError'>, TypeError('argument must be str, bytes or bytearray, not int',))
>>> Testing *Iter* using sys.stdout.writelines(%s)
sys.stdout.writelines(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError('iter',))
sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError('next',))
@@ -700,8 +700,8 @@ vim.foreach_rtp(NoArgsCall()):(<class 'TypeError'>, TypeError('__call__() takes
vim.foreach_rtp(FailingCall()):(<class 'NotImplementedError'>, NotImplementedError('call',))
vim.foreach_rtp(int, 2):(<class 'TypeError'>, TypeError('foreach_rtp() takes exactly one argument (2 given)',))
> import
import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
import xxx_no_such_module_xxx:(<class 'ModuleNotFoundError'>, ModuleNotFoundError("No module named 'xxx_no_such_module_xxx'",))
import failing_import:(<class 'ModuleNotFoundError'>, ModuleNotFoundError("No module named 'failing_import'",))
import failing:(<class 'NotImplementedError'>, NotImplementedError())
> Options
>> OptionsItem
+3 -1
View File
@@ -3,7 +3,6 @@
source test_assign.vim
source test_autocmd.vim
source test_command_count.vim
source test_cursor_func.vim
source test_delete.vim
source test_execute_func.vim
@@ -16,7 +15,9 @@ source test_file_perm.vim
source test_fileformat.vim
source test_filter_cmd.vim
source test_filter_map.vim
source test_float_func.vim
source test_fnamemodify.vim
source test_functions.vim
source test_glob2regpat.vim
source test_goto.vim
source test_help_tagjump.vim
@@ -30,6 +31,7 @@ source test_mapping.vim
source test_messages.vim
source test_partial.vim
source test_popup.vim
source test_put.vim
source test_reltime.vim
source test_searchpos.vim
source test_set.vim
+1 -1
View File
@@ -32,7 +32,7 @@ func Test_assert_notequal()
call assert_notequal([1, 2, 3], s)
call assert_notequal('foo', s)
call assert_match("Expected 'foo' differs from 'foo'", v:errors[0])
call assert_match("Expected not equal to 'foo'", v:errors[0])
call remove(v:errors, 0)
endfunc
+19
View File
@@ -322,3 +322,22 @@ func Test_three_windows()
call delete('Xtestje2')
call delete('Xtestje3')
endfunc
func Test_BufEnter()
au! BufEnter
au Bufenter * let val = val . '+'
let g:val = ''
split NewFile
call assert_equal('+', g:val)
bwipe!
call assert_equal('++', g:val)
" Also get BufEnter when editing a directory
call mkdir('Xdir')
split Xdir
call assert_equal('+++', g:val)
bwipe!
call delete('Xdir', 'd')
au! BufEnter
endfunc
-1
View File
@@ -279,7 +279,6 @@ func Ch_channel_handler(port)
endfunc
func Test_channel_handler()
call ch_logfile('channellog', 'w')
call ch_log('Test_channel_handler()')
let g:Ch_reply = ""
let s:chopt.callback = 'Ch_handler'
+78
View File
@@ -25,6 +25,60 @@ func Test_complete_wildmenu()
set nowildmenu
endfunc
func Test_match_completion()
if !has('cmdline_compl')
return
endif
hi Aardig ctermfg=green
call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"match Aardig', getreg(':'))
call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"match none', getreg(':'))
endfunc
func Test_highlight_completion()
if !has('cmdline_compl')
return
endif
hi Aardig ctermfg=green
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"hi Aardig', getreg(':'))
call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"hi link', getreg(':'))
call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"hi default', getreg(':'))
call feedkeys(":hi c\<S-Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"hi clear', getreg(':'))
endfunc
func Test_expr_completion()
if !has('cmdline_compl')
return
endif
for cmd in [
\ 'let a = ',
\ 'if',
\ 'elseif',
\ 'while',
\ 'for',
\ 'echo',
\ 'echon',
\ 'execute',
\ 'echomsg',
\ 'echoerr',
\ 'call',
\ 'return',
\ 'cexpr',
\ 'caddexpr',
\ 'cgetexpr',
\ 'lexpr',
\ 'laddexpr',
\ 'lgetexpr']
call feedkeys(":" . cmd . " getl\<Tab>\<Home>\"\<CR>", 'xt')
call assert_equal('"' . cmd . ' getline(', getreg(':'))
endfor
endfunc
func Test_getcompletion()
if !has('cmdline_compl')
return
@@ -215,5 +269,29 @@ func Test_paste_in_cmdline()
call feedkeys("f;:aaa \<C-R>\<C-A> bbb\<C-B>\"\<CR>", 'tx')
call assert_equal('"aaa a;b-c*d bbb', @:)
call feedkeys(":\<C-\>etoupper(getline(1))\<CR>\<C-B>\"\<CR>", 'tx')
call assert_equal('"ASDF.X /TMP/SOME VERYLONGWORD A;B-C*D ', @:)
bwipe!
endfunc
func Test_remove_char_in_cmdline()
call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx')
call assert_equal('"abc ef', @:)
call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx')
call assert_equal('"abcdef', @:)
call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx')
call assert_equal('"abc ghi', @:)
call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
call assert_equal('"def', @:)
endfunc
func Test_illegal_address()
new
2;'(
2;')
quit
endfunc
+39
View File
@@ -0,0 +1,39 @@
" Test for displaying stuff
if !has('gui_running') && has('unix')
set term=ansi
endif
function! s:screenline(lnum, nr) abort
let line = []
for j in range(a:nr)
for c in range(1, winwidth(0))
call add(line, nr2char(screenchar(a:lnum+j, c)))
endfor
call add(line, "\n")
endfor
return join(line, '')
endfunction
function! Test_display_foldcolumn()
new
vnew
vert resize 25
call assert_equal(25, winwidth(winnr()))
set isprint=@
1put='e more noise blah blah‚ more stuff here'
let expect = "e more noise blah blah<82\n> more stuff here \n"
call cursor(2, 1)
norm! zt
redraw!
call assert_equal(expect, s:screenline(1,2))
set fdc=2
redraw!
let expect = " e more noise blah blah<\n 82> more stuff here \n"
call assert_equal(expect, s:screenline(1,2))
quit!
quit!
endfunction

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