aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | | terminal: Handle loss of focus in event loop.Scott Prager2015-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While in a terminal and insert mode, if an event caused loss of focus, nvim would stay in the terminal event loop causing an inconsistent view of internal state and/or segfault. Remove the "term" argument from terminal_enter() as it only makes sense to call it with curbuf->terminal. Terminate the loop when switched to a different buffer. fixes #2301
* | | | event.c: Simplify timer use in event_poll()oni-link2015-04-08
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | event_poll() always leaves the libuv I/O loop after one iteration. The duration for how long the loop polls for I/O is given by the shortest timeout of all active timers. Is no timer active, I/O is/could be polled indefinitely. To make sure our timer is still active when I/O polling begins, a prepare handle is used to start the timer right before the polling. But by only using a timer that restarts after its timeout was reached, we also can assure that polling is done with (nearly) the same finite timeout. For a short explanation how the I/O loop is working, see http://docs.libuv.org/en/latest/design.html#the-i-o-loop.
* | | Fix warnings: window.c: close_last_window_tabpage(): Np deref: RI.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Dereference of null pointer @ 1769. Diagnostic : Real issue. Rationale : It seems buffer could be null. Not sure, though. Resolution : Check for buffer null. This resolution was chosen as it will always work. But it could be that buffer can't really be null at that point. autocmd_win is ruled out by close_window, so that can't be the case. I'm not sure if other windows without buffers are possible, so leaving it this way. If it's confirmed buffer can't be null, resolution through an assert would be possible and this would be FP, not RI.
* | | Fix warnings: terminal.c: get_config_int(): Dead init: RI.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Dead initialization @ 1119. Diagnostic : Real issue. Rationale : `obj` is immediately assigned another value through GET_CONFIG_VALUE macro. Resolution : Don't initialize. Helped-by: oni-link <knil.ino@gmail.com>
* | | Fix warnings: terminal.c: get_config_string(): Dead init: RI.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Dead initialization @ 1109. Diagnostic : Real issue. Rationale : `obj` is immediately assigned another value through GET_CONFIG_VALUE macro. Resolution : Don't initialize. Helped-by: oni-link <knil.ino@gmail.com>
* | | Fix warnings: terminal.c: redraw(): Np dereference: RI.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | Problem : Dereference of null pointer @ 1053. Diagnostic : Real issue. Rationale : Branch "Exiting focused terminal" can actually be executed when term is NULL. Resolution : Guard branch with term check.
* | | Fix warnings: eval.c: f_termopen(): Use-after-free: MI.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Use-after-free @ 15081. Diagnostic : Multithreading issue. Rationale : `get_dict_callback` can return NULL on two different cases: 1) when the dict doesn't contain the given key; this case is not considered an error. 2) when the key exists but there's some problem with its value; this is considered an error. Then, code calling `get_dict_callback` in `common_job_callbacks`, as well as code calling `common_job_callbacks`, uses `did_emsg` to distinguish between error/non-error cases. Suggested error path presumes an error condition within `common_job_callbacks`, with `did_emsg` being true, but then being false just after returning to calling code in `f_termopen`. That, clearly, could only happen if another thread run in between those points. Resolution : Refactor `get_dict_callback` and `common_job_callbacks`, so that they clearly distinguish between error/non-error situations, without recurring to globals.
* | | Fix warnings: eval.c: f_jobstart(): Np dereference: FP.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | Problem : Dereference of null pointer @ 10812. Diagnostic : False positive. Rationale : `args->lv_first` can't be NULL, as we have just stated above that that there's at least one item. Resolution : Assert.
* | | legacy tests: migrate test38 #2367Murali Suresh2015-04-07
| | |
* | | tests: Migrate legacy tests 44 and 99 #2366David Bürgin2015-04-07
| | | | | | | | | | | | Consolidates the old test44 and test99 tests into one busted spec.
* | | Enable -Wconversion: move.c.Eliseo Martínez2015-04-07
| | |
* | | Enable -Wconversion: fold.c.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor summary: - foldinfo_T.fi_lnum: int --> linenr_T Reorder field for optimal packing. - foldAddMarker(..., markerlen): int --> size_t * foldstartmarkerlen: int --> size_t - foldDelMarker(..., markerlen): int --> size_t * foldendmarkerlen: int --> size_t Helped-by: oni-link <knil.ino@gmail.com>
* | | Enable -Wconversion: popupmnu.c.Eliseo Martínez2015-04-07
| | | | | | | | | | | | Helped-by: oni-link <knil.ino@gmail.com>
* | | Enable -Wconversion: farsi.c: Cleanup.Eliseo Martínez2015-04-07
| | | | | | | | | | | | No semantic changes. Just some reformatting to save lines.
* | | Enable -Wconversion: farsi.c: Solve issues.Eliseo Martínez2015-04-07
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor summary: - toF_TyB: int fn(int) --> char_u fn(int) - put_and_redo: void fn(int) --> void fn(char_u) * put_curr_and_l_to_X: void fn(int) --> void fn(char_u) - toF_TyA: int fn(int) --> char_u fn(char_u) * toF_Xor_X_: int fn(int) --> char_u fn(int) - toF_leading: int fn(int) --> char_u fn(char_u) - toF_Rjoin: int fn(int) --> char_u fn(char_u) - toF_ending: int fn(int) --> char_u fn(char_u) - canF_Ljoin: bool fn(int) --> bool fn(char_u) - canF_Rjoin: bool fn(int) --> bool fn(char_u) - F_isterm: bool fn(int) --> bool fn(char_u) Helped-by: oni-link <knil.ino@gmail.com>
* | Merge pull request #2348 from mhinz/job-control-mouseScott Prager2015-04-06
|\ \ | | | | | | [RFC] Job control: enable mouse after foregrounding
| * | Job control: reset mouse support after foregroundingMarco Hinz2015-04-06
| | | | | | | | | | | | | | | | | | Reset mouse support to whatever was used before the process was suspended. References #2335.
* | | Remove redundant NULL checksAnton Ovchinnikov2015-04-06
|/ / | | | | | | | | menu_text() never returns NULL, because vim_strsave() and vim_strnsave() never return NULL.
* | legacy tests: Remove legacy tests for Lua (test85) #2357David Bürgin2015-04-06
| |
* | legacy tests: Remove legacy tests for MzScheme (test70)David Bürgin2015-04-06
| |
* | tests: Migrate legacy tests 92 and 93 #2261David Bürgin2015-04-05
| |
* | vim-patch:7.4.636 #2267David Bürgin2015-04-05
| | | | | | | | | | | | | | | | Problem: A search with end offset gets stuck at end of file. (Gary Johnson) Solution: When a search doesn't move the cursor repeat it with a higher count. (Christian Brabandt) https://github.com/vim/vim/releases/tag/v7-4-636
* | Fix problem with coverity/105568 fix.oni-link2015-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original fix 3db0a40d691c103a26ef3df74528f12d89b0fa61 does not work for more than one loop iteration, because memory allocated in the previous iteration could be reused in the current iteration. Because expand_wildcards() never reads the variables *num_file and *file before the first assignment to them, the initial values for these variables can be anything. So instead of calling expand_shellcmd() with *file = "" we set *file = NULL. That should help coverity see, that not a array-typed value is freed. Helped-by: Eliseo Martínez <eliseomarmol@gmail.com>
* | Update comments for expand_wildcards functions.oni-link2015-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Be more specific in the description of mch_expand_wildcards(): This function will never free memory pointed to by its arguments. If OK is returned, *file will always point to allocated memory. *num_file is set to the number of pointers in *file. If FAIL is returned *file is set to NULL and *num_file to 0. If gen_expand_wildcards() returns FAIL, no memory allocation in this function needs to be undone. If expand_wildcards() returns FAIL, no memory allocation in this function needs to be undone. Helped-by: Eliseo Martínez <eliseomarmol@gmail.com> Helped-by: Michael Reed <m.reed@mykolab.com>
* | vim-patch:7.4.497 #2295David Bürgin2015-04-05
|/ | | | | | | | | | | | | 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>
* Remove swap file accidentally committed in 34dba3d7.John Szakmeister2015-04-05
| | | | Also expand the rule in .gitignore to block other forms of swap files.
* clipboard: missing `return NULL` when provider not availableBjörn Linse2015-04-05
|
* clipboard: handle clipboard reading directly in `get_yank_register`Björn Linse2015-04-05
| | | | | | | | This makes :<c-r>* work as expected and avoids clobbering zero register ("0) when pasting unnamed clipboard Helped-By: Scott Prager <splinterofchaos@gmail.com> Helped-By: Michael Reed <m.reed@mykolab.com>
* clipboard: improve the handling of newlines in `get_clipboard`Björn Linse2015-04-05
| | | | | | This makes the interpretion consistent with the way newlines are used in the VIMENC format, while keeping the same fallback behaviour when regtype is unspecified. Also check both cases explicitly in the tests.
* clipboard: reallow `:put`Björn Linse2015-04-05
|
* clipboard: show "* and "+ in :registersBjörn Linse2015-04-05
| | | | | Helped-by: Robin Allen <r@foon.uk> Helped-by: Scott Prager <splinterofchaos@gmail.com>
* Fix a memory leak for WBuffers used in channel_write().oni-link2015-04-03
| | | | | | | channel_write() uses a ref-counted buffer for writing. This buffer should be released if it was used in "refcount" channel_write() calls. But calling channel_write() on a closed channel would return early and not decrease the refcount of the used buffer.
* Prevent too early sending of delayed notifications.oni-link2015-04-03
| | | | | | | | | | | | | | Notifications for a channel will be sent directly if there are no pending requests (for this channel). Otherwise notifications are queued for later sending. But in two cases a notification could be sent with pending requests: * Broadcasting a notification * A channel that has just finished its last pending request would call send_delayed_notifications() for all channels. To prevent this, every channel can now only send its own delayed notifications and broadcasting checks for pending requests.
* Merge pull request #2318 from yshui/masterJohn Szakmeister2015-04-03
|\ | | | | CMakeLists: fix build when there're multiple arguments in C_FLAGS
| * CMakeLists: fix build when there're multiple arguments in C_FLAGSYuxuan Shui2015-03-31
| | | | | | | | | | | | Because the COMMAND arguments of custom_command takes a list, and CMAKE_C_FLAGS is a string, it will be treated as a single long argument, which will cause the build to fail.
* | eval: Ensure all job callbacks are invoked by `jobwait()`Thiago de Arruda2015-04-02
| | | | | | | | | | A call to `event_poll` is required to ensure the exit callback from the last job is invoked.
* | eval: Add internal_refcount field to dict_TThiago de Arruda2015-04-02
| | | | | | | | | | | | | | | | Due to the way vimscript garbage collection handles cyclic references, its not possible to rely on incrementing `dv_refcount` to prevent dicts still used internally from being collected: If a object with dv_refcount > 0 isn't reachable by vimscript code, it will be freed when `garbage_collect()` is called. Add the `internal_refcount` field to prevent this.
* | vim-patch:7.4.336 #2299David Bürgin2015-04-02
| | | | | | | | | | | | | | Problem: Setting 'history' to a big value causes out-of-memory errors. Solution: Limit the value to 10000. (Hirohito Higashi) https://github.com/vim/vim/tree/v7-4-336
* | vim-patch:7.4.515David Bürgin2015-04-01
| | | | | | | | | | | | | | | | Problem: In a help buffer the global 'foldmethod' is used. (Paul Marshall) Solution: Reset 'foldmethod' when starting to edit a help file. Move the code to a separate function. https://github.com/vim/vim/releases/tag/v7-4-515
* | Modeline cleanupMichael Reed2015-03-31
| | | | | | | | | | If users want folds to be automatically collapsed, then they should just set foldmethod=marker in their vimrc.
* | Remove potential NULL dereference. #2316Prajjwal Bhandari2015-03-31
| | | | | | | | | | | | This also removes the `#elseif defined(MSWIN)` clause. Due to the enclosing `if` block, we will never get to this point when src starts with a '%', making the whole #elseif block dead code.
* | Merge pull request #2296 from glts/vim-7.4.324Florian Walch2015-03-31
|\ \ | |/ |/| [RDY] vim-patch:7.4.324
| * vim-patch:7.4.324David Bürgin2015-03-30
| | | | | | | | | | | | | | Problem: In Ex mode, cyrillic characters are not handled. (Stas Malavin) Solution: Support multi-byte characters in Ex mode. (Yukihiro Nakadaira) https://github.com/vim/vim/releases/tag/v7-4-324
* | CMakeLists: enable USE_FNAME_CASE on MacScott Prager2015-03-31
| |
* | os_scandir: fname_case -> path_fix_caseScott Prager2015-03-31
| | | | | | | | | | | | | | | | | | | | Use os_scandir(). fname_case() only gets used when `defined(USE_FNAME_CASE)` (on operating systems with case-insensitive file systems), but may be useful in other contexts, so move it to path.c. (See the TODO.) Remove the unused parameter, len.
* | os_scandir: mch/unix_expandpath() -> path_expand()Scott Prager2015-03-31
| | | | | | | | | | Merge unix_expandpath with dos_expandpath from upstream vim and use os_scandir() over POSIX readdir().
* | Un-mch mch_has_(exp_)wildcard().Scott Prager2015-03-31
| | | | | | | | | | Merge mch_has_wildcard() and mch_has_exp_wildcar() with their upstream equivalents for Windows and replace the "mch_" suffix with "path_".
* | os_scandir(), scandir_next(), and os_closedir()Scott Prager2015-03-31
| |
* | Create new mode() value for terminal-mode ('t') #2287Harm te Hennepe2015-03-27
|/
* eval: Improve validation of ids passed to job functionsThiago de Arruda2015-03-29
| | | | | Use the `is_user_job` to ensure that the job was started by `jobstart` or `termopen`.