aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* | | refactor: fix warningsJustin M. Keyes2017-02-04
| | |
* | | win: executable(): full path without extensionJustin M. Keyes2017-02-04
| | | | | | | | | | | | Absolute path is considered executable even *without* an extension.
* | | vim-patch:8.0.0280Justin M. Keyes2017-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch 8.0.0280: problem setting multi-byte environment var on MS-Windows Problem: On MS-Windows setting an environment variable with multi-byte strings does not work well. Solution: Use wputenv when possible. (Taro Muraoka, Ken Takata) 7c23d1d9d9cc
* | | win: Append process dir to $PATHJustin M. Keyes2017-02-04
| | | | | | | | | | | | | | | | | | | | | | | | This allows executables to be found by :!, system(), and executable() if they live next to ("sibling" to) nvim.exe. This is what gvim on Windows does, and also matches the behavior of Win32 SearchPath(). https://github.com/vim/vim/blob/c4a249a736d40ec54794827ef95804c225d0e38f/src/os_win32.c#L354-L370
* | | win: executable()Justin M. Keyes2017-02-04
|/ / | | | | | | | | Windows: prepend `".;"` to PATH, as Vim does. https://github.com/vim/vim/blob/c4a249a736d40ec54794827ef95804c225d0e38f/src/os_win32.c#L1916
* | Revert "tui: update_size(): Fix race condition."Justin M. Keyes2017-02-04
| | | | | | | | This reverts commit 0e75438a388f91c6219d2f22ade0472b067f5dca.
* | tests: Migrate legacy test 8. #4179Lucas Hoffmann2017-02-03
| | | | | | | | | | The test produces some "hit enter" prompts and error messages that had to be dealt with by `feed`ing CTRL-L to nvim.
* | Merge #2990 'tests: Migrate legacy test 69.'Justin M. Keyes2017-02-03
|\ \
| * | tests: Migrate legacy test 69.Lucas Hoffmann2016-05-23
| | |
* | | tui: update_size(): Fix race condition.Justin M. Keyes2017-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bridge.width and bridge.height reach ui.c:ui_refresh() when it iterates through all UIs, so they do not need to be set directly by tui.c:update_size(). Race found by helgrind: ==18532== Helgrind, a thread error detector ==18532== Copyright (C) 2007-2015, and GNU GPL'd, by OpenWorks LLP et al. ==18532== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info ==18532== Command: ./build/bin/nvim -u NONE --cmd set\ rtp+=~/.vim/bundle/vimfiler.vim,~/.vim/bundle/unite.vim --cmd runtime\ plugin/vimfiler.vim --cmd runtime\ plugin/unite.vim ==18532== Parent PID: 6477 ==18532== ==18532== ---Thread-Announcement------------------------------------------ ==18532== ==18532== Thread #2 was created ==18532== at 0x68FA98E: clone (clone.S:73) ==18532== by 0x5270179: create_thread (createthread.c:102) ==18532== by 0x5271BE2: pthread_create@@GLIBC_2.2.5 (pthread_create.c:679) ==18532== by 0x4C32B07: pthread_create_WRK (hg_intercepts.c:427) ==18532== by 0x4E53A3F: uv_thread_create (in /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0) ==18532== by 0x6A7154: ui_bridge_attach (ui_bridge.c:89) ==18532== by 0x6A164C: tui_start (tui.c:116) ==18532== by 0x6A4CFC: ui_builtin_start (ui.c:89) ==18532== by 0x55A825: main (main.c:433) ==18532== ==18532== ---Thread-Announcement------------------------------------------ ==18532== ==18532== Thread #1 is the program's root thread ==18532== ==18532== ---------------------------------------------------------------- ==18532== ==18532== Possible data race during write of size 4 at 0x770E7B4 by thread #2 ==18532== Locks held: none ==18532== at 0x6A3071: update_size (tui.c:759) ==18532== by 0x6A30DB: sigwinch_cb (tui.c:269) ==18532== by 0x4D0A54: signal_event (signal.c:44) ==18532== by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146) ==18532== by 0x4CD135: loop_poll_events (loop.c:56) ==18532== by 0x6A2451: tui_main (tui.c:239) ==18532== by 0x6A857A: ui_thread_run (ui_bridge.c:112) ==18532== by 0x4E539F6: ??? (in /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0) ==18532== by 0x4C32D06: mythread_wrapper (hg_intercepts.c:389) ==18532== by 0x5271423: start_thread (pthread_create.c:333) ==18532== by 0x68FA9BE: clone (clone.S:105) ==18532== ==18532== This conflicts with a previous read of size 4 by thread #1 ==18532== Locks held: none ==18532== at 0x6A542A: ui_refresh (ui.c:169) ==18532== by 0x6A5870: ui_refresh_event (ui.c:181) ==18532== by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146) ==18532== by 0x4CD135: loop_poll_events (loop.c:56) ==18532== by 0x5DEDB4: os_breakcheck (input.c:150) ==18532== by 0x59263D: line_breakcheck (misc1.c:2667) ==18532== by 0x621AE5: nfa_regmatch (regexp_nfa.c:6171) ==18532== by 0x61DCF7: nfa_regtry (regexp_nfa.c:6240) ==18532== Address 0x770e7b4 is 4 bytes inside a block of size 352 alloc'd ==18532== at 0x4C2EFE5: calloc (vg_replace_malloc.c:711) ==18532== by 0x57C962: xcalloc (memory.c:119) ==18532== by 0x6A6E29: ui_bridge_attach (ui_bridge.c:53) ==18532== by 0x6A164C: tui_start (tui.c:116) ==18532== by 0x6A4CFC: ui_builtin_start (ui.c:89) ==18532== by 0x55A825: main (main.c:433) ==18532== Block was alloc'd by thread #1 ==18532== ==18532== ---------------------------------------------------------------- ==18532== ==18532== Possible data race during write of size 4 at 0x770E7B8 by thread #2 ==18532== Locks held: none ==18532== at 0x6A3085: update_size (tui.c:760) ==18532== by 0x6A30DB: sigwinch_cb (tui.c:269) ==18532== by 0x4D0A54: signal_event (signal.c:44) ==18532== by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146) ==18532== by 0x4CD135: loop_poll_events (loop.c:56) ==18532== by 0x6A2451: tui_main (tui.c:239) ==18532== by 0x6A857A: ui_thread_run (ui_bridge.c:112) ==18532== by 0x4E539F6: ??? (in /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0) ==18532== by 0x4C32D06: mythread_wrapper (hg_intercepts.c:389) ==18532== by 0x5271423: start_thread (pthread_create.c:333) ==18532== by 0x68FA9BE: clone (clone.S:105) ==18532== ==18532== This conflicts with a previous read of size 4 by thread #1 ==18532== Locks held: none ==18532== at 0x6A5455: ui_refresh (ui.c:170) ==18532== by 0x6A5870: ui_refresh_event (ui.c:181) ==18532== by 0x4CDDB6: multiqueue_process_events (multiqueue.c:146) ==18532== by 0x4CD135: loop_poll_events (loop.c:56) ==18532== by 0x5DEDB4: os_breakcheck (input.c:150) ==18532== by 0x59263D: line_breakcheck (misc1.c:2667) ==18532== by 0x621AE5: nfa_regmatch (regexp_nfa.c:6171) ==18532== by 0x61DCF7: nfa_regtry (regexp_nfa.c:6240) ==18532== Address 0x770e7b8 is 8 bytes inside a block of size 352 alloc'd ==18532== at 0x4C2EFE5: calloc (vg_replace_malloc.c:711) ==18532== by 0x57C962: xcalloc (memory.c:119) ==18532== by 0x6A6E29: ui_bridge_attach (ui_bridge.c:53) ==18532== by 0x6A164C: tui_start (tui.c:116) ==18532== by 0x6A4CFC: ui_builtin_start (ui.c:89) ==18532== by 0x55A825: main (main.c:433) ==18532== Block was alloc'd by thread #1
* | | Merge #5975 from jamessan/execute-with-attrsJustin M. Keyes2017-02-03
|\ \ \ | | | | | | | | execute: Correctly capture output with highlight attributes
| * | | execute: Correctly capture output with highlight attributesJames McCoy2017-02-01
| | | | | | | | | | | | | | | | Closes #5422
* | | | Merge pull request #5869 from hardenedapple/undojoin-curheadJames McCoy2017-02-02
|\ \ \ \ | | | | | | | | | | Don't set `b_u_curhead` in `ex_undojoin()`
| * | | | Don't set b_u_curhead in ex_undojoin()Matthew Malcomson2017-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.0.0205 This provides no benefit, and introduces some bugs.
* | | | | Run cleanup.vim on {eo,fr}.poJames McCoy2017-02-01
| | | | |
* | | | | vim-patch:e18dbe8James McCoy2017-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated runtime files. https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
* | | | | vim-patch:a02a551James McCoy2017-02-01
| |/ / / |/| | | | | | | | | | | | | | | | | | | Updated runtime files. https://github.com/vim/vim/commit/a02a551e18209423584fcb923e93c6be18f3aa45
* | | | xstrlcat: Allow overlapped pointers. (#6017)Justin M. Keyes2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memcpy is not equivalent to memmove (which is used by vim_strcat), this could cause subtle bugs if xstrlcat is used as a replacement for vim_strcat. But vim_strcat is inconsistent: in the `else` branch it uses strcpy, which doesn't allow overlap. Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com> Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
* | | | undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)Matthew Malcomson2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously alternate branches were not accounted for properly, with this change g- after an undo to a branch point works. The current sequence number b_u_seq_cur is used in undo_time(), in u_doit() this was calculated by subtracting one from the curhead sequence number. The curhead header entry represents the change that was just undone, so the sequence number we want is that of the change we have moved to. This is the sequence number of the undo head that is the uh_next element of this curhead. That sequence number is not always one less than the curhead sequence number -- there may have been an alternate branch at this point. Instead of subtracting one, we now directly find the sequence number of curhead->uh_next.
* | | | dist: runtime/nvim.desktopMatthieu Coudron2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #3689 cmake: Add `desktop-install` and `icon-install` targets. `runtime` target will trigger them. Specification: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys Icons are stored system-wide in /usr/share/applications or user wide at /usr/share/icons/hicolor/scalable/apps and can be overriden in ~/.local/share/icons nvim.desktop file can be installed system wide or in ~/.local/share/applications/ To test without an installer: $ xdg-desktop-menu install --novendor runtime/nvim.desktop $ xdg-icon-resource install --novendor --mode user --size 64 contrib/nvim-icon.png Once it is installed, you can test with gtk-launch if installed or dmenu/rofi (drun mode)
* | | | eval.c: Fix findfile(), :find, gf in :terminal. #6009Tommy Allen2017-01-31
| | | | | | | | | | | | | | | | Closes #4299
* | | | defaults: Revert 'mouse=a' (#6022)Justin M. Keyes2017-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This default causes too much confusion for terminal users. Until a better approach is implemented, revert to the traditional default. Better solution would be: - Implement a right-click menu for TUI - Set 'mouse=a' *only* if clipboard is working. Closes #5938
* | | | Merge pull request #6012 from jamessan/override-TI-cursor-normalJames McCoy2017-01-26
|\ \ \ \ | | | | | | | | | | tui: Ignore DECRST 12 in terminfo's cursor_normal, if present
| * | | | tui: Ignore DECRST 12 in terminfo's cursor_normal, if presentJames McCoy2017-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in neovim/neovim#5977, it's typical for the terminfo database to disable cursor blink as part of setting up the normal cursor. Since this interferes with the user's control over the cursor, we'll skip over DECRST 12 if it starts the cursor_normal entry. Note, this doesn't handle any case where DECRST 12 is not at the start of the entry since unibilium simply stores the given pointer. We would need to allocate (and somewhere free) a modified copy of what we get back from unibi_get_str to handle that.
* | | | | refactor: Remove strncpy/STRNCPY. (#6008)Justin M. Keyes2017-01-26
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #731 References #851 Note: This does not remove some intentional legacy usages of strncpy. - memcpy isn't equivalent because it doesn't check the string length of `src`, and doesn't zero-out the remainder of `dst`. - xstrlcpy isn't equivalent because it doesn't zero-out the remainder of `dst`. Some Vim logic depends on that (e.g. ex_append which calls vim_strnsave). Helped-by: Douglas Schneider <ds3@ualberta.ca> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com>
* | | | Merge #5964 from equalsraf/windows-clipboardJustin M. Keyes2017-01-24
|\ \ \ \ | | | | | | | | | | Windows clipboard support
| * | | | Windows: Install runtime dependencies with Neovim binaryRui Abreu Ferreira2017-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Look for runtime dependencies diff.exe and win32yank.exe (and recursively for DLL dependencies) and install them with nvim.exe. If a dependency is missing a warning will be issued.
* | | | | clint.py: Suggest xstrlcat instead of strcat.Justin M. Keyes2017-01-23
| | | | |
* | | | | refactor: Replace vim_strcat() with xstrlcat().Justin M. Keyes2017-01-23
| | | | |
* | | | | coverity/133853: Out-of-bounds accessJustin M. Keyes2017-01-23
| | | | |
* | | | | coverity/155512: Pass correct length to strncat()Justin M. Keyes2017-01-23
| | | | | | | | | | | | | | | | | | | | References 8bc2bffda94bf2de4e8adae57b4b5597ed4e8247
* | | | | coverity/133845: Negative array index read. (FP)Justin M. Keyes2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `find_command(s->ca.cmdchar) >= 0` was established near the start of normal_execute(). And `unshift_special(&s->ca);` "should" not ever result in s->ca.cmdchar containing a multibyte char. So only an assert() is needed here.
* | | | | errors: Introduce "E856: Filename too long"Justin M. Keyes2017-01-23
| | | | |
* | | | | add_pathsep(): Return false if filename is too long.cztchoice2017-01-23
| | | | | | | | | | | | | | | | | | | | References #3042
* | | | | refactor: strlcat instead of str{n}cat.cztchoice2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add xstrlcat function. Closes #3042 References #988 References #1069 coverity: 71530, 71531, 71532
* | | | | Merge #5995 from ZyX-I/coverity-fixesJustin M. Keyes2017-01-23
|\ \ \ \ \ | |_|/ / / |/| | | | coverity fixes
| * | | | coverity/133898: Fix sizeof argumentZyX2017-01-23
| | | | |
| * | | | ex_cmds: Also pass correct length in windows codeZyX2017-01-23
| | | | |
| * | | | coverity/155511: Pass correct length argument to strncat()ZyX2017-01-23
| | | | |
| * | | | coverity/155512: Pass correct length to strncat()ZyX2017-01-23
| | | | |
| * | | | coverity/155513: Do not assume xcalloc can return NULLZyX2017-01-23
| | | | |
* | | | | version.c: updateShougo Matsushita2017-01-22
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | 1914: signal 2074: HIKEY2UF() Closes #5953
* | | | Merge #5782 'Visual-mode put from @. register'Justin M. Keyes2017-01-22
|\ \ \ \
| * | | | put fixup, esp. ". register close #5709 #5781Matthew Malcomson2017-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note some bugs were judged to have too ugly a fix to solve, tests to demonstrate these problems, and the explanation behind not fixing them are below. describe('register . problems', function() before_each(reset) -- The difficulty here is: The basic requirement is that the text -- inserted is treated as if it were typed in insert mode. This is why -- the paste method is to enter insert mode and enter the ". register -- into readbuf1. -- We can't add a count into the readbuf here because the insert mode -- count is implemented with readbuf2 which is checked for characters -- after readbuf1. -- Hence, the ".gp command (which adds extra characters into readbuf1 -- to emulate leaving the cursor after the text by moving the cursor -- after inserting the text) would insert the motion characters into -- the buffer instead of using them to move after the insert has been -- done. -- I could probably get this working properly with a special flag put -- into start_redo_ins() and set in do_put(), but I think this adds -- much more complexity than fixing this bug justifies. pending('should not change the ". register with ".2p', function() local orig_register = funcs.getreg('.') feed('2".p') eq(orig_register, funcs.getreg('.')) end) describe("cursor positioning after undo and redo with '.'", function() before_each(reset) local function make_cursor_test(macro_string) return function() feed(macro_string) local afterpos = funcs.getcurpos() local orig_string = curbuf_contents() feed('u.') eq(afterpos, funcs.getcurpos()) expect(orig_string) end end -- The difficulty here is: setting the cursor after the end of the -- pasted text is done by adding a motion command to the -- stuffbuffer after the insert. -- Modifying 'redobuff' is done in the code that handles inserting -- text and moving around. -- I could add a special case in ins_esc() that checks for a flag -- set in do_put() to add the motion character to the redo buffer, -- but I think that is starting to get way too convoluted for the -- benefit. pending('should be the same after ".gp and ".gpu.', make_cursor_test('".gp')) -- The difficulty here is: putting forwards is implemented by using -- 'a' instead of 'i' to start insert. -- Undoing with 'u' an insert that began with 'a' leaves the cursor -- where the first character was inserted, not where the cursor was -- when the 'a' was pressed. -- We account for this the first time by saving the cursor position -- in do_put(), but this isn't stored in redobuff for a second time -- around. -- We can't change how such a fundamental action as undo after -- inserting with 'a' behaves, we could add in a special case -- whereby we set a flag in do_put() and read it when entering -- insert mode but this seems like way too much to fix such a minor -- bug. pending('should be the same after ".pu. and ".pu.u.', make_cursor_test('".pu.')) end) end)
* | | | | readfile(): Fix read-after-free.Justin M. Keyes2017-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | References https://github.com/neovim/neovim/pull/5956#pullrequestreview-17812620 Helped-by: oni-link <knil.ino@gmail.com>
* | | | | test: expand_env_esc()Justin M. Keyes2017-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test expand_env_esc() using the same parameters reported in #3725. Closes #3725
* | | | | Merge #5977 from justinmk/tui-cursor-shapeJustin M. Keyes2017-01-21
|\ \ \ \ \ | |_|/ / / |/| | | | tui: enable NVIM_TUI_ENABLE_CURSOR_SHAPE by default
| * | | | tui: Enable mode-sensitive cursor by default.Justin M. Keyes2017-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also give NVIM_TUI_ENABLE_CURSOR_SHAPE more granularity: 0 = do not change cursor shape 1 = non-blinking ("steady") cursor with mode-sensitive shape 2 = blinking cursor with mode-sensitive shape Note: blink state is not changed for Konsole, instead user's terminal preference makes the decision. (Can't do that for xterm-likes, DECSCUSR forces us to choose blink-state.) This is a temporary step until the TUI respects 'guicursor' Ref: https://github.com/neovim/neovim/issues/2583#issuecomment-272988384
| * | | | tui: Do not decide cursor blinking.Justin M. Keyes2017-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "CSI ? 12 l" stops cursor blinking. `unibi_cursor_normal` need only _show_ the cursor, not make any pronouncement about cursor blinking. User's terminal setting (or NVIM_TUI_ENABLE_CURSOR_SHAPE) takes precedence.
* | | | | input_enqueue(): Fix length calculation. (#5981)Justin M. Keyes2017-01-20
| | | | | | | | | | | | | | | Ref: https://github.com/neovim/neovim/issues/5885#issuecomment-273614373