aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
Commit message (Collapse)AuthorAge
...
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* Bring E319 (cmd not available) in line with E519 (opt not available)Michael Reed2015-04-10
|
* clipboard: reallow `:put`Björn Linse2015-04-05
|
* 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_".
* terminal: New module that implements a terminal emulatorThiago de Arruda2015-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates libvterm with Neovim and implements a terminal emulator with nvim buffers as the display mechanism. Terminal buffers can be created using any of the following methods: - Opening a file with name following the "term://[${cwd}//[${pid}:]]${cmd}" URI pattern where: - cwd is the working directory of the process - pid is the process id. This is just for use in session files where a pid would have been assigned to the saved buffer title. - cmd is the command to run - Invoking the `:terminal` ex command - Invoking the `termopen` function which returns a job id for automating the terminal window. Some extra changes were also implemented to adapt with terminal buffers. Here's an overview: - The `main` function now sets a BufReadCmd autocmd to intercept the term:// URI and spawn the terminal buffer instead of reading the file. - terminal buffers behave as if the following local buffer options were set: - `nomodifiable` - `swapfile` - `undolevels=-1` - `bufhidden=hide` - All commands that delete buffers(`:bun`, `:bd` and `:bw`) behave the same for terminal buffers, but only work when bang is passed(eg: `:bwipeout!`) - A new "terminal" mode was added. A consequence is that a new set of mapping commands were implemented with the "t" prefix(tmap, tunmap, tnoremap...) - The `edit` function(which enters insert mode) will actually enter terminal mode if the current buffer is a terminal - The `put` operator was adapted to send data to the terminal instead of modifying the buffer directly. - A window being resized will also trigger a terminal resize if the window displays the terminal.
* buffer: Move b_p_ma(modifiable) checks into the MODIFIABLE macroThiago de Arruda2015-03-25
|
* ui: Replace cursor_{on,off} by busy_{stop,start}Thiago de Arruda2015-03-15
| | | | | | | | | | | | | | | | | | | | | | | | Switching cursor off is only necessary in two occasions: - When redrawing to avoid terminal flickering - When the editor is busy The first can now be handled by the TUI, so most calls to ui_cursor_off can be removed from the core. So, before this commit it was only necessary to switch the cursor off to notify the user that nvim was running some long operation. Now the cursor_{on,off} functions have been replaced by busy_{stop,start} which can be handled in a UI-specific way(turning the cursor off or showing a busy indicator, for example). To make things even more simpler, nvim is always busy except when waiting for user input or other asynchronous events: It automatically switches to a non-busy state when the event loop is about to be entered for more than 100 milliseconds. `ui_busy_start` can be called when its not desired to change the busy state in the event loop (As its now done by functions that perform blocking shell invocations).
* Merge pull request #2118 from rev112/fix_redundant_castJohn Szakmeister2015-03-13
|\ | | | | Remove redundant casts
| * Remove redundant castsAnton Ovchinnikov2015-03-09
| |
* | Interface cleanup: Symlink handling & docsMichael Reed2015-03-12
|/ | | | | | | | | | | | | | | | | | | | | | This removes the ability to start nvim via the following aliases in favor of just using their command line arguments: ex vim -e exim vim -E view vim -R gvim vim -g gex vim -eg gview vim -Rg rvim vim -Z rview vim -RZ rgvim vim -gZ rgview vim -RgZ This also removes Vi mode (-v) for consistency. From ':help -v': -v Start Ex in Vi mode. Only makes a difference when the executable is called "ex" or "gvim". For gvim the GUI is not started if possible.
* Macro cleanup: USE_ON_FLY_SCROLLMichael Reed2015-03-05
|
* Macro cleanup: SPACE_IN_FILENAMEMichael Reed2015-03-05
|
* Macro cleanup: HAVE_SANDBOXMichael Reed2015-03-05
|
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* Add TabClosed eventFelipe Morales2015-02-16
| | | | TabClosed is triggered when a tab page closes.
* Add TabNewEnteredFelipe Morales2015-02-16
| | | | TabNewEntered is triggered after vim has entered a buffer in new tab.
* Add TabNew eventFelipe Morales2015-02-16
| | | | | TabNew triggers when entering a new tab page, but not when entering an already created one.
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
* coverity/13810: Unitialized scalar variable: HI.Eliseo Martínez2015-02-02
| | | | | | | | | Problem : Unitialized scalar variable @ 3239. Diagnostic : Harmless issue. Rationale : It's true pos.coladd is not initialized when calling searchit(). But that's no problem, as coladd is only set in that function. Resolution : Initialize variable to 0.
* Remove nonnullret deadcode: home_replace_save.Eliseo Martínez2015-01-27
|
* Remove long_u: ex_docmd.c: Refactor long_u.Eliseo Martínez2015-01-19
|
* Macro cleanup: PROTOMichael Reed2015-01-14
| | | | | | Regarding dict_lookup() in eval.c: both definitions are the same, the only difference being the spacing between the indirection operator and the indentation level.
* Revert "[WIP] "abstract_ui" fixes and improvements"Justin M. Keyes2015-01-12
|
* Merge pull request #1657 from tarruda/abstract-ui-fixesJustin M. Keyes2015-01-12
|\ | | | | [WIP] "abstract_ui" fixes and improvements
| * ui: Reimplement `:suspend` command for remote UIs.Thiago de Arruda2015-01-12
| | | | | | | | | | | | - Remove suspend method from the UI protocol - Handle `:suspend` by disconnecting the last channel that sent a request to nvim.
* | Cleanup: Rename getdigits() family functions.Eliseo Martínez2015-01-11
| |
* | Cleanup: Refactor getdigits().Eliseo Martínez2015-01-11
|/ | | | | | | | | | | | | | | | Problem : getdigits() currently returns a long, but at most places, return value is casted (unsafely) into an int. Making casts safe would introduce a lot of fuss in the form of assertions checking for limits. Note : We cannot just change return type to int, because, at some places, legitimate long values are used. For example, in diff.c, for line numbers. Solution : Introduce new functions: - get_digits() : Gets an intmax_t from a string. - get_int_digits() : Wrapper for ints. - get_long_digits() : Wrapper for longs. And replace getdigits() invocations by the appropiate wrapper invocations.
* restore 'Not Implemented' for legacy script commands (:lua :ruby ...)Justin M. Keyes2014-12-27
| | | | | | | | | | | | | | | - restores behavior equivalent to Vim compiled without FEAT_MZSCHEME, etc. (avoids spurious "E492: Not an editor command: EOF") for code such as: ```vim if 0 perl << EOF end EOF endif ``` see :help script-here - fixes #1308 - fixes https://github.com/junegunn/vim-plug/issues/111
* Merge pull request #1730 from fwalch/vim-7.4.486Justin M. Keyes2014-12-26
|\ | | | | vim-patch:7.4.486
| * vim-patch:7.4.486Florian Walch2014-12-25
| | | | | | | | | | | | | | Problem: Check for writing to a yank register is wrong. Solution: Negate the check. (Zyx). Also clean up the #ifdefs. https://code.google.com/p/vim/source/detail?r=v7-4-486
* | Merge pull request #1725 from fwalch/vim-7.4.450Justin M. Keyes2014-12-26
|\ \ | |/ |/| vim-patch:7.4.450
| * vim-patch:7.4.450Florian Walch2014-12-23
| | | | | | | | | | | | | | | | Problem: Not all commands that edit another buffer support the +cmd argument. Solution: Add the +cmd argument to relevant commands. (Marcin Szamotulski) https://code.google.com/p/vim/source/detail?r=v7-4-450
* | vim-patch:7.4.494Florian Walch2014-12-23
|/ | | | | | | | Problem: Cursor shape is wrong after a CompleteDone autocommand. Solution: Update the cursor and mouse shape after ":normal" restores the state. (Jacob Niehus) https://code.google.com/p/vim/source/detail?r=v7-4-494
* Remove Amiga remnantsMichael Reed2014-12-19
| | | | | | | | | Notes regarding the removal of specific items: - Aztec C: only on the Amiga. - mch_check_win(): doesn't exist anymore. - Comment in ex_cmds.c: It seems the context for this comment was removed, but the comment was inadvertantly left alone.
* Merge pull request #1663 from philix/array_sizeJustin M. Keyes2014-12-19
|\ | | | | Define and use the ARRAY_SIZE macro
| * Use ARRAY_SIZE where Coccinelle wasn't able to do itFelipe Oliveira Carvalho2014-12-18
| |
| * Define and use the ARRAY_SIZE macroFelipe Oliveira Carvalho2014-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A similar macro is defined in the Linux kernel [1]. To refactor the code I used a slightly modified Coccinelle script I found in [2]. ```diff // Use the macro ARRAY_SIZE when possible // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/array.html // Options: -I ... -all_includes can give more complete results @@ type T; T[] E; @@ - (sizeof(E)/sizeof(*E)) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(E[...])) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) @n@ identifier AS,E; @@ - #define AS(E) ARRAY_SIZE(E) @@ expression E; identifier n.AS; @@ - AS(E) + ARRAY_SIZE(E) ``` `spatch --in-place --sp-file array_size.cocci -I src/ -I build/include/ -I build/src/nvim/auto/ src/nvim/*.c` [1] http://lxr.free-electrons.com/source/include/linux/kernel.h#L54 [2] http://www.emn.fr/z-info/coccinelle/rules/#macros
* | Reimplement :drop (vim-patch:0)Victor Adam2014-12-18
|/ | | | | The :drop ex command was inadvertently removed when removing FEAT_GUI. This patch reintroduces it.
* coverity/13695: Unchecked return value: RI.Eliseo Martínez2014-12-16
| | | | | | | | | Problem : Unchecked return value (CHECKED_RETURN) @ 8554. Diagnostic : Real issue. Rationale : Other invocations of `do_source` are checked and generate an error message if fail. There seems to be no reason why this particular instance could not fail the same. Resolution : Check invocation and generate error message on failure.
* Reduce indentation level by early returning or continuing loopFelipe Oliveira Carvalho2014-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace code like this ```c func() { if (cond) { ... ... ... } return ret; } ``` ```c for (...) { if (cond) { ... ... ... } } ``` with ```c func() { if (!cond) { return ret; } ... ... ... } ``` ```c for (...) { if (!cond) { continue; } ... ... ... } ```
* Ignore compatible modeJoel Teichroeb2014-12-13
|
* Use GA_DEEP_CLEAR where appropriateFelipe Oliveira Carvalho2014-12-11
|
* GA_DEEP_CLEAR macro for garray memory deallocationFelipe Oliveira Carvalho2014-12-11
| | | | | | | Used to free garrays of `salitem_T` and `fromto_T` in spell.c, and garray `wcmd_T` in ex_docmd.c. Helped-by: Jiaqi Li
* term: Remove most calls to settmodeThiago de Arruda2014-12-02
| | | | | | Nvim now relies much less on setting terminal mode to cooked mode, remove most calls to settmode, except for those that happen on startup or when suspending. Eventually even those will be handled by the UI layer.
* term: Move "set_shellsize" to screen.c as "screen_resize"Thiago de Arruda2014-12-02
|
* Merge pull request #1497 from splinterofchaos/const-attrJustin M. Keyes2014-11-29
|\ | | | | constify and func-attribute memory.c and strings.c
| * strings/memory: constify and func_attr.Scott Prager2014-11-27
| | | | | | | | Fix MB_COPY_cHAR() to accept const pointers.
* | ui: Remove ui_delay, ui_breakcheck and ui_set_shellsizeThiago de Arruda2014-11-27
|/ | | | | These functions only used to call another os_* function, so remove them and replace all occurences in the project.
* Fix warnings: syntax.c: get_id_list(): Double free: FP.Eliseo Martínez2014-11-15
| | | | | | | | | | | | Problem : Double free @ 5213. Diagnostic : False positive. Rationale : Suggested error path contains two consecutive invocations of `ends_excmd(*p)` having different results, which is not possible. First invocation is before the while loop. Second invocation is the while loop condition itsef. Resolution : Refactor while loop into do-while loop. That removes the impossible path from analysis, and, in addition, is a bit more efficient.
* vim-patch:7.4.415Scott Prager2014-11-11
| | | | | | | Problem: Cannot build. Warning for shadowed variable. (John Little) Solution: Add missing change. Remove declaration. https://code.google.com/p/vim/source/detail?name=v7-4-414&r=20dbceb6f4713ccd01be45dc531abc269fbb7579