Commit Graph

3622 Commits

Author SHA1 Message Date
Justin M. Keyes
3dd166b203 Merge #2598 'set stdin as "blocking" on exit' 2015-05-27 09:34:40 -04:00
Justin M. Keyes
b2c400b3f2 input: rename input_{start,stop}_stdin()
- "stdin" is misleading because it may read from stdout or stderr
- also remove some unused includes
2015-05-27 09:34:05 -04:00
Justin M. Keyes
4219b69145 input: stream_set_blocking(): libuv impl
- Create a private libuv loop instead of re-using uv_default_loop(), to
  avoid conflict[1] with existing watcher(s) on the fd.
- Expose the global "input" fd as a getter instead of a mutable global.

[1] .deps/build/src/libuv/src/unix/core.c:833:
      uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
2015-05-27 09:34:04 -04:00
Justin M. Keyes
8a782f1699 input: set input stream to blocking on exit
If stdin is non-blocking, many tools (e.g. cat(1), read(1)) which assume
that stdin is blocking, will break in odd ways:

  read: read error: 0: Resource temporarily unavailable
  cat: -: Resource temporarily unavailable
  rm: error closing file

libuv puts stdin in nonblocking mode, and leaves it that way at exit
(this is apparently by design). So, before this commit, this always
works (because the shell clobbers O_NONBLOCK):

  $ nvim --cmd q
  $ read

...but these forms do _not_ work:

  $ nvim --cmd q && read
  $ echo foo | nvim --cmd q && read
  $ nvim && read

After this commit, all of the above forms work.

Background:

437b4397b9 (diff-41f4d294430cd8c36538999d62681ae2)
https://github.com/fish-shell/fish-shell/issues/176#issuecomment-15800155

- bash (and other shells: zsh, tcsh, fish), upon returning to the
  foreground, always sets fd 0 back to blocking mode. This practice only
  applies to stdin, _not_ stdout or stderr (in practice these fds may be
  affected anyways).
- bash/zsh/tcsh/fish do _not_ restore the non-blocking status of stdin
  when _resuming a job_.
- We do _not_ save/restore the original flags visible to
  fcntl(F_[SG]ETFL), because (counterintuitively) that isn't expected.

Helped-by: oni-link <knil.ino@gmail.com>

Closes #2086
Closes #2377

---

Note: The following implementation of stream_set_blocking() was
discarded, because it resulted in a failed libuv assertion[1]:

  int stream_set_blocking(int fd, bool blocking)
  {
    uv_pipe_t stream;
    uv_pipe_init(uv_default_loop(), &stream, 0);
    uv_pipe_open(&stream, fd);
    int retval = uv_stream_set_blocking((uv_stream_t *)&stream, blocking);
    uv_close((uv_handle_t *)&stream, NULL);
    return retval;
  }

[1] .deps/build/src/libuv/src/unix/core.c:833: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
2015-05-27 09:32:31 -04:00
David Bürgin
5a9ad68b25 vim-patch:7.4.582 #2653
Problem:    Can't match "%>80v" properly. (Axel Bender)
Solution:   Correctly handle ">". (Christian Brabandt)

https://github.com/vim/vim/commit/v7-4-582

See https://groups.google.com/d/msg/vim_dev/n-02i4FnOcw/P3Yyx1OLeXgJ

Slightly adapted due to the long_u refactoring in
2ceb1c74d5.

Reviewed-by: Florian Walch <florian@fwalch.com>

Fixes #2726
2015-05-26 01:07:37 -04:00
David Bürgin
c6da503336 vim-patch:7.4.579 #2652
Problem:    Wrong cursor positioning when 'linebreak' is set and lines wrap.
Solution:   (Christian Brabandt)

https://github.com/vim/vim/commit/v7-4-579

See https://groups.google.com/d/msg/vim_dev/Eh3N9L68Ajw/4dB5x1RTQJQJ
2015-05-26 00:49:05 -04:00
Justin M. Keyes
a7b5ae37a7 Merge #2555 Remove "j" flag from 'cpoptions' 2015-05-25 16:30:17 -04:00
David Bürgin
e4c3ac1f82 tests: Convert legacy test29 2015-05-25 16:29:01 -04:00
David Bürgin
44175224cc 'cpoptions': Remove "j" flag 2015-05-25 16:29:00 -04:00
Daniel Hahler
297973ab00 tui: defer resize event #2738
When maximizing the window, often only lines would be detected properly
with the `try_resize` handler being called immediately.

Fixes https://github.com/neovim/neovim/issues/2322.
2015-05-25 14:42:12 -04:00
Nelson Yeung
8ce22c6323 tests: Migrate legacy test 31 #2736 2015-05-25 15:47:12 +03:00
Shougo Matsushita
d9f97e3026 completion: Add v:completed_item feature #2563
Reviewed-by: Michael Reed <m.reed@mykolab.com>
Reviewed-by: Luke Andrew <luke.github@la.id.au>
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Florian Walch <florian@fwalch.com>
2015-05-24 17:05:12 -04:00
Rui Abreu Ferreira
8ef5a61dd6 cmake: Use cmake -E touch instead of touch #2730
CMake has a portable touch command using cmake -E touch, use
it instead of calling touch that is only available in Unix.
2015-05-24 02:22:32 -04:00
Rui Abreu Ferreira
466bb84ff0 Rename var eof as input_eof #2728
- In Windows eof is a function, renamed the eof var in input.c
  to input_eof
2015-05-24 02:17:32 -04:00
Michael Reed
8c27b0dd45 Merge pull request #2715 from equalsraf/tb-platform-thingies
[RDY] Small fixes for platform checks

Reviewed-by: Scott Prager <splinterofchaos@gmail.com>
Reviewed-by: Michael Reed <m.reed@mykolab.com>
2015-05-21 18:38:00 -04:00
Rui Abreu Ferreira
99aacb1429 cmake: Remove unneeded platform checks
Removed unneeded platform checks from config/config.h.in and
config/CMakeLists.txt

- HAVE_OSPEED and HAVE_UP_BC_PC were used by the old UI, and are
  no longer needed.
- sigvec() was used as part of the signal handling code in os_unix.c, but it is
  no longer used in Neovim.
- The function lstat() is no longer used, replaced with libuv.
2015-05-21 23:16:40 +01:00
Rui Abreu Ferreira
82c36970b8 Dont require setenv() in non Unix systems
config/CMakeLists.txt failed with a fatal error if the functions
setenv  could not be found, however this functions only exist in Unix
systems.
2015-05-21 23:16:39 +01:00
Rui Abreu Ferreira
ac42fb8ca7 Add guard for sys/wait.h header in job.c #2686
The sys/wait.h include was moved after the vim.h include, since the include
guards are defined in config.h the guards cannot be used earlier.
2015-05-21 02:09:50 -04:00
Rui Abreu Ferreira
e1f83d304d Add header guards for sys/time.h and unistd.h in log.c 2015-05-21 02:09:49 -04:00
David Bürgin
32837cc7df 'cpoptions': Remove "-" flag #2655 2015-05-21 01:31:30 -04:00
Felipe Morales
eca51bbfa0 options: Include "j" in default 'formatoptions' #2669 2015-05-21 01:28:20 -04:00
Steven Oliver
1add7a422f sha256.c: Remove unused headers and comments #2714
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
2015-05-21 01:24:21 -04:00
Perry Hung
04a3d5ecc7 vim-patch:f654ad9 #2659
Update runtime files.

https://code.google.com/p/vim/source/detail?r=f654ad95fd4e25e014dda71963b9745a4bf5f83b

Resolves issue #1999.
2015-05-20 16:31:28 -04:00
Michael Reed
dac8bcd090 CONTRIBUTING.md: Fix broken links #2702
The wiki has had a dedicated "Troubleshooting" page for a while now.
2015-05-19 17:06:22 -04:00
Felipe Morales
3c2eae6cc6 options: Search upwards for tags file #2670
Also remove some references to emacs tags from the docs.

References https://github.com/neovim/neovim/issues/1664
2015-05-19 16:58:46 -04:00
Florian Walch
e211362a6d vim-patch:c5d53d4 #2695
Update runtime files.

https://code.google.com/p/vim/source/detail?r=c5d53d4c3e2e24e23fc4272bf91be3c031ccb598
2015-05-19 12:31:44 -04:00
Björn Linse
5bbd182a3e msgpack-rpc: handle failure to convert method arguments #2664 2015-05-19 16:21:01 +02:00
Florian Walch
90fae3663f vim-patch:4abac79 #2694
Update runtime files.

https://code.google.com/p/vim/source/detail?r=4abac79c0b7ae7aac0cb32d9930e155de628b63f
2015-05-19 12:44:56 +03:00
Michael Reed
73137e0a84 deps: Update unibilium 1.12 -> 1.14 #2665
From here[1]:

1.1.4   2015-04-26
        - move maintainer options from GNUmakefile to maint.mk
        - compile with -O2 by default

1.1.3   2015-04-25
        - fix permission error when installing into existing directory
          (gh PR #7)
        - relicense tools/*.c under MIT (gh #9)
        - add change log in Changes

[1]: https://github.com/mauke/unibilium/compare/v1.1.2...v1.1.4
2015-05-18 20:31:57 -04:00
Michael Reed
182b550ef2 Merge pull request #2532 from Pyrohh/doc-cleanup-3
[RDY] Doc cleanup (3) + terminal remnants

Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
2015-05-18 11:07:24 -04:00
Michael Reed
a16eab9e57 Remove -T command-line option
It didn't actually do anything after
3baba1e7bc

Helped-by: Justin M. Keyes <justinkz@gmail.com>
2015-05-18 11:06:54 -04:00
Michael Reed
64cecd917d Cleanup 'ttyscroll' remnants
Removed in 3baba1e7bc, but the docs
weren't updated.
2015-05-18 11:06:54 -04:00
Michael Reed
59b7299570 Cleanup 'weirdinvert' remnants
Removed in 3baba1e7bc, but the docs
weren't updated.
2015-05-18 11:06:54 -04:00
Michael Reed
c50c831b85 Cleanup 'ttym[ouse]', FEAT_MOUSE, mouse_(dec|gpm|etc.)
Because of 3baba1e7bc, it's dead code.

Helped-by: Justin M. Keyes <justinkz@gmail.com>
2015-05-18 11:06:54 -04:00
Michael Reed
00cf632b2b Cleanup misc.
Regarding debugger.txt (which was Spotted by @Hettomei):
The third section was empty, and the second section is very outdated.
Nvim doesn't have things like Balloon Evalutation and Sun Visual
workshop integration, so just remove the section.

Regarding everything else:
- term.[ch] and term_defs.h don't exist anymore, so remove refs to them
- Add ttybuiltin to vim_diff.txt. It should have been done before, but
  vim_diff.txt didn't exist when ttybuiltin was removed (done in
  3baba1e7bc6698e6bc9f1d37fce88b30d6274bc9,)

Helped-by: Justin M. Keyes <justinkz@gmail.com>
2015-05-18 11:06:54 -04:00
Florian Walch
f415932b2d README: Add AppVeyor badge. #2691 2015-05-18 11:03:48 -04:00
Thiago de Arruda
1352725beb build: Limit --coverage flag to files under "src"
Resolves #2632. This is done so C helper modules don't generate unexpected
coverage output.

Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Florian Walch <florian@fwalch.com>
2015-05-18 04:28:01 -03:00
Florian Walch
945186be2e deps: Update LuaJIT to 2.0.4. #2688
Changes since 2.0.3:

 - Fix stack check in narrowing optimization.
 - Fix Lua/C API typecheck error for special indexes.
 - Fix string to number conversion.
 - Fix lexer error for chunks without tokens.
 - Don't compile IR_RETF after CALLT to ff with-side effects.
 - Fix BC_UCLO/BC_JMP join optimization in Lua parser.
 - Fix corner case in string to number conversion.
 - Gracefully handle lua_error() for a suspended coroutine.
 - Avoid error messages when building with Clang.
 - Fix snapshot #0 handling for traces with a stack check on entry.
 - Fix fused constant loads under high register pressure.
 - Invalidate backpropagation cache after DCE.
 - Fix ABC elimination.
 - Fix debug info for main chunk of stripped bytecode.
 - Fix FOLD rule for string.sub(s, ...) == k.
 - Fix FOLD rule for STRREF of SNEW.
 - Fix frame traversal while searching for error function.
 - Prevent GC estimate miscalculation due to buffer growth.
 - Prevent adding side traces for stack checks.
 - Fix top slot calculation for snapshots with continuations.
 - Fix check for reuse of SCEV results in FORL.
 - Add PS Vita port.
 - Fix compatibility issues with Illumos.
 - Fix DragonFly build (unsupported).
 - OpenBSD/x86: Better executable memory allocation for W^X mode.
 - x86: Fix argument checks for ipairs() iterator.
 - x86: lj_math_random_step() clobbers XMM regs on OSX Clang.
 - x86: Fix code generation for unused result of math.random().
 - x64: Allow building with LUAJIT_USE_SYSMALLOC and LUAJIT_USE_VALGRIND.
 - x86/x64: Fix argument check for bit shifts.
 - x86/x64: Fix code generation for fused test/arith ops.
 - ARM: Fix write barrier check in BC_USETS.
 - PPC: Fix red zone overflow in machine code generation.
 - PPC: Don't use mcrxr on PPE.
 - Various archs: Fix excess stack growth in interpreter.
 - FFI: Fix FOLD rule for TOBIT + CONV num.u32.
 - FFI: Prevent DSE across ffi.string().
 - FFI: No meta fallback when indexing pointer to incomplete struct.
 - FFI: Fix initialization of unions of subtypes.
 - FFI: Fix cdata vs. non-cdata arithmetic and comparisons.
 - FFI: Fix __index/__newindex metamethod resolution for ctypes.
 - FFI: Fix compilation of reference field access.
 - FFI: Fix frame traversal for backtraces with FFI callbacks.
 - FFI: Fix recording of indexing a struct pointer ctype object itself.
 - FFI: Allow non-scalar cdata to be compared for equality by address.
 - FFI: Fix pseudo type conversions for type punning.

Taken from http://luajit.org/changes.html
2015-05-18 10:09:09 +03:00
Michael Reed
4140d23cc0 Manual pages: Fix incorrect environment variable references
This was done prematurely for #2569, but obviously forgotten about.
2015-05-17 19:19:41 -04:00
Felipe Morales
b90378dfb0 options: Enable &wildmenu, use "list:longest,full" for &wildmode by default #2677 2015-05-17 15:24:31 -04:00
David Bürgin
b1403e7d44 vim-patch:7.4.597 #2658
Problem:    Cannot change the result of systemlist().
Solution:   Initialize v_lock. (Yukihiro Nakadaira)

https://github.com/vim/vim/commit/v7-4-597

See https://groups.google.com/d/msg/vim_dev/WXCfHMeqjfk/n2PjNwZ2bzIJ
2015-05-17 15:11:10 -04:00
cztchoice
7341b285d0 vim-patch: Mark some patches as NA #2672
These changes cannot apply because they
a) fix compiler warning
b) modify removed GUI related code
c) modify removed build files

mark the following patch as NA:
* 7.4.728, https://github.com/vim/vim/commit/v7-4-728
* 7.4.727, https://github.com/vim/vim/commit/v7-4-727
* 7.4.726, https://github.com/vim/vim/commit/v7-4-726
* 7.4.724, https://github.com/vim/vim/commit/v7-4-724
* 7.4.720, https://github.com/vim/vim/commit/v7-4-720
* 7.4.705, https://github.com/vim/vim/commit/v7-4-705
* 7.4.681, https://github.com/vim/vim/commit/v7-4-681
* 7.4.679, https://github.com/vim/vim/commit/v7-4-679
* 7.4.677, https://github.com/vim/vim/commit/v7-4-677
* 7.4.676, https://github.com/vim/vim/commit/v7-4-676
* 7.4.674, https://github.com/vim/vim/commit/v7-4-674
* 7.4.669, https://github.com/vim/vim/commit/v7-4-669
* 7.4.663, https://github.com/vim/vim/commit/v7-4-663
* 7.4.657, https://github.com/vim/vim/commit/v7-4-657

Reviewed-by: David Bürgin <676c7473@gmail.com>
Reviewed-by: Michael Reed <m.reed@mykolab.com>
Reviewed-by: oni-link <knil.ino@gmail.com>
2015-05-17 15:03:49 -04:00
Michael Reed
aa1d9a1807 Build: Use GNUInstallDirs, install man pages #2649
For now, only install man pages matching "nvim*.1": we don't want to
install xxd.1 as it might conflict with that of a user's Vim
installation.

closes #1826

Reviewed-by: Florian Walch <florian@fwalch.com>
Helped-by: John Szakmeister <john@szakmeister.net>
2015-05-17 14:57:43 -04:00
Björn Linse
d9acfbd471 options: mark nonfunctional &termencoding option as hidden. #2631
Remove related dead code and references in the docs.

Helped-By: Michael Reed <m.reed@mykolab.com>
Helped-By: Shougo Matsushita <Shougo.Matsu@gmail.com>
2015-05-17 18:39:25 +02:00
Justin M. Keyes
f4423c9697 Merge #2620 'repurpose legacy v:servername' 2015-05-17 02:17:34 -04:00
Justin M. Keyes
85c51baf06 passing-by: get_vim_var_str: mark non-null return 2015-05-17 02:17:34 -04:00
Justin M. Keyes
84443f176e doc: v:servername, serverstart() 2015-05-17 02:17:34 -04:00
Justin M. Keyes
64c7a36933 test: v:servername, serverstart(), serverstop() 2015-05-17 02:17:34 -04:00
Justin M. Keyes
3e4534f40f server: repurpose legacy v:servername
- On startup, v:servername is equivalent to $NVIM_LISTEN_ADDRESS
- v:servername may be considered the "default" server address
- v:servername does not change unless the associated server is stopped
  by serverstop()
2015-05-17 02:17:34 -04:00
David Bürgin
7a7d082e12 vim-patch:7.4.562 #2593
Problem:    Segfault with wide screen and error in 'rulerformat'. (Ingo Karkat)
Solution:   Check there is enough space. (Christian Brabandt)

https://github.com/vim/vim/commit/v7-4-562
2015-05-16 23:46:29 -04:00