Compare commits

...

136 Commits

Author SHA1 Message Date
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
Kazuki Sakamoto e61a091ac1 MacVim Snapshot 119
Binary targets macOS 10.8+

- Vim patch 8.0.0124
- Fixed crash with Python.org 3.5.2 binary

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.5.2
- Ruby 2.0
2016-12-08 23:51:57 -08:00
Kazuki Sakamoto 7c7e807cb3 Merge pull request #434 from macvim-dev/fix/pythonthreehome
Fix Py_SetPythonHome calling
2016-12-08 23:47:59 -08:00
Kazuki Sakamoto 1d88ecc753 Fix Py_SetPythonHome calling
The pointer for Py_SetPythonHome shouldn't be freed
2016-12-08 23:46:31 -08:00
Kazuki Sakamoto 5ff38b0d07 MacVim Snapshot 118
Binary targets macOS 10.8+

- Vim patch 8.0.0124
- Fixed crash in :set

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.5.2
- Ruby 2.0
2016-12-07 12:30:48 -08:00
Kazuki Sakamoto e3f9841f59 Merge pull request #433 from macvim-dev/fix/option
Fix :set crash
2016-12-07 12:29:21 -08:00
Kazuki Sakamoto 1de4548643 Fix :set crash
P_STRING option default value can't be NULL
2016-12-07 12:25:16 -08:00
Kazuki Sakamoto fd114bd289 Merge pull request #430 from macvim-dev/MMUseCGLayerAlwaysKey
Introduce MMUseCGLayerAlways user default
2016-12-04 17:24:02 -08:00
Kazuki Sakamoto b115d75a66 Introduce MMUseCGLayerAlways user default
Add user default key `MMUseCGLayerAlways` to control to use CGLayer
rendering always in Core Text Renderer.

    $ defaults write org.vim.MacVim MMUseCGLayerAlways -bool YES
2016-12-04 17:10:02 -08:00
Kazuki Sakamoto 4f653a19c5 Add setNeedsDisplayCGLayerInRect and setNeedsDisplayCGLayer 2016-12-04 16:41:34 -08:00
Ben Osheroff 2fb08d3456 draw the layer from the background thread
during layer draw we know what parts of the screen will need repainting,
so we can call set setNeedsDisplayInRect and do a partial draw of the
screen.  This brings down overall keyDown-to-drawRect(finish) latency
when in "layer" mode from 17ms to 4.5ms (about what the "stock" CoreText
renderer does).
2016-12-04 16:33:19 -08:00
Kazuki Sakamoto 675446da32 Merge remote-tracking branch 'vim/master' 2016-12-04 12:00:50 -08:00
Bram Moolenaar 3421566376 patch 8.0.0124
Problem:    Internal error for assert_inrange(1, 1).
Solution:   Adjust number of allowed arguments. (Dominique Pelle)
2016-12-04 13:37:41 +01:00
Kazuki Sakamoto 079c0c9d4a Merge remote-tracking branch 'vim/master' 2016-12-03 20:58:26 -08:00
Bram Moolenaar a899e6ecc4 patch 8.0.0123
Problem:    Modern Sun compilers define "__sun" instead of "sun".
Solution:   Use __sun. (closes #1296)
2016-12-03 16:40:51 +01:00
Bram Moolenaar 3fad98e8af patch 8.0.0122
Problem:    Channel test is still flaky on OS X.
Solution:   Add a short sleep.
2016-12-03 15:23:40 +01:00
Bram Moolenaar a2477fd349 patch 8.0.0121
Problem:    Setting 'cursorline' changes the curswant column. (Daniel Hahler)
Solution:   Add the P_RWINONLY flag. (closes #1297)
2016-12-03 15:13:20 +01:00
Bram Moolenaar 5643db84c6 patch 8.0.0120
Problem:    Channel test is still flaky on OS X.
Solution:   Set the drop argument to "never".
2016-12-03 14:29:10 +01:00
Bram Moolenaar 21efc3633e patch 8.0.0119
Problem:    No test for using CTRL-R on the command line.
Solution:   Add a test. (Dominique Pelle) And some more.
2016-12-03 14:05:49 +01:00
Kazuki Sakamoto d96d409df8 Merge remote-tracking branch 'vim/master' 2016-12-02 20:55:59 -08:00
Bram Moolenaar 99c5eb4fd7 Add objects dirstamp to gitignore. 2016-12-02 21:24:21 +01:00
Bram Moolenaar 5162822914 patch 8.0.0118
Problem:    "make proto" adds extra function prototype.
Solution:   Add #ifdef.
2016-12-01 23:03:28 +01:00
Bram Moolenaar cf49790443 Updated runtime files. 2016-12-01 22:57:02 +01:00
Bram Moolenaar 327054df45 patch 8.0.0117
Problem:    Parallel make fails. (J. Lewis Muir)
Solution:   Make sure the objects directory exists. (closes #1259)
2016-12-01 21:46:14 +01:00
Bram Moolenaar 6dbf66aa3e patch 8.0.0116
Problem:    When reading English help and using CTRl-] the language from
            'helplang' is used.
Solution:   Make help tag jumps keep the language. (Tatsuki, test by Hirohito
            Higashi, closes #1249)
2016-12-01 21:32:32 +01:00
Bram Moolenaar e3af763d5e patch 8.0.0115
Problem:    When building with Cygwin libwinpthread isn't found.
Solution:   Link winpthread statically. (jmmerz, closes #1255, closes #1256)
2016-12-01 20:37:47 +01:00
Bram Moolenaar b04a98f6c3 patch 8.0.0114
Problem:    Coding style not optimal.
Solution:   Add spaces. (Ken Takata)
2016-12-01 20:32:29 +01:00
Bram Moolenaar 87f3d202a9 patch 8.0.0113
Problem:    MS-Windows: message box to prompt for saving changes may appear on
            the wrong monitor.
Solution:   Adjust the CenterWindow function. (Ken Takata)
2016-12-01 20:18:50 +01:00
Bram Moolenaar eca626fcdb patch 8.0.0112
Problem:    Tests 92 and 93 are old style.
Solution:   Make test92 and test93 new style. (Hirohito Higashi, closes #1289)
2016-12-01 18:47:38 +01:00
Bram Moolenaar eebd84eb94 patch 8.0.0111
Problem:    The :history command is not tested.
Solution:   Add tests. (Dominique Pelle)
2016-12-01 17:57:44 +01:00
Bram Moolenaar 5a030a540f patch 8.0.0110
Problem:    Drop command doesn't use existing window.
Solution:   Check the window width properly. (Hirohito Higashi)
2016-12-01 17:48:29 +01:00
Bram Moolenaar b129a447f3 patch 8.0.0109
Problem:    Still checking if memcmp() exists while every system should have
            it now.
Solution:   Remove vim_memcmp().  (James McCoy, closes #1295)
2016-12-01 17:25:20 +01:00
Bram Moolenaar 65e08ee1d2 patch 8.0.0108
Problem:    The channel "drop" option is not tested.
Solution:   Add a test.
2016-12-01 16:41:50 +01:00
Bram Moolenaar 958dc6923d patch 8.0.0107
Problem:    When reading channel output in a timer, messages may go missing.
            (Skywind)
Solution:   Add the "drop" option.  Write error messages in the channel log.
            Don't have ch_canread() check for the channel being open.
2016-12-01 15:34:12 +01:00
Kazuki Sakamoto 5cc2a2b8f8 MacVim Snapshot 117
Binary targets macOS 10.8+

- Vim patch 8.0.0106
- Fixed feedkeys in timer callback
- [Experimental] Automatic Python settings
  - Python 2.7.x: Homebrew python2 or System's
  - Python 3.5.2 or later: Homebrew python3 or python.org binary

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.5.2
- Ruby 2.0
2016-11-30 20:52:28 -08:00
Kazuki Sakamoto 34d4c9f566 Update README_mac.txt for MacVim 2016-11-29 20:58:03 -08:00
Kazuki Sakamoto d05258ea2a Merge remote-tracking branch 'vim/master' 2016-11-29 20:38:44 -08:00
Bram Moolenaar 0945eaface patch 8.0.0106
Problem:    Cannot use a semicolon in 'backupext'. (Jeff)
Solution:   Allow for a few more characters when "secure" isn't set.
2016-11-29 22:10:48 +01:00
Bram Moolenaar 4b785f69c0 patch 8.0.0105
Problem:    When using ch_read() with zero timeout, can't tell the difference
            between reading an empty line and nothing available.
Solution:   Add ch_canread().
2016-11-29 21:54:44 +01:00
Kazuki Sakamoto 1b15a7159b Merge pull request #423 from macvim-dev/experimental/pythonhomeopt
[Experimental] Set pythonhome and pythonthreehome automatically
2016-11-28 22:13:16 -08:00
Kazuki Sakamoto e3e3a15159 Set pythonhome and pythonthreehome automatically
MacVim uses Homebrew python2 if installed, otherwise System's
MacVim uses Homebrew python3 if installed, next try to use python.org binary
2016-11-28 22:10:23 -08:00
Kazuki Sakamoto 16974f80f9 Introduce pythonhome and pythonthreehome options
It is really difficult to set Python home directory properly for Python
2.7 and 3.5 in .vimrc at the same time since both versions use `$PYTHONHOME`
environment variable. Introduce `pythonhome` and `pythonthreehome`
options in order to set Python home directory via `Py_SetPythonHome` API
for both versions.
2016-11-28 20:53:43 -08:00
Kazuki Sakamoto f9248a4311 Merge remote-tracking branch 'vim/master' 2016-11-28 20:51:35 -08:00
Bram Moolenaar f422bcc7f9 patch 8.0.0104
Problem:    Value of 'thesaurus' option not checked properly.
Solution:   Add P_NDNAME flag. (Daisuke Suzuki)
2016-11-26 17:45:53 +01:00
Bram Moolenaar 8a8199e4a1 patch 8.0.0103
Problem:    May not process channel readahead. (skywind)
Solution:   If there is readahead don't block on input.
2016-11-26 15:13:33 +01:00
Bram Moolenaar 7554da4033 patch 8.0.0102
Problem:    Cannot set 'dictionary' to a path.
Solution:   Allow for slash and backslash.  Add a test (partly by Daisuke
            Suzuki, closes #1279, closes #1284)
2016-11-25 22:04:13 +01:00
Bram Moolenaar 031cb743ae patch 8.0.0101
Problem:    Some options are not strictly checked.
Solution:   Add flags for strickter checks.
2016-11-24 21:46:19 +01:00
Bram Moolenaar 319afe3804 patch 8.0.0100
Problem:    Options that are a file name may contain non-filename characters.
Solution:   Check for more invalid characters.
2016-11-24 18:30:59 +01:00
Bram Moolenaar 73095288da patch 8.0.0099
Problem:    Popup menu always appears above the cursor when it is in the lower
            half of the screen. (Matt Gardner)
Solution:   Compute the available space better. (Hirohito Higashi,
            closes #1241)
2016-11-24 17:47:07 +01:00
Bram Moolenaar 58c358753e patch 8.0.0098
Problem:    Can't build on MS-Windows.
Solution:   Add missing parenthesis.
2016-11-24 17:33:17 +01:00
Bram Moolenaar 833eb1d752 patch 8.0.0097
Problem:    When a channel callback consumes a lot of time Vim becomes
            unresponsive. (skywind)
Solution:   Bail out of checking channel readahead after 100 msec.
2016-11-24 17:22:50 +01:00
Bram Moolenaar 2cab0e1910 patch 8.0.0096
Problem:    When the input or output is not a tty Vim appears to hang.
Solution:   Add the --ttyfail argument.  Also add the "ttyin" and "ttyout"
            features to be able to check in Vim script.
2016-11-24 15:09:07 +01:00
Kazuki Sakamoto f7c4ef23fa Merge pull request #417 from ichizok/fix/timer-feedkeys
Fix job/channel/timer handling
2016-11-21 13:05:11 -08:00
Bram Moolenaar 182707ac10 patch 8.0.0095
Problem:    Problems with GTK 3.22.2 fixed in 3.22.4.
Solution:   Adjust the #ifdefs. (Kazunobu Kuriyama)
2016-11-21 20:55:58 +01:00
ichizok c8b6fd59f0 Enable Test_exit_callback_interval() 2016-11-21 23:40:46 +09:00
ichizok 235364e825 Check for jobs and channels more often 2016-11-21 23:40:46 +09:00
ichizok 362a5c0b39 Fix feedkeys in timer callback 2016-11-21 23:40:46 +09:00
Kazuki Sakamoto ca82514bff Merge pull request #416 from macvim-dev/revert-415-fix/py3
Revert "Set Python3 settings automatically"
2016-11-20 22:37:01 -08:00
Kazuki Sakamoto 414abe65f1 Revert "Set Python3 settings automatically" 2016-11-20 22:36:32 -08:00
Kazuki Sakamoto 6cfc463126 Merge pull request #415 from macvim-dev/fix/py3
Set Python3 settings automatically
2016-11-20 22:13:24 -08:00
Kazuki Sakamoto 031dd64ad7 Set Python3 settings automatically
Supports
- Homebrew Python3 (Default)
- https://www.python.org/downloads/mac-osx/
2016-11-20 22:11:00 -08:00
Kazuki Sakamoto c85f864c35 Merge pull request #413 from osheroff/layer_transparency
fixes for transparency + cgLayer code
2016-11-20 19:16:14 -08:00
Ben Osheroff 75c997049e fixes for transparency + cgLayer code 2016-11-20 18:53:50 -08:00
137 changed files with 3349 additions and 1101 deletions
+1
View File
@@ -5,6 +5,7 @@ src/xxd/xxd
src/auto/if_perl.c
src/auto/gui_gtk_gresources.c
src/auto/gui_gtk_gresources.h
src/objects/.dirstamp
src/tags
# We do need src/auto/configure.
+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'"
+5 -30
View File
@@ -1,38 +1,13 @@
README_mac.txt for version 8.0 of Vim: Vi IMproved.
This file explains the installation of MacVim.
See "README.txt" for general information about Vim.
See "src/MacVim/README" for an overview of the MacVim specific source code.
MacVim uses the usual configure/make steps to build the binary but instead of
"make install" you just drag the app bundle into the directory you wish to
install in (usually `/Applications').
How to build and install
How to install MacVim?
========================
Run `./configure` in the `src/` directory with the flags you want (call
`./configure --help` to see a list of flags) e.g.:
Download MacVim.dmg from latest binary release page https://github.com/macvim-dev/macvim/releases/latest , open the dmg file, and copy MacVim.app to /Applications.
$ cd src
$ ./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--enable-perlinterp \
--enable-cscope
Now build the project using `make`:
Questions?
========================
$ make
Please take a look at the home page http://macvim-dev.github.io/macvim/
The resulting app bundle will reside under `MacVim/build/Release`. To try it
out quickly, type:
$ open MacVim/build/Release/MacVim.app
To install MacVim, type
$ open MacVim/build/Release
and drag the MacVim icon into your `Applications` folder.
+26
View File
@@ -0,0 +1,26 @@
" Vim compiler file
" Compiler: GHC Haskell Compiler
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
" Latest Revision: 2016-11-29
if exists("current_compiler")
finish
endif
let current_compiler = "ghc"
let s:cpo_save = &cpo
set cpo&vim
CompilerSet errorformat=
\%-G%.%#:\ build,
\%-G%.%#preprocessing\ library\ %.%#,
\%-G[%.%#]%.%#,
\%E%f:%l:%c:\ %m,
\%-G--%.%#
if exists('g:compiler_ghc_ignore_unmatched_lines')
CompilerSet errorformat+=%-G%.%#
endif
let &cpo = s:cpo_save
unlet s:cpo_save
+2 -1
View File
@@ -1,4 +1,4 @@
*change.txt* For Vim version 8.0. Last change: 2016 Oct 02
*change.txt* For Vim version 8.0. Last change: 2016 Nov 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -684,6 +684,7 @@ g& Synonym for `:%s//~/&` (repeat last substitute with
*:s_flags*
The flags that you can use for the substitute commands:
*:&&*
[&] Must be the first one: Keep the flags from the previous substitute
command. Examples: >
:&&
+21 -7
View File
@@ -1,4 +1,4 @@
*channel.txt* For Vim version 8.0. Last change: 2016 Nov 07
*channel.txt* For Vim version 8.0. Last change: 2016 Dec 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -155,7 +155,13 @@ Use |ch_status()| to see if the channel could be opened.
func MyCloseHandler(channel)
< Vim will invoke callbacks that handle data before invoking
close_cb, thus when this function is called no more data will
be received.
be passed to the callbacks.
*channel-drop*
"drop" Specifies when to drop messages:
"auto" When there is no callback to handle a message.
The "close_cb" is also considered for this.
"never" All messages will be kept.
*waittime*
"waittime" The time to wait for the connection to be made in
milliseconds. A negative number waits forever.
@@ -418,7 +424,11 @@ This uses the channel timeout. To read without a timeout, just get any
message that is available: >
let output = ch_read(channel, {'timeout': 0})
When no message was available then the result is v:none for a JSON or JS mode
channels, an empty string for a RAW or NL channel.
channels, an empty string for a RAW or NL channel. You can use |ch_canread()|
to check if there is something to read.
Note that when there is no callback message are dropped. To avoid that add a
close callback to the channel.
To read all output from a RAW channel that is available: >
let output = ch_readraw(channel)
@@ -534,7 +544,7 @@ You will want to do something more useful than "echomsg".
To start another process without creating a channel: >
let job = job_start(command,
\ {"in_io": "null", "out_io": "null", "err_io": "null"})
\ {"in_io": "null", "out_io": "null", "err_io": "null"})
This starts {command} in the background, Vim does not wait for it to finish.
@@ -595,6 +605,10 @@ 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-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.
@@ -629,7 +643,7 @@ See |job_setoptions()| and |ch_setoptions()|.
"channel": {channel} Use an existing channel instead of creating a new one.
The parts of the channel that get used for the new job
will be disconnected from what they were used before.
If the channel was still use by another job this may
If the channel was still used by another job this may
cause I/O errors.
Existing callbacks and other settings remain.
@@ -647,7 +661,7 @@ See |job_setoptions()| and |ch_setoptions()|.
"out_io": "null" disconnect stdout (goes to /dev/null)
"out_io": "pipe" stdout is connected to the channel (default)
"out_io": "file" stdout writes to a file
"out_io": "buffer" stdout appends to a buffer (see below)
"out_io": "buffer" stdout appends to a buffer (see below)
"out_name": "/path/file" the name of the file or buffer to write to
"out_buf": number the number of the buffer to write to
"out_modifiable": 0 when writing to a buffer, 'modifiable' will be off
@@ -660,7 +674,7 @@ See |job_setoptions()| and |ch_setoptions()|.
"err_io": "null" disconnect stderr (goes to /dev/null)
"err_io": "pipe" stderr is connected to the channel (default)
"err_io": "file" stderr writes to a file
"err_io": "buffer" stderr appends to a buffer (see below)
"err_io": "buffer" stderr appends to a buffer (see below)
"err_name": "/path/file" the name of the file or buffer to write to
"err_buf": number the number of the buffer to write to
"err_modifiable": 0 when writing to a buffer, 'modifiable' will be off
+8 -5
View File
@@ -359,8 +359,11 @@ terminals)
List entries 6 to 12 from the search history: >
:history / 6,12
<
List the recent five entries from all histories: >
:history all -5,
List the penultimate entry from all histories: >
:history all -2
<
List the most recent two entries from all histories: >
:history all -2,
:keepp[atterns] {command} *:keepp* *:keeppatterns*
Execute {command}, without adding anything to the search
@@ -1057,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.
+4 -4
View File
@@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.0. Last change: 2016 Sep 27
*editing.txt* For Vim version 8.0. Last change: 2016 Nov 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -977,12 +977,12 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write*
*:wa* *:wall*
:wa[ll] Write all changed buffers. Buffers without a file
name or which are readonly are not written. {not in
Vi}
name cause an error message. Buffers which are
readonly are not written. {not in Vi}
:wa[ll]! Write all changed buffers, even the ones that are
readonly. Buffers without a file name are not
written. {not in Vi}
written and cause an error message. {not in Vi}
Vim will warn you if you try to overwrite a file that has been changed
+34 -13
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2016 Nov 04
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2009,6 +2009,7 @@ byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr}
call({func}, {arglist} [, {dict}])
any call {func} with arguments {arglist}
ceil({expr}) Float round {expr} up
ch_canread({handle}) Number check if there is something to read
ch_close({handle}) none close {handle}
ch_close_in({handle}) none close in part of {handle}
ch_evalexpr({handle}, {expr} [, {options}])
@@ -2980,16 +2981,28 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
don't fit, a vertical layout is used anyway. For some systems
the horizontal layout is always used.
ch_canread({handle}) *ch_canread()*
Return non-zero when there is something to read from {handle}.
{handle} can be a Channel or a Job that has a Channel.
This is useful to read from a channel at a convenient time,
e.g. from a timer.
Note that messages are dropped when the channel does not have
a callback. Add a close callback to avoid that.
{only available when compiled with the |+channel| feature}
ch_close({handle}) *ch_close()*
Close {handle}. See |channel-close|.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
A close callback is not invoked.
{only available when compiled with the |+channel| feature}
ch_close_in({handle}) *ch_close_in()*
Close the "in" part of {handle}. See |channel-close-in|.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
A close callback is not invoked.
{only available when compiled with the |+channel| feature}
@@ -2998,7 +3011,7 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
Send {expr} over {handle}. The {expr} is encoded
according to the type of channel. The function cannot be used
with a raw channel. See |channel-use|.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
*E917*
{options} must be a Dictionary. It must not have a "callback"
entry. It can have a "timeout" entry to specify the timeout
@@ -3012,7 +3025,7 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()*
Send {string} over {handle}.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
Works like |ch_evalexpr()|, but does not encode the request or
decode the response. The caller is responsible for the
@@ -3025,7 +3038,7 @@ ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()*
ch_getbufnr({handle}, {what}) *ch_getbufnr()*
Get the buffer number that {handle} is using for {what}.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
{what} can be "err" for stderr, "out" for stdout or empty for
socket output.
Returns -1 when there is no buffer.
@@ -3071,7 +3084,7 @@ ch_log({msg} [, {handle}]) *ch_log()*
|ch_logfile()|.
When {handle} is passed the channel number is used for the
message.
{handle} can be Channel or a Job that has a Channel. The
{handle} can be a Channel or a Job that has a Channel. The
Channel must be open for the channel number to be used.
ch_logfile({fname} [, {mode}]) *ch_logfile()*
@@ -3099,7 +3112,7 @@ ch_open({address} [, {options}]) *ch_open()*
ch_read({handle} [, {options}]) *ch_read()*
Read from {handle} and return the received message.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
See |channel-more|.
{only available when compiled with the |+channel| feature}
@@ -3113,7 +3126,7 @@ ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
according to the type of channel. The function cannot be used
with a raw channel.
See |channel-use|. *E912*
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
{only available when compiled with the |+channel| feature}
@@ -3134,7 +3147,7 @@ ch_setoptions({handle}, {options}) *ch_setoptions()*
"timeout" default read timeout in msec
"mode" mode for the whole channel
See |ch_open()| for more explanation.
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
Note that changing the mode may cause queued messages to be
lost.
@@ -3148,7 +3161,7 @@ ch_status({handle} [, {options}]) *ch_status()*
"open" channel can be used
"buffered" channel can be read, not written to
"closed" channel can not be used
{handle} can be Channel or a Job that has a Channel.
{handle} can be a Channel or a Job that has a Channel.
"buffered" is used when the channel was closed but there is
still data that can be obtained with |ch_read()|.
@@ -5216,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.
@@ -7548,7 +7562,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.
@@ -7598,7 +7616,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.
@@ -8420,6 +8439,8 @@ timers Compiled with |timer_start()| support.
title Compiled with window title support |'title'|.
toolbar Compiled with support for |gui-toolbar|.
transparency Compiled with 'transparency' support.
ttyin input is a terminal (tty)
ttyout output is a terminal (tty)
unix Unix version of Vim.
user_commands User-defined commands.
vertsplit Compiled with vertically split windows |:vsplit|.
+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}
+2 -1
View File
@@ -1,4 +1,4 @@
*motion.txt* For Vim version 8.0. Last change: 2016 Jul 12
*motion.txt* For Vim version 8.0. Last change: 2016 Nov 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -915,6 +915,7 @@ was made yet in the current file.
then the position can be near the end of what the
command changed. For example when inserting a word,
the position will be on the last character.
To jump to older changes use |g;|.
{not in Vi}
*'(* *`(*
+39 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2016 Oct 12
*options.txt* For Vim version 8.0. Last change: 2017 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -242,7 +242,7 @@ opt+=val" the expansion is done before the adding or removing.
Handling of local options *local-options*
Some of the options only apply to a window or buffer. Each window or buffer
has its own copy of this option, thus can each have their own value. This
has its own copy of this option, thus each can have its own value. This
allows you to set 'list' in one window but not in another. And set
'shiftwidth' to 3 in one buffer and 4 in another.
@@ -3984,6 +3984,8 @@ A jump table for the options with a short description can be found at |Q_op|.
The format of this option is like that of 'statusline'.
'guitabtooltip' is used for the tooltip, see below.
The expression will be evaluated in the |sandbox| when set from a
modeline, see |sandbox-option|.
Only used when the GUI tab pages line is displayed. 'e' must be
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
@@ -5171,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*
@@ -5851,6 +5855,8 @@ A jump table for the options with a short description can be found at |Q_op|.
and |+postscript| features}
Expression used to print the PostScript produced with |:hardcopy|.
See |pexpr-option|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'printfont'* *'pfn'*
'printfont' 'pfn' string (default "courier")
@@ -5921,6 +5927,21 @@ A jump table for the options with a short description can be found at |Q_op|.
DYNAMIC_PYTHON_DLL, which was specified at compile time.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'pythonhome'*
'pythonhome' string (default "")
global
{not in Vi}
{only available when compiled with the |+python/dyn|
feature}
Note: EXPERIMENTAL. It may be changed or removed in the future.
Specifies the name of the Python 2.x home directory. When 'pythonhome'
and the PYTHONHOME environment variable are not set, PYTHON_HOME,
which was specified at compile time, will be used for the Python 2.x
home directory.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'pythonthreedll'*
@@ -5933,6 +5954,21 @@ A jump table for the options with a short description can be found at |Q_op|.
DYNAMIC_PYTHON3_DLL, which was specified at compile time.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'pythonthreehome'*
'pythonthreehome' string (default "")
global
{not in Vi}
{only available when compiled with the |+python3/dyn|
feature}
Note: EXPERIMENTAL. It may be changed or removed in the future.
Specifies the name of the Python 3 home directory. When
'pythonthreehome' and the PYTHONHOME environment variable are not set,
PYTHON3_HOME, which was specified at compile time, will be used for
the Python 3 home directory.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'quoteescape'* *'qe'*
@@ -7973,7 +8009,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Amiga console, Win32 console, all GUI versions and terminals with a
non-empty 't_ts' option).
When Vim was compiled with HAVE_X11 defined, the original title will
be restored if possible |X11|.
be restored if possible, see |X11|.
When this option contains printf-style '%' items, they will be
expanded according to the rules used for 'statusline'.
Example: >
+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*
+5 -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
@@ -840,7 +840,9 @@ Short explanation of each option: *option-list*
'prompt' 'prompt' enable prompt in Ex mode
'pumheight' 'ph' maximum height of the popup menu
'pythondll' name of the Python 2 dynamic library
'pythonhome' name of the Python 2 home directory
'pythonthreedll' name of the Python 3 dynamic library
'pythonthreehome' name of the Python 3 home directory
'quoteescape' 'qe' escape characters used in a string
'readonly' 'ro' disallow writing the buffer
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
@@ -1074,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:
+5 -1
View File
@@ -1,4 +1,4 @@
*starting.txt* For Vim version 8.0. Last change: 2016 Sep 09
*starting.txt* For Vim version 8.0. Last change: 2016 Nov 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -421,6 +421,10 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
not connected to a terminal. This will avoid the warning and
the two second delay that would happen. {not in Vi}
*--ttyfail*
--ttyfail When the stdin or stdout is not a terminal (tty) then exit
right away.
*-d*
-d Start in diff mode, like |vimdiff|.
{not in Vi} {not available when compiled without the |+diff|
+10 -2
View File
@@ -1378,6 +1378,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
--servername remote.txt /*--servername*
--socketid starting.txt /*--socketid*
--startuptime starting.txt /*--startuptime*
--ttyfail starting.txt /*--ttyfail*
--version starting.txt /*--version*
--windowid starting.txt /*--windowid*
-A starting.txt /*-A*
@@ -1865,6 +1866,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:$ cmdline.txt /*:$*
:% cmdline.txt /*:%*
:& change.txt /*:&*
:&& change.txt /*:&&*
:' cmdline.txt /*:'*
:, cmdline.txt /*:,*
:. cmdline.txt /*:.*
@@ -5302,6 +5304,7 @@ catch-text eval.txt /*catch-text*
cc change.txt /*cc*
ceil() eval.txt /*ceil()*
ch.vim syntax.txt /*ch.vim*
ch_canread() eval.txt /*ch_canread()*
ch_close() eval.txt /*ch_close()*
ch_close_in() eval.txt /*ch_close_in()*
ch_evalexpr() eval.txt /*ch_evalexpr()*
@@ -5349,6 +5352,7 @@ channel-close channel.txt /*channel-close*
channel-close-in channel.txt /*channel-close-in*
channel-commands channel.txt /*channel-commands*
channel-demo channel.txt /*channel-demo*
channel-drop channel.txt /*channel-drop*
channel-functions usr_41.txt /*channel-functions*
channel-mode channel.txt /*channel-mode*
channel-more channel.txt /*channel-more*
@@ -7021,6 +7025,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*
@@ -7156,7 +7161,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*
@@ -7873,6 +7877,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*
@@ -9215,16 +9220,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*
+124 -53
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2016 Nov 17
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -29,32 +29,21 @@ 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 -----------------------
Test_help_complete sometimes fails on MS-Windows:
function RunTheTest[9]..Test_help_complete line 22: Expected ['h test-char@ab',
'h test-char@en', 'h test-col@ab', 'h test-col@en'] but got ['h test-char@en', '
h test-char@en\t', 'h test-col@ab', 'h test-col@en']
Appears to be related to calling feedkeys() with exactly 8 characters.
Patch for GTK3: Kazunobu Kuriyama, 14 Nov.
Patch for fix breakindent bug (Christian, Nov 15)
+channel:
- Skip checking if job ended if there aren't any. (ichizok, 2016 Nov 7, #1196)
- problem with channel callback getting job, while the job was already
deleted. #1242. Fix in #1245 (ichizok), but is that correct?
Perhaps just replace job_still_alive() with job_still_useful()?
That's not sufficient.
- 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?
@@ -85,8 +74,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
@@ -115,32 +104,38 @@ Regexp problems:
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
Patch to support nested namespace syntax. (Pauli, 2016 Oct 30, #1214)
Patch to fix popup menu positioning. (Hirohito Higashi, 2016 Nov 7, #1241)
Patch to make help tag jumps keep language. (Tatsuki, #1249)
Test by Hirohito Higashi.
'] mark invalid after undoing insert "hello".
Make html indent file use javascript indent, now that it's not just cindent.
#1220
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)
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.
Include rust files. (Klabnik, #1356)
More float tests. (Dominique, #1364)
Patch to avoid ubsan warning for integer overflow. (Dominique, 2016 Dec 26)
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
Make dict_add give a duplicate key error.
Patch to make str2nr and str2float work with signed values.
(Lemonbody, 2016 Dec 18, #1332)
Should json_encode()/json_decode() restrict recursiveness?
Or avoid recursiveness.
Patch to fix UBSan error. Is this actually needed?
(Yegappan, 2016 Dec 18)
Allow using json with empty key? Dict already has it.
Json string with trailing \u should be an error. (Lcd)
@@ -151,17 +146,66 @@ 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.
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)
Patch for restoring wide characters in the console buffer.
(Ken Takata, 2016 Jun 7)
@@ -182,11 +226,23 @@ 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)
Patch for wrong cursor position on wrapped line, involving breakindent.
(Ozaki Kiichi, 2016 Nov 25)
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())
@@ -195,6 +251,13 @@ 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 trim() function. (Bukn, 2016 Nov 25, #1280)
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
On Windows buffer completion sees backslash as escape char instead of path
separator. (Toffanim, 2016 Nov 24, #1274)
min() and max() spawn lots of error messages if sorted list/dictionary
contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039)
@@ -212,6 +275,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.
@@ -234,12 +300,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)
@@ -264,14 +328,30 @@ 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.
Bogus characters inserted when triggering indent while changing test.
(Vitor Antunes, 2016 Nov 22, #1269)
Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26)
Also for ":@.".
@@ -280,6 +360,9 @@ Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
Have a way to get the call stack, in a function and from an exception.
#1125
Patch to add 'pythonhome' and 'pythonthreehome' options. (Kazuki Sakamoto,
2016 Nov 21, #1266)
Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple
times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5)
@@ -392,14 +475,6 @@ 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?
Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
Added tests (James McCoy, 2016 Aug 3). Still needs more work.
@@ -413,6 +488,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,
@@ -974,9 +1052,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()
@@ -1283,11 +1358,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)
@@ -1306,6 +1376,7 @@ With "tw=55 fo+=a" typing space before ) doesn't work well. (Scott Mcdermott,
Patch to add random number generator. (Hong Xu, 2010 Nov 8, update Nov 10)
Alternative from Christian Brabandt. (2010 Sep 19)
New one from Yasuhiro Matsumoto, #1277.
Messages in message.txt are highlighted as examples.
+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)
+2 -1
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.0. Last change: 2016 Sep 01
*usr_41.txt* For Vim version 8.0. Last change: 2016 Nov 29
VIM USER MANUAL - by Bram Moolenaar
@@ -930,6 +930,7 @@ Testing: *test-functions*
test_null_string() return a null String
Inter-process communication: *channel-functions*
ch_canread() check if there is something to read
ch_open() open a channel
ch_close() close a channel
ch_close_in() close the in part of a channel
+7 -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: 2016 Dec 10
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
+3 -1
View File
@@ -1,4 +1,4 @@
*windows.txt* For Vim version 8.0. Last change: 2016 Oct 21
*windows.txt* For Vim version 8.0. Last change: 2016 Dec 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -696,6 +696,8 @@ can also get to them with the buffer list commands, like ":bnext".
- If the file is not open in a window edit the file in the
current window. If the current buffer can't be |abandon|ed,
the window is split first.
- Windows that are not in the argument list or are not full
width will be closed if possible.
The |argument-list| is set, like with the |:next| command.
The purpose of this command is that it can be used from a
program that wants Vim to edit another file, e.g., a debugger.
+5 -2
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()
+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:
+8
View File
@@ -1345,10 +1345,18 @@ if exists("&pythondll")
call append("$", "pythondll\tname of the Python 2 dynamic library")
call <SID>OptionG("pythondll", &pythondll)
endif
if exists("&pythonhome")
call append("$", "pythonhome\tname of the Python 2 home directory")
call <SID>OptionG("pythonhome", &pythonhome)
endif
if exists("&pythonthreedll")
call append("$", "pythonthreedll\tname of the Python 3 dynamic library")
call <SID>OptionG("pythonthreedll", &pythonthreedll)
endif
if exists("&pythonthreehome")
call append("$", "pythonthreehome\tname of the Python 3 home directory")
call <SID>OptionG("pythonthreehome", &pythonthreehome)
endif
if exists("&rubydll")
call append("$", "rubydll\tname of the Ruby dynamic library")
call <SID>OptionG("rubydll", &rubydll)
+9 -9
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Nov 17
" Last Change: 2016 Nov 18
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -363,23 +363,23 @@ syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
if !exists("c_no_if0")
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
if !exists("c_no_if0_fold")
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
else
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
endif
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
if !exists("c_no_if0_fold")
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
else
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
endif
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
endif
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match cIncluded display contained "<[^>]*>"
+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
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>116</string>
<string>121</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
+22
View File
@@ -233,6 +233,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
[NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey,
[NSNumber numberWithBool:NO], MMUseCGLayerAlwaysKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -1195,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");
+40 -1
View File
@@ -198,6 +198,9 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
#ifdef FEAT_BEVAL
- (void)bevalCallback:(id)sender;
#endif
#ifdef MESSAGE_QUEUE
- (void)checkForProcessEvents:(NSTimer *)timer;
#endif
@end
@@ -679,13 +682,26 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
// Only start the run loop if the input queue is empty, otherwise process
// the input first so that the input on queue isn't delayed.
if ([inputQueue count]) {
if ([inputQueue count] || input_available()) {
inputReceived = YES;
} else {
// Wait for the specified amount of time, unless 'milliseconds' is
// negative in which case we wait "forever" (1e6 seconds translates to
// approximately 11 days).
CFTimeInterval dt = (milliseconds >= 0 ? .001*milliseconds : 1e6);
NSTimer *timer = nil;
// Set interval timer which checks for the events of job and channel
// when there is any pending job or channel.
if (dt > 0.1 && (has_any_channel() || has_pending_job())) {
timer = [NSTimer scheduledTimerWithTimeInterval:0.1
target:self
selector:@selector(checkForProcessEvents:)
userInfo:nil
repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:timer
forMode:NSDefaultRunLoopMode];
}
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, dt, true)
== kCFRunLoopRunHandledSource) {
@@ -695,6 +711,11 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
dt = 0.0;
inputReceived = YES;
}
if (input_available())
inputReceived = YES;
[timer invalidate];
}
// The above calls may have placed messages on the input queue so process
@@ -3004,6 +3025,24 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
}
#endif
#ifdef MESSAGE_QUEUE
- (void)checkForProcessEvents:(NSTimer *)timer
{
# ifdef FEAT_TIMERS
did_add_timer = FALSE;
# endif
parse_queued_messages();
if (input_available()
# ifdef FEAT_TIMERS
|| did_add_timer
# endif
)
CFRunLoopStop(CFRunLoopGetCurrent());
}
#endif
@end // MMBackend (Private)
+1
View File
@@ -42,6 +42,7 @@
BOOL cgLayerEnabled;
CGLayerRef cgLayer;
CGContextRef cgLayerContext;
NSLock *cgLayerLock;
// These are used in MMCoreTextView+ToolTip.m
id trackingRectOwner_; // (not retained)
+64 -16
View File
@@ -132,6 +132,10 @@ defaultAdvanceForFont(NSFont *font)
if (!(self = [super initWithFrame:frame]))
return nil;
cgLayerEnabled = [[NSUserDefaults standardUserDefaults]
boolForKey:MMUseCGLayerAlwaysKey];
cgLayerLock = [NSLock new];
// NOTE! It does not matter which font is set here, Vim will set its
// own font on startup anyway. Just set some bogus values.
font = [[NSFont userFixedPitchFontOfSize:0] retain];
@@ -586,18 +590,12 @@ defaultAdvanceForFont(NSFont *font)
NSGraphicsContext *context = [NSGraphicsContext currentContext];
[context setShouldAntialias:antialias];
id data;
NSEnumerator *e = [drawData objectEnumerator];
while ((data = [e nextObject]))
[self batchDrawData:data];
[drawData removeAllObjects];
if (cgLayerEnabled) {
if (cgLayerEnabled && drawData.count == 0) {
// during a live resize, we will have around a stale layer until the
// refresh messages travel back from the vim process. We push the old
// layer in at an offset to get rid of jitter due to lines changing
// position.
[cgLayerLock lock];
CGLayerRef l = [self getCGLayer];
CGSize cgLayerSize = CGLayerGetSize(l);
CGSize frameSize = [self frame].size;
@@ -607,19 +605,46 @@ defaultAdvanceForFont(NSFont *font)
cgLayerSize.width,
cgLayerSize.height);
CGContextDrawLayerInRect([context graphicsPort], drawRect, l);
CGContextRef cgContext = [context graphicsPort];
const NSRect *rects;
long count;
[self getRectsBeingDrawn:&rects count:&count];
int i;
for (i = 0; i < count; i++) {
CGContextSaveGState(cgContext);
CGContextClipToRect(cgContext, rects[i]);
CGContextSetBlendMode(cgContext, kCGBlendModeCopy);
CGContextDrawLayerInRect(cgContext, drawRect, l);
CGContextRestoreGState(cgContext);
}
[cgLayerLock unlock];
} else {
id data;
NSEnumerator *e = [drawData objectEnumerator];
while ((data = [e nextObject]))
[self batchDrawData:data];
[drawData removeAllObjects];
}
}
- (void)performBatchDrawWithData:(NSData *)data
{
[drawData addObject:data];
[self setNeedsDisplay:YES];
if (cgLayerEnabled && drawData.count == 0 && [self getCGContext]) {
[cgLayerLock lock];
[self batchDrawData:data];
[cgLayerLock unlock];
} else {
[drawData addObject:data];
[self setNeedsDisplay:YES];
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
// and columns are changed (due to ipc delays). Force a redraw here.
if ([self inLiveResize])
[self display];
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
// and columns are changed (due to ipc delays). Force a redraw here.
if ([self inLiveResize])
[self display];
}
}
- (void)setCGLayerEnabled:(BOOL)enabled
@@ -642,11 +667,12 @@ defaultAdvanceForFont(NSFont *font)
- (CGLayerRef)getCGLayer
{
NSParameterAssert(cgLayerEnabled);
if (!cgLayer) {
if (!cgLayer && [self lockFocusIfCanDraw]) {
NSGraphicsContext *context = [NSGraphicsContext currentContext];
NSRect frame = [self frame];
cgLayer = CGLayerCreateWithContext(
[context graphicsPort], frame.size, NULL);
[self unlockFocus];
}
return cgLayer;
}
@@ -662,6 +688,18 @@ defaultAdvanceForFont(NSFont *font)
}
}
- (void)setNeedsDisplayCGLayerInRect:(CGRect)rect
{
if (cgLayerEnabled)
[self setNeedsDisplayInRect:rect];
}
- (void)setNeedsDisplayCGLayer:(BOOL)flag
{
if (cgLayerEnabled)
[self setNeedsDisplay:flag];
}
- (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size
{
@@ -978,6 +1016,7 @@ defaultAdvanceForFont(NSFont *font)
operation:NSCompositingOperationSourceOver
fraction:1.0];
}
[self setNeedsDisplayCGLayerInRect:r];
} else if (DrawStringDrawType == type) {
int bg = *((int*)bytes); bytes += sizeof(int);
int fg = *((int*)bytes); bytes += sizeof(int);
@@ -1474,6 +1513,8 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
if (thinStrokes)
CGContextSetFontSmoothingStyle(context, originalFontSmoothingStyle);
CGContextRestoreGState(context);
[self setNeedsDisplayCGLayerInRect:clipRect];
}
- (void)scrollRect:(NSRect)rect lineCount:(int)count
@@ -1487,9 +1528,11 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
// draw self on top of self, offset so as to "scroll" lines vertically
CGContextSaveGState(context);
CGContextClipToRect(context, clipRect);
CGContextSetBlendMode(context, kCGBlendModeCopy);
CGContextDrawLayerAtPoint(
context, CGPointMake(0, -yOffset), [self getCGLayer]);
CGContextRestoreGState(context);
[self setNeedsDisplayCGLayerInRect:clipRect];
} else {
NSSize delta={0, -count * cellSize.height};
[self scrollRect:rect by:delta];
@@ -1544,6 +1587,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
CGContextSetBlendMode(context, kCGBlendModeCopy);
CGContextFillRect(context, *(CGRect*)&rect);
CGContextSetBlendMode(context, kCGBlendModeNormal);
[self setNeedsDisplayCGLayerInRect:rect];
}
- (void)clearAll
@@ -1560,6 +1604,8 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
CGContextSetRGBFillColor(context, r, g, b, a);
CGContextFillRect(context, *(CGRect*)&rect);
CGContextSetBlendMode(context, kCGBlendModeNormal);
[self setNeedsDisplayCGLayer:YES];
}
- (void)drawInsertionPointAtRow:(int)row column:(int)col shape:(int)shape
@@ -1607,6 +1653,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
CGContextFillRect(context, *(CGRect*)&rect);
}
[self setNeedsDisplayCGLayerInRect:rect];
CGContextRestoreGState(context);
}
@@ -1623,6 +1670,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
numColumns:ncols];
CGContextFillRect(cgctx, *(CGRect*)&rect);
[self setNeedsDisplayCGLayerInRect:rect];
CGContextRestoreGState(cgctx);
}
+1
View File
@@ -52,6 +52,7 @@ extern NSString *MMSuppressTerminationAlertKey;
extern NSString *MMNativeFullScreenKey;
extern NSString *MMUseMouseTimeKey;
extern NSString *MMFullScreenFadeTimeKey;
extern NSString *MMUseCGLayerAlwaysKey;
// Enum for MMUntitledWindowKey
+1
View File
@@ -48,6 +48,7 @@ NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
NSString *MMFullScreenFadeTimeKey = @"MMFullScreenFadeTime";
NSString *MMUseCGLayerAlwaysKey = @"MMUseCGLayerAlways";
+22
View File
@@ -13,3 +13,25 @@ set backspace+=indent,eol,start
" the entire MacVim menu is set up in a nib file which currently only is
" translated to English).
set langmenu=none
" Python2
" MacVim uses Homebrew python2 if installed, otherwise configured one
if exists("&pythondll") && exists("&pythonhome")
if filereadable("/usr/local/Frameworks/Python.framework/Versions/2.7/Python")
" Homebrew python 2.7
set pythondll=/usr/local/Frameworks/Python.framework/Versions/2.7/Python
set pythonhome=/usr/local/Frameworks/Python.framework/Versions/2.7
endif
endif
" Python3
" MacVim uses Homebrew python3 if installed, next try to use python.org binary
if exists("&pythonthreedll") && exists("&pythonthreehome") &&
\ !filereadable(&pythonthreedll)
if filereadable("/Library/Frameworks/Python.framework/Versions/3.5/Python")
" https://www.python.org/downloads/mac-osx/
set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.5/Python
set pythonthreehome=/Library/Frameworks/Python.framework/Versions/3.5
endif
endif
+11
View File
@@ -81,6 +81,13 @@ ifndef STATIC_STDCPLUS
STATIC_STDCPLUS=no
endif
# Link against the shared version of libwinpthread by default. Set
# STATIC_WINPTHREAD to "yes" to link against static version instead.
ifndef STATIC_WINPTHREAD
STATIC_WINPTHREAD=$(STATIC_STDCPLUS)
endif
# If the user doesn't want gettext, undefine it.
ifeq (no, $(GETTEXT))
GETTEXT=
@@ -817,6 +824,10 @@ LIB += -lstdc++
endif
endif
ifeq (yes, $(STATIC_WINPTHREAD))
LIB += -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic
endif
all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
vimrun.exe: vimrun.c
-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:
+37 -7
View File
@@ -1695,27 +1695,42 @@ 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
JSON_TEST_OBJ = $(OBJ_COMMON) \
OBJ = $(OBJ_COMMON) $(OBJ_MAIN)
OBJ_JSON_TEST = \
objects/memfile.o \
objects/message.o \
objects/json_test.o
MEMFILE_TEST_OBJ = $(OBJ_COMMON) \
JSON_TEST_OBJ = $(OBJ_COMMON) $(OBJ_JSON_TEST)
OBJ_MEMFILE_TEST = \
objects/json.o \
objects/message.o \
objects/memfile_test.o
MESSAGE_TEST_OBJ = $(OBJ_COMMON) \
MEMFILE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MEMFILE_TEST)
OBJ_MESSAGE_TEST = \
objects/json.o \
objects/memfile.o \
objects/message_test.o
MESSAGE_TEST_OBJ = $(OBJ_COMMON) $(OBJ_MESSAGE_TEST)
ALL_OBJ = $(OBJ_COMMON) \
$(OBJ_MAIN) \
$(OBJ_JSON_TEST) \
$(OBJ_MEMFILE_TEST) \
$(OBJ_MESSAGE_TEST)
PRO_AUTO = \
arabic.pro \
blowfish.pro \
@@ -2069,7 +2084,7 @@ test1 \
test60 test64 test65 test66 test67 test68 test69 \
test70 test72 test73 test74 test75 test77 test78 test79 \
test80 test82 test83 test84 test85 test86 test87 test88 test89 \
test90 test91 test92 test93 test94 test95 test97 test98 test99 \
test90 test91 test94 test95 test97 test98 test99 \
test100 test101 test103 test104 test107 test108:
cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
@@ -2093,6 +2108,8 @@ test_arglist \
test_delete \
test_diffmode \
test_digraph \
test_functions \
test_display \
test_ex_undo \
test_execute_func \
test_expand \
@@ -2105,8 +2122,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 \
@@ -2135,6 +2154,8 @@ test_arglist \
test_matchadd_conceal_utf8 \
test_menu \
test_messages \
test_mksession \
test_mksession_utf8 \
test_nested_function \
test_netbeans \
test_normal \
@@ -2162,6 +2183,7 @@ test_arglist \
test_substitute \
test_syn_attr \
test_syntax \
test_system \
test_tabline \
test_tabpage \
test_tagcase \
@@ -2868,8 +2890,16 @@ 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:
mkdir objects
objects: objects/.dirstamp
objects/.dirstamp:
mkdir -p objects
touch objects/.dirstamp
# All object files depend on the objects directory, so that parallel make
# works. Can't depend on the directory itself, its timestamp changes all the
# time.
$(ALL_OBJ): objects/.dirstamp
objects/MMBackend.o: MacVim/MMBackend.m
$(CCC) -fobjc-exceptions -o $@ MacVim/MMBackend.m
+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 \
+2 -2
View File
@@ -4868,8 +4868,8 @@ do_arg_all(
wpnext = wp->w_next;
buf = wp->w_buffer;
if (buf->b_ffname == NULL
|| (!keep_tabs && buf->b_nwindows > 1)
|| wp->w_width != Columns)
|| (!keep_tabs && (buf->b_nwindows > 1
|| wp->w_width != Columns)))
i = opened_len;
else
{
+152 -19
View File
@@ -1216,6 +1216,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
if (opt->jo_set & JO_CLOSE_CALLBACK)
set_callback(&channel->ch_close_cb, &channel->ch_close_partial,
opt->jo_close_cb, opt->jo_close_partial);
channel->ch_drop_never = opt->jo_drop_never;
if ((opt->jo_set & JO_OUT_IO) && opt->jo_io[PART_OUT] == JIO_BUFFER)
{
@@ -1587,7 +1588,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;
@@ -1916,9 +1917,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
@@ -1939,6 +1943,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
clear_tv(&listtv);
else
{
item->jq_no_callback = FALSE;
item->jq_value = alloc_tv();
if (item->jq_value == NULL)
{
@@ -2071,11 +2076,17 @@ remove_json_node(jsonq_T *head, jsonq_T *node)
* When "id" is positive it must match the first number in the list.
* When "id" is zero or negative jut get the first message. But not the one
* with id ch_block_id.
* When "without_callback" is TRUE also get messages that were pushed back.
* Return OK when found and return the value in "rettv".
* Return FAIL otherwise.
*/
static int
channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
channel_get_json(
channel_T *channel,
ch_part_T part,
int id,
int without_callback,
typval_T **rettv)
{
jsonq_T *head = &channel->ch_part[part].ch_json_head;
jsonq_T *item = head->jq_next;
@@ -2085,10 +2096,11 @@ channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
list_T *l = item->jq_value->vval.v_list;
typval_T *tv = &l->lv_first->li_tv;
if ((id > 0 && tv->v_type == VAR_NUMBER && tv->vval.v_number == id)
if ((without_callback || !item->jq_no_callback)
&& ((id > 0 && tv->v_type == VAR_NUMBER && tv->vval.v_number == id)
|| (id <= 0 && (tv->v_type != VAR_NUMBER
|| tv->vval.v_number == 0
|| tv->vval.v_number != channel->ch_part[part].ch_block_id)))
|| tv->vval.v_number != channel->ch_part[part].ch_block_id))))
{
*rettv = item->jq_value;
if (tv->v_type == VAR_NUMBER)
@@ -2101,6 +2113,65 @@ channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
return FAIL;
}
/*
* Put back "rettv" into the JSON queue, there was no callback for it.
* Takes over the values in "rettv".
*/
static void
channel_push_json(channel_T *channel, ch_part_T part, typval_T *rettv)
{
jsonq_T *head = &channel->ch_part[part].ch_json_head;
jsonq_T *item = head->jq_next;
jsonq_T *newitem;
if (head->jq_prev != NULL && head->jq_prev->jq_no_callback)
/* last item was pushed back, append to the end */
item = NULL;
else while (item != NULL && item->jq_no_callback)
/* append after the last item that was pushed back */
item = item->jq_next;
newitem = (jsonq_T *)alloc((unsigned)sizeof(jsonq_T));
if (newitem == NULL)
clear_tv(rettv);
else
{
newitem->jq_value = alloc_tv();
if (newitem->jq_value == NULL)
{
vim_free(newitem);
clear_tv(rettv);
}
else
{
newitem->jq_no_callback = FALSE;
*newitem->jq_value = *rettv;
if (item == NULL)
{
/* append to the end */
newitem->jq_prev = head->jq_prev;
head->jq_prev = newitem;
newitem->jq_next = NULL;
if (newitem->jq_prev == NULL)
head->jq_next = newitem;
else
newitem->jq_prev->jq_next = newitem;
}
else
{
/* append after "item" */
newitem->jq_prev = item;
newitem->jq_next = item->jq_next;
item->jq_next = newitem;
if (newitem->jq_next == NULL)
head->jq_prev = newitem;
else
newitem->jq_next->jq_prev = newitem;
}
}
}
}
#define CH_JSON_MAX_ARGS 4
/*
@@ -2431,11 +2502,11 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
int argc = 0;
/* Get any json message in the queue. */
if (channel_get_json(channel, part, -1, &listtv) == FAIL)
if (channel_get_json(channel, part, -1, FALSE, &listtv) == FAIL)
{
/* Parse readahead, return when there is still no message. */
channel_parse_json(channel, part);
if (channel_get_json(channel, part, -1, &listtv) == FAIL)
if (channel_get_json(channel, part, -1, FALSE, &listtv) == FAIL)
return FALSE;
}
@@ -2475,7 +2546,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
{
/* If there is a close callback it may use ch_read() to get the
* messages. */
if (channel->ch_close_cb == NULL)
if (channel->ch_close_cb == NULL && !channel->ch_drop_never)
drop_messages(channel, part);
return FALSE;
}
@@ -2552,7 +2623,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
{
int done = FALSE;
/* invoke the one-time callback with the matching nr */
/* JSON or JS mode: invoke the one-time callback with the matching nr */
for (cbitem = cbhead->cq_next; cbitem != NULL; cbitem = cbitem->cq_next)
if (cbitem->cq_seq_nr == seq_nr)
{
@@ -2561,7 +2632,17 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
break;
}
if (!done)
ch_logn(channel, "Dropping message %d without callback", seq_nr);
{
if (channel->ch_drop_never)
{
/* message must be read with ch_read() */
channel_push_json(channel, part, listtv);
listtv = NULL;
}
else
ch_logn(channel, "Dropping message %d without callback",
seq_nr);
}
}
else if (callback != NULL || buffer != NULL)
{
@@ -2588,7 +2669,7 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
}
}
else
ch_log(channel, "Dropping message");
ch_logn(channel, "Dropping message %d", seq_nr);
if (listtv != NULL)
free_tv(listtv);
@@ -2624,7 +2705,7 @@ channel_is_open(channel_T *channel)
/*
* Return TRUE if "channel" has JSON or other typeahead.
*/
static int
int
channel_has_readahead(channel_T *channel, ch_part_T part)
{
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
@@ -2813,9 +2894,10 @@ channel_close(channel_T *channel, int invoke_close_cb)
redraw_after_callback();
}
/* any remaining messages are useless now */
for (part = PART_SOCK; part < PART_IN; ++part)
drop_messages(channel, part);
if (!channel->ch_drop_never)
/* any remaining messages are useless now */
for (part = PART_SOCK; part < PART_IN; ++part)
drop_messages(channel, part);
}
channel->ch_nb_close_cb = NULL;
@@ -3112,9 +3194,9 @@ ch_close_part_on_error(
channel_close_now(channel_T *channel)
{
ch_log(channel, "Closing channel because all readable fds are closed");
channel_close(channel, TRUE);
if (channel->ch_nb_close_cb != NULL)
(*channel->ch_nb_close_cb)();
channel_close(channel, TRUE);
}
/*
@@ -3268,7 +3350,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
* When "id" is -1 accept any message;
* Blocks until the message is received or the timeout is reached.
*/
int
static int
channel_read_json_block(
channel_T *channel,
ch_part_T part,
@@ -3289,7 +3371,7 @@ channel_read_json_block(
more = channel_parse_json(channel, part);
/* search for message "id" */
if (channel_get_json(channel, part, id, rettv) == OK)
if (channel_get_json(channel, part, id, TRUE, rettv) == OK)
{
chanpart->ch_block_id = 0;
return OK;
@@ -3840,6 +3922,11 @@ channel_parse_messages(void)
int ret = FALSE;
int r;
ch_part_T part = PART_SOCK;
#ifdef ELAPSED_FUNC
ELAPSED_TYPE start_tv;
ELAPSED_INIT(start_tv);
#endif
++safe_to_invoke_callback;
@@ -3884,7 +3971,14 @@ channel_parse_messages(void)
r = may_invoke_callback(channel, part);
if (r == OK)
ret = TRUE;
if (channel_unref(channel) || r == OK)
if (channel_unref(channel) || (r == OK
#ifdef ELAPSED_FUNC
/* Limit the time we loop here to 100 msec, otherwise
* Vim becomes unresponsive when the callback takes
* more than a bit of time. */
&& ELAPSED_FUNC(start_tv) < 100L
#endif
))
{
/* channel was freed or something was done, start over */
channel = first_channel;
@@ -3912,6 +4006,31 @@ channel_parse_messages(void)
return ret;
}
/*
* Return TRUE if any channel has readahead. That means we should not block on
* waiting for input.
*/
int
channel_any_readahead(void)
{
channel_T *channel = first_channel;
ch_part_T part = PART_SOCK;
while (channel != NULL)
{
if (channel_has_readahead(channel, part))
return TRUE;
if (part < PART_ERR)
++part;
else
{
channel = channel->ch_next;
part = PART_SOCK;
}
}
return FALSE;
}
/*
* Mark references to lists used in channels.
*/
@@ -4278,6 +4397,20 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
return FAIL;
}
}
else if (STRCMP(hi->hi_key, "drop") == 0)
{
int never = FALSE;
val = get_tv_string(item);
if (STRCMP(val, "never") == 0)
never = TRUE;
else if (STRCMP(val, "auto") != 0)
{
EMSG2(_(e_invarg2), "drop");
return FAIL;
}
opt->jo_drop_never = never;
}
else if (STRCMP(hi->hi_key, "exit_cb") == 0)
{
if (!(supported & JO_EXIT_CB))
+1 -1
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
-2
View File
@@ -154,7 +154,6 @@
#undef BAD_GETCWD
/* Define if you the function: */
#undef HAVE_BCMP
#undef HAVE_FCHDIR
#undef HAVE_FCHOWN
#undef HAVE_FSEEKO
@@ -170,7 +169,6 @@
#undef HAVE_ICONV
#undef HAVE_NL_LANGINFO_CODESET
#undef HAVE_LSTAT
#undef HAVE_MEMCMP
#undef HAVE_MEMSET
#undef HAVE_MKDTEMP
#undef HAVE_NANOSLEEP
+10 -4
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. */
@@ -3673,8 +3679,8 @@ fi
dnl Check for functions in one big call, to reduce the size of configure.
dnl Can only be used for functions that do not require any include.
AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
AC_CHECK_FUNCS(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 \
+1 -1
View File
@@ -3889,7 +3889,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)
+17 -1
View File
@@ -270,7 +270,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);
@@ -5971,6 +5971,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);
+72 -15
View File
@@ -76,6 +76,7 @@ static void f_call(typval_T *argvars, typval_T *rettv);
static void f_ceil(typval_T *argvars, typval_T *rettv);
#endif
#ifdef FEAT_JOB_CHANNEL
static void f_ch_canread(typval_T *argvars, typval_T *rettv);
static void f_ch_close(typval_T *argvars, typval_T *rettv);
static void f_ch_close_in(typval_T *argvars, typval_T *rettv);
static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
@@ -470,7 +471,7 @@ static struct fst
{"assert_exception", 1, 2, f_assert_exception},
{"assert_fails", 1, 2, f_assert_fails},
{"assert_false", 1, 2, f_assert_false},
{"assert_inrange", 2, 3, f_assert_inrange},
{"assert_inrange", 3, 4, f_assert_inrange},
{"assert_match", 2, 3, f_assert_match},
{"assert_notequal", 2, 3, f_assert_notequal},
{"assert_notmatch", 2, 3, f_assert_notmatch},
@@ -499,6 +500,7 @@ static struct fst
{"ceil", 1, 1, f_ceil},
#endif
#ifdef FEAT_JOB_CHANNEL
{"ch_canread", 1, 1, f_ch_canread},
{"ch_close", 1, 1, f_ch_close},
{"ch_close_in", 1, 1, f_ch_close_in},
{"ch_evalexpr", 2, 3, f_ch_evalexpr},
@@ -1778,6 +1780,21 @@ f_ceil(typval_T *argvars, typval_T *rettv)
#endif
#ifdef FEAT_JOB_CHANNEL
/*
* "ch_canread()" function
*/
static void
f_ch_canread(typval_T *argvars, typval_T *rettv)
{
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
rettv->vval.v_number = 0;
if (channel != NULL)
rettv->vval.v_number = channel_has_readahead(channel, PART_SOCK)
|| channel_has_readahead(channel, PART_OUT)
|| channel_has_readahead(channel, PART_ERR);
}
/*
* "ch_close()" function
*/
@@ -3956,7 +3973,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);
@@ -5978,6 +5996,10 @@ f_has(typval_T *argvars, typval_T *rettv)
}
else if (STRICMP(name, "vim_starting") == 0)
n = (starting != 0);
else if (STRICMP(name, "ttyin") == 0)
n = mch_input_isatty();
else if (STRICMP(name, "ttyout") == 0)
n = stdout_isatty;
#ifdef FEAT_MBYTE
else if (STRICMP(name, "multi_byte_encoding") == 0)
n = has_mbyte;
@@ -6815,8 +6837,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);
}
/*
@@ -9514,15 +9535,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;
@@ -11072,10 +11093,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
@@ -11090,6 +11114,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)
{
@@ -11102,7 +11127,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)
{
@@ -11112,7 +11138,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
@@ -11822,7 +11852,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;
@@ -11836,7 +11865,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)
@@ -11851,14 +11880,42 @@ 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);
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)
+2 -1
View File
@@ -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;
+42 -15
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:
@@ -4379,7 +4395,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 +4672,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 +7615,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
@@ -9319,7 +9346,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;
+4 -5
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". */
@@ -6915,9 +6916,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 +6963,7 @@ ex_window(void)
# endif
/* Restore the command line info. */
ccline = save_ccline;
restore_cmdline(&save_ccline);
cmdwin_type = 0;
exmode_active = save_exmode;
+10 -11
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 */
@@ -2009,7 +2008,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)
+2
View File
@@ -643,6 +643,8 @@ EXTERN int exiting INIT(= FALSE);
EXTERN int really_exiting INIT(= FALSE);
/* TRUE when we are sure to exit, e.g., after
* a deadly signal */
EXTERN int stdout_isatty INIT(= TRUE); /* is stdout a terminal? */
#if defined(FEAT_AUTOCHDIR)
EXTERN int test_autochdir INIT(= FALSE);
#endif
+3
View File
@@ -51,6 +51,9 @@
# ifdef _
# undef _
# endif
# ifdef ngettext
# undef ngettext
# endif
# ifdef N_
# undef N_
# endif
+13 -2
View File
@@ -35,6 +35,9 @@
# ifdef _
# undef _
# endif
# ifdef ngettext
# undef ngettext
# endif
# ifdef N_
# undef N_
# endif
@@ -3102,7 +3105,7 @@ drawarea_configure_event_cb(GtkWidget *widget,
g_return_val_if_fail(event
&& event->width >= 1 && event->height >= 1, TRUE);
# if GTK_CHECK_VERSION(3,22,2)
# if GTK_CHECK_VERSION(3,22,2) && !GTK_CHECK_VERSION(3,22,4)
/* As of 3.22.2, GdkWindows have started distributing configure events to
* their "native" children (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=12579fe71b3b8f79eb9c1b80e429443bcc437dd0).
*
@@ -3123,6 +3126,10 @@ drawarea_configure_event_cb(GtkWidget *widget,
* implementation details. Therefore, watch out any relevant internal
* changes happening in GTK in the feature (sigh).
*/
/* Follow-up
* After a few weeks later, the GdkWindow change mentioned above was
* reverted (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=f70039cb9603a02d2369fec4038abf40a1711155).
* The corresponding official release is 3.22.4. */
if (event->send_event == FALSE)
return TRUE;
# endif
@@ -4492,7 +4499,7 @@ form_configure_event(GtkWidget *widget UNUSED,
{
int usable_height = event->height;
#if GTK_CHECK_VERSION(3,22,2)
#if GTK_CHECK_VERSION(3,22,2) && !GTK_CHECK_VERSION(3,22,4)
/* As of 3.22.2, GdkWindows have started distributing configure events to
* their "native" children (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=12579fe71b3b8f79eb9c1b80e429443bcc437dd0).
*
@@ -4508,6 +4515,10 @@ form_configure_event(GtkWidget *widget UNUSED,
* To filter out such fallacious events, check if the given event is the
* one that was sent out to the right place. Ignore it if not.
*/
/* Follow-up
* After a few weeks later, the GdkWindow change mentioned above was
* reverted (https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=f70039cb9603a02d2369fec4038abf40a1711155).
* The corresponding official release is 3.22.4. */
if (event->window != gtk_widget_get_window(gui.formwin))
return TRUE;
#endif
+39 -27
View File
@@ -2297,19 +2297,24 @@ GetTextWidthEnc(HDC hdc, char_u *str, int len)
# define GetTextWidthEnc(h, s, l) GetTextWidth((h), (s), (l))
#endif
static void get_work_area(RECT *spi_rect);
/*
* A quick little routine that will center one window over another, handy for
* dialog boxes. Taken from the Win32SDK samples.
* dialog boxes. Taken from the Win32SDK samples and modified for multiple
* monitors.
*/
static BOOL
CenterWindow(
HWND hwndChild,
HWND hwndParent)
{
RECT rChild, rParent;
int wChild, hChild, wParent, hParent;
int wScreen, hScreen, xNew, yNew;
HDC hdc;
HMONITOR mon;
MONITORINFO moninfo;
RECT rChild, rParent, rScreen;
int wChild, hChild, wParent, hParent;
int xNew, yNew;
HDC hdc;
GetWindowRect(hwndChild, &rChild);
wChild = rChild.right - rChild.left;
@@ -2317,32 +2322,39 @@ CenterWindow(
/* If Vim is minimized put the window in the middle of the screen. */
if (hwndParent == NULL || IsMinimized(hwndParent))
SystemParametersInfo(SPI_GETWORKAREA, 0, &rParent, 0);
get_work_area(&rParent);
else
GetWindowRect(hwndParent, &rParent);
wParent = rParent.right - rParent.left;
hParent = rParent.bottom - rParent.top;
hdc = GetDC(hwndChild);
wScreen = GetDeviceCaps (hdc, HORZRES);
hScreen = GetDeviceCaps (hdc, VERTRES);
ReleaseDC(hwndChild, hdc);
xNew = rParent.left + ((wParent - wChild) /2);
if (xNew < 0)
moninfo.cbSize = sizeof(MONITORINFO);
mon = MonitorFromWindow(hwndChild, MONITOR_DEFAULTTOPRIMARY);
if (mon != NULL && GetMonitorInfo(mon, &moninfo))
{
xNew = 0;
rScreen = moninfo.rcWork;
}
else if ((xNew+wChild) > wScreen)
else
{
xNew = wScreen - wChild;
hdc = GetDC(hwndChild);
rScreen.left = 0;
rScreen.top = 0;
rScreen.right = GetDeviceCaps(hdc, HORZRES);
rScreen.bottom = GetDeviceCaps(hdc, VERTRES);
ReleaseDC(hwndChild, hdc);
}
yNew = rParent.top + ((hParent - hChild) /2);
if (yNew < 0)
yNew = 0;
else if ((yNew+hChild) > hScreen)
yNew = hScreen - hChild;
xNew = rParent.left + ((wParent - wChild) / 2);
if (xNew < rScreen.left)
xNew = rScreen.left;
else if ((xNew + wChild) > rScreen.right)
xNew = rScreen.right - wChild;
yNew = rParent.top + ((hParent - hChild) / 2);
if (yNew < rScreen.top)
yNew = rScreen.top;
else if ((yNew + hChild) > rScreen.bottom)
yNew = rScreen.bottom - hChild;
return SetWindowPos(hwndChild, NULL, xNew, yNew, 0, 0,
SWP_NOSIZE | SWP_NOZORDER);
@@ -3539,12 +3551,12 @@ gui_mch_browseW(
filterp = convert_filterW(filter);
vim_memset(&fileStruct, 0, sizeof(OPENFILENAMEW));
#ifdef OPENFILENAME_SIZE_VERSION_400W
# ifdef OPENFILENAME_SIZE_VERSION_400W
/* be compatible with Windows NT 4.0 */
fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W;
#else
# else
fileStruct.lStructSize = sizeof(fileStruct);
#endif
# endif
if (title != NULL)
titlep = enc_to_utf16(title, NULL);
@@ -3581,10 +3593,10 @@ gui_mch_browseW(
* Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog.
*/
fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY);
#ifdef FEAT_SHORTCUT
# ifdef FEAT_SHORTCUT
if (curbuf->b_p_bin)
fileStruct.Flags |= OFN_NODEREFERENCELINKS;
#endif
# endif
if (saving)
{
if (!GetSaveFileNameW(&fileStruct))
@@ -5559,7 +5571,7 @@ get_work_area(RECT *spi_rect)
MONITORINFO moninfo;
/* work out which monitor the window is on, and get *it's* work area */
mon = MonitorFromWindow(s_hwnd, 1 /*MONITOR_DEFAULTTOPRIMARY*/);
mon = MonitorFromWindow(s_hwnd, MONITOR_DEFAULTTOPRIMARY);
if (mon != NULL)
{
moninfo.cbSize = sizeof(MONITORINFO);
+9 -5
View File
@@ -933,13 +933,17 @@ Python_Init(void)
EMSG(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
goto fail;
}
#endif
#ifdef PYTHON_HOME
# ifdef DYNAMIC_PYTHON
if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
# endif
if (p_pyhome && *p_pyhome != '\0')
Py_SetPythonHome((char *)p_pyhome);
# ifdef PYTHON_HOME
else if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
Py_SetPythonHome(PYTHON_HOME);
# endif
#else
# ifdef PYTHON_HOME
Py_SetPythonHome(PYTHON_HOME);
# endif
#endif
init_structs();
+19 -5
View File
@@ -860,12 +860,26 @@ Python3_Init(void)
init_structs();
#ifdef PYTHON3_HOME
# ifdef DYNAMIC_PYTHON3
if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
# endif
#ifdef DYNAMIC_PYTHON3
if (*p_py3home != '\0')
{
int len;
wchar_t *buf;
len = mbstowcs(NULL, (char *)p_py3home, 0) + 1;
buf = (wchar_t *)alloc(len * sizeof(wchar_t));
if (buf && mbstowcs(buf, (char *)p_py3home, len) != (size_t)-1) {
Py_SetPythonHome(buf);
/* We must keep buf for Py_SetPythonHome */
}
}
# ifdef PYTHON3_HOME
else if (mch_getenv((char_u *)"PYTHONHOME") == NULL)
Py_SetPythonHome(PYTHON3_HOME);
# endif
#else
# ifdef PYTHON3_HOME
Py_SetPythonHome(PYTHON3_HOME);
# endif
#endif
PyImport_AppendInittab("vim", Py3Init_vim);
+2 -1
View File
@@ -523,9 +523,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},
+431 -292
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,438 @@ 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;
cur_item->v_type = VAR_STRING;
cur_item->vval.v_string = vim_strnsave(key, (int)(p - key));
reader->js_used += (int)(p - key);
top_item->jd_key = cur_item->vval.v_string;
}
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(_("E937: 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 +1016,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;
}
+1 -1
View File
@@ -181,7 +181,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
+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)
+10 -4
View File
@@ -1036,7 +1036,7 @@ common_init(mparm_T *paramp)
* (needed for :! to * work). mch_check_win() will also handle the -d or
* -dev argument.
*/
paramp->stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != FAIL);
stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != FAIL);
TIME_MSG("window checked");
/*
@@ -1906,6 +1906,7 @@ command_line_scan(mparm_T *parmp)
/* "--literal" take files literally */
/* "--nofork" don't fork */
/* "--not-a-term" don't warn for not a term */
/* "--ttyfail" exit if not a term */
/* "--noplugin[s]" skip plugins */
/* "--cmd <cmd>" execute cmd before vimrc */
if (STRICMP(argv[0] + argv_idx, "help") == 0)
@@ -1935,6 +1936,8 @@ command_line_scan(mparm_T *parmp)
p_lpl = FALSE;
else if (STRNICMP(argv[0] + argv_idx, "not-a-term", 10) == 0)
parmp->not_a_term = TRUE;
else if (STRNICMP(argv[0] + argv_idx, "ttyfail", 7) == 0)
parmp->tty_fail = TRUE;
else if (STRNICMP(argv[0] + argv_idx, "cmd", 3) == 0)
{
want_argument = TRUE;
@@ -2573,7 +2576,7 @@ check_tty(mparm_T *parmp)
if (!input_isatty)
silent_mode = TRUE;
}
else if (parmp->want_full_screen && (!parmp->stdout_isatty || !input_isatty)
else if (parmp->want_full_screen && (!stdout_isatty || !input_isatty)
#ifdef FEAT_GUI
/* don't want the delay when started from the desktop */
&& !gui.starting
@@ -2588,7 +2591,7 @@ check_tty(mparm_T *parmp)
* input buffer so fast I can't even kill the process in under 2
* minutes (and it beeps continuously the whole time :-)
*/
if (netbeans_active() && (!parmp->stdout_isatty || !input_isatty))
if (netbeans_active() && (!stdout_isatty || !input_isatty))
{
mch_errmsg(_("Vim: Error: Failure to start gvim from NetBeans\n"));
exit(1);
@@ -2601,11 +2604,13 @@ check_tty(mparm_T *parmp)
exit(1);
}
#endif
if (!parmp->stdout_isatty)
if (!stdout_isatty)
mch_errmsg(_("Vim: Warning: Output is not to a terminal\n"));
if (!input_isatty)
mch_errmsg(_("Vim: Warning: Input is not from a terminal\n"));
out_flush();
if (parmp->tty_fail && (!stdout_isatty || !input_isatty))
exit(1);
if (scriptin[0] == NULL)
ui_delay(2000L, TRUE);
TIME_MSG("Warning delay");
@@ -3371,6 +3376,7 @@ usage(void)
#endif
main_msg(_("-T <terminal>\tSet terminal type to <terminal>"));
main_msg(_("--not-a-term\t\tSkip warning for input/output not being a terminal"));
main_msg(_("--ttyfail\t\tExit if input or output is not a terminal"));
main_msg(_("-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"));
#ifdef FEAT_GUI
main_msg(_("-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"));
+1 -1
View File
@@ -5807,7 +5807,7 @@ static char e_xim[] = N_("E285: Failed to create input context");
#endif
#if defined(FEAT_GUI_X11) || defined(PROTO)
# if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(sun)
# if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(SUN_SYSTEM)
# define USE_X11R6_XIM
# endif
+24 -1
View File
@@ -42,6 +42,9 @@ static int confirm_msg_used = FALSE; /* displaying confirm_msg */
static char_u *confirm_msg = NULL; /* ":confirm" message */
static char_u *confirm_msg_tail; /* tail of confirm_msg */
#endif
#ifdef FEAT_JOB_CHANNEL
static int emsg_to_channel_log = FALSE;
#endif
struct msg_hist
{
@@ -166,6 +169,14 @@ msg_attr_keep(
&& STRCMP(s, last_msg_hist->msg)))
add_msg_hist(s, -1, attr);
#ifdef FEAT_JOB_CHANNEL
if (emsg_to_channel_log)
{
/* Write message in the channel log. */
ch_logs(NULL, "ERROR: %s", (char *)s);
}
#endif
/* When displaying keep_msg, don't let msg_start() free it, caller must do
* that. */
if (s == keep_msg)
@@ -556,6 +567,7 @@ emsg(char_u *s)
{
int attr;
char_u *p;
int r;
#ifdef FEAT_EVAL
int ignore = FALSE;
int severe;
@@ -624,6 +636,9 @@ emsg(char_u *s)
}
redir_write(s, -1);
}
#ifdef FEAT_JOB_CHANNEL
ch_logs(NULL, "ERROR: %s", (char *)s);
#endif
return TRUE;
}
@@ -650,6 +665,9 @@ emsg(char_u *s)
* and a redraw is expected because
* msg_scrolled is non-zero */
#ifdef FEAT_JOB_CHANNEL
emsg_to_channel_log = TRUE;
#endif
/*
* Display name and line number for the source of the error.
*/
@@ -659,7 +677,12 @@ emsg(char_u *s)
* Display the error message itself.
*/
msg_nowait = FALSE; /* wait for this msg */
return msg_attr(s, attr);
r = msg_attr(s, attr);
#ifdef FEAT_JOB_CHANNEL
emsg_to_channel_log = FALSE;
#endif
return r;
}
+19 -11
View File
@@ -5428,7 +5428,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 +6007,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 +6037,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 +7402,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 +7815,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 +7857,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 +7975,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 +8152,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 +8873,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 +8974,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
+31 -22
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
@@ -1740,27 +1740,6 @@ vim_memset(void *ptr, int c, size_t size)
}
#endif
#ifdef VIM_MEMCMP
/*
* Return zero when "b1" and "b2" are the same for "len" bytes.
* Return non-zero otherwise.
*/
int
vim_memcmp(void *b1, void *b2, size_t len)
{
char_u *p1 = (char_u *)b1, *p2 = (char_u *)b2;
for ( ; len > 0; --len)
{
if (*p1 != *p2)
return 1;
++p1;
++p2;
}
return 0;
}
#endif
/* skipped when generating prototypes, the prototype is in vim.h */
#ifdef VIM_MEMMOVE
/*
@@ -6269,3 +6248,33 @@ parse_queued_messages(void)
# endif
}
#endif
#ifndef PROTO /* proto is defined in vim.h */
# ifdef ELAPSED_TIMEVAL
/*
* Return time in msec since "start_tv".
*/
long
elapsed(struct timeval *start_tv)
{
struct timeval now_tv;
gettimeofday(&now_tv, NULL);
return (now_tv.tv_sec - start_tv->tv_sec) * 1000L
+ (now_tv.tv_usec - start_tv->tv_usec) / 1000L;
}
# endif
# ifdef ELAPSED_TICKCOUNT
/*
* Return time in msec since "start_tick".
*/
long
elapsed(DWORD start_tick)
{
DWORD now = GetTickCount();
return (long)now - (long)start_tick;
}
# endif
#endif
+8 -5
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
+37 -19
View File
@@ -441,8 +441,8 @@ struct vimoption
/* when option changed, what to display: */
#define P_RSTAT 0x1000 /* redraw status lines */
#define P_RWIN 0x2000 /* redraw current window */
#define P_RBUF 0x4000 /* redraw current buffer */
#define P_RWIN 0x2000 /* redraw current window and recompute text */
#define P_RBUF 0x4000 /* redraw current buffer and recompute text */
#define P_RALL 0x6000 /* redraw all windows */
#define P_RCLR 0x7000 /* clear and redraw all */
@@ -458,10 +458,12 @@ struct vimoption
#define P_NFNAME 0x400000L /* only normal file name chars allowed */
#define P_INSECURE 0x800000L /* option was set from a modeline */
#define P_PRI_MKRC 0x1000000L /* priority for :mkvimrc (setting option has
side effects) */
side effects) */
#define P_NO_ML 0x2000000L /* not allowed in modeline */
#define P_CURSWANT 0x4000000L /* update curswant required; not needed when
* there is a redraw flag */
#define P_NDNAME 0x8000000L /* only normal dir name chars allowed */
#define P_RWINONLY 0x10000000L /* only redraw current window */
#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
@@ -978,7 +980,7 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN,
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWINONLY,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUL,
#else
@@ -1004,7 +1006,7 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"dictionary", "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
{"dictionary", "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
#ifdef FEAT_INS_EXPAND
(char_u *)&p_dict, PV_DICT,
#else
@@ -2111,7 +2113,7 @@ static struct vimoption options[] =
{(char_u *)NULL, (char_u *)0L}
#endif
SCRIPTID_INIT},
{"printexpr", "pexpr", P_STRING|P_VI_DEF,
{"printexpr", "pexpr", P_STRING|P_VI_DEF|P_SECURE,
#ifdef FEAT_POSTSCRIPT
(char_u *)&p_pexpr, PV_NONE,
{(char_u *)"", (char_u *)0L}
@@ -2186,12 +2188,20 @@ static struct vimoption options[] =
(char_u *)&p_py3dll, PV_NONE,
{(char_u *)DYNAMIC_PYTHON3_DLL, (char_u *)0L}
SCRIPTID_INIT},
{"pythonthreehome", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
(char_u *)&p_py3home, PV_NONE,
{(char_u *)"", (char_u *)0L}
SCRIPTID_INIT},
#endif
#if defined(DYNAMIC_PYTHON)
{"pythondll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
(char_u *)&p_pydll, PV_NONE,
{(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L}
SCRIPTID_INIT},
{"pythonhome", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
(char_u *)&p_pyhome, PV_NONE,
{(char_u *)"", (char_u *)0L}
SCRIPTID_INIT},
#endif
{"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF,
#ifdef FEAT_TEXTOBJ
@@ -2712,7 +2722,7 @@ static struct vimoption options[] =
{"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
(char_u *)&p_tw, PV_TW,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
#ifdef FEAT_INS_EXPAND
(char_u *)&p_tsr, PV_TSR,
#else
@@ -5961,11 +5971,15 @@ did_set_string_option(
errmsg = e_secure;
}
/* Check for a "normal" file name in some options. Disallow a path
* separator (slash and/or backslash), wildcards and characters that are
* often illegal in a file name. */
else if ((options[opt_idx].flags & P_NFNAME)
&& vim_strpbrk(*varp, (char_u *)"/\\*?[|<>") != NULL)
/* Check for a "normal" directory or file name in some options. Disallow a
* path separator (slash and/or backslash), wildcards and characters that
* are often illegal in a file name. Be more permissive if "secure" is off.
*/
else if (((options[opt_idx].flags & P_NFNAME)
&& vim_strpbrk(*varp, (char_u *)(secure
? "/\\*?[|;&<>\r\n" : "/\\*?[<>\r\n")) != NULL)
|| ((options[opt_idx].flags & P_NDNAME)
&& vim_strpbrk(*varp, (char_u *)"*?[|;&<>\r\n") != NULL))
{
errmsg = e_invarg;
}
@@ -7111,6 +7125,7 @@ did_set_string_option(
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
/* 'toolbar' */
else if (varp == &p_toolbar)
{
if (opt_strings_flags(p_toolbar, p_toolbar_values,
@@ -7335,6 +7350,7 @@ did_set_string_option(
#endif
#if defined(FEAT_RENDER_OPTIONS)
/* 'renderoptions' */
else if (varp == &p_rop && gui.in_use)
{
if (!gui_mch_set_rendering_options(p_rop))
@@ -7362,19 +7378,19 @@ did_set_string_option(
else
{
p = NULL;
if (varp == &p_ww)
if (varp == &p_ww) /* 'whichwrap' */
p = (char_u *)WW_ALL;
if (varp == &p_shm)
if (varp == &p_shm) /* 'shortmess' */
p = (char_u *)SHM_ALL;
else if (varp == &(p_cpo))
else if (varp == &(p_cpo)) /* 'cpoptions' */
p = (char_u *)CPO_ALL;
else if (varp == &(curbuf->b_p_fo))
else if (varp == &(curbuf->b_p_fo)) /* 'formatoptions' */
p = (char_u *)FO_ALL;
#ifdef FEAT_CONCEAL
else if (varp == &curwin->w_p_cocu)
else if (varp == &curwin->w_p_cocu) /* 'concealcursor' */
p = (char_u *)COCU_ALL;
#endif
else if (varp == &p_mouse)
else if (varp == &p_mouse) /* 'mouse' */
{
#ifdef FEAT_MOUSE
p = (char_u *)MOUSE_ALL;
@@ -7384,7 +7400,7 @@ did_set_string_option(
#endif
}
#if defined(FEAT_GUI)
else if (varp == &p_go)
else if (varp == &p_go) /* 'guioptions' */
p = (char_u *)GO_ALL;
#endif
if (p != NULL)
@@ -9223,6 +9239,8 @@ check_redraw(long_u flags)
changed_window_setting();
if (flags & P_RBUF)
redraw_curbuf_later(NOT_VALID);
if (flags & P_RWINONLY)
redraw_later(NOT_VALID);
if (doclear)
redraw_all_later(CLEAR);
else if (all)
+2
View File
@@ -706,9 +706,11 @@ EXTERN char_u *p_perldll; /* 'perldll' */
#endif
#if defined(DYNAMIC_PYTHON3)
EXTERN char_u *p_py3dll; /* 'pythonthreedll' */
EXTERN char_u *p_py3home; /* 'pythonthreehome' */
#endif
#if defined(DYNAMIC_PYTHON)
EXTERN char_u *p_pydll; /* 'pythondll' */
EXTERN char_u *p_pyhome; /* 'pythonhome' */
#endif
#ifdef FEAT_RELTIME
EXTERN long p_rdt; /* 'redrawtime' */
+4 -2
View File
@@ -40,7 +40,7 @@
# include <dlgs.h>
# include <winspool.h>
# include <commdlg.h>
#endif
# endif
#endif /* PROTO */
@@ -1619,7 +1619,9 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
if (psettings->n_uncollated_copies == 0)
psettings->n_uncollated_copies = 1;
} else {
}
else
{
psettings->n_collated_copies = 1;
psettings->n_uncollated_copies = 1;
}
+30 -44
View File
@@ -376,21 +376,6 @@ mch_write(char_u *s, int len)
RealWaitForChar(read_cmd_fd, p_wd, NULL, NULL);
}
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
/*
* Return time in msec since "start_tv".
*/
static long
elapsed(struct timeval *start_tv)
{
struct timeval now_tv;
gettimeofday(&now_tv, NULL);
return (now_tv.tv_sec - start_tv->tv_sec) * 1000L
+ (now_tv.tv_usec - start_tv->tv_usec) / 1000L;
}
#endif
/*
* mch_inchar(): low level input function.
* Get a characters from the keyboard.
@@ -411,10 +396,10 @@ mch_inchar(
int did_start_blocking = FALSE;
long wait_time;
long elapsed_time = 0;
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
struct timeval start_tv;
#ifdef ELAPSED_FUNC
ELAPSED_TYPE start_tv;
gettimeofday(&start_tv, NULL);
ELAPSED_INIT(start_tv);
#endif
/* repeat until we got a character or waited long enough */
@@ -438,8 +423,8 @@ mch_inchar(
else
/* going to block after p_ut */
wait_time = p_ut;
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
elapsed_time = elapsed(&start_tv);
#ifdef ELAPSED_FUNC
elapsed_time = ELAPSED_FUNC(start_tv);
#endif
wait_time -= elapsed_time;
if (wait_time < 0)
@@ -477,6 +462,10 @@ mch_inchar(
/* Checking if a job ended requires polling. Do this every 100 msec. */
if (has_pending_job() && (wait_time < 0 || wait_time > 100L))
wait_time = 100L;
/* If there is readahead then parse_queued_messages() timed out and we
* should call it again soon. */
if ((wait_time < 0 || wait_time > 100L) && channel_any_readahead())
wait_time = 10L;
#endif
/*
@@ -1554,18 +1543,16 @@ mch_input_isatty(void)
#ifdef FEAT_X11
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) \
# if defined(ELAPSED_TIMEVAL) \
&& (defined(FEAT_XCLIPBOARD) || defined(FEAT_TITLE))
static void xopen_message(struct timeval *start_tv);
/*
* Give a message about the elapsed time for opening the X window.
*/
static void
xopen_message(struct timeval *start_tv)
xopen_message(long elapsed_msec)
{
smsg((char_u *)_("Opening the X display took %ld msec"), elapsed(start_tv));
smsg((char_u *)_("Opening the X display took %ld msec"), elapsed_msec);
}
# endif
#endif
@@ -1864,11 +1851,11 @@ get_x11_windis(void)
#endif
if (x11_display != NULL)
{
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
# ifdef ELAPSED_FUNC
if (p_verbose > 0)
{
verbose_enter();
xopen_message(&start_tv);
xopen_message(ELAPSED_FUNC(start_tv));
verbose_leave();
}
# endif
@@ -4648,8 +4635,8 @@ mch_call_shell(
ga_init2(&ga, 1, BUFLEN);
noread_cnt = 0;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
gettimeofday(&start_tv, NULL);
# ifdef ELAPSED_FUNC
ELAPSED_INIT(start_tv);
# endif
for (;;)
{
@@ -4684,8 +4671,8 @@ mch_call_shell(
/* Get extra characters when we don't have any.
* Reset the counter and timer. */
noread_cnt = 0;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
gettimeofday(&start_tv, NULL);
# ifdef ELAPSED_FUNC
ELAPSED_INIT(start_tv);
# endif
len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
}
@@ -4908,10 +4895,10 @@ mch_call_shell(
if (got_int)
break;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
# ifdef ELAPSED_FUNC
if (wait_pid == 0)
{
long msec = elapsed(&start_tv);
long msec = ELAPSED_FUNC(start_tv);
/* Avoid that we keep looping here without
* checking for a CTRL-C for a long time. Don't
@@ -5654,15 +5641,14 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted)
/* May retry getting characters after an event was handled. */
# define MAY_LOOP
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
# ifdef ELAPSED_FUNC
/* Remember at what time we started, so that we know how much longer we
* should wait after being interrupted. */
# define USE_START_TV
long start_msec = msec;
struct timeval start_tv;
ELAPSED_TYPE start_tv;
if (msec > 0)
gettimeofday(&start_tv, NULL);
ELAPSED_INIT(start_tv);
# endif
/* Handle being called recursively. This may happen for the session
@@ -5969,9 +5955,9 @@ select_eintr:
/* We're going to loop around again, find out for how long */
if (msec > 0)
{
# ifdef USE_START_TV
# ifdef ELAPSED_FUNC
/* Compute remaining wait time. */
msec = start_msec - elapsed(&start_tv);
msec = start_msec - ELAPSED_FUNC(start_tv);
# else
/* Guess we got interrupted halfway. */
msec = msec / 2;
@@ -7068,11 +7054,11 @@ setup_term_clip(void)
#if defined(HAVE_SETJMP_H)
int (*oldIOhandler)();
#endif
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
struct timeval start_tv;
# ifdef ELAPSED_FUNC
ELAPSED_TYPE start_tv;
if (p_verbose > 0)
gettimeofday(&start_tv, NULL);
ELAPSED_INIT(start_tv);
# endif
/* Ignore X errors while opening the display */
@@ -7114,11 +7100,11 @@ setup_term_clip(void)
/* Catch terminating error of the X server connection. */
(void)XSetIOErrorHandler(x_IOerror_handler);
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
# ifdef ELAPSED_FUNC
if (p_verbose > 0)
{
verbose_enter();
xopen_message(&start_tv);
xopen_message(ELAPSED_FUNC(start_tv));
verbose_leave();
}
# endif
+2 -2
View File
@@ -17,8 +17,8 @@
# define signal sigset
#endif
/* sun's sys/ioctl.h redefines symbols from termio world */
#if defined(HAVE_SYS_IOCTL_H) && !defined(sun)
/* Sun's sys/ioctl.h redefines symbols from termio world */
#if defined(HAVE_SYS_IOCTL_H) && !defined(SUN_SYSTEM)
# include <sys/ioctl.h>
#endif
-1
View File
@@ -101,7 +101,6 @@
#define HAVE_STRTOL
#define HAVE_TGETENT
#define HAVE_MEMSET
#define HAVE_MEMCMP
#define HAVE_STRERROR
#define HAVE_FCHOWN
#define HAVE_RENAME
+7 -4
View File
@@ -1351,9 +1351,15 @@ WaitForChar(long msec)
DWORD dwWaitTime = dwEndTime - dwNow;
#ifdef FEAT_JOB_CHANNEL
/* Check channel while waiting input. */
/* Check channel while waiting for input. */
if (dwWaitTime > 100)
{
dwWaitTime = 100;
/* If there is readahead then parse_queued_messages() timed out
* and we should call it again soon. */
if (channel_any_readahead())
dwWaitTime = 10;
}
#endif
#ifdef FEAT_MZSCHEME
if (mzthreads_allowed() && p_mzq > 0
@@ -4287,9 +4293,6 @@ mch_system_piped(char *cmd, int options)
/* Get extra characters when we don't have any. Reset the
* counter and timer. */
noread_cnt = 0;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
gettimeofday(&start_tv, NULL);
# endif
len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
}
if (ta_len > 0 || len > 0)
-5
View File
@@ -50,12 +50,7 @@ extern int poll(struct pollfd *, long, int);
#ifdef HAVE_MEMSET
extern void *memset(void *, int, size_t);
#endif
#ifdef HAVE_BCMP
extern int bcmp(void *, void *, size_t);
#endif
#ifdef HAVE_MEMCMP
extern int memcmp(const void *, const void *, size_t);
#endif
#ifdef HAVE_STRPBRK
extern char *strpbrk(const char *, const char *);
#endif
+2 -1
View File
@@ -105,7 +105,8 @@ redo:
/* Put the pum below "row" if possible. If there are few lines decide on
* where there is more room. */
if (row - above_row >= below_row - row)
if (row + 2 >= below_row - pum_height
&& row - above_row > (below_row - above_row) / 2)
{
/* pum above "row" */
+2 -1
View File
@@ -25,6 +25,7 @@ void channel_consume(channel_T *channel, ch_part_T part, int len);
int channel_collapse(channel_T *channel, ch_part_T part, int want_nl);
int channel_can_write_to(channel_T *channel);
int channel_is_open(channel_T *channel);
int channel_has_readahead(channel_T *channel, ch_part_T part);
char *channel_status(channel_T *channel, int req_part);
void channel_info(channel_T *channel, dict_T *dict);
void channel_close(channel_T *channel, int invoke_close_cb);
@@ -32,7 +33,6 @@ void channel_close_in(channel_T *channel);
void channel_clear(channel_T *channel);
void channel_free_all(void);
char_u *channel_read_block(channel_T *channel, ch_part_T part, int timeout);
int channel_read_json_block(channel_T *channel, ch_part_T part, int timeout_arg, int id, typval_T **rettv);
void common_channel_read(typval_T *argvars, typval_T *rettv, int raw);
channel_T *channel_fd2channel(sock_T fd, ch_part_T *partp);
void channel_handle_events(void);
@@ -44,6 +44,7 @@ int channel_poll_check(int ret_in, void *fds_in);
int channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in);
int channel_select_check(int ret_in, void *rfds_in, void *wfds_in);
int channel_parse_messages(void);
int channel_any_readahead(void);
int set_ref_in_channel(int copyID);
ch_part_T channel_part_send(channel_T *channel);
ch_part_T channel_part_read(channel_T *channel);
+5 -5
View File
@@ -62,7 +62,7 @@
#ifdef sinix
#undef buf_T
#endif
# ifdef sun
# ifdef SUN_SYSTEM
# include <sys/conf.h>
# endif
#endif
@@ -87,11 +87,11 @@
# include <sys/ptem.h>
#endif
#if !defined(sun) && !defined(VMS) && !defined(MACOS)
#if !defined(SUN_SYSTEM) && !defined(VMS) && !defined(MACOS)
# include <sys/ioctl.h>
#endif
#if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
#if defined(SUN_SYSTEM) && defined(LOCKPTY) && !defined(TIOCEXCL)
# include <sys/ttold.h>
#endif
@@ -166,7 +166,7 @@ SetupSlavePTY(int fd)
# endif
if (ioctl(fd, I_PUSH, "ldterm") != 0)
return -1;
# ifdef sun
# ifdef SUN_SYSTEM
if (ioctl(fd, I_PUSH, "ttcompat") != 0)
return -1;
# endif
@@ -391,7 +391,7 @@ OpenPTY(char **ttyn)
continue;
}
#endif
#if defined(sun) && defined(TIOCGPGRP) && !defined(SUNOS3)
#if defined(SUN_SYSTEM) && defined(TIOCGPGRP) && !defined(SUNOS3)
/* Hack to ensure that the slave side of the pty is
* unused. May not work in anything other than SunOS4.1
*/
+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
+2 -1
View File
@@ -1704,7 +1704,8 @@ searchc(cmdarg_T *cap, int t_cmd)
}
else
{
if (vim_memcmp(p + col, lastc_bytes, lastc_bytelen) == 0 && stop)
if (memcmp(p + col, lastc_bytes, lastc_bytelen) == 0
&& stop)
break;
}
stop = TRUE;
+4 -1
View File
@@ -1474,6 +1474,7 @@ struct jsonq_S
typval_T *jq_value;
jsonq_T *jq_next;
jsonq_T *jq_prev;
int jq_no_callback; /* TRUE when no callback was found */
};
struct cbq_S
@@ -1600,6 +1601,7 @@ struct channel_S {
partial_T *ch_partial;
char_u *ch_close_cb; /* call when channel is closed */
partial_T *ch_close_partial;
int ch_drop_never;
job_T *ch_job; /* Job that uses this channel; this does not
* count as a reference to avoid a circular
@@ -1687,6 +1689,7 @@ typedef struct
partial_T *jo_close_partial; /* not referenced! */
char_u *jo_exit_cb; /* not allocated! */
partial_T *jo_exit_partial; /* not referenced! */
int jo_drop_never;
int jo_waittime;
int jo_timeout;
int jo_out_timeout;
@@ -3244,8 +3247,8 @@ typedef struct
#endif
int want_full_screen;
int stdout_isatty; /* is stdout a terminal? */
int not_a_term; /* no warning for missing term? */
int tty_fail; /* exit if not a tty */
char_u *term; /* specified terminal name */
#ifdef FEAT_CRYPT
int ask_for_key; /* -x argument */
+40 -8
View File
@@ -6383,7 +6383,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 +6436,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 +6451,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 +6458,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 +6730,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"));
@@ -8766,6 +8794,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;
}
+25 -10
View File
@@ -742,7 +742,7 @@ do_tag(
/* skip backslash used for escaping a command char or
* a backslash */
if (*p == '\\' && (*(p + 1) == *tagp.command
|| *(p + 1) == '\\'))
|| *(p + 1) == '\\'))
++p;
if (*p == TAB)
@@ -1356,6 +1356,7 @@ find_tags(
char_u *help_lang_find = NULL; /* lang to be found */
char_u help_lang[3]; /* lang of current tags file */
char_u *saved_pat = NULL; /* copy of pat[] */
int is_txt = FALSE; /* flag of file extension */
#endif
pat_T orgpat; /* holds unconverted pattern info */
@@ -1388,7 +1389,7 @@ find_tags(
*/
switch (curbuf->b_tc_flags ? curbuf->b_tc_flags : tc_flags)
{
case TC_FOLLOWIC: break;
case TC_FOLLOWIC: break;
case TC_IGNORE: p_ic = TRUE; break;
case TC_MATCH: p_ic = FALSE; break;
case TC_FOLLOWSCS: p_ic = ignorecase(pat); break;
@@ -1476,6 +1477,15 @@ find_tags(
* When the tag file is case-fold sorted, it is either one or the other.
* Only ignore case when TAG_NOIC not used or 'ignorecase' set.
*/
#ifdef FEAT_MULTI_LANG
/* Set a flag if the file extension is .txt */
if ((flags & TAG_KEEP_LANG)
&& help_lang_find == NULL
&& curbuf->b_fname != NULL
&& (i = (int)STRLEN(curbuf->b_fname)) > 4
&& STRICMP(curbuf->b_fname + i - 4, ".txt") == 0)
is_txt = TRUE;
#endif
#ifdef FEAT_TAG_BINS
orgpat.regmatch.rm_ic = ((p_ic || !noic)
&& (findall || orgpat.headlen == 0 || !p_tbs));
@@ -1509,14 +1519,19 @@ find_tags(
#ifdef FEAT_MULTI_LANG
if (curbuf->b_help)
{
/* Prefer help tags according to 'helplang'. Put the
* two-letter language name in help_lang[]. */
i = (int)STRLEN(tag_fname);
if (i > 3 && tag_fname[i - 3] == '-')
STRCPY(help_lang, tag_fname + i - 2);
else
/* Keep en if the file extension is .txt*/
if (is_txt)
STRCPY(help_lang, "en");
else
{
/* Prefer help tags according to 'helplang'. Put the
* two-letter language name in help_lang[]. */
i = (int)STRLEN(tag_fname);
if (i > 3 && tag_fname[i - 3] == '-')
STRCPY(help_lang, tag_fname + i - 2);
else
STRCPY(help_lang, "en");
}
/* When searching for a specific language skip tags files
* for other languages. */
if (help_lang_find != NULL
@@ -2400,7 +2415,7 @@ parse_line:
mfp2 = ((struct match_found **)
(ga_match[mtt].ga_data))[i];
if (mfp2->len == mfp->len
&& vim_memcmp(mfp2->match, mfp->match,
&& memcmp(mfp2->match, mfp->match,
(size_t)mfp->len) == 0)
break;
fast_breakcheck();
+6 -2
View File
@@ -6075,8 +6075,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
+5 -2
View File
@@ -63,8 +63,6 @@ SCRIPTS_ALL = \
test88.out \
test90.out \
test91.out \
test92.out \
test93.out \
test94.out \
test95.out \
test98.out \
@@ -150,8 +148,10 @@ NEW_TESTS = test_arglist.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 \
@@ -167,6 +167,8 @@ NEW_TESTS = test_arglist.res \
test_man.res \
test_marks.res \
test_matchadd_conceal.res \
test_mksession.res \
test_mksession_utf8.res \
test_nested_function.res \
test_netbeans.res \
test_normal.res \
@@ -182,6 +184,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
+1 -1
View File
@@ -92,7 +92,7 @@ SCRIPT = test1.out test3.out test4.out test5.out \
test72.out test75.out \
test77a.out test78.out test79.out test80.out \
test82.out test84.out test88.out test89.out \
test90.out test91.out test92.out test93.out test94.out \
test90.out test91.out test94.out \
test95.out test98.out test99.out \
test103.out test104.out \
test107.out test108.out\
+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.

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