Commit Graph

432 Commits

Author SHA1 Message Date
b-r-o-c-k
7097aba6be cmake: Organize targets into folders
Enabling CMake's USE_FOLDERS option and adding the FOLDER property to
targets allows some IDEs to list the targets in an organized
hierarchy of folders.
2018-06-17 07:54:39 -05:00
Justin M. Keyes
fa2ad305e3 version bump 2018-06-11 10:58:54 +02:00
Justin M. Keyes
44c6deb91a NVIM v0.3.0
FEATURES:
3cc7ebf810 #7234 built-in VimL expression parser
6a7c904648 #4419 implement <Cmd> key to invoke command in any mode
b8363283fa #7679 'startup: treat stdin as text instead of commands'
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
7a13611ba2 #8276 'startup: Let `-s -` read from stdin'
1e71978cf0 events: VimSuspend, VimResume #8280
1e7d5e8cdf #6272 'stdpath()'
f96d99ad11 #8247 server: introduce --listen
e8c39f72fd #8226 insert-mode: interpret unmapped META as ESC
98e7112390 msg: do not scroll entire screen (#8088)
f72630b784 #8055 let negative 'writedelay' show all redraws
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
a4f6cec7a3 cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
207b7ca4bc #6844 channels: support buffered output and bytes sockets/stdio

API:
f85cbea725 #7917 API: buffer updates
418abfc9d0 #6743 API: list information about all channels/jobs.
36b2e3f743 #8375 API: nvim_get_commands
273d2cd5d5 #8329 API: Make nvim_set_option() update `:verbose set …`
8d40b3617c #8371 API: more reliable/descriptive VimL errors
ebb1acb3c0 #8353 API: nvim_call_dict_function
9f994bb699 #8004 API: nvim_list_uis
34057045be #7520 API/UI: forward option updates to UIs
911b1e49ab #7821 API: improve nvim_command_output

WINDOWS OS:
9cefd83cc7 #8084, #8516 build/win: support MSVC
ee4e1fd8ec win: Fix reading content from stdin (#8267)

TUI:
ffb8904913 #8309 TUI: add support for mouse release events in urxvt
8d5a46e77b #8081 TUI: implement "standout" attribute
60716371e9 TUI: support TERM=konsole-256color
67848c0b91 #7653 TUI: report TUI info with -V3 ('verbose' >= 3)
3d0ee17c91 TUI/rxvt: enable focus-reporting
d109f5645b #7640 TUI: 'term' option: reflect effective terminal behavior

FIXES:
ed6a113804 #8273 'job-control: avoid kill-timer race'
4e02f1ab87 #8107 'jobs: separate process-group'
451c48a092 terminal: flush vterm output buffer on pty output #8486
5d6732ff09 :checkhealth fixes #8335
53f11dcfc7 #8218 'Fix errors reported by PVS'
d05712fbe7 inccommand: pause :terminal redraws (#8307)
51af911a27 inccommand: do not execute trailing commands #8256
84359a467f terminal: resize to the max dimensions (#8249)
d49c1dda8b #8228 Make vim_fgets() return the same values as in Vim
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
0c59ac1a2c #5908 'shada: Also save numbered marks'
ba87a2cde7 cscope: ignore EINTR while reading the prompt (#8079)
b1412dc412 #7971 ':terminal Enter/Leave should not increment jumplist'
3a5721e91b TUI: libtermkey: force CSI driver for mouse input #7948
6ff13d78b7 #7720 TUI: faster startup
1c6e956079 #7862 TUI: fix resize-related segfaults
a58c9094db #7676 TUI: always hide cursor when flushing, never flush buffers during unibilium output
303e1df13f #7624 TUI: disable BCE almost always
249bdb07dd #7761 mark: Make sure that jumplist item will not have zero lnum
6f41ce0260 #7704 macOS: Set $LANG based on the system locale
a043899ba2 #7633 'Retry fgets on EINTR'

CHANGES:
ad60927d09 #8304 default to 'nofsync'
f3f1970597 #8035 defaults: 'fillchars'
a6052c7307 #7984 defaults: sidescroll=1
b69fa866db #7888 defaults: enable cscopeverbose
7c4bb23ff3 defaults: do :filetype stuff unless explicitly "off"
2aa308c685 #5658 'Apply :lmap in macros'
8ce6393048 terminal: Leave 'relativenumber' alone (#8360)
e46534b423 #4486 refactor: Remove maxmem, maxmemtot options
131aad953c win: defaults: 'shellcmdflag', 'shellxquote' #7343
c57d315963 #8031 jobwait(): return -2 on interrupt also with timeout
6452831cf9 clipboard: macOS: fallback to tmux if pbcopy is broken #7940
300d3651e2 #7919 Make 'langnoremap' apply directly after a map
ada1956206 #7880 'lua/executor: Remove lightuserdata'

INTERNAL:
de0a9548f7 #7806 internal statistics for list impl
dee78a4095 #7708 rewrite internal list impl
2018-06-11 00:46:49 +02:00
Justin M. Keyes
f72f638f97 doc: job/channel, misc #7783
doc: termios defaults. ref #6992
doc: :help shell-powershell
doc: provider: Python minimum version is 2.7, 3.4
doc: remove :!start special-case. #5844
doc: mention #7917 change which accepts empty Array for Dictionary parameter
doc: <Cmd> pseudokey
doc: lmap change #5658
doc: -s, -es
2018-06-11 00:08:27 +02:00
b-r-o-c-k
61890382eb deps: Build bundled dependencies automatically for IDEs
Environment variables are used to detect when the project is being built
from within Clion or Visual Studio, so that the build process can be
simplified by automatically building the bundled dependencies for them.
2018-06-10 09:57:12 -05:00
b-r-o-c-k
d87e5d7016 build/msvc: Add libiconv to bundled dependencies 2018-06-09 20:50:02 -05:00
Justin M. Keyes
b7032cf1e3 win: enable DYNAMIC_ICONV 2018-06-06 00:58:58 +02:00
Justin M. Keyes
21c9db1861 build/CMake: find_package(… REQUIRED)
"Always use `find_package` with `REQUIRED`."

- We make an exception for LuaJit (not REQUIRED): the `nvim-test` target
  is included only if we can find LuaJit.

This is partially a cargo-cult (reference below), but it uncovered at
least one problem: `find_package(LibIntl REQUIRED)` fails on my vanilla
ubuntu 16.04 system.

ref: https://schneide.blog/2017/11/06/4-tips-for-better-cmake/

> optional dependencies is nice, but skipping on REQUIRED is not the way
> you want to do it. In the worst case, some of your features will just
> not work if those packages are not found, with no explanation
> whatsoever. Instead, use explicit feature-toggles (e.g. using option())
> that either skip the find_package call or use it with REQUIRED, so the
> user will know that another lib is needed for this feature.
2018-06-06 00:58:57 +02:00
Björn Linse
6da4548f0e api: list information about all channels/jobs.
Fire autocmd when channel opens or its info changes.
Add a way for API clients can describe themselves.
2018-05-23 18:18:16 +02:00
Jan Edmund Lazo
7e9afca990 win/package: move gui shim to its runtime folder (#8418)
Close #7517

gui shim is for nvim-qt only.
2018-05-20 08:27:52 +02:00
Justin M. Keyes
ef4feab0e7
version: rename "0.2.3" to "0.3.0" (#8268)
0.2.1 was a big release, it should have been renamed to 0.3.0.
0.2.3 also has significant changes, so rename it.
2018-04-13 22:15:52 +02:00
Justin M. Keyes
cb5cde6e2b
build/CMake: use CMake-2.8.7-compatible list-check (#8220)
Tested with:
    make CMAKE_EXTRA_FLAGS='-DLANGUAGES="en_GB;ja;sk"'

closes #8219
2018-04-02 12:40:31 +02:00
Marty E. Plummer
362346f563 build/CMake: LANGUAGES config option #8203
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
2018-03-31 10:59:45 +02:00
Justin M. Keyes
9a0147754c build: respect $DEPS_BUILD_DIR
Without this, the CI_TARGET=lint travis job cant't find the cached deps
(in $HOME/nvim-deps), nor can it update the cache.
2018-03-11 15:38:18 +01:00
b-r-o-c-k
01fc02beee build/msvc: Add missing WIN32 macro
MSVC predefines `_WIN32`, but not `WIN32`. Also, some unnecessary includes have been removed.
2018-03-04 17:44:23 -06:00
Justin M. Keyes
4b81f627c6 build/gcc: disable -Warray-bounds entirely #7923
We need to disable -Warray-bounds locally for kbtree.h, but we can't
because _Pragma("GCC diagnostic pop") is broken in GCC 5.x+.

So this commit disables -Warray-bounds entirely (for GCC only).

GCC bug:
"_Pragma diagnostic 'ignored' in macro with strict-overflow not
suppressing warning fully with -Werror"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099

ref https://github.com/neovim/neovim/pull/7083#issuecomment-326323599
closes #7921
2018-02-19 22:14:34 +01:00
James McCoy
86ee92f2a2
cmake: Set TEST_LIBNVIM_PATH to empty string when not unit testing 2018-02-02 07:28:56 -05:00
James McCoy
41a91af5cf cmake: Use generator expression to determine libnvim-test path
Prior to CMake 2.8.12, generator expressions could only be used in
custom commands so the path to libnvim-test in test/config/paths.lua was
set by inspecting the target's LOCATION property.  Post 2.8.12, the
file(GENERATE) command exists to handle this, but it can't interpolate
normal CMake variables.

In order to bridge the gap while < 2.8.12 is supported, use
configure_file() to create paths.lua.gen with the
$<TARGET_FILE:nvim-test> generator expression and then generate the
final paths.lua file.

Closes #7077
2018-01-22 14:16:31 -05:00
ZyX
6a1557f2f4 eval/typval: Log list actions
New logging is guarded by cmake LOG_LIST_ACTIONS define. To make it more
efficient it is allocated as a linked list with chunks of length
2^(7+chunk_num); that uses basically the same idea as behind increasing kvec
length (make appending O(1) (amortized)), but reduces constant by not bothering
to move memory around what realloc() would surely do: it is not like we need
random access to log entries here to justify usage of a single continuous memory
block.
2018-01-14 01:33:18 +03:00
ZyX
fe3a58273e cmake: Fix api/version test failure 2017-11-19 22:24:26 +03:00
Justin M. Keyes
d6f9d1df04 version bump 2017-11-18 12:46:38 +01:00
Justin M. Keyes
6d2c30daf3 NVIM v0.2.2
FEATURES:
a6de144c3e 'viewoptions': add "curdir" flag #7447
b6a603fe51 node.js remote-plugin support #7458
f5d4da0144 :checkhealth : validate 'runtimepath' #7526

FIXES:
e6beb60da5 :terminal : fix crash on resize #7547
f19e5d6530 work around gnome-terminal memory leak #7573
07931ed1c8 'guicursor': use DECSCUSR for xterm-likes #7576
f185c739bc 'os_open: UV_EINVAL on NULL filename' #7561
e8af34dc63 win: provider: Detect(): return *.cmd path #7577
eacd788cf5 :checkhealth : fix check for npm and yarn #7569
a43a573ad5 health.vim: normalize slashes for script path #7525
69e3308771 cmake: install runtime/rgb.txt
d0b05e3c36 runtime: syntax error in `runtime/syntax/tex.vim` #7518
55d8967147 tutor: some fixes #7510

CHANGES:
9837a9c401 remove legacy alias to `v:count` #7407
c5f001a46a runtime: revert netrw update #7557
67e4529292 defaults: scrollback=10000 #7556
881f9e42d1 process_close(): uv_unref() detached processes #7539
2017-11-18 12:39:14 +01:00
Justin M. Keyes
c46d6f8da2 version bump 2017-11-08 01:25:06 +01:00
Justin M. Keyes
c67dd5acd0 NVIM v0.2.1
FEATURES:
0e873a30f3 Lua(Jit) built-in #4411
5b32bce73c Windows: `:terminal` #7007
7b0ceb3726 UI/API: externalize cmdline #7173
b67f58b284 UI/API: externalize wildmenu #7454
b23aa1cf09 UI: 'winhighlight' #6597
17531ed082 UI: command-line coloring (`:help input()-highlight`) #6364
244a1f97db API: execute lua directly from the remote api #6704
45626de63f API: `get_keymap()` #6236
db999821d4 API: `nvim_get_hl_by_name()`, `nvim_get_hl_by_id()` #7082
dc685387a3 menu_get() function #6322
9db42d4ce9 :cquit : take an error code argument #7336
9cc185dc6d job-control: serverstart(): support ipv6 #6680
1b7a9bf4d2 job-control: sockopen() #6594
6efe84af68 clipboard: fallback to tmux clipboard #6894
6016ac270f clipboard: customize clipboard with `g:clipboard` #6030
3a86dd54f3 ruby: override ruby host via `g:ruby_host_prog` #6841
16cce1ac17 debug: $NVIM_LOG_FILE #6827
0cba3da26e `:checkhealth` built-in, validates $VIMRUNTIME #7399

FIXES:
105d680aea TUI: more terminals, improve scroll/resize #6816
cb912a3eda :terminal : handle F1-F12, other keys #7241
619838f85d inccommand: improve performance #6949
04b3c32772 inccommand: Fix matches for zero-width #7487
60b1e8ad12 inccommand: multiline, other fixes #7315
f1f7f3b512 inccommand: Ignore leading modifiers in the command #6967
1551f71321 inccommand: fix 'gdefault' lockup #7262
6338199b76 API: bufhl: support creating new groups #7414
541dde36e3 API: allow K_EVENT during operator-pending
8c732f7274 terminal: adjust for 'number' #7440
5bec94652c UI: preserve wildmenu during jobs/events #7110
c349083155 UI: disable 'lazyredraw' during ui_refresh. #6259
51808a244e send FocusGained/FocusLost event instead of pseudokey #7221
133f8bc628 shada: preserve unnamed register on restart #4700
1b70a1da04 shada: avoid assertion on corrupt shada file #6958
9f534f338a mksession: Restore tab-local working directory #6859
de1084f3c4 fix buf_write() crash #7140
7f7698649f syntax: register 'Normal' highlight group #6973
6e7a8c3fe2 RPC: close channel if stream was closed #7081
85f3084e21 clipboard: disallow recursion; show hint only once #7203
8d1ccb606d clipboard: performance, avoid weird edge-cases #7193
01487d4385 'titleold' #7358
01e53a5cbe Windows: better path-handling, separator (slash) hygiene #7349
0f2873ce99 Windows: multibyte startup arguments #7060

CHANGES:
9ff0cc7085 :terminal : start in normal-mode #6808
032b088c84 lower priority of 'cursorcolumn', 'colorcolumn' #7364
2a3bcd1ff8 RPC: Don't delay notifications when request is pending #6544
023f67cad8 :terminal : Do not change 'number', 'relativenumber' #6796
1ef2d768e7 socket.c: Disable Nagle's algorithm on TCP sockets #6915
6720fe253e help: `K` tries Vim help instead of manpage #3104
7068370560 help, man.vim: change "outline" map to `gO` #7405
2017-11-07 23:54:31 +01:00
Justin M. Keyes
37420ef942 build: set MIN_LOG_LEVEL correctly (#7419)
closes #7283
regression by 42d892913d

- Don't need to explicitly put "-O2 -g" in RelWithDebInfo; CMake does
  that already. That was left-over from 42d892913d which removed the
  "Dev" custom build-type, but repurposed the logic for RelWithDebInfo.

- `if(DEFINED MIN_LOG_LEVEL)` doesn't work.
- `if(${MIN_LOG_LEVEL} MATCHES "^$")` doesn't work if -DMIN_LOG_LEVEL is
  omitted.
- `if(MIN_LOG_LEVEL)` also isn't what we want: it would be true if
  MIN_LOG_LEVEL=0.
2017-10-21 02:30:21 +02:00
James McCoy
6d471636ee
cmake: Check if the compiler understands -Wno-array-bounds
Closes #7297
2017-09-23 07:42:15 -04:00
James McCoy
b9cba41106
tui: Use unibi_var_from_num when available
As of unibilium 1.2.1, directly manipulating unibi_var_t is deprecated.

    ../src/nvim/tui/tui.c: In function 'update_attrs':
    ../src/nvim/tui/tui.c:321:7: warning: 'i' is deprecated: use unibi_var_from_num or unibi_num_from_var instead [-Wdeprecated-declarations]
           data->params[0].i = (fg >> 16) & 0xff;  // red
           ^~~~
    In file included from ../src/nvim/tui/tui.c:12:0:
    /usr/include/unibilium.h:632:9: note: declared here
         int i   UNIBI_DEPRECATED("use unibi_var_from_num or unibi_num_from_var instead");
             ^

All use should go through unibi_{num,str}_from_var and
unibi_var_from_{num,str}.  Wrap access of unibi_var_t behind a new
UNIBI_SET_NUM_VAR macro which uses the new functions when they're
available.
2017-09-16 23:23:01 -04:00
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
Josh Triplett
fc98d2d96d Pass busted the path to the detected Lua interpreter
Otherwise, busted may run a different interpreter than the one we
detected, without the capabilities we expect.  (For instance, we might
have detected the luajit interpreter, but busted might run the lua
interpreter, without the ffi module.)
2016-07-13 00:37:50 -07:00
Nicolai Skogheim
c475e3f8d1 cmake: remove unused includes (#4947) 2016-06-22 22:46:21 -04:00
Florian Walch
abe47d5f64 CMake: Search all possibly usable Lua executables. (#4858) 2016-06-03 12:21:29 -04:00
Rui Abreu Ferreira
46aac2a09a Windows: Don't build the TUI is systems where it is not supported
The TUI can be enabled/disabled at build time with -DFEAT_TUI, default is ON for
UNIX, and OFF for non UNIX. When off, Neovim prints a message to stderr, along
with a list of the server endpoints.
2016-05-27 23:43:40 +01:00
Rui Abreu Ferreira
d5c89b1896 cmake: Allow building without Luajit
By default Neovim searched a Luajit instalation and linked against
the luajit library.

In practice Neovim only requires luajit to run the unit tests. All other
targets only require lua and the correct lua modules. This commit:

1. Remove the strict dependency on Luajit
2. Makes the unittest target depend on the lua 'ffi' module.
   If the module is not available the target is not enabled
   and a message is displayed.
2016-05-19 17:55:19 +01:00
Dimitri Merejkowsky
2582754bdd Fix running tests from Ninja 2016-05-17 23:23:32 +02:00
Justin M. Keyes
7925ffc872 version bump 2016-04-24 21:58:07 -04:00
Justin M. Keyes
4dcd19d9bc NVIM v0.1.4
Features:
  5ebffaa :tcd for tab-local working directory (like :lcd, but for tabs)
  d835c03 remote/define.vim: support remote function "range"
  007d573 json_encode/json_decode (with sophisticated error detection) #4131
  b50afb4 clipboard: support "lemonade" tool

Fixes:
  cc1beec eval.c: Fix heap corruption error. #4592
  4043725 mbyte.c: Fix invalid memory access in utfc_ptr2char_len #4574
  4eb5827 Enable syntax/filetype by default. #4558

Changes:
  5c6592f v:windowid is writeable (useful for GUIs) #4608
2016-04-24 21:46:34 -04:00
Thiago de Arruda
c18d5917e3 Update lua client to 0.0.1-24
The new version of the lua client uses libmpack as a backend, and some test
scripts had to be updated to reflect that.
2016-04-13 09:21:32 -03:00
Justin M. Keyes
e605faaa2f version bump 2016-04-08 17:26:07 -04:00
Justin M. Keyes
f4f80a238b NVIM v0.1.3
Features:
  f2ae5a9 Add TextYankPost and TextDeletePost autocmds
  44b2cef bufhl: new mechanism for plugins to add highlights to a buffer
  39c3842 Make set{qf,loc}list() take {title}
  77a7ca4 'shortmess': Add "F" flag. #4446
  99d4c8c keymap: Support <D-...> (super/command key).

Fixes:
  14c9b30 terminal.c: temporary fix for incorrect paste handling

Notable changes:
  50e129f defaults: Enable syntax and filetype plugins.
  4e39eee upgrade libvterm (improves terminal reflow)
2016-04-07 22:04:21 -04:00
Justin M. Keyes
d9ecd06627 build: Specify old behavior for POLICY CMP0059.
This is needed as long as we support cmake older than 2.8.12. When we
bump the minimum version to 2.8.12, we can use target_compile_options()
and add_compile_options() instead.

Closes #4389
2016-03-09 10:25:45 -05:00
Thiago de Arruda
646ab30858 Add Lua 5.1 as a third party dep
Also add a functionaltest-lua target to run the functional tests using the lua
interpreter and corresponding helper to top-level Makefile
2016-03-07 14:38:39 -03:00
Justin M. Keyes
0c2ba7554f Merge pull request #3900 from ZyX-I/inf-nan-string
Make it possible to eval() all floating-point values dumped by string()
2016-02-28 11:48:54 -05:00
ZyX
92d4dfdca5 ci: Disable -Wc11-extensions on FreeBSD
Closes #4363.
2016-02-28 06:58:47 +03:00
Jun T
1a15cf84c2 build: install *.mo into the "standard" directory
Change POROJECT_NAME to 'nvim', and use it as the gettext
domain name. The *.mo files, previously installed as
$runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as
$prefix/locale/xx/LC_MESSAGES/nvim.mo.
2016-02-23 13:39:56 +09:00
Florian Walch
e7615ddc22 CMake: Add #include in _FORTIFY_SOURCE check. #4214
Some toolchains apparently set _FORTIFY_SOURCE=2 in internal header
files. Include <string.h> (which in turn should include such internal
header files) before checking the value of _FORTIFY_SOURCE to catch
that.

Fixes #4183.
2016-02-10 00:17:55 +01:00
Justin M. Keyes
cb5ee26540 Merge pull request #4094 from justinmk/_GNU_SOURCE
cmake: Linux: define _GNU_SOURCE.
2016-02-09 00:34:14 -05:00
Justin M. Keyes
d402841b54 version bump 2016-02-09 00:21:54 -05:00
Justin M. Keyes
b33c777493 NVIM v0.1.2
Features:
  ef66249 tabline: Add %[] atom to the tabline, for random commands on click
  f338ea7 job control: implement jobpid() to get PID of job
  d0d5d17 job control: add 'detach' option to jobstart
  7ad3f07 Add support for binary numbers

Fixes:
  291495a regexp_nfa.c: Speed up find_match_text()
  317d5ca input: Do not set high-bit; preserve ALT modifier.
  3b7c409 shell: Unquote &shell* options before using them

Notable changes:
  49b06a8 encoding: Always use "utf-8" as default for &encoding
  79a6983 ui: revert "gui_running" hack

Other changes:
  b4b4536 version: semver.org compliance
  c6aa716 reproducible builds: Stop using __{DATE,TIME}__
  46bd3c0 clipboard: Check $DISPLAY. Prefer xsel. #4150
  f6ecd12 job control: don't kill PTY processes on exit
  49f0417 clipboard: Detach clipboard helper, so contents is kept after nvim exit
  38435e8 python: Add missing I/O methods to RedirectStream
  d26b01d eval: Use better error messages when failing to dump values
  62d137c Remove swapsync.
2016-02-09 00:01:18 -05:00
James McCoy
2be51f5e85 cmake: msgpack: Add more thorough version check
In 33bc332, version constraints were added to pkg_search_module(), but
that only affects the set of directories searched by
find_library()/find_path().

Once the header directory is found, parse the version from
version_master.h so it can be checked by the find_package() call in the
root CMakeLists.txt.
2016-02-05 19:46:53 -05:00
Justin M. Keyes
b5f6f43095 cmake: Linux: define _GNU_SOURCE.
Closes #4042
2016-01-24 21:18:44 -05:00
Rui Abreu Ferreira
1eaa2227e9 CMake: Defer setting CACHE CMAKE_BUILD_TYPE.
The Visual Studio CMake generator fails to configure if
CACHE CMAKE_BUILD_TYPE is set before CMAKE_BUILD_TYPE.
2016-01-18 09:18:18 -05:00
Rui Abreu Ferreira
f5ae5fa799 MSVC+CMake: avoid get_target_property. #4004
When using the Visual Studio generator don't use get_target_property for
custom command, because it returns unexpanded VS variables (e.g.
$(Configuration)) within the result as part of the LOCATION path.

The single case where this is a problem is for getting the output path for
nvim-test, instead we use a path here.
2016-01-17 22:59:55 -05:00
Rui Abreu Ferreira
54a1fb77e7 MinGW: don't use -fstack-protector
Mingw-w64 fails to link when using -fstack-protector flags, disabled the
flag check for non Unix system.
2016-01-13 23:09:27 -05:00
Rui Abreu Ferreira
1ce329e7dd Fix build output paths for Visual Studio generator
The Visual Studio cmake generator creates subdirectories inside
the build path for different build configuration. But this breaks some of our
cmake scripts, like the help tags installer, that assume the targets are
built in that location. Updated CMakeLists.txt to remove extra paths.
2016-01-10 14:16:30 -05:00
Justin M. Keyes
73b8c89518 Merge pull request #2667 from equalsraf/tb-min-log
cmake: Pass MIN_LOG_LEVEL as compiler definition
2016-01-10 12:21:52 -05:00
Rui Abreu Ferreira
72d03cc961 cmake: Pass -DMIN_LOG_LEVEL as compiler definition
- Check if MIN_LOG_LEVEL value is a number 0-3, default to
  INFO (1) or ignore it in Release mode
- When TRAVIS_CI_BUILD is ON the default is DEBUG (0)
- Add local.mk.example
2016-01-10 17:06:53 +00:00
Rui Abreu Ferreira
fd10729bc8 CMake: Add CPack settings to CMakeLists.txt 2016-01-10 09:50:35 -05:00
Justin M. Keyes
b4b4536339 version: semver.org compliance
We use `git describe` to stamp pre-release versions (dev builds). But
`git describe` uses the result of the most-recent tag (the current
_release_ version)--so we must munge it with the _next_ (i.e.
unreleased) version.

Also fix non-git builds: do not invoke git_describe(NVIM_VERSION_MEDIUM)
if we're not in a git tree, else it gets the dummy value
"HEAD-HASH-NOTFOUND".

Example :version output in non-git build:
  NVIM 0.1.2-dev

Example :version output in git build:
  NVIM v0.1.2-176-g9c3c2b5
2016-01-08 01:09:22 -05:00
Rui Abreu Ferreira
bd529ea3f3 MinGW: libuv needs -D_WIN32_WINNT=0x0600
Without this compilation fails due to a missing symbol: SRWLOCK in libuv
headers. _WIN32_WINNT defines the Windows header version that is to be used,
and it seems libuv requires this version. See

    b471b33da8
2016-01-04 19:51:09 -05:00
Rui Abreu Ferreira
8be2ab11de Fix CMakeLists.txt search paths for cross compile 2015-12-15 13:53:46 -05:00
Michael Reed
7be12edd38 Remove "Commit:" field from --version output
If nvim is built from a non-tagged commit, the truncated commit hash is
already appended to the main version string (e.g., "NVIM v0.1.0-83-g959f260 ..."),
making the "Commit:" field redundant.

Regarding the truncated hash length: we don't have nearly enough commits
to worry about collisions, and probably won't ever, so the default
length should be fine.
2015-12-05 16:15:32 -05:00
Justin M. Keyes
4a1c36e953 Nvim 0.1.1
- shada/msgpack editor plugin #3270
- VimL Dict notifications #3603
    - Note: API for this feature may change.
- :profile dump, :profile stop #2427
- :oldfiles! #3611
- TermOpen, TermClose events #3653
- fix: shada/viminfo: Do not save unlisted and quickfix buffers #3581
2015-12-05 14:56:37 -05:00
Marco Hinz
818f926eb0 Tests: add luacheck for linting tests
Source: https://github.com/mpeterv/luacheck
Docs:   http://luacheck.readthedocs.org/en/0.12.0/index.html

Run via "make testlint".
2015-11-23 13:57:21 +01:00
Justin M. Keyes
d0401b04a4 build: Use git describe for version strings.
When building in a git repo:
  - If HEAD corresponds to an annotated tag, (i.e. git_get_exact_tag()
    returns truthy) the current build is considered a "release" build:
    NVIM_VERSION_MEDIUM is directly assigned the tagged version name,
    and NVIM_VERSION_* defines are ignored.
  - If HEAD is not a tagged release, then NVIM_VERSION_MEDIUM is
    directly assigned the result of `git describe`.

If git (or the repo) is not available:
  - The NVIM_VERSION_* defines are used to define NVIM_VERSION_MEDIUM.

Sample outputs for `nvim --version` and `nvim +version`:

    Building with git @ non-tagged commit e66df14:
      NVIM v0.1.0-1-ge66df14 (compiled Nov  1 2015 19:10:30)
      Commit: e66df148f9401be17adab324a6e41d927aae20b3

    Building with git @ v0.1.1 tag:
      NVIM v0.1.1 (compiled Nov  1 2015 19:03:52)
      [no "Commit:" line]

    Building this commit _not_ in a git repo:
      NVIM 0.1.0-dev (compiled Nov  1 2015 19:16:11)
      [no "Commit:" line]
2015-11-01 21:31:29 -05:00
Justin M. Keyes
c4826c3003 Nvim 0.1.0 2015-11-01 16:16:38 -05:00
Justin M. Keyes
4a0c0fd321 Nvim 0.1.0 2015-11-01 14:23:40 -05:00
Florian Walch
90909e9362 CMake: Force use of project directory to look for Git data.
Before this change, building Neovim would recursively search parent
directories for a .git directory. If Neovim was downloaded as a tarball
(i.e. without a .git directory), but placed in a subdirectory of
a Git repository, this caused a CMake error. Such a situation could
occur when packaging Neovim, for example.

Unfortunately, the previous attempt in #3317 did not fix this problem.
2015-11-01 16:19:52 +01:00
Florian Walch
a83020922d version: Prepare for releases.
* Hide commit information from --version if we can't find any (e.g. when
  building from tarball).

To define a release in CMake, set NVIM_VERSION_PRERELEASE to "".
This will modify --version output to:

    * Show annotated Git tag instead of commit hash (NVIM_VERSION_COMMIT).
    * Hide commit date (NVIM_VERSION_BUILD).
2015-11-01 15:41:36 +01:00
Florian Walch
cb87ea7e82 CMake: Disable logging for release build types.
These are: Release, MinSizeRel, and RelWithDebInfo.

Closes #2913.
2015-11-01 15:41:36 +01:00
Florian Walch
87e5a41316 CMake: Add custom Dev build type.
Introduce new build type Dev that replaces RelWithDebInfo for development
builds off master and has optimizations, debug info, and logging enabled.
Keep assertions enabled for RelWithDebInfo.
2015-11-01 15:41:36 +01:00
Thiago de Arruda
6cd20177df build: Set the default value of ENABLE_JEMALLOC to ON
Restoring the default which was changed by #3515.
2015-10-29 14:51:56 -03:00
Ole Reifschneider
2bcfd7fde1 Make jemalloc optional 2015-10-26 19:33:50 +01:00
Michael Reed
e0974bdd0d build: Check if compiler supports -Wvla before use
OpenBSD's GCC (4.2.1) doesn't have the -Wvla flag.
2015-10-02 13:02:44 -04:00
Florian Walch
e8fdbd1cc4 CMake: Remove --sort-common from linker flags.
Workaround for bugs reported at #2641 and #3374.
Root cause for this problem is still unknown.

Resolves #2641 and resolves #3374.
2015-10-01 00:16:25 +02:00
Rui Abreu Ferreira
2c6f74d6d6 Enable compiler flag -Wvla 2015-09-24 17:41:03 +01:00
Florian Walch
231ac048aa CMake: Use project directory to look for Git revision.
If downloading Neovim as a tarball (i.e. without Git data),
building Neovim will search parent directories for a .git directory.
Explicitly set GIT_DIR to the project directory to avoid that.
2015-09-08 22:54:57 +02:00
Rui Abreu Ferreira
9bc1b78058 MSVC: Don't use GCC -O/-g flags. #3267 2015-08-31 02:51:49 -04:00
Yamakaky
4a8d557d44 cmake: Enable -fdiagnostics-color=auto gcc flag. #3137 2015-08-27 22:16:43 -04:00
Justin M. Keyes
f15b864239 MSVC: use MSVC instead of GCC-like compiler flags.
- We can build with /W4, but it gives thousands of warnings.
- _CRT_NONSTDC_NO_DEPRECATE disables warnings about POSIX functions.
  https://msdn.microsoft.com/en-us/library/ms235384.aspx
- _CRT_SECURE_NO_WARNINGS
  https://msdn.microsoft.com/en-us/library/8ef0s5kh.aspx
2015-08-27 22:00:34 -04:00
Michael Reed
2b4cbbebf4 cmake: Build with -fstack-protector-strong if available #2597
If not available, fall back to -fstack-protector + --param=ssp-buffer-size=4
If that isn't available, do nothing.

See the following articles for more information:

https://lwn.net/Articles/584225/
https://outflux.net/blog/archives/2014/01/27/fstack-protector-strong/
2015-08-26 18:05:38 -04:00
Rui Abreu Ferreira
fc7055f6e9 Mingw: Use POSIX compatible stdio #3232
- There are some differences between stdio (*printf) functions in POSIX
  and the MS runtime, this commit enables Mingw compatibility for these
  functions
2015-08-25 19:13:23 -04:00
ZyX
e1cc0fe996 cmake: Generate tags and some vim syntax elements 2015-07-26 21:09:52 +03:00
Florian Walch
fe6bd8cae2 CMake: Add option for Clang TSan, rename option ASAN -> ASAN_UBSAN. 2015-07-05 10:31:16 +03:00
Florian Walch
bd9042b1a9 CMake: Add option for Clang MSan. 2015-07-05 10:31:16 +03:00
Michael Reed
01a200996a Remove outdated and unused manuals #2891
`nvim-[lang].1`:
The non-english manuals are completely outdated and still written in
roff, as opposed to mdoc, which is used for `nvim.1`.
Given that, they're nearly useless at the moment, and when/if they are
updated, they should probably be rewritten from scratch using `nvim.1`
as a reference.

`xxd*.1`:
xxd hasn't been in the source tree for a long time, so the manual is of
little use.

`nvimtutor*.1`:
The vimtutor script hasn't ever shipped with nvim, and the consensus
seems to be that it won't, at least in the form of an executable
installed alongside `$(PREFIX)/bin/nvim` (see #2700).

In `nvim.1`, the argument to the `.Os` macro was removed. This was done
because its only purpose was to signify that nvim and nvimtutor
were part of the "Neovim" distribution, i.e., one and the same, which
isn't applicable anymore because `nvimtutor.1` is being removed.
From the `.Os` documentation in `man mdoc`:

    Os
	 Operating system version for display in the page footer.  This is the
	 mandatory third macro of any mdoc file.  Its syntax is as follows:

	       .Os [system [version]]

	 The optional system parameter specifies the relevant operating system or
	 environment.  It is suggested to leave it unspecified, in which case
	 mandoc(1) uses its -Ios argument or, if that isn't specified either,
	 sysname and release as returned by uname(3).

	 Examples:
	       .Os
	       .Os KTH/CSC/TCS
	       .Os BSD 4.3

	 See also Dd and Dt.

Reviewed-by: Felipe Morales <hel.sheep@gmail.com>
Reviewed-by: Florian Walch <florian@fwalch.com>
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>

[ci skip]
2015-06-25 19:08:21 -04:00
Thomas Anderson
9995f15a98 CMake: Fix helptags generation when prefix is not /usr. #2741 2015-06-09 01:12:08 -04:00
Florian Walch
2271b746d7 CMake: Fix _FORTIFY_SOURCE detection when using hardening-wrapper. #2788
When checking code with check_c_source_compiles, the "check variable"
(for the _FORTIFY_SOURCE detection: previously _FORTIFY_SOURCE_ACCEPTABLE, now
HAS_ACCEPTABLE_FORTIFY) is passed to the compiler like
-D_FORTIFY_SOURCE_ACCEPTABLE. This throws off hardening-wrapper [1],
which then NOT sets _FORTIFY_SOURCE=2 for the check, assuming it had already
been set manually as it detected -D_FORTIFY_SOURCE*. Renaming the "check
variable" to not match this pattern works around this problem.

[1] https://github.com/thestinger/hardening-wrapper
2015-06-04 13:43:02 +03: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
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
John Szakmeister
d00558bbdb build: create prereq targets for test dependencies
This will help make sure that we build all the right prereqs before
manually running tests under QuickBuild.

Notice that shell-test has been added as a prereq for the functional
tests, since it's a requirement for testing the terminal features.
2015-05-09 09:24:07 -04:00
Scott Prager
74aef89720 term: use an argument vector for termopen().
Old behaviour: termopen('cmd') would run `&shell &shcf "cmd"`, which
caused the functional tests to fail on some systems due to the process
not "owning" the terminal. Also, it is inconsistent with jobstart().

Modify termopen() so that &shell is not invoked, but maintain the old
behaviour with :terminal. Factor the common code for building the
argument vector from jobstart() and modify the functional tests to call
termopen() instead of :terminal (fixes #2354).

Also:
 * Add a 'name' option for termopen() so that `:terminal {cmd}` produces
   a buffer named "term//{cwd}/{cmd}" and termopen() users can customize
   the name.
 * Update the documentation.
 * Add functional tests for `:terminal` sinse its behaviour now differs
   from termopen(). Add "test/functional/fixtures/shell-test.c" and move
   "test/functional/job/tty-test.c" there, too.

Helped-by: Justin M. Keyes <@justinmk>
2015-05-02 09:47:29 -04:00
Florian Walch
8130eb1191 jemalloc: Force use of prefixed functions.
* Set JEMALLOC_NO_DEMANGLE to be able to use `je_*` functions,
  regardless of how jemalloc was compiled (--with-jemalloc-prefix)
* Show jemalloc information in Neovim's version output.

Resolve #2449.
2015-04-29 22:26:55 +03:00
Florian Walch
5b5d353151 CMake: Don't request static linking for dependencies.
For built-in dependencies, shared libraries are removed and static
linking is always used.

For systemwide dependencies, static linking should not be used.
2015-04-29 22:26:55 +03:00
Florian Walch
07d4142a18 CMake: Refer to Unibilium instead of LibUnibilium. 2015-04-29 22:26:55 +03:00
Michael Reed
55aab0e7e1 CMakeLists.txt: Remove unneeded globs
refs #2426
2015-04-16 20:22:05 -04:00
Thiago de Arruda
8a1a9b9558 deps: Add jemalloc as an optional dependency
Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the
default). To avoid trouble with clang's ASAN, it is disabled by default if the
`SANITIZE` option is enabled.

Since jemalloc has thread cache for small objects, it fills the gap created by
removing klib memory pools.

The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to
make it work with a custom allocator.
2015-04-13 08:22:59 -03:00
David Bürgin
d3bb177f1e vim-patch:7.4.497 #2295
Problem:    With some regexp patterns the NFA engine uses many states and
            becomes very slow.  To the user it looks like Vim freezes.
Solution:   When the number of states reaches a limit fall back to the old
            engine. (Christian Brabandt)

https://github.com/vim/vim/releases/tag/v7-4-497

Helped-by: David Bürgin <676c7473@gmail.com>
Helped-by: Justin M. Keyes <justinkz@gmail.com>
Helped-by: Scott Prager <splinterofchaos@gmail.com>
2015-04-05 19:24:58 -04:00
Scott Prager
feca9624b8 CMakeLists: enable USE_FNAME_CASE on Mac 2015-03-31 11:20:24 -03:00
lyuts
862d687fea Fixed compilation when using custom libtermkey (not installed in base
system).
2015-03-15 00:11:10 -07:00
Volodymyr Medvid
f7d5839d0c deps: Provide options to disable static linkage
Allow dynamic linkage to libunibilium, libtermkey and libvterm.
2015-03-08 23:29:47 +02:00
Thiago de Arruda
81a346553c deps: Add libvterm to the project dependencies
libvterm is a terminal emulation library with abstract display. It will be used
to implement builtin terminal emulation into Nvim.
2015-02-28 10:41:53 -03:00
Mike Zeller
f28941b96d illumos requires the use of limits.h for things like INT_MAX #2049 2015-02-26 11:42:05 -05:00
John Szakmeister
9bc1e4335c build: make sure our deps area is picked up for pkg-config files 2015-02-24 14:01:20 -05:00
Thiago de Arruda
d7e560e5b3 job: Allow spawning jobs connected to pseudo terminals 2015-02-23 21:43:33 -03:00
Thiago de Arruda
9a2dd7c498 ui: Rewrite the builtin terminal UI
Now all terminal-handling code was moved to src/nvim/tui, which implements a
new terminal UI based on libtermkey and unibilium
2015-02-16 23:17:39 -03:00
John Szakmeister
1eef530351 Merge pull request #1588 from equalsraf/tb-no-central-deps
Dont force ../.deps in third-party/CMakeLists.txt use the Makefile instead
2014-12-18 08:11:00 -05:00
John Szakmeister
379dcd7d7f Merge pull request #1686 from jszakmeister/include-opts-in-fortify-check
build: include the flags for the build type in the _FORTIFY_SOURCE check
2014-12-18 04:14:14 -05:00
Ross Smith
1c3d093c85 Detect and propagate _FORTIFY_SOURCE prefix
Get prefix to a -D_FORTIFY_SOURCE string if it is present in
CFLAGS and apply the prefix to flags added to redefine
_FORTIFY_SOURCE in CFLAGS and CPPFLAGS

* fixes 1569
2014-12-17 23:05:46 -05:00
John Szakmeister
0a5dad8a10 build: include the flags for the build type in the _FORTIFY_SOURCE check
It turns out the check was being performed without optimizations enabled
even when the CMAKE_BUILD_TYPE was set to a release build.  This led to
_FORTIFY_SOURCE's level not being correctly determined, and us failing
to apply the correct workaround.

To counter this, we'll take the default flags for the build type and
apply them.  Also, if options are passed via CFLAGS, they are
automatically passed on to the underlying build.  So this should cover
all the necessary ground.

This fixes #1647.
2014-12-16 06:02:42 -05:00
Rui Abreu Ferreira
8d54a7203e Allow cmake caller to override DEPS_PREFIX
- Caller can override bundled dependency location using
  DEPS_PREFIX
- Cache variable DEPS_PREFIX, using .deps/usr by default
- Removed unused variables DEPS_BIN_DIR, DEPS_BUILD_DIR, DEPS_DIR
  DEPS_INSTALL_DIR
- Corner case: if the caller tries to override DEPS_PREFIX after a
  successful cmake configuration, the caller needs to clear the cache
  because dependency checks are based on the old value
2014-12-16 10:28:43 +00:00
oakes
dd9e5a3d7a Allow building as a static -fPIC library 2014-12-12 14:48:39 -05:00
John Szakmeister
7b6f705e5f build: probe the compiler to see if we need to turn down _FORTIFY_SOURCE
Some builds don't use Release (such as Gentoo, though it can be told
to).  So let's go a bit further and probe the compiler to see if we need
to turn down the _FORTIFY_SOURCE level.
2014-11-25 20:18:51 -05:00
Florian Walch
96b31ca048 CMake: Set -Wconversion by default. 2014-11-19 17:21:21 +01:00
Rui Abreu Ferreira
2b887ec66b Use cmake --build instead of Make
- If possble try to abstract away from Make, and use cmake --build
- third-party still needs to find Make to build some components
- Removed search for Make from CMakeLists.txt
* for CMake < 3.0 --build has no color output
2014-11-14 14:35:16 +00:00
John Szakmeister
2540155591 build: fix CMAKE_MODULE_PATH usage
Fixes #1447.  `CMAKE_MODULE_PATH` is meant to be a list of directories,
and as such, is not the proper way to launch our scripts.  Let's use
`${PROJECT_SOURCE_DIR}/cmake` instead.  Also, let's not outright set
`CMAKE_MODULE_PATH`, but instead append our location to the list.
2014-11-10 19:26:01 -05:00
Florian Walch
176930fa56 version: Add compilation info. 2014-11-09 18:34:57 +01:00
John Szakmeister
dcccc1a50d Merge pull request #1437 from jszakmeister/build-search-fixes
A few fixes for some build-related issues.
2014-11-09 08:31:33 -05:00
John Szakmeister
d51c0a9471 build: only attempt to use -Og if it's supported
Commit a1d411f9c9 just assumes that gcc
will support the `-Og` option, but gcc that comes with Ubuntu 12.04 does
not.  Let's check to see if the flag is supported, and then decide
whether to enable it or not.
2014-11-09 06:58:17 -05:00
Justin M. Keyes
c9df7ba308 Merge pull request #1383 from fwalch/nvim-buildtype
CMake: Set custom RelWithDebInfo compile flags.
2014-11-08 18:39:12 -05:00
John Szakmeister
9344a40e74 build: pull iconv detection into its own FindIconv.cmake file
This will provide better control for those who may want to alter which
one gets used.
2014-11-08 16:22:35 -05:00
John Szakmeister
203a5166a0 build: give priority to /sw and /opt/local on Mac OS X
Unfortunately, we can't force the specific inclusion of a header file.
So if anything add /opt/local/include to the include path--such as
libintl--then other dependencies might be drawn from /opt/local at
compile time, even though we detected them elsewhere at configure time.
This, in turn, causes issues with mixed versions, such as the iconv.h
header being pulled from /opt/local/include, but linked against the
library in /usr/lib--which can be mismatched versions.

So, despite CMake's best effort to treat /sw and /opt/local as just
another system area, we really need to give them preferential treatment.
To do this, we add them to CMAKE_PREFIX_PATH.

This fixes an issue discovered while re-enabling iconv in #1370.
2014-11-08 16:21:47 -05:00
John Szakmeister
05f78d30ac build: use the proper libintl include variable
What was there worked, but it wasn't meant to be the variable that you
use for inclusion.
2014-11-08 16:11:12 -05:00
Florian Walch
a1d411f9c9 CMake: Set custom RelWithDebInfo compile flags. 2014-11-08 21:54:30 +01:00
John Szakmeister
5d97f3fc2c build: default to using -O2 for release builds
The -O3 optimization level can often lead to dangerous (and sometimes
incorrect) optimizations being performed.  So let's use a level that's
more stable.
2014-11-07 06:21:54 -05:00
John Szakmeister
5ba1d980fb build: fix running of functional tests directly with CMake
If you aren't just building everything into build/, then the functional
tests fail because they can't find the nvim executable.  Let's pass in
the location of the nvim executable, and set NVIM_PRG environment
variable accordingly.
2014-11-05 07:26:35 -05:00
Florian Walch
b904c33e41 CMake: Rename target "test" to "functionaltest".
Remove build warning:

    The target name "test" is reserved or not valid for certain CMake
    features, such as generator expressions, and may result in undefined
    behavior.
2014-11-05 11:54:20 +01:00
Florian Walch
5714afc11e CMake: Modify _FORTIFY_SOURCE only for release builds.
Remove build warning for Debug builds:

    # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
2014-11-05 11:54:15 +01:00
John Szakmeister
64ea00299d build: turn down the _FORTIFY_SOURCE level on gcc >= 4.0 2014-11-05 03:53:31 -05:00
John Szakmeister
5e65400c6f Add missing linker flags required for LuaJIT on 64-bit Mac OS X.
This was brought up in #1294.
2014-10-17 06:50:13 -04:00
Thiago de Arruda
69561ea922 test: Remove run-functional-tests.py
Now that the lua client is available, python/lupa are no longer necessary to run
the functional tests. The helper functions previously defined in
run-functional-tests.py were adapted to test/functional/helpers.lua.
2014-10-16 09:21:37 -03:00
Justin M. Keyes
92b17e174f cmake: handle missing git or .git/
GetGitRevisionDescription.cmake: we don't need fine-grained failure
modes, we only need "yes" or "no".

fix #1292
2014-10-15 14:45:42 -04:00
Justin M. Keyes
a1901941f8 version: generate "build number" from commit timestamp
- cmake: git_timestamp() returns last commit time formatted as
  `YYYYMMddHHmm`.
- Always include commit hash in :version and --version output.

`nvim --version` sample output:
  NVIM 0.0.0-alpha+201410070245 (compiled Oct  7 2014 05:30:45)
  Commit: f747b2b1ff7bfe7eb00cc2be82d7af87c98f1111
2014-10-07 10:23:15 +00:00
Justin M. Keyes
2c2fee4d1f version: report commit hash as "build number" in long version string 2014-10-07 10:03:14 +00:00
Thiago de Arruda
42d5b526b9 test: Replace vroom by lua/busted for functional tests
The 'lupa' python package provides a simple way to seamless integrate lua and
python code.

This commit replaces vroom by a python script that exposes the 'neovim' package
to a lua state, and invokes busted to run functional tests. This is a temporary
solution that will enable writing functional tests using lua/bused while a lua
client library is not available.

The reason for dropping vroom is flexibility: Lua/busted has a nice DSL-style
syntax while also providing the customization power of a full programming
language. Another reason is to use a single framework for unit/functional tests.

Two other changes were performed in this commit:

- Instead of "gcc-unittest/gcc-ia32", the travis builds for gcc are now
  identified by "gcc/gcc-32". They will run unit/functional tests for both 64
  and 32 bits.
- Old integration tests(in src/nvim/testdir) are now ran by the 'oldtest' target
2014-09-30 17:37:16 -03:00
John Szakmeister
0d35369324 build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask.  We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.

To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command.  This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.

To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command.  It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.

This fixes #1201 and #1086.
2014-09-22 05:56:52 -04:00
Thiago de Arruda
ddecfb763b deps: Switch lua msgpack library to one that supports 2.0 2014-09-16 14:14:00 -03:00
Florian Walch
0a01b3052e Update busted to 2.0.rc3.
Default to verbose output to show more information in case of errors.
Fix #1031.
2014-09-11 20:03:35 +02:00
Rui Abreu Ferreira
426f906485 Add 'bit' to the list of lua dependencies
- ex_cmds.lua requires the 'bit' module
2014-08-29 05:56:21 -04:00
Florian Walch
1310820e4f CMake: Generate helptags during install step.
Fix #1056.
2014-08-23 09:32:47 -04:00
Joey Gouly
5fffe1ab8e Set the policy to 'OLD' to avoid warning CMP0026 in CMake 3.0. 2014-08-23 09:00:19 -04:00
Rui Abreu Ferreira
718beb2613 Add install target for runtime dir 2014-07-31 08:13:58 -03:00
Pavel Platto
47084ea765 Use strict function prototypes #945
`-Wstrict-prototypes` warn if a function is declared or defined without
specifying the argument types.

This warning disallow function prototypes with empty parameter list.
In C, a function declared with an empty parameter list accepts an
arbitrary number of arguments when being called. This is for historic
reasons; originally, C functions didn't have prototypes, as C evolved
from B, a typeless language. When prototypes were added, the original
typeless declarations were left in the language for backwards
compatibility.
Instead we should provide `void` in argument list to state
that function doesn't have arguments.

Also this warning disallow declaring type of the parameters after the
parentheses because Neovim header generator produce no declarations for
old-stlyle prototypes: it expects to find `{` after prototype.
2014-07-14 20:28:40 +02:00
Rui Abreu Ferreira
5d44f89a8c Check dependencies for each lua interpreter.
- When USE_BUNDLED=OFF and the system has multiple lua interpreters
  (luajit AND lua) it may occur that only the later has the needed
  dependencies (lua-lpeg, lua-cmsgpack). If we pick luajit then
  finding the dependencies FAILS.
- This commit groups detection of the lua interpreter with the lua
  dependencies it tries to find them for both the interpreters and
  choses the first one that has them.

Helped-by: John Szakmeister <john@szakmeister.net>
2014-07-11 19:28:54 -04:00
Rui Abreu Ferreira
6f0d3c0e77 Refactor the lua dependency checking.
This is in preparation for the next step, which is to find a suitable
lua interpreter, rather than just erroring when an interpreter is found
but doesn't have the necessary dependencies.

Helped-by: John Szakmeister <john@szakmeister.net>
2014-07-11 19:28:54 -04:00
Rui Abreu Ferreira
40bc328813 Remove pthread fatal check from CMakeLists.txt #891 2014-06-30 13:37:38 -04:00
John Szakmeister
3b3811b165 Fix #867: cmake doesn't issue -isystem for versioned gcc
CMake purposefully disables the use of the `-isystem` flag on Apple
platforms, but it's overly blunt with the detection.  Apple's compilers
have supported the flag since at least 10.4.  Let's force the switch to
be on when gcc/g++ is detected on an Apple platform to reduce the
warnings out of the msgpack-related bits.
2014-06-27 06:58:46 -04:00
John Szakmeister
b235793dac Fix #838: build with "USE_BUNDLED=OFF" fails to find dependencies
Stop forcing some platform setting that are really intended to be used
for Travis CI.  Under other systems, like Arch Linux, it prevents
dependencies from being correctly located.
2014-06-27 06:52:59 -04:00
ZyX
70929f7e16 Add automatic generation of headers
- The 'stripdecls.py' script replaces declarations in all headers by includes to
  generated headers.
  `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'`
  was used for this.
- Add and integrate gendeclarations.lua into the build system to generate the
  required includes.
- Add -Wno-unused-function
- Made a bunch of old-style definitions ANSI

This adds a requirement: all type and structure definitions must be present
before INCLUDE_GENERATED_DECLARATIONS-protected include.

Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is
the only exception.
2014-06-02 11:04:17 -03:00
John Szakmeister
a581173e71 Turn off -Werror by default.
It inteferes with development activities by breaking your build in the
middle of a refactor.  Instead, let's enable -Werror on the Travis CI
builds via a TRAVIS_CI_BUILD option.
2014-05-29 17:37:12 -04:00
Eliseo Martínez
a6734844ca Introduce nvim namespace: Fix build process.
- Leave src as include dir (for includes to recognize 'nvim/' prefix).
- Change subdirectory from src to src/nvim.
- Fix msgpack generation.
- Fix some other paths to new locations.
2014-05-15 20:46:01 +02:00
Thiago de Arruda
ffe61e5ba1 Tell cmake to use -isystem third-party includes
This adds the `SYSTEM` parameter to `include_directories`, which will tell cmake
to use `-isystem` instead of `-I` for specifying include directories. One
advantage is that compilers won't emit warnings for included files that belong
to dependencies.
2014-05-15 08:21:13 -03:00
John Szakmeister
21bd990603 Don't allow undefined references under Linux.
Many other systems expect this already, but on Linux the default is to
allow them.  Let's turn that off.
2014-05-14 21:14:28 -04:00
John Szakmeister
7cb20fd1b0 Generate a lua module to help pass build-related settings.
This allows us to avoid hard-coding paths and using environment
variables to communicate key information to unit tests, which fits
with the overall goal of making sure that folks driving CMake directly
can continue to do out-of-tree builds.
2014-05-03 10:36:54 -04:00
Thiago de Arruda
9f7426ca16 Configure travis to perform a 32-bit build
- Build targeting 32-bit with travis
- Code in `before_install`/`after_success` was moved to travis.sh since it
  provides greater flexibility for detecting the build matrix environment. This
  improves the build speed since we now install only what's necessary.
- Now clint has a dedicated travis worker
2014-04-22 21:55:59 -03:00
Thiago de Arruda
78fd9386b6 Fix unit tests
Apparently busted 1.11.0 is broken(https://github.com/Olivine-Labs/busted/issues/236)
in a way that is causing the unit tests to fail. This pins the version to 1.10.0
and also fixes a wrong variable set when msgpack was added as a dependency
2014-04-14 16:46:16 -03:00
Thiago de Arruda
15f3bae801 Add checks for lpeg/cmsgpack lua packages
These checks will stop the build process with meaningful error messages if
any of those packages are not installed.
2014-04-13 07:32:52 -03:00
Thiago de Arruda
3ee5683a78 Use cmake to find a lua executable
A lua executable is now required for the build process since a lpeg-based script
is used for generating a dispatch function and metadata for the msgpack API
frontend. This removes the need for setting the LUA_BINARY environment variable.
Fixes #518.
2014-04-13 07:32:52 -03:00
Thiago de Arruda
878e6e661d Add cmake module for finding msgpack 2014-04-11 14:07:44 -03:00
Eliseo Martínez
ad48e7c648 Fix #451: Build broken on OSX.
Problem:  Build breaks in OSX if macports ncurses present, due to
          header conflict involving 'term.h'.
Solution: Modify include search order.
2014-04-03 21:00:43 +02:00
aph
7fd140b99a enable coveralls support 2014-04-01 08:06:20 -03:00
John Szakmeister
0efc815216 Append to CMAKE_PREFIX_PATH instead setting it outright.
Also, don't set it in the FindXxx cmake scripts--it's unnecessary, and
it resets the value.
2014-03-28 05:09:45 -04:00
John Szakmeister
7bd4d68d93 Don't require busted.
Only provide the unittest target if busted was found.  And only build
nvim-test if the unittest target exists by excluding nvim-test from all.
Note: this means nvim-test won't be built by default, but it will be
built when you try to run unittests.
2014-03-23 05:42:18 -04:00
John Szakmeister
1eed86883b Deal with the missing dependencies for libuv.
Since libuv.pc is broken at the moment, try to determine libuv's
dependencies ourselves.  This ports most of the checks from libuv into
our CMake build, and fixes the build on other unix platforms.
2014-03-21 15:22:00 -04:00
John Szakmeister
0b2f6a0cf4 Revamp the build system.
This achieves several goals:

 * Less reliance on scripts so we have better portability to Windows
   (though we still have a ways to go for proper Windows support).
   Luajit, luarocks, moonscript, and busted are all installed via CMake
   now.
 * Trying to make use of pkg-config to get the correct libraries.  The
   latest libuv is still broken in this regard, but we'll at least be in
   a position to use it.
 * Allow the use of Ninja or make.  The former runs faster in many
   environments, and automatically makes use of parallel builds.

This also allows for system installed dependencies--though not through
the Makefile just yet--and adds support for FreeBSD.

This also make us build libuv and luajit as static libraries only, since
we're only concerned about having static libraries for our bundled
dependencies.
2014-03-21 15:22:00 -04:00
James McCoy
a86b1a129e Use include paths relative to src/
As described in Google's style guide, the basis for Neovim's

> All of a project's header files should be listed as descendants of the
> project's source directory without use of UNIX directory shortcuts .
> (the current directory) or .. (the parent directory).

Add src as an include directory to facilitate this.
2014-03-14 21:54:32 -03:00
Thiago de Arruda
f6ace9962d Refactor travis build to use clang's sanitizers
- Valgrind configuration removed
- Fix errors reported by the undefined behavior sanitizer
- Travis will now run two build steps:
  - A normal build of a shared library for unit testing(in parallel with gcc)
  - A clang build with some sanitizers enabled for integration testing.

After these changes travis will run much faster, while providing valgrind-like
error detection.
2014-03-13 15:26:28 -03:00
Thiago de Arruda
2f1a2eb0f2 Fix free_all_mem and EXITFREE definition
Because of the '$' in `if(DEFINED $ENV{VALGRIND_CHECK})` EXITFREE wasn't being
defined, so the `free_all_mem` wasn't being included or called in the resulting
binary.

This commit fixes that, and also adds includes needed for `free_all_mem`
compilation.
2014-03-07 11:58:06 -03:00
Gaelan Steele
eb835bc2ca Use -Werror.
This makes all warnings errors. We don't want any warnings, so we should
enforce that.
2014-03-03 08:47:21 -03:00
Nicolas Hillegeer
3f29a02166 MAKE: ask gnulikes to warn and be pedantic + fixes
It seems clang 3.4 thinks the codebase is in fantastic shape and gcc 4.9.0
has only minor niggles, which I fixed:

- fix uninitialized member warning:
    In DEBUG mode the expr member doesn't get properly initialized to NULL.

- fix warnings about directive inside of macro's:
    On some platforms/compilers, sprintf is a macro. Putting macro directives
    inside of a macro is unportable and gcc 4.9 warns about that.

- fix signed vs. unsigned comparison warning:
    The in-memory table will luckily not even come close to the limits imposed
    by ssize_t. If it ever reaches that, we've got bigger problems.
2014-02-28 11:48:43 -03:00
John Szakmeister
ef6933bd60 Setup better warning flags for Clang. 2014-02-28 08:18:24 -03:00
John Szakmeister
fe226f5376 Only include libintl's include dir if libintl was found.
This prevents an error from CMake when libintl is not found.  It's not a
required library, so we must wrap the inclusion in a conditional.  It
was already done for the library.
2014-02-28 08:16:57 -03:00
Alexis Hildebrandt
05b9e11584 CMakeLists: Improve handling of libintl
by refactoring it into a separate CMake module
2014-02-27 19:11:48 +00:00
Alexis Hildebrandt
e728ce95ef Use GNU gettext from homebrew on Mac if available 2014-02-27 19:11:48 +00:00
Rich Wareham
1f827beff0 Use CMAKE_C_FLAGS variable to set compiler flags.
If the compiler is some GNU-alike variant, set the compiler flags to use
the gnu99 dialect of C and enable all warnings.

Non-GNU compilers may have to have their own magic added to set dialect
and enable warnings.

Closes #179.
2014-02-27 12:29:44 +00:00
Thiago de Arruda
cb9a368445 Add configuration to help debug memory leaks 2014-02-26 15:48:26 -03:00
Rich Wareham
de4fbf92d0 link to rt if it provides clock_gettime
As noted in #128, if clock_gettime is provided by librt then it does not
end up being linked into the static libuv.a binary. This might be
considered a bug in libuv but we can address it here.

Detect if librt provides the clock_gettime symbol and, if so, append it
to the list of libraries linked into nvim. On non-librt systems the
behaviour should be as before.
2014-02-26 07:10:21 -03:00
Rich Wareham
e94f933f39 CMakeLists: remove hardcoded .deps directory
We use the standard CMAKE_PREFIX_PATH variable to pass the location of
.deps as a search location on the command line. There is now no need for
explicitly hard-coding it.
2014-02-26 07:09:11 -03:00
Rich Wareham
2a6780431e make use of libuv when found by CMake 2014-02-26 07:09:11 -03:00
Rich Wareham
00ca93fb50 automatically discover libuv in CMake
Idiomatically discover if libuv is installed.
2014-02-26 07:08:44 -03:00
Rich Wareham
809885ea7d add custom CMake module path 2014-02-26 07:08:26 -03:00
Rich Wareham
fd346a95fa use CMake's built in pthread detection
CMake ships with a standard FindThreads module which can be used to a)
test for a threading library and b) confirm that it is pthread. It also
allows the hard-coding of the threading library name to be removed from
``src/CMakeLists.txt``.

Make it an error not to have a pthread library installed and indicate to
CMake that we strongly prefer pthread to any other platform threading
library.
2014-02-24 18:52:12 +00:00
jdiez17
be3ce617c7 Changed binary output directory from src/ to bin/ 2014-02-24 14:45:07 -03:00
Thiago de Arruda
72cf89bce8 Import vim from changeset v5628:c9cad40b4181
- Cleanup source tree, leaving only files necessary for compilation/testing
- Process files through unifdef to remove tons of FEAT_* macros
- Process files through uncrustify to normalize source code formatting.
- Port the build system to cmake
2014-01-31 10:39:15 -03:00