Commit Graph

6632 Commits

Author SHA1 Message Date
Marco Hinz
0fa4f98a05
Revert "Makefile: add PREFIX variable"
This reverts commit c13f72ee0a.

References #5447.
2016-10-16 12:17:00 +02:00
Justin M. Keyes
97caabc49a test: execute_spec: Adjust screen assertion.
The previous form was passing because it happens immediately before this form;
 but on a very fast(?) server the screen check might miss that form. It's also
 not really want we want to assert anyways.
2016-10-15 22:16:48 +02:00
Michael Ennen
3a2903c836 vim-patch: 7.4.1619 (#5475)
Problem:    When 'fileformats' is set in the vimrc it applies to new buffers
            but not the initial buffer.
Solution:   Set 'fileformat' when starting up. (Mike Williams)

364fa5c7ec
2016-10-16 00:02:31 +02:00
Shougo
4169fc8281 vim-patch:7.4.1833 (#5484)
Problem:    Cannot use an Ex command for 'keywordprg'.
Solution:   Accept an Ex command. (Nelo-Thara Wallus)

2ff8b64679
2016-10-15 23:59:23 +02:00
James McCoy
b268ba353a Merge pull request #5424 from jamessan/win-tab-nr
api: Support getting the number of a window/tabpage
2016-10-15 15:29:53 -04:00
James McCoy
885db120fa Merge pull request #5456 from jamessan/char-sign-conversion
Enable CI testing of unsigned char and fix fallout
2016-10-15 15:29:13 -04:00
Björn Linse
9477c5bb5b Merge pull request #5384 from bfredl/getchar_event
allow event processing in getchar()
2016-10-15 10:36:34 +02:00
Björn Linse
719dae2e01 events: allow event processing in getchar()
this is consistent with vim, and is necessary for plugins that implement
their own input modes using "getchar()" and still want to do async
event processing.
2016-10-15 09:50:59 +02:00
Linda_pp
79d77da8a0 startup: Remove 'N files to edit' message. #5481
Problem:
    When '--embed' passed to command line arguments, stdin and stdout
    are used for IPC. But when multiple files are passed as
    arguments, nvim wrongly sends 'N files to edit' message to its
    stdout. As the result, attaching to process from frontend failed.

Solution:
    Remove the message because it doesn't fill any purpose.
2016-10-14 18:12:10 +02:00
Justin M. Keyes
819b79dbc5 health/provider.vim: Pass errors through. Give more feedback. 2016-10-13 17:55:15 +02:00
Justin M. Keyes
c9b9f052cc Revert "tui: Move ui_bridge module to tui/ namespace."
ui_bridge.c is useful for libnvim consumers, not just the built-in TUI.

This reverts commit beb2e4f095.
2016-10-13 16:05:06 +02:00
Justin M. Keyes
294c0ba014 health/provider.vim: Fix system([]) invocations.
Closes #5435
2016-10-13 15:17:24 +02:00
Justin M. Keyes
5060ebc5d0 test/tui_spec: Force LANG=C
References #5455
2016-10-13 14:20:03 +02:00
Justin M. Keyes
5a61ff188c Merge #5257 from jbradaric/vim-7.4.1893
vim-patch:7.4.{1893,1895}
2016-10-13 01:19:09 +02:00
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