Commit Graph

6553 Commits

Author SHA1 Message Date
ZyX
6127eaef05 shada: Fix non-writeable ShaDa directory handling
Before this change,

    nvim -i /etc/shada

segfaults on exit if the file does not exist and user does not have
permissions to create the file at /etc/shada.

Closes #5296
Reported in #5277
https://github.com/neovim/neovim/issues/5277#issuecomment-243937255
2016-09-04 21:45:48 -04:00
HiPhish
cd321b7d0f getcwd(): Return empty string if CWD is invalid. #5292
Closes #5291

Restores behaviour identical to Vim. If the user calls the VimScript
function 'getcwd()' and the working directory cannot be found (for
example because the directory has been deleted since the last time it
was used) an empty string needs to be returned instead of throwing an
error.
2016-09-04 08:01:31 -04:00
Jurica Bradarić
73b8424fad vim-patch:7.4.1913 (#5260)
Problem:    When ":doautocmd" is used modelines are used even when no
            autocommands were executed. (Daniel Hahler)
Solution:   Skip processing modelines. (closes vim/vim#854)

1610d05241
2016-09-04 23:43:41 +02:00
Jurica Bradarić
0f381f26cb vim-patch:7.4.1971 (#5262)
Problem:    It is not easy to see unrecognized error lines below the current
            error position.
Solution:   Add ":clist +count".

e8fea0728a
2016-09-04 23:40:12 +02:00
Kalle Ranki
e75e9c10dc test: Add unittest spec for option.c (#5289)
Move typedef expand_T to types.h for tests
Fix lint error for old style comments

Describe 'check_ff_value' valid values as an initial test.

Fix 'get_sts_value' comment inaccuracy and add unit test for it
2016-09-04 09:54:41 +02:00
Anmol Sethi
9bba8ba372 [RFC] man.vim: remove <Plug> mappings (#5290)
- :Man with no arguments opens the manapage for the
  <cWORD> (man buffers) or <cword> (non-man buffers).
- remove now irrelevent comment about -P flag
2016-09-04 03:53:58 +02:00
Alejandro Sanchez
626065d385 tchdir: New tab should inherit CWD. (#5227)
When a new tabpage gets created it will copy the local working directory
of the previous one, if there is any.
2016-09-04 03:40:01 +02:00
Jurica Bradarić
5d8d24f0c2 vim-patch:7.4.1900 (#5259)
Problem:    Using CTRL-] in the help on "{address}." doesn't work.
Solution:   Recognize an item in {}. (Hirohito Higashi, closes vim/vim#814)

28b942a064
2016-09-04 03:30:36 +02:00
Nicolas Hillegeer
a9c5423263 signal_init: unblock all signals on startup. #5283
As discussed on #5243 and #5283.

Helped-by: John Szakmeister <john@szakmeister.net>
Helped-by: Justin M. Keyes <justinkz@gmail.com>
2016-09-03 19:16:23 -04:00
Justin M. Keyes
2f6d3e599b Merge #5249 'man.vim' 2016-09-03 14:01:04 -04:00
Justin M. Keyes
c9e39f8227 man.vim: Avoid hard redraw.
Use system() instead of :read to avoid a hard redraw.
2016-09-03 13:59:37 -04:00
Anmol Sethi
f8fc8f51c0 man.vim #5249
- fix synopsis highlighting in other locales. Cannot always rely on the first
  line for the section in some locales; instead, use the file path and
  explicitly set b:man_sect to the actual section.
- eliminate separate s:man_args function
- simplify logic: do not reuse buffer content
- introduce b:man_default_sects Fixes #5233
- introduce <Plug>(man_vsplit), <Plug>(man_tab)
- simplify regexps
2016-09-03 12:57:41 -04:00
James McCoy
94dfb6cea2 Merge pull request #5286 from jamessan/strtoimax-error-checking
Fix error-handling of strtoimax boundary conditions
2016-09-03 00:55:27 -04:00
Patrick Jackson
0253766b5d lint: Close resource leak (#5288) 2016-09-03 00:41:55 +02:00
James McCoy
a371f1027e Fix error-handling of strtoimax boundary conditions
strtoimax is only required to set errno if there is an
underflow/overflow.  In those conditions, strtoimax returns
INTMAX_MIN/INTMAX_MAX respectively, so that's the only time we should be
checking the value of errno.

Even in those conditions, errno needs to be set to a known good value
before calling strtoimax to differentiate between "value is actually
INTMAX_MAX/MIN" and "value over/underflows".

Closes #5279
2016-09-02 10:11:32 -04:00
oni-link
f175b281cf helpers.c: Fix invalid state of failed conversion result for object_to_vim() (#5282)
If a conversion for a container fails in object_to_vim(), the memory for
the container in the returned/converted value is freed, but the returned
value keeps a pointer to the freed memory. Calling later clear_tv() on
this value leads to an invalid memory access.

Set v_type to VAR_UNKNOWN in the converted value on failure, so that
clear_tv() has no effect.
2016-09-01 23:52:58 +02:00
Björn Linse
c6ac4f84b1 Merge pull request #4934 from bfredl/api
make the API callable from vimL, rename API functions to common nvim_ prefix
2016-09-01 18:32:37 +02:00
Björn Linse
acb7c826b3 api: fix leak when a api function is incorrectly called with a list.
This applies both to msgpack-rpc and eval.
2016-08-31 21:57:06 +02:00
Björn Linse
98a08c3e5a api: add tests for calling the api from vimscript 2016-08-31 21:57:06 +02:00
Björn Linse
1c22cab2fd api: consistently use nvim_ prefix and update documentation 2016-08-31 21:57:06 +02:00
Björn Linse
e536abc1e1 api: Allow blacklist functions that shouldn't be accesible from eval
Blacklist deprecated functions and functions depending on channel_id
2016-08-31 21:57:06 +02:00
Björn Linse
7e2348f2b1 eval: use gperf to generate the hash of builtin functions
make api functions highlighted as builtins in vim.vim
2016-08-31 21:57:04 +02:00
Björn Linse
87e054bb24 api: When calling get/set_lines from vimL, don't convert between "\n" and "\0". 2016-08-31 21:40:20 +02:00
Björn Linse
a2d25b7bf8 api: unify buffer numbers and window ids with handles
also allow handle==0 meaning curbuf/curwin/curtab
2016-08-31 21:40:20 +02:00
Björn Linse
3bd3b3b768 api: auto generate api function wrappers for viml 2016-08-31 21:40:20 +02:00
Björn Linse
de3a515123 api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the header generator. 2016-08-31 21:40:20 +02:00
ZyX
5e59916e84 eval: Use generated hash to look up function list
Problems:
- Disables cross-compiling (alternative: keeps two hash implementations which
  need to be synchronized with each other).
- Puts code-specific name literals into CMakeLists.txt.
- Workaround for lua’s absence of bidirectional pipe communication is rather
  ugly.
2016-08-31 21:40:20 +02:00
Björn Linse
abe00d583e eval: add new function entries 2016-08-31 21:40:20 +02:00
ZyX
8fb7273ac0 eval: Move VimL functions list to a lua file
Removes all kinds of problems with sorting, provides a ready-to-use function
list representation for genvimvim.lua, does not require specifying function name
twice (VimL function name (string) + f_ function name).
2016-08-31 21:40:20 +02:00
Björn Linse
0ade1bb706 Merge pull request #5225 from equalsraf/windows-functionaltests
Enable functional tests in Appveyor
2016-08-31 21:39:42 +02:00
Rui Abreu Ferreira
9ce81f7b2b functionaltest: Create lua helper for os.tmpname()
In Windows Lua's os.tmpname() returns relative paths starting with \s,
prepend them with $TEMP to generate a valid path.

In OS X os.tmpname() returns paths in '/tmp' but they should be in
'/private/tmp'. We cannot use os_name() for platform detection because
some tests use tempname() before nvim is spawned, instead use one of the
following:

1. Set SYSTEM_NAME environment variable before calling the tests, it
   is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows')
2. Call uname -s
3. Assume windows
2016-08-31 11:32:28 +01:00
Jurica Bradarić
7fd771619f vim-patch:7.4.1896 (#5258)
Problem:    Invoking mark_adjust() when adding a new line below the last line
            is pointless.
Solution:   Skip calling mark_adjust() when appending below the last line.

82faa259cc
2016-08-29 14:35:48 -04:00
Justin M. Keyes
10a54ad12e signal_init: Always unblock SIGCHLD. (#5243)
Inherited signal mask may block SIGCHLD, which causes libuv to hang at
epoll_wait.

Closes #5230

Helped-by: Nicolas Hillegeer <nicolas@hillegeer.com>
Helped-by: John Szakmeister <john@szakmeister.net>

Note: the #pragma gymnastics are a workaround for broken system headers on
macOS.

  signal.h:
      int  sigaddset(sigset_t *, int);
      #define     sigaddset(set, signo)   (*(set) |= __sigbits(signo), 0)
  sys/_types/_sigset.h:
      typedef __darwin_sigset_t            sigset_t;
  sys/_types.h:
      typedef __uint32_t   __darwin_sigset_t;      /* [???] signal set */

sigset_t is defined as unsigned int, but the sigaddset() ORs it with an int,
mixing the types.  So GCC generates a sign-conversion warning:

  sig.c:9:13: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    (*(&s) |= __sigbits((sigset_t) 20), 0);
           ~~ ^~~~~~~~~~~~~~~~~~~~~~~~
  1 warning generated.

System headers are normally ignored when the compiler generates warnings:
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html

  > GCC gives code found in system headers special treatment. All warnings,
  > other than those generated by ‘#warning’ (see Diagnostics), are suppressed
  > while GCC is processing a system header. Macros defined in a system header
  > are immune to a few warnings wherever they are expanded. This immunity is
  > granted on an ad-hoc basis, when we find that a warning generates lots of
  > false positives because of code in macros defined in system headers.

Instead of the #pragma workaround, we could cast the sigset_t pointer:

    # if defined(__APPLE__)
      sigaddset((int *)&mask, SIGCHLD);
    # else
      sigaddset(&mask, SIGCHLD);
    # endif

but that could break if the headers are later fixed.
2016-08-29 13:39:32 -04:00
Björn Linse
0b5a7e4ad5 Merge pull request #4432 from bfredl/pum_ui
allow external UI:s to render the popupmenu
2016-08-29 11:00:24 +02:00
Björn Linse
8d6e3f2b88 api/ui: add documentation for remote ui redraw events 2016-08-29 10:17:31 +02:00
Björn Linse
c41bacc67c api/ui: add tests for popupmenu_external events
update screen.lua to use new style nvim_ui_attach
2016-08-29 10:17:31 +02:00
Björn Linse
e968d72cae api/ui: use ui options instead of one method per feature
Use new nvim_ui_ prefix to avoid breaking change.
2016-08-29 10:17:31 +02:00
Björn Linse
999af47be8 api/ui: allow popupmenu to be drawn by external ui 2016-08-29 10:17:31 +02:00
KillTheMule
0b3ec84840 Add if_cscope documentation for querytype 'a'
From 802a0d902fca423acb15f835d7b09183883d79a0.
2016-08-26 22:13:56 +02:00
KillTheMule
e587b490a0 Lint 2016-08-26 21:50:19 +02:00
KillTheMule
59468e3495 vim-patch:7.4.2033
Problem:    'cscopequickfix' option does not accept new value "a".
Solution:   Adjust list of command characters. (Ken Takata)

6d20e17544

All changes applied manually. Definition of `CSQF_CMDS` was moved to
`option_defs.h` in nvim.
2016-08-26 21:50:19 +02:00
KillTheMule
1995be8451 vim-patch:7.4.1990
Problem:    Cscope items are not sorted.
Solution:   Put the new "a" command first. (Ken Takata)

80632db65e

All changes applied manually.
2016-08-26 21:50:19 +02:00
KillTheMule
86a95c5117 vim-patch:7.4.1952
Problem:    Cscope interface does not support finding assignments.
Solution:   Add the "a" command. (ppettina, closes vim/vim#882)

b12e7ef956

All changes applied manually.
2016-08-26 21:50:18 +02:00
Justin M. Keyes
97c6d80ca7 release.sh: Sign the tag.
Also: hacks for BSD sed.
2016-08-26 03:51:52 -04:00
Rui Abreu Ferreira
39c628d031 Mark some functional tests as pending in Windows 2016-08-26 08:21:41 +01:00
Rui Abreu Ferreira
0089ef6b65 Appveyor: Enable functional tests
Most functional tests don't work on Windows yet, for now enable a subset of the tests in Appveyor builds.
2016-08-26 08:21:41 +01:00
Rui Abreu Ferreira
703cf3197f third-party: Windows fix for luv build recipe
The argument quotes in the luv build recipe did not work
in Windows.
2016-08-26 08:09:56 +01:00
Rui Abreu Ferreira
bed61041a0 third-party: Build busted in Windows
Busted now builds on Windows, remove the check. In Windows the binary
is called busted.bat.
2016-08-26 08:09:56 +01:00
Michael Ennen
9da4d0dfee Update to libuv 1.9.1 2016-08-26 08:09:56 +01:00
Rui Abreu Ferreira
eb2d547bd5 build: Refactor appveyor/Windows scripts (#5244)
- Join all msys build scripts into one
- Clean up appveyor.yml and generate installer for tagged builds

A side effect of the cosmetic changes is that appveyor artifact
permalinks are easier to use, e.g. for the latest zip in the
master branch

    https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_64
2016-08-26 01:38:46 -04:00