Commit Graph

6643 Commits

Author SHA1 Message Date
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
James McCoy
48dbb75ff6 iconv: Always include errno.h when USE_ICONV is defined (#5251)
When USE_ICONV is defined, iconv.h references various errno constants,
but errno.h is only being included when HAVE_ICONV_H is not defined.
This causes build failures on at least GNU/Hurd.
2016-08-25 22:02:40 -04:00
Justin M. Keyes
7bc627b3c8 Merge #5210 'vim-patch:7.4.1898 + :Man modifiers support'. 2016-08-25 21:54:00 -04:00
Justin M. Keyes
4af6ec746c Merge #5253 'perf: Disable clipboard in do_cmdline()' 2016-08-25 20:47:00 -04:00
Justin M. Keyes
7a589e4a9e lint 2016-08-25 20:36:59 -04:00
Björn Linse
41a64586c7 Merge pull request #5232 from bfredl/dictchar_u
eval: remove char_u in  get_dict_(string|number) key parameters
2016-08-25 19:16:03 +02:00
Justin M. Keyes
c826ebd3de perf: Disable clipboard in do_cmdline().
For any script--not just `:global` commands--there is no reason to
update the system clipboard until the script is finished, so disable it
during do_cmdline().

Before this change, 'clipboard=unnamedplus' causes scripted editing to
be extremely slow (e.g. `:normal` in a while-loop).

Closes #3534
2016-08-25 11:16:22 -04:00
Justin M. Keyes
c79bf4ec99 ops.c: Rename start_global_changes(). 2016-08-25 10:34:47 -04:00
Anmol Sethi
db2aa27df1
man.vim: if reusing a buffer, do not use noautocmd
The commit that added support for modifiers regressed #5168
causing #5172. This commit fixes it again.
2016-08-24 15:41:51 -04:00
Anmol Sethi
470883d705
man.vim: slight refactoring
Addresses problem one in #5240
2016-08-24 11:51:59 -04:00
Anmol Sethi
f5d3f3da6f
use bool type for flag mod_entry_T members 2016-08-24 11:51:59 -04:00