Compare commits

...

77 Commits

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

- Vim patch 8.0.0094
- Fixed Non-native fullscreen issue on 10.12 Sierra (#312)

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-20 01:08:04 -08:00
Kazuki Sakamoto 967b1a1814 Merge pull request #410 from macvim-dev/fix/fullscreen
Runtime 10.12 version check for CGLayer in non-native fullscreen
2016-11-20 00:35:38 -08:00
Kazuki Sakamoto 7fe35f8735 Runtime 10.12 version check for CGLayer in non-native fullscreen 2016-11-20 00:34:43 -08:00
Kazuki Sakamoto cab4040499 Merge pull request #405 from osheroff/master
Fix problems with non-native fullscreen and mac 10.12
2016-11-20 00:32:37 -08:00
Kazuki Sakamoto 4dba9d1e2f Merge remote-tracking branch 'vim/master' 2016-11-19 22:21:44 -08:00
Kazuki Sakamoto aedaad51cf Merge pull request #409 from macvim-dev/revert-408-xcode8.2
Revert "xcode8.2 on Travis CI"
2016-11-19 10:18:25 -08:00
Kazuki Sakamoto fbf66f9918 Revert "xcode8.2 on Travis CI" 2016-11-19 10:18:11 -08:00
Bram Moolenaar 63e4344edc patch 8.0.0094
Problem:    When vimrun.exe is not found the error message is not properly
            encoded.
Solution:   Use utf-16 and MessageBoxW(). (Ken Takata)
2016-11-19 17:28:44 +01:00
Bram Moolenaar dda39aeafc patch 8.0.0093
Problem:    Not using multiprocess build feature.
Solution:   Enable multiprocess build with MSVC 10. (Ken Takata)
2016-11-19 17:17:12 +01:00
Kazuki Sakamoto 3129be9a78 Merge pull request #408 from macvim-dev/xcode8.2
xcode8.2 on Travis CI
2016-11-18 21:27:14 -08:00
Kazuki Sakamoto 7c8684761b xcode8.2 on Travis CI 2016-11-18 21:26:31 -08:00
Kazuki Sakamoto 32418b98a0 Merge pull request #407 from macvim-dev/revert-406-fix/timer-feedkeys
Revert "Fix #401"
2016-11-18 08:29:12 -08:00
Kazuki Sakamoto abeb366f9f Revert "Fix #401" 2016-11-18 08:28:36 -08:00
Kazuki Sakamoto 28f88ac8e7 Merge pull request #406 from ichizok/fix/timer-feedkeys
Fix #401
2016-11-18 07:23:31 -08:00
ichizok a6d11c71a0 Enable Test_exit_callback_interval() 2016-11-18 23:55:33 +09:00
ichizok cf2ddc70a1 Check for jobs and channels more often 2016-11-18 23:55:32 +09:00
ichizok 1ed1ccc2c3 Fix feedkeys in timer callback 2016-11-17 05:36:07 +09:00
Ben Osheroff 4663f06f3e Fix problems with non-native fullscreen and mac 10.12
When you set a borderless style on a subclasses window in 10.12, the
original behavior in which you could progressively draw partially on a
stale window seems to be gone; it blanks the thing after each draw. It's
totally unclear to me whether the CoreText engine as written was ever
"correct", or maybe it just "accidentally worked" -- no documentation on
the internets seems to indicate you're allowed to only draw CoreGraphics
updates to a window in drawRect.

This PR works around that by drawing onto a persistent background layer
which we then blit to the screen.  This PR also makes resizing a
CoreGraphics view much smoother; the old code was pretty flickery.

addreses #312.
2016-11-14 22:03:10 -08:00
81 changed files with 1383 additions and 490 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.
+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 01
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.
@@ -596,6 +606,10 @@ See |job_setoptions()| and |ch_setoptions()|.
"close_cb": handler Callback for when the channel is closed. Same as
"close_cb" on |ch_open()|, see |close_cb|.
*job-exit_cb*
"drop" Specifies when to drop messages. Same as "drop" on
|ch_open()|, see |channel-drop|. For "auto" the
exit_cb is not considered.
"exit_cb": handler Callback for when the job ends. The arguments are the
job and the exit status.
Vim checks up to 10 times per second for jobs that
@@ -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
+5 -2
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
+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
+26 -11
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: 2016 Nov 29
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()|.
@@ -8420,6 +8433,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|.
+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}
*'(* *`(*
+37 -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: 2016 Nov 26
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
@@ -5851,6 +5853,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 +5925,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 +5952,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 +8007,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: >
+2
View File
@@ -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
+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|
+4
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*
+30 -22
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: 2016 Dec 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,22 +35,7 @@ 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.
- 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.
@@ -115,25 +100,26 @@ 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
Use __sun instead of sun define check. #1296
Patch to use buffer id for system() and systemlist() (LemonBoy, 2016 Nov 7,
#1240)
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.
Test by Pavol Juhas, Nov 22.
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
Make dict_add give a duplicate key error.
@@ -162,6 +148,9 @@ Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
Screen updated delayed when using CTRL-O u in Insert mode.
(Barlik, #1191) Perhaps because status message?
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)
@@ -187,6 +176,11 @@ Is there another solution?
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)
Invalid behavior with NULL list. (Nikolai Pavlov, #768)
E.g. deepcopy(test_null_list())
@@ -195,6 +189,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)
@@ -272,6 +273,9 @@ Lakshmanan, 2016 Aug 25)
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 +284,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)
@@ -1306,6 +1313,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 -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
+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.
+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 "<[^>]*>"
+1 -1
View File
@@ -1255,7 +1255,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>115</string>
<string>118</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
+1
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];
+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)
+6
View File
@@ -39,6 +39,11 @@
CGPoint *positions;
NSMutableArray *fontCache;
BOOL cgLayerEnabled;
CGLayerRef cgLayer;
CGContextRef cgLayerContext;
NSLock *cgLayerLock;
// These are used in MMCoreTextView+ToolTip.m
id trackingRectOwner_; // (not retained)
void *trackingRectUserData_;
@@ -85,6 +90,7 @@
- (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
- (NSRect)rectForRow:(int)row column:(int)column numRows:(int)nr
numColumns:(int)nc;
- (void)setCGLayerEnabled:(BOOL)enabled;
//
// NSTextView methods
+154 -25
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,25 +590,117 @@ defaultAdvanceForFont(NSFont *font)
NSGraphicsContext *context = [NSGraphicsContext currentContext];
[context setShouldAntialias:antialias];
id data;
NSEnumerator *e = [drawData objectEnumerator];
while ((data = [e nextObject]))
[self batchDrawData:data];
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;
NSRect drawRect = NSMakeRect(
0,
frameSize.height - cgLayerSize.height,
cgLayerSize.width,
cgLayerSize.height);
[drawData removeAllObjects];
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
{
cgLayerEnabled = enabled;
if (!cgLayerEnabled)
[self releaseCGLayer];
}
- (void)releaseCGLayer
{
if (cgLayer) {
CGLayerRelease(cgLayer);
cgLayer = nil;
cgLayerContext = nil;
}
}
- (CGLayerRef)getCGLayer
{
NSParameterAssert(cgLayerEnabled);
if (!cgLayer && [self lockFocusIfCanDraw]) {
NSGraphicsContext *context = [NSGraphicsContext currentContext];
NSRect frame = [self frame];
cgLayer = CGLayerCreateWithContext(
[context graphicsPort], frame.size, NULL);
[self unlockFocus];
}
return cgLayer;
}
- (CGContextRef)getCGContext
{
if (cgLayerEnabled) {
if (!cgLayerContext)
cgLayerContext = CGLayerGetContext([self getCGLayer]);
return cgLayerContext;
} else {
return [[NSGraphicsContext currentContext] graphicsPort];
}
}
- (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
{
// TODO:
@@ -852,7 +948,7 @@ defaultAdvanceForFont(NSFont *font)
const void *end = bytes + [data length];
#if MM_DEBUG_DRAWING
ASLogNotice(@"====> BEGIN %s", _cmd);
ASLogNotice(@"====> BEGIN");
#endif
// TODO: Sanity check input
@@ -908,10 +1004,19 @@ defaultAdvanceForFont(NSFont *font)
column:col
numRows:height
numColumns:width];
[signImg drawInRect:r
fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver
fraction:1.0];
if (cgLayerEnabled) {
CGContextRef context = [self getCGContext];
CGImageRef cgImage = [signImg CGImageForProposedRect:&r
context:nil
hints:nil];
CGContextDrawImage(context, r, cgImage);
} else {
[signImg drawInRect:r
fromRect:NSZeroRect
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);
@@ -1013,11 +1118,11 @@ defaultAdvanceForFont(NSFont *font)
}
#if MM_DEBUG_DRAWING
ASLogNotice(@"<==== END %s", _cmd);
ASLogNotice(@"<==== END");
#endif
}
static CTFontRef
static CTFontRef
lookupFont(NSMutableArray *fontCache, const unichar *chars, UniCharCount count,
CTFontRef currFontRef)
{
@@ -1294,7 +1399,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
withFlags:(int)flags foregroundColor:(int)fg
backgroundColor:(int)bg specialColor:(int)sp
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef context = [self getCGContext];
NSRect frame = [self bounds];
float x = col*cellSize.width + insetSize.width;
float y = frame.size.height - insetSize.height - (1+row)*cellSize.height;
@@ -1408,12 +1513,30 @@ 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
{
NSSize delta={0, -count * cellSize.height};
[self scrollRect:rect by:delta];
if (cgLayerEnabled) {
CGContextRef context = [self getCGContext];
int yOffset = count * cellSize.height;
NSRect clipRect = rect;
clipRect.origin.y -= yOffset;
// 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];
}
}
- (void)deleteLinesFromRow:(int)row lineCount:(int)count
@@ -1455,7 +1578,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
- (void)clearBlockFromRow:(int)row1 column:(int)col1 toRow:(int)row2
column:(int)col2 color:(int)color
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef context = [self getCGContext];
NSRect rect = [self rectFromRow:row1 column:col1 toRow:row2 column:col2];
CGContextSetRGBFillColor(context, RED(color), GREEN(color), BLUE(color),
@@ -1464,11 +1587,13 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
CGContextSetBlendMode(context, kCGBlendModeCopy);
CGContextFillRect(context, *(CGRect*)&rect);
CGContextSetBlendMode(context, kCGBlendModeNormal);
[self setNeedsDisplayCGLayerInRect:rect];
}
- (void)clearAll
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
[self releaseCGLayer];
CGContextRef context = [self getCGContext];
NSRect rect = [self bounds];
float r = [defaultBackgroundColor redComponent];
float g = [defaultBackgroundColor greenComponent];
@@ -1479,12 +1604,14 @@ 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
fraction:(int)percent color:(int)color
{
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef context = [self getCGContext];
NSRect rect = [self rectForRow:row column:col numRows:1 numColumns:1];
CGContextSaveGState(context);
@@ -1526,6 +1653,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
CGContextFillRect(context, *(CGRect*)&rect);
}
[self setNeedsDisplayCGLayerInRect:rect];
CGContextRestoreGState(context);
}
@@ -1533,7 +1661,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
numColumns:(int)ncols
{
// TODO: THIS CODE HAS NOT BEEN TESTED!
CGContextRef cgctx = [[NSGraphicsContext currentContext] graphicsPort];
CGContextRef cgctx = [self getCGContext];
CGContextSaveGState(cgctx);
CGContextSetBlendMode(cgctx, kCGBlendModeDifference);
CGContextSetRGBFillColor(cgctx, 1.0, 1.0, 1.0, 1.0);
@@ -1542,6 +1670,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
numColumns:ncols];
CGContextFillRect(cgctx, *(CGRect*)&rect);
[self setNeedsDisplayCGLayerInRect:rect];
CGContextRestoreGState(cgctx);
}
+5
View File
@@ -172,6 +172,8 @@ enum {
oldPosition = [view frame].origin;
[view removeFromSuperviewWithoutNeedingDisplay];
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12)
[[view textView] setCGLayerEnabled:YES];
[[self contentView] addSubview:view];
[self setInitialFirstResponder:[view textView]];
@@ -284,6 +286,9 @@ enum {
[view setFrameOrigin:oldPosition];
[self close];
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12)
[[view textView] setCGLayerEnabled:NO];
// Set the text view to initial first responder, otherwise the 'plus'
// button on the tabline steals the first responder status.
[target setInitialFirstResponder:[view textView]];
+1
View File
@@ -72,4 +72,5 @@
// NOT IMPLEMENTED (only in Core Text renderer)
- (void)deleteSign:(NSString *)signName;
- (void)setToolTipAtMousePoint:(NSString *)string;
- (void)setCGLayerEnabled:(BOOL)enabled;
@end
+5
View File
@@ -517,6 +517,11 @@
// ONLY in Core Text!
}
- (void)setCGLayerEnabled:(BOOL)enabled
{
// ONLY in Core Text!
}
- (BOOL)isOpaque
{
return NO;
+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
+11
View File
@@ -297,6 +297,9 @@ CPU = ix86
# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
WP64CHECK = /Wp64
# Use multiprocess build
USE_MP = yes
#>>>>> path of the compiler and linker; name of include and lib directories
# PATH = c:\msvc20\bin;$(PATH)
# INCLUDE = c:\msvc20\include
@@ -473,6 +476,14 @@ NODEFAULTLIB =
NODEFAULTLIB = /nodefaultlib
!endif
# Use multiprocess build on MSVC 10
!if "$(USE_MP)"=="yes"
!if $(MSVC_MAJOR) >= 10
CFLAGS = $(CFLAGS) /MP
!endif
!endif
!ifdef NODEBUG
VIM = vim
!if "$(OPTIMIZE)" == "SPACE"
+23 -6
View File
@@ -1701,21 +1701,30 @@ OBJ = $(OBJ_COMMON) \
objects/memfile.o \
objects/message.o
JSON_TEST_OBJ = $(OBJ_COMMON) \
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_JSON_TEST) $(OBJ_MEMFILE_TEST) $(OBJ_MESSAGE_TEST)
PRO_AUTO = \
arabic.pro \
blowfish.pro \
@@ -2069,7 +2078,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)
@@ -2135,6 +2144,8 @@ test_arglist \
test_matchadd_conceal_utf8 \
test_menu \
test_messages \
test_mksession \
test_mksession_utf8 \
test_nested_function \
test_netbeans \
test_normal \
@@ -2868,8 +2879,14 @@ 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:
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
+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
{
+147 -17
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)
{
@@ -1939,6 +1940,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 +2073,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 +2093,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 +2110,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 +2499,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 +2543,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 +2620,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 +2629,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 +2666,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 +2702,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 +2891,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 +3191,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 +3347,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 +3368,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 +3919,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 +3968,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 +4003,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 +4394,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))
-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
+2 -2
View File
@@ -3673,8 +3673,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 \
+22 -1
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
*/
@@ -5978,6 +5995,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;
+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
+10 -2
View File
@@ -3102,7 +3102,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 +3123,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 +4496,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 +4512,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();
+18 -5
View File
@@ -860,12 +860,25 @@ 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 && *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);
vim_free(buf);
}
# 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);
+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;
}
+30 -21
View File
@@ -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
+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
+25 -10
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)
@@ -4705,12 +4708,24 @@ mch_call_shell(
#if defined(FEAT_GUI_W32)
if (need_vimrun_warning)
{
MessageBox(NULL,
_("VIMRUN.EXE not found in your $PATH.\n"
"External commands will not pause after completion.\n"
"See :help win32-vimrun for more information."),
_("Vim Warning"),
MB_ICONWARNING);
char *msg = _("VIMRUN.EXE not found in your $PATH.\n"
"External commands will not pause after completion.\n"
"See :help win32-vimrun for more information.");
char *title = _("Vim Warning");
# ifdef FEAT_MBYTE
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
WCHAR *wmsg = enc_to_utf16((char_u *)msg, NULL);
WCHAR *wtitle = enc_to_utf16((char_u *)title, NULL);
if (wmsg != NULL && wtitle != NULL)
MessageBoxW(NULL, wmsg, wtitle, MB_ICONWARNING);
vim_free(wmsg);
vim_free(wtitle);
}
else
# endif
MessageBox(NULL, msg, title, MB_ICONWARNING);
need_vimrun_warning = FALSE;
}
if (!s_dont_use_vimrun && p_stmp)
-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
*/
+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 */
+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();
+2 -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 \
@@ -167,6 +165,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 \
+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\
+1 -1
View File
@@ -88,7 +88,7 @@ func RunServer(cmd, testfunc, args)
call call(function(a:testfunc), [port])
catch
call assert_false(1, "Caught exception: " . v:exception)
call assert_false(1, 'Caught exception: "' . v:exception . '" in ' . v:throwpoint)
finally
call s:kill_server(a:cmd)
endtry
-48
View File
@@ -1,48 +0,0 @@
vim: set ft=vim fenc=utf-8:
Tests if :mksession saves cursor columns correctly in presence of tab and
multibyte characters when fileencoding=utf-8.
STARTTEST
:so mbyte.vim
:if !has('mksession')
: e! test.ok
: wq! test.out
:endif
:set sessionoptions=buffers splitbelow fileencoding=utf-8
/^start:
:vsplit
j16|:split
j16|:split
j16|:split
j8|:split
j8|:split
j16|:split
j16|:split
j16|:wincmd l
/^start:
:set nowrap
j16|3zl:split
j016|3zl:split
j016|3zl:split
j08|3zl:split
j08|3zl:split
j016|3zl:split
j016|3zl:split
j016|3zl:split
:mksession! test.out
:new test.out
:v/\(^ *normal! 0\|^ *exe 'normal!\)/d
:w! test.out
:qa!
ENDTEST
start:
no multibyte chAracter
one leaDing tab
four leadinG spaces
two consecutive tabs
two tabs in one line
one … multibyteCharacter
a “b” two multiByte characters
“c”1€ three mulTibyte characters
-26
View File
@@ -1,26 +0,0 @@
normal! 016|
normal! 016|
normal! 016|
normal! 08|
normal! 08|
normal! 016|
normal! 016|
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 8 . '|'
normal! 08|
exe 'normal! ' . s:c . '|zs' . 8 . '|'
normal! 08|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
-48
View File
@@ -1,48 +0,0 @@
vim: set ft=vim fenc=latin1:
Tests if :mksession saves cursor columns correctly in presence of tab and
multibyte characters when fileencoding=latin1.
STARTTEST
:so mbyte.vim
:if !has('mksession')
: e! test.ok
: wq! test.out
:endif
:set sessionoptions=buffers splitbelow fileencoding=latin1
/^start:
:vsplit
j16|:split
j16|:split
j16|:split
j8|:split
j8|:split
j16|:split
j16|:split
j16|:wincmd l
/^start:
:set nowrap
j16|3zl:split
j016|3zl:split
j016|3zl:split
j08|3zl:split
j08|3zl:split
j016|3zl:split
j016|3zl:split
j016|3zl:split
:mksession! test.out
:new test.out
:v/\(^ *normal! 0\|^ *exe 'normal!\)/d
:w! test.out
:qa!
ENDTEST
start:
no multibyte chAracter
one leaDing tab
four leadinG spaces
two consecutive tabs
two tabs in one line
one ä multibyteCharacter
aä Ä two multiByte characters
Aäöü three mulTibyte characters
-26
View File
@@ -1,26 +0,0 @@
normal! 016|
normal! 016|
normal! 016|
normal! 08|
normal! 08|
normal! 016|
normal! 016|
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 8 . '|'
normal! 08|
exe 'normal! ' . s:c . '|zs' . 8 . '|'
normal! 08|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
exe 'normal! ' . s:c . '|zs' . 16 . '|'
normal! 016|
+2
View File
@@ -117,6 +117,8 @@ func Test_assert_inrange()
call assert_inrange(5, 7, 8)
call assert_match("Expected range 5 - 7, but got 8", v:errors[0])
call remove(v:errors, 0)
call assert_fails('call assert_inrange(1, 1)', 'E119:')
endfunc
func Test_user_is_happy()
+3 -1
View File
@@ -127,7 +127,9 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("sending: {0}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
time.sleep(0.01)
# Need to wait for Vim to give up, otherwise it
# sometimes fails on OS X.
time.sleep(0.2)
elif decoded[1] == 'malformed2':
cmd = '"unterminated string'
print("sending: {0}".format(cmd))
+20 -3
View File
@@ -26,7 +26,10 @@ func Ch_requestHandler(handle, msg)
endfunc
func Ch_communicate(port)
" Avoid dropping messages, since we don't use a callback here.
let s:chopt.drop = 'never'
let handle = ch_open('localhost:' . a:port, s:chopt)
unlet s:chopt.drop
if ch_status(handle) == "fail"
call assert_false(1, "Can't open channel")
return
@@ -58,6 +61,9 @@ func Ch_communicate(port)
" string with ][ should work
call assert_equal('this][that', ch_evalexpr(handle, 'echo this][that'))
" nothing to read now
call assert_equal(0, ch_canread(handle))
" sending three messages quickly then reading should work
for i in range(3)
call ch_sendexpr(handle, 'echo hello ' . i)
@@ -126,6 +132,9 @@ func Ch_communicate(port)
call ch_setoptions(handle, {'mode': 'json'})
call assert_fails("call ch_setoptions(handle, {'waittime': 111})", "E475")
call ch_setoptions(handle, {'callback': ''})
call ch_setoptions(handle, {'drop': 'never'})
call ch_setoptions(handle, {'drop': 'auto'})
call assert_fails("call ch_setoptions(handle, {'drop': 'bad'})", "E475")
" Send an eval request that works.
call assert_equal('ok', ch_evalexpr(handle, 'eval-works'))
@@ -246,6 +255,7 @@ endfunc
"""""""""
func Ch_handler(chan, msg)
call ch_log('Ch_handler()')
unlet g:Ch_reply
let g:Ch_reply = a:msg
endfunc
@@ -269,6 +279,7 @@ func Ch_channel_handler(port)
endfunc
func Test_channel_handler()
call ch_logfile('channellog', 'w')
call ch_log('Test_channel_handler()')
let g:Ch_reply = ""
let s:chopt.callback = 'Ch_handler'
@@ -368,7 +379,7 @@ func Ch_raw_one_time_callback(port)
endif
call ch_setoptions(handle, {'mode': 'raw'})
" The message are sent raw, we do our own JSON strings here.
" The messages are sent raw, we do our own JSON strings here.
call ch_sendraw(handle, "[1, \"hello!\"]\n", {'callback': 'Ch_handleRaw1'})
call WaitFor('g:Ch_reply1 != ""')
call assert_equal("[1, \"got it\"]", g:Ch_reply1)
@@ -431,7 +442,10 @@ func Test_raw_pipe()
return
endif
call ch_log('Test_raw_pipe()')
let job = job_start(s:python . " test_channel_pipe.py", {'mode': 'raw'})
" Add a dummy close callback to avoid that messages are dropped when calling
" ch_canread().
let job = job_start(s:python . " test_channel_pipe.py",
\ {'mode': 'raw', 'drop': 'never'})
call assert_equal(v:t_job, type(job))
call assert_equal("run", job_status(job))
@@ -458,6 +472,9 @@ func Test_raw_pipe()
call assert_equal("something\n", substitute(msg, "\r", "", 'g'))
call ch_sendraw(job, "double this\n")
let g:handle = job_getchannel(job)
call WaitFor('ch_canread(g:handle)')
unlet g:handle
let msg = ch_readraw(job)
call assert_equal("this\nAND this\n", substitute(msg, "\r", "", 'g'))
@@ -1396,7 +1413,7 @@ function MyExitTimeCb(job, status)
endfunction
func Test_exit_callback_interval()
if !has('job') || has('gui_macvim')
if !has('job')
return
endif
+23
View File
@@ -194,3 +194,26 @@ func Test_expand_star_star()
bwipe!
call delete('a', 'rf')
endfunc
func Test_paste_in_cmdline()
let @a = "def"
call feedkeys(":abc \<C-R>a ghi\<C-B>\"\<CR>", 'tx')
call assert_equal('"abc def ghi', @:)
new
call setline(1, 'asdf.x /tmp/some verylongword a;b-c*d ')
call feedkeys(":aaa \<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx')
call assert_equal('"aaa asdf bbb', @:)
call feedkeys("ft:aaa \<C-R>\<C-F> bbb\<C-B>\"\<CR>", 'tx')
call assert_equal('"aaa /tmp/some bbb', @:)
set incsearch
call feedkeys("fy:aaa veryl\<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx')
call assert_equal('"aaa verylongword bbb', @:)
call feedkeys("f;:aaa \<C-R>\<C-A> bbb\<C-B>\"\<CR>", 'tx')
call assert_equal('"aaa a;b-c*d bbb', @:)
bwipe!
endfunc
+15
View File
@@ -273,3 +273,18 @@ func Test_gd_string_only()
\ ]
call XTest_goto_decl('gd', lines, 5, 10)
endfunc
" Check that setting 'cursorline' does not change curswant
func Test_cursorline_keep_col()
new
call setline(1, ['long long long line', 'short line'])
normal ggfi
let pos = getcurpos()
normal j
set cursorline
normal k
call assert_equal(pos, getcurpos())
bwipe!
set nocursorline
endfunc
+32
View File
@@ -141,4 +141,36 @@ func Test_help_complete()
endtry
endfunc
func Test_help_respect_current_file_lang()
try
let list = []
call s:doc_config_setup()
if has('multi_lang')
function s:check_help_file_ext(help_keyword, ext)
exec 'help ' . a:help_keyword
call assert_equal(a:ext, expand('%:e'))
call feedkeys("\<C-]>", 'tx')
call assert_equal(a:ext, expand('%:e'))
pop
helpclose
endfunc
set rtp+=Xdir1/doc-ab
set rtp+=Xdir1/doc-ja
set helplang=ab
call s:check_help_file_ext('test-char', 'abx')
call s:check_help_file_ext('test-char@ja', 'jax')
set helplang=ab,ja
call s:check_help_file_ext('test-char@ja', 'jax')
call s:check_help_file_ext('test-char@en', 'txt')
endif
catch
call assert_exception('X')
finally
call s:doc_config_teardown()
endtry
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+24
View File
@@ -31,6 +31,30 @@ function History_Tests(hist)
call assert_equal('ls', histget(a:hist, -1))
call assert_equal(4, histnr(a:hist))
let a=execute('history ' . a:hist)
call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
let a=execute('history all')
call assert_match("^\n # .* history\n 3 buffers\n> 4 ls", a)
if len(a:hist) > 0
let a=execute('history ' . a:hist . ' 2')
call assert_match("^\n # \\S* history$", a)
let a=execute('history ' . a:hist . ' 3')
call assert_match("^\n # \\S* history\n 3 buffers$", a)
let a=execute('history ' . a:hist . ' 4')
call assert_match("^\n # \\S* history\n> 4 ls$", a)
let a=execute('history ' . a:hist . ' 3,4')
call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
let a=execute('history ' . a:hist . ' -1')
call assert_match("^\n # \\S* history\n> 4 ls$", a)
let a=execute('history ' . a:hist . ' -2')
call assert_match("^\n # \\S* history\n 3 buffers$", a)
let a=execute('history ' . a:hist . ' -2,')
call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
let a=execute('history ' . a:hist . ' -3')
call assert_match("^\n # \\S* history$", a)
endif
" Test for removing entries matching a pattern
for i in range(1, 3)
call histadd(a:hist, 'text_' . i)
+104
View File
@@ -0,0 +1,104 @@
" Test for :mksession, :mkview and :loadview in latin1 encoding
set encoding=latin1
scriptencoding latin1
if !has('multi_byte') || !has('mksession')
finish
endif
func Test_mksession()
tabnew
let wrap_save = &wrap
set sessionoptions=buffers splitbelow fileencoding=latin1
call setline(1, [
\ 'start:',
\ 'no multibyte chAracter',
\ ' one leaDing tab',
\ ' four leadinG spaces',
\ 'two consecutive tabs',
\ 'two tabs in one line',
\ 'one ä multibyteCharacter',
\ 'aä Ä two multiByte characters',
\ 'Aäöü three mulTibyte characters'
\ ])
let tmpfile = tempname()
exec 'w! ' . tmpfile
/^start:
set wrap
vsplit
norm! j16|
split
norm! j16|
split
norm! j16|
split
norm! j8|
split
norm! j8|
split
norm! j16|
split
norm! j16|
split
norm! j16|
wincmd l
set nowrap
/^start:
norm! j16|3zl
split
norm! j016|3zl
split
norm! j016|3zl
split
norm! j08|3zl
split
norm! j08|3zl
split
norm! j016|3zl
split
norm! j016|3zl
split
norm! j016|3zl
split
call wincol()
mksession! test_mks.out
let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
let expected = [
\ 'normal! 016|',
\ 'normal! 016|',
\ 'normal! 016|',
\ 'normal! 08|',
\ 'normal! 08|',
\ 'normal! 016|',
\ 'normal! 016|',
\ 'normal! 016|',
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
\ " normal! 08|",
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
\ " normal! 08|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|"
\ ]
call assert_equal(expected, li)
tabclose!
call delete('test_mks.out')
call delete(tmpfile)
let &wrap = wrap_save
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+104
View File
@@ -0,0 +1,104 @@
" Test for :mksession, :mkview and :loadview in utf-8 encoding
set encoding=utf-8
scriptencoding utf-8
if !has('multi_byte') || !has('mksession')
finish
endif
func Test_mksession_utf8()
tabnew
let wrap_save = &wrap
set sessionoptions=buffers splitbelow fileencoding=utf-8
call setline(1, [
\ 'start:',
\ 'no multibyte chAracter',
\ ' one leaDing tab',
\ ' four leadinG spaces',
\ 'two consecutive tabs',
\ 'two tabs in one line',
\ 'one … multibyteCharacter',
\ 'a “b” two multiByte characters',
\ '“c”1€ three mulTibyte characters'
\ ])
let tmpfile = tempname()
exec 'w! ' . tmpfile
/^start:
set wrap
vsplit
norm! j16|
split
norm! j16|
split
norm! j16|
split
norm! j8|
split
norm! j8|
split
norm! j16|
split
norm! j16|
split
norm! j16|
wincmd l
set nowrap
/^start:
norm! j16|3zl
split
norm! j016|3zl
split
norm! j016|3zl
split
norm! j08|3zl
split
norm! j08|3zl
split
norm! j016|3zl
split
norm! j016|3zl
split
norm! j016|3zl
split
call wincol()
mksession! test_mks.out
let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
let expected = [
\ 'normal! 016|',
\ 'normal! 016|',
\ 'normal! 016|',
\ 'normal! 08|',
\ 'normal! 08|',
\ 'normal! 016|',
\ 'normal! 016|',
\ 'normal! 016|',
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
\ " normal! 08|",
\ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
\ " normal! 08|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|",
\ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
\ " normal! 016|"
\ ]
call assert_equal(expected, li)
tabclose!
call delete('test_mks.out')
call delete(tmpfile)
let &wrap = wrap_save
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+23
View File
@@ -106,3 +106,26 @@ func Test_keymap_valid()
call assert_fails(":set kmp=trunc\x00name", "E544:")
call assert_fails(":set kmp=trunc\x00name", "trunc")
endfunc
func Check_dir_option(name)
" Check that it's possible to set the option.
exe 'set ' . a:name . '=/usr/share/dict/words'
call assert_equal('/usr/share/dict/words', eval('&' . a:name))
exe 'set ' . a:name . '=/usr/share/dict/words,/and/there'
call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name))
exe 'set ' . a:name . '=/usr/share/dict\ words'
call assert_equal('/usr/share/dict words', eval('&' . a:name))
" Check rejecting weird characters.
call assert_fails("set " . a:name . "=/not&there", "E474:")
call assert_fails("set " . a:name . "=/not>there", "E474:")
call assert_fails("set " . a:name . "=/not.*there", "E474:")
endfunc
func Test_dictionary()
call Check_dir_option('dictionary')
endfunc
func Test_thesaurus()
call Check_dir_option('thesaurus')
endfunc
+9
View File
@@ -65,6 +65,15 @@ function Test_tabpage()
call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1)
tabclose
q
"
"
" Test for ":tab drop vertical-split-window" to jump test1 buffer
tabedit test1
vnew
tabfirst
tab drop test1
call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)])
1tabonly
endif
"
"
+64
View File
@@ -779,6 +779,70 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
124,
/**/
123,
/**/
122,
/**/
121,
/**/
120,
/**/
119,
/**/
118,
/**/
117,
/**/
116,
/**/
115,
/**/
114,
/**/
113,
/**/
112,
/**/
111,
/**/
110,
/**/
109,
/**/
108,
/**/
107,
/**/
106,
/**/
105,
/**/
104,
/**/
103,
/**/
102,
/**/
101,
/**/
100,
/**/
99,
/**/
98,
/**/
97,
/**/
96,
/**/
95,
/**/
94,
/**/
93,
/**/
92,
/**/
+22 -12
View File
@@ -269,6 +269,11 @@
# define UNUSED
#endif
/* Used to check for "sun", "__sun" is used by newer compilers. */
#if defined(__sun)
# define SUN_SYSTEM
#endif
/* if we're compiling in C++ (currently only KVim), the system
* headers must have the correct prototypes or nothing will build.
* conversely, our prototypes might clash due to throw() specifiers and
@@ -1736,17 +1741,6 @@ void mch_memmove(void *, void *, size_t);
void *vim_memset(void *, int, size_t);
#endif
#ifdef HAVE_MEMCMP
# define vim_memcmp(p1, p2, len) memcmp((p1), (p2), (len))
#else
# ifdef HAVE_BCMP
# define vim_memcmp(p1, p2, len) bcmp((p1), (p2), (len))
# else
int vim_memcmp(void *, void *, size_t);
# define VIM_MEMCMP
# endif
#endif
#if defined(UNIX) || defined(FEAT_GUI) || defined(VMS) \
|| defined(FEAT_CLIENTSERVER)
# define USE_INPUT_BUF
@@ -2501,9 +2495,25 @@ typedef enum
#define FNE_INCL_BR 1 /* include [] in name */
#define FNE_CHECK_START 2 /* check name starts with valid character */
#if (defined(sun) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) \
#if (defined(SUN_SYSTEM) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) \
&& defined(S_ISCHR)
# define OPEN_CHR_FILES
#endif
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
# define ELAPSED_TIMEVAL
# define ELAPSED_INIT(v) gettimeofday(&v, NULL)
# define ELAPSED_FUNC(v) elapsed(&v)
# define ELAPSED_TYPE struct timeval
long elapsed(struct timeval *start_tv);
#else
# if defined(WIN32)
# define ELAPSED_TICKCOUNT
# define ELAPSED_INIT(v) v = GetTickCount()
# define ELAPSED_FUNC(v) elapsed(v)
# define ELAPSED_TYPE DWORD
long elapsed(DWORD start_tick);
# endif
#endif
#endif /* VIM__H */
+4 -4
View File
@@ -17,7 +17,7 @@ There are three ways to remove Vim:
have to use uninstal.exe.
It's recommended to use the method that matches with how you installed Vim.
Thus if you installed Vim by hand, deleted it by hand.
Thus if you installed Vim by hand, delete it by hand.
The first two methods should be available from the Add/Remove software window
and the Vim entry in the Start menu. If these have been removed already, find
@@ -33,8 +33,8 @@ Here are guidelines for removing Vim by hand:
menu entry. You only need to run uninstal.exe when you have installed the
menu entry. You can also run uninstal.exe from the Control panel with the
Add/Remove programs application.
Note that uninstal.exe offers you to uninstal other items. You can skip
this.
Note that uninstal.exe offers you the option to uninstal other items. You
can skip this.
2. Only if you have used the OLE version of gvim: Remove the registration of
this program by running "gvim -unregister" in a console window.
@@ -46,7 +46,7 @@ Here are guidelines for removing Vim by hand:
If you created .bat files when installing Vim, also search for vim.bat,
gvim.bat, etc.
4. If you completely want to delete vim, and are not going to install another
4. If you want to completely delete vim, and are not going to install another
version, you can delete the vimrc files that you created. These are
normally located in a directory like "C:\vim". If the $VIM environment
variable is set, it will tell the name of the directory. Normally you can