Commit Graph

6718 Commits

Author SHA1 Message Date
Justin M. Keyes
22fe76aec4 Merge #5418 from Shougo/vim-7.4.2158
vim-patch: 7.4.2158, 2162, 2205
2016-10-13 00:44:18 +02:00
Justin M. Keyes
6a2d40497a Merge #5427 from Shougo/vim-7.4.1714
vim-patch: 7.4.1765, 7.4.1714
2016-10-13 00:22:23 +02:00
Justin M. Keyes
51937e1322 Merge #5470 from justinmk/pr5445 2016-10-13 00:13:39 +02:00
Justin M. Keyes
e9fd1244b7 doc
yuck
2016-10-13 00:06:32 +02:00
Justin M. Keyes
8fb7972517 doc 2016-10-12 23:52:41 +02:00
Harm te Hennepe
3a54ce5a73 vim-patch:7.4.2274 (#5439)
Problem:    Command line completion on "find **/filename" drops sub-directory.
Solution:   Handle this case separately. (Harm te Hennepe, closes vim/vim#932, closes
            vim/vim#939)

73d4e4c892
2016-10-12 23:01:11 +02:00
James McCoy
68f7464eed
ui: Blank the next cell for any multi-cell character
Followup for #5461
2016-10-12 16:32:53 -04:00
Justin M. Keyes
6b7faf22f4 main.c: "BufReadCmd term://": Skip existing terminal.
Check `exists('b:term_title')` to avoid the BufReadCmd for already-initialized
:terminal buffers.

Move the test for `:argadd`.
Add a test for `:edit<CR>`.
Tweak comments and code style.
2016-10-12 21:37:08 +02:00
James McCoy
6bc3bcefc6
Merge pull request #5461 from jamessan/emoji-ui-regression
ui: Fix the call to utf_ambiguous_width
2016-10-12 12:53:44 -04:00
Harm te Hennepe
538255c228 terminal: Move re-edit detection to do_ecmd(). #5445
Closes #4784
2016-10-12 14:56:20 +02:00
John Szakmeister
cb351c678b Merge pull request #5467 from jszakmeister/prevent-in-tree-builds
build: prevent in-tree builds for the time being, as it's not supported
2016-10-12 04:03:15 -04:00
John Szakmeister
f098e53e6f Merge pull request #5466 from jszakmeister/fix-generated-files-for-in-tree-build
Fix generated files for in-tree build.
2016-10-12 04:02:47 -04:00
Justin M. Keyes
0190b9fb92 Merge #5463 from justinmk/te-skip-writes
term_write(): Skip writes if stream was closed.
2016-10-12 08:45:30 +02:00
Justin M. Keyes
b182f247ec eval/term_write(): Skip writes if stream was closed.
If the backing stream for a :terminal was closed (e.g. if the shell exits
unexpectedly) there may be pending input on the loop which will be processed
before the terminal close event (which is queued on the same loop).

terminal_send checks term->closed but this does not reflect the state of the
underlying streams. The terminal.c module in fact has no knowledge of the
streams (this seems intentional: it is abstracted as TerminalOption.write_cb).

The SIGCHLD handler (pty_process_unix.c) is executed immediately, and it
triggers a stream teardown so Stream.closed=false (TerminalJobData.in.closed).
When the pending writes are handled by eval.c:term_write, wstream_write() aborts
because it sees the closed Stream.

To avoid that, this commit checks Stream.closed in eval:term_write() before writing
to the WStream. (As hinted above, we cannot do this in terminal:terminal_send()
because that module cannot inspect the underlying streams.)

References #5445
https://github.com/neovim/neovim/pull/5445#issuecomment-252529766
2016-10-12 04:33:53 +02:00
Justin M. Keyes
ef4676ed5b test/terminal: Cover race when :term shell process exits.
References #5445

See https://github.com/neovim/neovim/pull/5445#issuecomment-252529766
2016-10-12 04:33:53 +02:00
John Szakmeister
baaddf358b build: fix generated file paths when building in-tree 2016-10-11 20:46:27 -04:00
John Szakmeister
53eddb881c build: prevent in-tree builds for the time being, as it's not supported 2016-10-11 20:20:31 -04:00
Shougo
1dde512498 UpdateRemotePlugins: Discard duplicate paths. (#5464) 2016-10-12 01:04:59 +02:00
James McCoy
892f55bd20
ui: Fix the call to utf_ambiguous_width
`utf_ambiguous_width` expects the Unicode character, but in 9e1c6596 I
just passed the first UTF-8 byte to the function.  This led to various
display problems because now many multi-cell characters weren't falling
into that part of the branch.

Also, to better align with the existing Vim code, remove the forced
cursor update.  Setting the flag will cause it to happen in the next
UI_CALL.

Thanks to qvacua for all the help investigating the issue!

Closes #5448
2016-10-11 18:59:01 -04:00
James McCoy
f1bc50d7da Merge pull request #5457 from jamessan/wincmd-count
window: Fix cmd_with_count's formatting when sizeof(long) != 8
2016-10-11 18:57:06 -04:00
James McCoy
d545c8e1ce
window: Fix cmd_with_count's formatting when sizeof(long) != 8
On architectures where `sizeof(long)` != 8, "%" PRId64 will read junk from
memory.  This was seen on various Debian builds where
test/functional/legacy/close_count_spec.lua would fail due to `1<C-w>c`
emitting an error like `E488: Trailing characters: close-87944975647104`.

Changing the `Prenum` parameter to int64_t ensures it is safe to use
`"%" PRId64`, and make another small step towards removal of the use of
`long`.
2016-10-11 16:22:24 -04:00
James McCoy
1dd98a03aa
lint 2016-10-09 22:06:45 -04:00
James McCoy
8fd12805d7
if_cscope: Fix conversion warnings when char defaults to unsigned
../src/nvim/if_cscope.c: In function 'cs_read_prompt':
    ../src/nvim/if_cscope.c:1771:47: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         while ((ch = (char)getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
                                                   ^~
    ../src/nvim/if_cscope.c:1804:14: warning: comparison is always false due to limited range of data type [-Wtype-limits]
           if (ch == EOF) {
                  ^~
    ../src/nvim/if_cscope.c:1816:14: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
             ch = EOF;
                  ^~~
    ../src/nvim/if_cscope.c:1821:12: warning: comparison is always false due to limited range of data type [-Wtype-limits]
         if (ch == EOF)
                ^~

Since EOF is -1, it will be converted to a large unsigned value to
compare with unsigned char and never match.  Use an int to store the
return from getc so we can safely compare it and, once known to be
valid, cast it to char when storing it into buf.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-09 21:13:08 -04:00
James McCoy
4192c411a8
Change constack.cs_flags from char to int
This fixes the -Wconversion warning when char's type is unsigned.

    ../src/nvim/ex_eval.c: In function 'ex_while':
    ../src/nvim/ex_eval.c:1000:28: warning: conversion to 'char' from 'int' may alter its value [-Wconversion]
           cstack->cs_lflags &= ~CSL_HAD_LOOP;
                                ^

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-09 21:13:07 -04:00
James McCoy
cb03517fd3
ci: Force unsigned char usage for the 32bit build
Since C leaves whether char is signed or unsigned up to the implementer,
there are different defaults on different architectures.

Forcing unsigned char for one of our CI builds should help catch these
issues moving forward.
2016-10-09 21:12:45 -04:00
James McCoy
4408431086 Merge pull request #5411 from P4Cu/vim-7.4.1549
vim-patch:7.4.1549
2016-10-08 20:51:32 -04:00
James McCoy
27ced483cc Merge pull request #5447 from mhinz/makefile/add-prefix
Makefile: add PREFIX variable
2016-10-08 20:38:32 -04:00
James McCoy
26a6ed55c6 Merge pull request #5451 from jamessan/set-username-hostname
config: Allow setting USERNAME/HOSTNAME from the environment
2016-10-08 20:28:01 -04:00
James McCoy
9b0b281b75
config: Allow setting USERNAME/HOSTNAME from the environment
Allowing this to be controlled externally improves reproducibility, as
well as provides a more useful address to report for "Compiled by".  For
example, I intend to set it to the packaging list when building the
Debian package.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-08 14:22:36 -04:00
Marco Hinz
c13f72ee0a
Makefile: add PREFIX variable
We use a Makefile which in turn uses cmake. If we wanted to set the install
prefix for cmake, we had to do this so far:

  make CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/tmp/nvim"

That's long and hard to remember. Following the conventions of other Makefiles,
this now works as well and is equivalent:

  make PREFIX=/tmp/nvim
2016-10-08 18:39:35 +02:00
Justin M. Keyes
1984072822 Merge #5428 'vim-patch: 0c1ff16, 939a1ab, 8067a64'. 2016-10-08 17:17:43 +02:00
Marco Hinz
31f6334aa8 CheckHealth: choose correct path for the latest version (#5446)
If multiple versions of a package are installed, the provider health check could
choose a wrong path:

  /usr/local/lib/python3.5/site-packages/neovim-0.1.10-py3.5.egg-info/PKG-INFO
  /usr/local/lib/python3.5/site-packages/neovim-0.1.9-py3.5.egg-info/PKG-INFO

Prior to this change :CheckHealth could falsely show 0.1.9 as the installed
version, since glob() doesn't enforce any predictable order.

Now we sort all potential paths numerically in descending order and just look at
the first path instead.
2016-10-08 16:34:54 +02:00
Justin M. Keyes
91d13bd861 hardcopy.c: Fix -Wmaybe-uninitialized warning. 2016-10-08 00:05:50 +02:00
Patrick Jackson
09e0c96201 lint: Removing dead initializations #5410 2016-10-08 00:01:03 +02:00
Jurica Bradaric
1b61bd93ae server_requests_spec: Expect correct window ID. 2016-10-07 17:07:17 +02:00
Jurica Bradaric
61024fb4a8 eval: Exit early if argument is invalid. 2016-10-07 17:07:17 +02:00
Jurica Bradaric
50bd8297e6 vim-patch:7.4.1895
Problem:    Cannot use a window ID where a window number is expected.
Solution:   Add LOWEST_WIN_ID, so that the window ID can be used where a
            number is expected.

888ccac890
2016-10-07 17:07:16 +02:00
Jurica Bradaric
d8079e5ab7 vim-patch:7.4.1893
Problem:    Cannot easily get the window ID for a buffer.
Solution:   Add bufwinid().

b3619a90ea
2016-10-07 17:07:16 +02:00
Justin M. Keyes
b6300742d2 Merge #5444 from malept/dont-hardcode-python3-in-checkhealth
Fix Python 2/3 health checks
2016-10-07 12:15:49 +02:00
Mark Lee
a8f9d56796 health: fix Python 2 variable names 2016-10-06 22:09:36 -07:00
Mark Lee
153e6835f1 health: remove duplicate nvim_path declaration
It's the same as the declaration above it, but hardcoded to use python3
and does not redirect stderr.
2016-10-06 22:09:10 -07:00
Shougo
2ef1b68751 version.c: mark NA patches (#5380)
NA list:

1653: matchit packadd
1750: channel
1770: termguicolors
1794: GUI Win32
1805: Makefile
1804, 1945: manpager.vim
1811: channel
2115, 2232, 2278, 2319: defaults.vim

included:
1763: spell
2016-10-06 16:22:20 +02:00
Florian Larysch
e83845285c tui/flush_buf: Don't toggle cursor when called from out() #5436
unibi_format() calls out() multiple times for a given format string.
When data->buf fills up during this process, flush_buf() gets called,
which possibly calls unibi_out() again to toggle the cursor visibility.
However, if we were halfway through outputting an escape sequence, doing
this will clobber it, resulting in junk being displayed.

Fix this by not toggling the cursor visibility when draining a full
buffer in out().
2016-10-06 15:57:24 +02:00
Justin M. Keyes
d57f25e5ef doc/vim_diff.txt (#5432) 2016-10-06 09:45:24 +02:00
James McCoy
1ebb75b1ec api: Support getting the number of a window/tabpage
In order to provide better compatibility with the classic bindings, the
API needs to provide the ability to query the number (really index) of
the window/tabpage.

This is needed for neovim/python-client#87, as discussed in
neovim/neovim#1898.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-04 14:34:35 -04:00
James McCoy
b1edc8abb7 Merge pull request #5366 from NovaDev94/vim-7.4.1740
vim-patch:7.4.1740
2016-10-04 13:14:56 -04:00
Shougo Matsushita
7bc86b2bbc vim-patch:0c1ff16
updated runtime files.  Add avra syntax.

0c1ff16b54
2016-10-04 23:34:28 +09:00
Shougo Matsushita
d4f32d0789 vim-patch:939a1ab
Updated runtime files.

939a1abe93
2016-10-04 23:33:28 +09:00
Shougo Matsushita
31a29e41b0 vim-patch:8067a64
Add missing test file.

8067a64852
2016-10-04 23:25:37 +09:00
Shougo Matsushita
fdb0a5e24e vim-patch:7.4.1765
Problem:    Undo options are not together in the options window.
Solution:   Put them together.  (Gary Johnson)

4694a17d1e
2016-10-04 23:18:24 +09:00