Commit Graph

205 Commits

Author SHA1 Message Date
Ryan Prichard
7f22a27a10 win: integrate winpty (WIP)
Handling of process exit is still broken.  It detects the moment when the
child process exits, then quickly stops polling for process output.  It
should continue polling for output until the agent has scraped all of the
process' output.  This problem is easy to notice by running a command like
"dir && exit", but even typing "exit<ENTER>" can manifest the problem --
the "t" might not appear.

winpty's Cygwin adapter handles shutdown by waiting for the agent to close
the CONOUT pipe, which it does after it has scraped the child's last
output.  AFAIK, neovim doesn't do anything interesting when winpty closes
the CONOUT pipe.
2017-08-16 09:13:43 +02:00
Justin M. Keyes
a7538371fe build: linux does not always have execinfo.h (#7101)
Closes #7099
2017-07-30 23:02:41 +02:00
Justin M. Keyes
e6d54407ba Merge #7083 'build: disable array bounds checking in gcc < 4.8.5'
References #6931
2017-07-28 01:18:05 +02:00
John Szakmeister
3abf4c72b4 build: disable array bounds checking in gcc < 4.8.5
Thanks to James McCoy (jamessan) for finding the source of this issue.
2017-07-27 07:35:15 -04:00
Justin M. Keyes
42d892913d cmake: Remove custom "Dev" build-type. (#6932)
The main purpose of this build-type was to avoid unwanted ~/.nvimlog
files (which could get really big, and also affects performance) for
non-devs. But that is no longer necessary since the log system now
avoids non-critical logging by default (#6827).

This essentially reverts 87e5a41316
2017-06-29 09:29:40 +02:00
Justin M. Keyes
f34befe74c Merge #6789 from ZyX-I/lua-path
lua: Add paths from &runtimepath to package.path and package.cpath
2017-06-27 02:29:15 +02:00
Justin M. Keyes
fe1af9c2bc log: Always enable; remove DISABLE_LOG
- Establish ERROR log level as "critical". Such errors are rare and will
  be valuable when users encounter unusual circumstances.
- Set -DMIN_LOG_LEVEL=3 for release-type builds
2017-06-07 00:26:21 +02:00
Justin M. Keyes
1cf377f23a Merge #6777 from justinmk/bsd 2017-05-28 02:37:07 +02:00
Justin M. Keyes
a84926763f install: bsd: install manpages to /usr/local/man
https://svnweb.freebsd.org/ports/head/editors/neovim/Makefile?revision=428479&view=markup#l28

Closes #6771
2017-05-27 21:42:10 +02:00
ZyX
58f6ef50a8 ci: Also lint lua code in src/nvim/lua 2017-05-25 16:50:06 +03:00
Justin M. Keyes
7a1a3a1258 build: Default BUSTED_OUTPUT_TYPE to "nvim" (#6811) 2017-05-25 14:51:53 +02:00
Justin M. Keyes
6255c4e053 build: FreeBSD: Disable -Wc11-extensions only for clang
From FreeBSD ports patch:
https://svnweb.freebsd.org/ports/head/editors/neovim/files/patch-CMakeLists.txt?revision=425833&view=markup

References #4363
2017-05-21 13:44:02 +02:00
Florian Walch
7383274f66 cmake: Support building without LuaJIT. #6736
Compile `nvim` executable against Lua if PREFER_LUA=ON.

As the testing library `nvim-test` requires LuaJIT, it is
still compiled against LuaJIT. If LuaJIT is not available,
`nvim-test` is not built.
2017-05-13 16:59:06 +02:00
Björn Linse
244a1f97db Merge pull request #6704 from bfredl/luaexec
execute lua directly from the remote API
2017-05-13 15:06:41 +02:00
James McCoy
b43a3dbff8 Detect support for and use -Wimplicit-fallthrough 2017-05-12 14:41:51 -04:00
Björn Linse
12fb634fe6 API version bump 2017-05-12 10:02:36 +02:00
ZyX
09f849b600 Merge branch 'master' into luaviml'/lua 2017-05-08 15:43:45 +03:00
Rui Abreu Ferreira
685ca180f7 win: Terminal UI #6315
For CI builds unibilium is provided through msys2 packages, and
libtermkey is built from source in third-party from equalsraf/libtermkey.

In Windows we cannot read terminal input from the stdin file descriptor,
instead use libuv's uv_tty API. It should handle key input and encoding.

The UI suspend is not implemented for Windows, because the
SIGSTP/SIGCONT do not exist in windows. Currently this is a NOOP.

Closes #3902
Closes #6640
2017-05-03 12:48:24 +02:00
Justin M. Keyes
1b0d573a65 version bump 2017-05-01 22:17:32 +02:00
Justin M. Keyes
52727d98d7 NVIM v0.2.0
FEATURES:
    bc4a2e1576 help, man.vim: "outline" (TOC) feature #5169
    58422f17d8 'guicursor' works in the TUI (and sends info to UIs) #6423
    129f107c0c api: nvim_get_mode() #6247
    0b59f988f4 api/ui: externalize tabline #6583
    bc6d868d00 'listchars': `Whitespace` highlight group #6367
    6afa7d66cd writefile() obeys 'fsync' option #6427
    c60e409471 eval.c refactor (also improves some error messages) #5119
    9d200cd0a3 getcompletion("cmdline") #6376
    2ea7bfc627 terminal: Support extra arguments in 'shell'. #4504
    bf5110266c DirChanged autocmd #5928 #6262
    1743df82f9 'cpoptions': "_" flag to toggle `cw` behaviour #6235
    22337b1c01 CTRL-R omits trailing ^M when pasting to cmdline #6137
    0e44916fff :edit allows unescaped spaces in filename #6119
    abdbfd26bc eval: Add id() function and make printf("%p") useful #6095
    bdfa1479d2 findfile(), :find, gf work in :terminal. #6009
    2f38ed11c9 providers: Disable if `g:loaded_*` exists.
    b5560a69b1 setpos() can set lowercase marks in other buffers #5753
    7c513d646d Throttle :! output, pulse "..." message. #5396
    d2e8c76dc2 v:exiting #5651

    :terminal improvements #6185 #6142
      - cursor keeps position after leaving insert-mode.
      - 4ceec30cd0 Follows output only if cursor is at end of buffer.
      - e7bbd35c81 new option: 'scrollback'
      - fedb8443d5 quasi-support for undo and 'modifiable'
      - b45ddf731b disables 'list' by default
      - disables 'relativenumber' by default

    :help now contains full API documentation at `:help api`.

    man.vim saw numerous improvements.

    Windows support:
      - Windows is no longer "experimental", it is fully supported.
      - Windows package includes a GUI, curl.exe and other utilities.

    "Vim 8" features: partials, lambdas.

SECURITY FIXES:
    CVE-2017-5953 CVE-2017-6349 CVE-2017-6350 #6485

CHANGES:
    NVIM_TUI_ENABLE_CURSOR_SHAPE was removed. Use 'guicursor' instead.
        See https://github.com/neovim/neovim/wiki/Following-HEAD#20170402

    81525dc5c3 'mouse=a' is no longer the default. (This will probably
                 change again after it is improved.) #6022

    0c1f783164 defaults: 'showcmd', 'belloff', 'ruler' #6087
    eb0e94f71b api: {get,set}_option update local options as appropriate #6405
    bdcb2a38b3 "Reading from stdin..." message was removed. #6298

FIXES:
    12fc1defd6 ops: fix i<c-r> with multi-byte text #6524
    dd391bfca1 Windows: system() and friends #6497
    13352c00f1 Windows: os_get_hostname() #6413
    16babc6687 tui: Less-noisy mouse seqs #6411
    3a9dd13f9e (vim bug) folding edge-cases  #6207
    f6946c68ae job-control: set CLOEXEC on pty processes. #5986
    d1afd434f3 rplugin: Call s:LoadRemotePlugins() on startup.
    1215084676 backtick-expansion works with `shell=fish` #6224
    e32ec03d67 tui: Improved behavior after resize. #6202
    86c2adc074 edit.c: CTRL-SPC: Insert previously-inserted text. #6090
    c318d8e672 b:changedtick now follows VimL rules #6112
    34e24cb2f7 terminal: Initialize colors in reverse order #6160
    e8899178ec undo: Don't set b_u_curhead in ex_undojoin() #5869
    d25649fa01 undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)
    043d8ba422 'Visual-mode put from @. register' #5782
    42c922b32c open_buffer(): Do `BufEnter` for directories.
    50d0d89129 inccommand: Preview :sub commands only after delimiter #5932
    1420e10474 CheckHealth improvements #5519
    c8d5e9230e jobstart(): Return -1 if cmd is not executable. #5671
2017-05-01 22:13:23 +02:00
ZyX
ab4d13e2fa Merge branch 'master' into luaviml'/lua 2017-04-10 22:21:06 +03:00
ZyX
0f4b4c7529 headers: Remove useless HAVE_CONFIG_H macros
We do not have non-cmake build options, cmake always does configure_file.
2017-04-09 03:36:18 +03:00
ZyX
043d8ff9f2 Merge branch 'master' into luaviml'/lua 2017-04-08 01:54:58 +03:00
James McCoy
af2ee9c5d1
cmake: Detect whether msgpack-c has MSGPACK_OBJECT_FLOAT{32,64} types 2017-03-30 21:35:36 -04:00
ZyX
d60302d517 cmake: Link libnvim-test with luajit in place of lua, disable ASAN
Reasoning: luajit is not being compiled with sanitizers, lua is. Given that 
linking with sanitized libraries requires sanitizers enabled, it is needed to 
either compile libnvim-test with sanitizers or link it with lua compiled without 
sanitizers. Most easy way to do the latter is just use luajit which is compiled 
without sanitizers (as they do not work well with luajit).
2017-03-27 00:12:23 +03:00
ZyX
1646a28173 cmake: Allow switching from luajit to lua 2017-03-27 00:12:23 +03:00
ZyX
e7bbd8256b eval: Add luaeval function
No tests yet, no documentation update, no :lua* stuff, no vim module.

converter.c should also work with typval_T, not Object.

Known problem: luaeval("1", {}) results in

    PANIC: unprotected error in call to Lua API (attempt to index a nil value)

Ref #3823
2017-03-27 00:11:24 +03:00
Björn Linse
a5d03be7b8 api: bump api level to 2 2017-03-15 15:01:06 +01:00
Justin M. Keyes
039c7ab607 ci: MIN_LOG_LEVEL=2 (#6169)
DEBUG_LOG_LEVEL is very noisy and causes a lot of disk activity.
It is not needed on CI.
2017-02-24 11:03:56 +01:00
Justin M. Keyes
30826cb2d6 build: oldtest target: TEST_FILE, NVIM_PRG (#6098)
- Add support for TEST_FILE to the `oldtest` target, for consistency
  with the busted/lua tests.
  Caveat: with the busted/lua tests TEST_FILE takes a full path, whereas
  for `oldtest` it must be "test_foo.res".
- Add support for NVIM_PRG, again so that all test-related targets are
  consistent.
- Use consistent name for NVIM_PRG. But still need to support NVIM_PROG
  for QuickBuild CI.

Note: The `oldtest` target is driven by the top-level Makefile, because
it requires a TTY. CMake 3.2 added a USES_TERMINAL flag to
add_custom_target(). But we support CMake 2.8...

    add_custom_target(oldtest
      COMMAND make clean
      COMMAND make NVIM_PRG=$<TARGET_FILE:nvim> $ENV{MAKEOVERRIDES}
      DEPENDS nvim
      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/testdir"
      USES_TERMINAL true
    )
2017-02-12 01:02:54 +01:00
Justin M. Keyes
3803314f78 doc: QuickBuild 2017-01-31 08:58:43 +01:00
Justin M. Keyes
f78982620a build: Disable jemalloc for FreeBSD. (#6007)
jemalloc's README states:

> jemalloc [is] the FreeBSD libc allocator since 2005. ...  Modern jemalloc
> releases continue to be integrated back into FreeBSD

Since FreeBSD ships with jemalloc in some form, we don't need to require
jemalloc there. Less risk, low cost.
2017-01-26 13:07:30 +01:00
Justin M. Keyes
d3b4764dc1 win: Define USE_FNAME_CASE (#5962) 2017-01-17 16:32:41 +01:00
Rui Abreu Ferreira
ac44d0ed54 test: system([...]) 2017-01-11 01:05:55 +01:00
Justin M. Keyes
9956beee24 version bump 2016-11-27 20:03:35 +01:00
Justin M. Keyes
0542baac28 NVIM v0.1.7
FEATURES:
0213e99aaf PR #5561 'inccommand'

FIXES:
c685879eea PR #5632 SECURITY FIX
d28d108648 CheckHealth: Fix version comparison.
7be113d795 PR #5670 shell_write_cb: Schedule error message.
1d4563771b jobs: ensure calling jobclose() on a pty job sends SIGHUP.
36c0ec6dd4 tui/suspend_event(): set STDIN to "blocking"
7a4d069bcc, cf52b881d9 man.vim: avoid errors in unusual circumstances
ed198737fd PR #5546 ex_global: Catch CTRL-C even if it is mapped.

CHANGES:
9147331e21 PR #2905 encoding: only allow encoding=utf-8
5f0260808c PR #5636 build: Upgrade jemalloc
f1fed42ca7 PR #5567 l10n: Update Ukrainian translation
2016-11-27 20:03:30 +01:00
Justin M. Keyes
242c3d5f0b version bump 2016-10-28 15:16:59 +02:00
Justin M. Keyes
cc1ec959f1 NVIM v0.1.6
FEATURES:
0b5a7e4ad5 #4432 API: external UIs can render custom popupmenu
c6ac4f84b1 #4934 API: call any API method from vimscript
31df051ed9 #4568 API: nvim_call_atomic(): multiple calls in a single request
b268ba353a #5424 API: nvim_win_get_number(), nvim_tabpage_get_number()
e7e2844d46 has("nvim-1.2.3") checks for a specific Nvim version
522b885a0d #5295, #5493 `:CheckHealth` checks tmux, terminfo, performance
719dae2e01 #5384 events: allow event processing in getchar()
f25797f869 #5386 API: metadata: Nvim version & API level
22dfe6925d #5389 API: metadata: "since", "deprecated_since"
605e74327a Added QuickFixLine highlight group

CHANGES:
4af6ec746c #5253 perf: Disable clipboard in do_cmdline()
6e9f329d05 #5299 perf: Skip foldUpdate() in insert-mode.
9d4fcec7c6 #5426 perf: Do not auto-update folds for some foldmethods.
eeec0cab58 #5419 tui: Default to normal-mode cursor shape.

FIXES:
e83845285c #5436 tui: Fix "weird characters" / "bleeding termcodes"
10a54ad12e #5243 signal_init: Always unblock SIGCHLD.
bccb49bedb #5316 eval.c: Fix memory leak for detached pty job
626065d385 #5227 tchdir: New tab should inherit CWD.
cd321b7d0f #5292 getcwd(): Return empty string if CWD is invalid.
6127eaef05 shada: Fix non-writeable ShaDa directory handling
ca65514a24 #2789 system(): Respect shellxescape, shellxquote
2daf54ee8d #4874 Restore vim-like tab dragging
0c536b5d8a #5319 syntax.c: Support bg/fg special color-names.
3c53371b0c #4972 from justinmk/schedule-ui_refresh
68bcb32ec4 #4789 tui.c: Do not wait for tui loop on teardown.
c8b6ec2e6a #5409 v:count broken in command-line window
6bc3bcefc6 #5461 fix emoji display
51937e1322 #5470 fix :terminal with :argadd, :argu
79d77da8a0 #5481 external UIs: opening multiple files from command-line
657ba62a84 #5501 rplugin: resolve paths in manifest file
6a6f188d2a #5502 system('foo &', 'bar'): Show error, don't crash.
1ff162c0d9 #5515 os_nodetype: open fd with O_NONBLOCK
2a6c5bb0c4 #5450 modeline: Handle version number overflow.
0ade1bb706 #5225 CI tests now run against Windows!
2016-10-28 15:16:45 +02:00
Justin M. Keyes
c5f5f427c6 api: api_info()['version']
API level is disconnected from NVIM version. The API metadata holds the
current API level, and the lowest backwards-compatible level supported
by this instance.

Release 0.1.6 is the first release that reports the Nvim version and API
level.

    metadata['version'] = {
      major: 0,
      minor: 1,
      patch: 6,
      api_level: 1,
      api_compatible: 0,
      api_prerelease: false,
    }

The API level may remain unchanged across Nvim releases if the API has
not changed.

When changing the API,
    - set NVIM_API_PRERELEASE to true
    - increment NVIM_API_LEVEL (at most once per Nvim version)
    - adjust NVIM_API_LEVEL_COMPAT if backwards-compatibility was broken

api_level_0.mpack was generated from Nvim 0.1.5 with:
    nvim --api-info
2016-10-28 14:33:13 +02:00
Rui Abreu Ferreira
f25797f869 api: Nvim version, API level #5386
The API level is disconnected from the NVIM version. The API metadata
holds the current API level, and the lowest backwards-compatible level
supported by this instance.

Release 0.1.6 will be the first release reporting the Nvim version and
API level.

    metadata['version'] = {
      major: 0,
      minor: 1,
      patch: 6,
      prerelease: true,
      api_level: 1,
      api_compatible: 0,
    }

The API level may remain unchanged across Neovim releases if the API has
not changed.

When changing the API the CMake variable NVIM_API_PRERELEASE is set to
true, and  NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented
accordingly.

The functional tests check the API table against fixtures of past
versions of Neovim. It compares all the functions in the old table with
the new one, it does ignore some metadata attributes that do not alter
the function signature or were removed since 0.1.5.  Currently the only
fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
2016-10-26 14:23:50 +02: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
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
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
Rui Abreu Ferreira
4c9e5676cd Disable use of jemalloc in OpenBSD
Works around #3434, turning off the use of jemalloc in OpenBSD.
2016-09-10 18:43:04 +01: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
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
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
Justin M. Keyes
ad43480952 version bump 2016-08-22 00:28:47 -04:00
Justin M. Keyes
5b8255e251 NVIM v0.1.5
Features:
    c7d84c5550 PR #4980 Full `:ruby` support!
    c74ce334f2 PR #4624 timers: timer_start(), timer_stop()
    b8e6f04e69 PR #5205 `:CheckHealth` command

    47a15d0256 PR #4865 file: Add buffered reading and writing
        *Much* faster shada file reading (important for startup time).

    71b3e20d0f PR #4723 jobstart() learned 'rpc'
        jobs and RPC channel IDs share the same "namespace".
        jobstart() can starts RPC channels, which allows scripts to handle
        'stderr' on a RPC channel, like a typical non-RPC job.
        jobpid()/jobstop() work on RPC "jobs".
        Deprecates rpcstart().

    4dc4efc36f PR #4449 man.vim rewrite
        `:Man` command is enabled by default.
        New features: completion, window handling, better parsing, and more.

    8a4e5b4bc2 PR #4697 capture() function (renamed to execute())
        Supports nesting, including nested :redir.

    ae6db26b09 PR #5050 'rplugin manifest: default to XDG dir'
    a1682281f4 PR #5214 Restore ":browse oldfiles".
    1f7304b846 Better handling of mouse-clicks on concealed chars.
    5ea4d58a1b PR #5026 terminal: Ensure b:term_title always has a value
    c002310787 tui: Assume 256 colors in most cases.
    a2ecbc2cc0 PR #4929 Always resize the :terminal
    a59330d6fc PR #4925 api_info()
    a160590e40 PR #4813 allow setting cwd in jobstart(), termopen()
    74f6460181 PR #4633: support "special" highlight (undercurl)
    5a5ef1c222 PR #3450 mouse: Implement horizontal scroll.

Windows support:
    All PRs now build on Appveyor targeting win32 and win64!
    Numerous fixes!

Fixes:
    e9061117a5 PR #4646 Prevent data loss for process output streams
    7fa1baf44e PR #4798 'process.c: Fix block in teardown'
    c10fe010f1 Prevent endless loop in printdigraph(). (#5215)
    add41dca98 PR #5192 timers: Avoid crash after processing events
    006f9c0c9c PR #5195 Set the default value for 'packpath'
    6da7d6890c PR #5025 Restore double click
    d622e9c416 readfile(): Less-disruptive readonly check.
        Fixes an issue where nvim unnecessarily "touched" open files.
    fe6ec75725 PR #4964 Handle very long $XDG_DATA_DIRS.
    895f712df8 option: Do not expand options in XDG vars.
    1d8a076157 server_init: Handle server_address_new() failure.
    be531aba77 PR #5042 Fix v:register for clipboard=unnamed,unnamedplus
    204f557a11 PR #4984 'Trigger TabNewEntered with <CTRL-W>T'
    1e93e24f5e PR #4851 synIDattr(): Return RRGGBB value for `fg#`.

Changes:
    acc5d08b37 PR #4690 'termguicolors' option enables "true color".
        NVIM_TUI_ENABLE_TRUE_COLOR is now ignored.
2016-08-21 22:14:28 -04:00
Rui Abreu Ferreira
25ec29d4e1 Windows: Fix functionaltest fixtures 2016-08-07 21:57:29 +01:00