aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
Commit message (Collapse)AuthorAge
...
* Replace vim_iswhite with ascii_iswhite() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Refactor get_env() to respect const qualifierMark Bainter2015-04-18
| | | | | | Without the casts*, the compiler rightly warns about the os_getenv losing the qualifier. This refactor adds a variable to manage this properly, and renames the original variables to increase clarity.
* Remove char_u: vim_getenv()Mark Bainter2015-04-17
|
* 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.
* 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.
* 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.
* 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
|
* refactor: split some more functions from misc1.cbobtwinkles2015-03-24
| | | | | | | | | | | This commit pulls the some environment-variable handling functions out of misc1.c and in to os/env.c. Previously submited as #1231, this is the start of a patch series that does that work based on a more up-to-date master branch. Major tasks accomplished: - move functions and fix includes - fix clint/clang analysis warnings - correct documentation comments
* misc2.c: Move emsg* functions to message.c #2152Michael Reed2015-03-19
| | | | Clean up said functions and some outdated comments while we're at it.
* 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.
* | version: don't use NVIM_VERSION_* directly outside version.cBjörn Linse2015-03-08
|/ | | | This avoids recompiles after commiting.
* Macro cleanup: USE_ON_FLY_SCROLLMichael 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
* Enable -Wconversion: ui.c.Eliseo Martínez2015-02-18
| | | | | | | | | | | | | | | Refactoring summary: - ui_write(): len: int --> size_t * parse_abstract_ui_codes(): len: int --> size_t * string_convert(): lenp: int * --> size_t * - string_convert_ext(): lenp : int * --> size_t * unconvlenp: int * --> size_t * * utf8len_tab_zero: char[] --> uint8_t[] * iconv_string(): slen : int --> size_t unconvlenp: int * --> size_t * resultlenp: int * --> size_t * - mch_print_text_out(): len: int --> size_t * out_pos: int --> size_t
* 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`)
* Remove 'edcompatible' #1911Michael Reed2015-02-16
| | | | Closes #1902
* Remove nonnullret deadcode: vim_strsave.Eliseo Martínez2015-01-27
|
* "halfway a line" is a very confusing phraseJack Danger Canty2015-01-22
| | | | | | | | | If you Google for this phrase found in the Vim documentation you'll find almost exclusively hits from the Vim documentation. I think changing "halfway a line" to "halfway through a line" makes more sense. There seems to be an pervasive odd use of the word 'halfway' in the original docs which I'm updating everywhere.
* Macro cleanup: HAS_SWAP_EXISTS_ACTIONMichael Reed2015-01-14
| | | | | | | Neovim always ships with all features[0], so this serves no purpose. Besides, this always evaluated to true. [0]: https://github.com/neovim/neovim/wiki/Differences-from-vim
* 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.
* 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.
* vim-patch:7.4.452Florian Walch2014-12-23
| | | | | | | Problem: Can't build with tiny features. (Tony Mechelynck) Solution: Use "return" instead of "break". https://code.google.com/p/vim/source/detail?r=v7-4-452
* vim-patch:7.4.449Florian Walch2014-12-23
| | | | | | | Problem: Can't easily close the help window. (Chris Gaal) Solution: Add ":helpclose". (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-449
* 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.
* 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
* vim-patch:7.4.543.Eliseo Martínez2014-12-15
| | | | | | | | | | | Adapt #1533 and #1596 to conform to upstream patch (https://groups.google.com/forum/#!topic/vim_dev/vp0Lwo9f56s). Problem: Since patch 7.4.232 "1,3s/\n//" joins two lines instead of three. (Eliseo Martínez) Issue 287 Solution: Correct the line count. (Christian Brabandt) Also set the last used search pattern.
* Simple refatorings that didn't fit the pattern of the last commitFelipe Oliveira Carvalho2014-12-13
|
* 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; } ... ... ... } ```
* vim-patch:? Fix memory leak in readviminfoJoel Teichroeb2014-12-13
| | | | | Patch provided by Christian Brabandt Improved by oni-link
* GA_DEEP_FREE_PTR: deep free macro for garrays that store simple pointersFelipe Oliveira Carvalho2014-12-11
| | | | | | | By "simple pointer" I mean a pointer that can be freed with a call to `free` without leaking any member pointer. This macro does exactly what `ga_clear_strings` does.
* shell: Remove kShellOptCooked from ShellOptsThiago de Arruda2014-12-03
|
* Fix newline substitution: Adapt to upstream patch.Eliseo Martínez2014-12-02
| | | | | Fix previous changes to be compatible with agreed changes to upstream vim (https://code.google.com/p/vim/issues/detail?id=287).
* term: Move more mouse functions to mouse.cThiago de Arruda2014-12-02
|
* Fix newline substitution.Eliseo Martínez2014-11-28
| | | | | | | | | | | | | | | | | | Problem : Command `s/\n//` is being translated into a call to do_join with a count of 1. But do_join asserts its precondition count >= 2, which is causing the program to abort. Note : This in fact revealed bigger problems: generated join command line count, as well as reported substitutions/lines were wrong in several cases, since patch 7.4.232. See: [patch] http://markmail.org/message/vo7ruair5raccawp [issue] https://code.google.com/p/vim/issues/detail?id=287 Solution : - Don't generate join command for single-line-range case. - Make generated join command include: * lines in range + 1, when range doesn't end at last line. * lines in range, when range ends at last line. - Make reported substitutions/lines always be number-of-lines-joined - 1.
* ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | Also move read_error_exit to os/input.c
* 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.
* Convert some values from buffer_defs.h to boolsWayne Rowcliffe2014-11-12
|
* Fix warnings: ex_cmds.c: do_ecmd(): Np dereference: FP.Eliseo Martínez2014-11-11
| | | | | | | Problem : Dereference of null pointer @ 2768. Diagnostic : False positive. Rationale : `win_valid(oldwin)` implies `oldwin` not null. Resolution : Assert `oldwin` not null.
* Fix warnings: ex_cmds.c: do_ascii(): Garbage value (2): MI.Eliseo Martínez2014-11-11
| | | | | | | | | Problems : Assigned value is garbage or undefined @ 127. Assigned value is garbage or undefined @ 152. Diagnostic : Multithreading issues. Rationale : Error could only occurr if global `enc_utf8` changed while the function is executing. Resolution : Use local copy of global var.
* fix 'sign unplace id'Kartik K. Agaram2014-10-28
| | | | | | | | | | | | Since the introduction of the FOR_ALL_BUFFERS macro, 'sign unplace id' without a buffer was only removing the sign from the first buffer rather than all buffers, as described in the documentation. :help sign-unplace -- modeline discussion: https://github.com/akkartik/neovim/commit/7863c247db#commitcomment-8342590
* vim-patch:7.4.418Scott Prager2014-10-16
| | | | | | | | Problem: When leaving ":append" the cursor shape is like in Insert mode. (Jacob Niehus) Solution: Do not have State set to INSERT when calling getline(). https://code.google.com/p/vim/source/detail?r=v7-4-418
* version: remove non-functional Vim version identifiersJustin M. Keyes2014-10-07
|
* Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab)Wayne Rowcliffe2014-09-24
|