aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* 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
* | | vim-patch:7.4.2049,7.4.2050,7.4.2064,7.4.2067,7.4.2081 (#5969)Justin M. Keyes2017-01-20
|\ \ \ | |/ / |/| | vim-patch:7.4.2049,7.4.2050,7.4.2064,7.4.2067,7.4.2081
| * | vim-patch:7.4.2081lonerover2017-01-19
| | | | | | | | | | | | | | | | | | | | | Problem: Line numbers in the error list are not always adjusted. Solution: Set b_has_qf_entry properly. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
| * | vim-patch:7.4.2067lonerover2017-01-19
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Compiler warning for char/char_u conversion. (Tony Mechelynck) Inefficient code. Solution: Use more lines to fill with spaces. (Nikolai Pavlov) Add type cast. https://github.com/vim/vim/commit/16ec3c9be3fcdc38530bddb12978bc5a7b98c0f6
| * | vim-patch:7.4.2064lonerover2017-01-19
| | | | | | | | | | | | | | | | | | | | | Problem: Coverity warns for possible buffer overflow. Solution: Use vim_strcat() instead of strcat(). https://github.com/vim/vim/commit/4f5c5f29806e53251b7a7b68ce7de86a21ff8015
| * | vim-patch:7.4.2050lonerover2017-01-19
| | | | | | | | | | | | | | | | | | | | | Problem: When using ":vimgrep" may end up with duplicate buffers. Solution: When adding an error list entry pass the buffer number if possible. https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
| * | vim-patch:7.4.2049lonerover2017-01-19
| |/ | | | | | | | | | | | | Problem: There is no way to get a list of the error lists. Solution: Add ":chistory" and ":lhistory". https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
* | Merge #5937 from justinmk/win32-testJustin M. Keyes2017-01-19
|\ \ | | | | | | Windows: test: enable job_spec.lua
| * | win: fix warningsJustin M. Keyes2017-01-19
| |/
* | Merge #5865 from lonerover/vim-7.4.2036Justin M. Keyes2017-01-19
|\ \ | |/ |/| vim-patch:7.4.2036
| * buffer.c: use a map instead of hashtabrover2017-01-19
| |
| * fix lint errorlonerover2017-01-04
| |
| * vim-patch:7.4.2036lonerover2017-01-03
| | | | | | | | | | | | | | Problem: Looking up a buffer by number is slow if there are many. Solution: Use a hashtab. https://github.com/vim/vim/commit/480778b805bd8bdc5d657560230e9c50feda1d0f
* | DirChanged: set <amatch> (#5961)Justin M. Keyes2017-01-17
| | | | | | | | | | Also: - test that DirChanged is not recursive - fix 'not trigger if :cd fails' test on Windows
* | vim-patch:7.4.2062 (#5954)Shougo2017-01-16
| | | | | | | | | | | | Problem: Using dummy variable to compute struct member offset. Solution: Use offsetof(). https://github.com/vim/vim/commit/840268400dc8fda62a14f8a084e8b1ea46619454
* | Merge #5928 'New event: DirChanged'Marco Hinz2017-01-16
|\ \
| * | Rename yank_do_autocmd() to do_autocmd_textyankpost()Marco Hinz2017-01-13
| | |
| * | Move apply_autocmd_dirchanged() to vim_chdir()Marco Hinz2017-01-13
| | |
| * | Trigger DirChanged on 'autochdir'Marco Hinz2017-01-13
| | |
| * | Don't expand filenames during autocmdMarco Hinz2017-01-13
| | |
| * | New event: DirChangedMarco Hinz2017-01-13
| | |
* | | vim-patch:7.4.2031 (#5955)Shougo2017-01-16
| | | | | | | | | | | | | | | | | | | | | | | | Problem: The list_lbr_utf8 test fails if ~/.vim/syntax/c.vim sets 'textwidth' to a non-zero value. (Oyvind A. Holm) Solution: Add a setup.vim file that sets 'runtimepath' and $HOME to a safe value. (partly by Christian Brabandt, closes vim/vim#912) https://github.com/vim/vim/commit/89b10421ca1aea55acbafac1df93be4e20210ceb
* | | readfile(): Avoid file message when reading from stdin. #5956Michael Schupikov2017-01-16
| | | | | | | | | | | | Closes #5921
* | | Merge #5918 'vim-patch: 7.4.2006, 7.4.2075, 7.4.2077, 7.4.2117, 7.4.2300, ↵Justin M. Keyes2017-01-16
|\ \ \ | | | | | | | | | | | | 7.4.2313, 7.4.2314'.
| * | | fix test failurelonerover2017-01-09
| | | |
| * | | vim-patch:7.4.2314lonerover2017-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No error when deleting an augroup while it's the current one. Solution: Disallow deleting an augroup when it's the current one. https://github.com/vim/vim/commit/de653f08805dde14424d417502a0480a6ad292f8
| * | | vim-patch:7.4.2313lonerover2017-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when deleting an augroup and listing an autocommand. (Dominique Pelle) Solution: Make sure deleted_augroup is valid. https://github.com/vim/vim/commit/b62cc36a600e2e1e5a1d1d484fef89898c847c4c
| * | | vim-patch:7.4.2300lonerover2017-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Get warning for deleting autocommand group when the autocommand using the group is scheduled for deletion. (Pavol Juhas) Solution: Check for deleted autocommand. https://github.com/vim/vim/commit/5c80908ced601be6db7554a147cdb0f98ac8daa1
| * | | vim-patch:7.4.2117lonerover2017-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Deleting an augroup that still has autocmds does not give a warning. The next defined augroup takes its place. Solution: Give a warning and prevent the index being used for another group name. https://github.com/vim/vim/commit/f2c4c391192cab6e923b1a418d4af09106fba25f
| * | | vim-patch:7.4.2077rover2017-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot update 'tabline' when a tab was closed. Solution: Add the TabClosed autocmd event. (partly by Felipe Morales) https://github.com/vim/vim/commit/12c11d553053f5a9eae9eb3c518279b12fa928c2
| * | | vim-patch:7.4.2075rover2017-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No autocommand event to initialize a window or tab page. Solution: Add WinNew and TabNew events. (partly by Felipe Morales) https://github.com/vim/vim/commit/c917da4b3e8801a255dbefea8e4ed19c1c716dd8
| * | | vim-patch:7.4.2006rover2017-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when using tabnext in BufUnload autocmd. (Norio Takagi) Solution: First check that the current buffer is the right one. (Hirohito Higashi) https://github.com/vim/vim/commit/30445cb6e94698d212ba866ef3e4022ac625540a
* | | | vim-patch:7.4.2099 (#5951)Shougo2017-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When a keymap is active only "(lang)" is displayed. (Ilya Dogolazky) Solution: Show the keymap name. (Dmitri Vereshchagin, closes vim/vim#933) https://github.com/vim/vim/commit/73ac0c4281a3606651604a3cbcc334bfb3859a87
* | | | setpos(): Set lowercase mark in other buffers (#5753)Matthew Malcomson2017-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also make setpos("'A", [999, 1, 1, 0]) fail, i.e. return -1 (assuming there is no buffer 999). Fixes #5713 Background: `:help setpos()` mentions an argument `"bufnum"` that determines the buffer a mark should be put in. This argument is respected for uppercase marks, but not for lowercase marks. This is reasonable (though I personally would like `setpos()` to be able to set marks in other buffers), but the help doesn't mention this anywhere. It's also strange that attempting to change buffers with `setpos('.', [bufnr('#'), 1, 1, 0])` alerts the user that having a different buffer is an error, while attempting to set a mark with `setpos("'d", [bufnr('#'), 1, 1, 0])` doesn't tell the user that the `"bufnum"` argument is an error.