aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
Commit message (Collapse)AuthorAge
...
* 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
|
* Remove redundant castsAnton Ovchinnikov2015-03-09
|
* Macro cleanup: ONE_CLIPBOARDMichael 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
* clipboard: don't clobber "0 when deleting to unnamedBjörn Linse2015-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.
* Remove long_u: ops.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.
* 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.559Florian Walch2015-01-03
| | | | | | | | Problem: Appending a block in the middle of a tab does not work correctly when virtualedit is set. Solution: Decrement spaces and count, don't reset them. (James McCoy) https://code.google.com/p/vim/source/detail?r=v7-4-559
* vim-patch:7.4.521Florian Walch2014-12-24
| | | | | | | | Problem: When using "vep" a mark is moved to the next line. (Maxi Padulo, Issue 283) Solution: Decrement the line number. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-521
* coverity/13696: Unchecked return value: RI.Eliseo Martínez2014-12-16
| | | | | | | | | | Problem : Unchecked return value (CHECKED_RETURN) @ 2644. Diagnostic : Real issue. Rationale : Other `u_save` invocations are checked, and there's no reason to think this invocation could not fail. Resolution : Check and return if failed (other previous checks in the same function just return, without reporting error, so we just do the same).
* Fix warning: ops.c: read_viminfo_register(): Dereference of null pointer: RI.oni-link2014-12-15
| | | | | | | | | | | Problem : Array access (via field 'y_array') results in a null pointer dereference @ 4487. Diagnostic : Real issue. Rationale : If the array was previously freed and the size of the array (y_current->y_size) was not updated to zero, the loop @4486 could be entered and a NULL pointer would be dereferenced. Resolution : Use free_yank_all() to take care of the NULL check and to free the current yank register.
* vim-patch:? Fix memory leak in readviminfoJoel Teichroeb2014-12-13
| | | | | Patch provided by Christian Brabandt Improved by oni-link
* Merge pull request #1635 from danthedeckie/masterJustin M. Keyes2014-12-12
|\ | | | | replace copy_spaces and copy_chars functions with equivalent memset.
| * strings.c: replace copy_spaces, copy_chars with equivalent memset.Daniel Fairhead2014-12-12
| |
* | Refactor str_to_reg().Scott Prager2014-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | - Update the doxygen comments. - Use more descriptive types. - Localize variables. - Find the '\n' with memchr instead of a for loop. - Remove `if (size)` checks before memmove since memmove(dst,src,0) is a noop. - Use memcpy instead since the pointers don't alias. - Use xmemdupz instead of vim_strnsave. - xrealloc instead of xmalloc/memcpy. - Use memcnt/xmemscan/memchrsub.
* | vim-patch:7.4.243Scott Prager2014-12-11
| | | | | | | | | | | | | | Problem: Cannot use setreg() to add text that includes a NUL. Solution: Make setreg() accept a list. https://code.google.com/p/vim/source/detail?r=v7-4-243
* | Return void * from get_reg_contents.Scott Prager2014-12-11
| |
* | vim-patch:7.4.242Scott Prager2014-12-11
|/ | | | | | | | Problem: getreg() does not distinguish between a NL used for a line break and a NL used for a NUL character. Solution: Add another argument to return a list. (ZyX) https://code.google.com/p/vim/source/detail?r=v7-4-242
* clipboard: fix `let @+ = ...` and add testBjörn Linse2014-12-08
|
* clipboard: better error messages when provider not availableBjörn Linse2014-12-08
|
* options: change "unnamedclip" back to "clipboard=unnamed/unnamedplus"Björn Linse2014-12-08
| | | | | This allows to configure which of '*' and '+' should be used for the unnamed clipboard, and is consistent with vim.
* clipboard: clean up unnamedclip logicBjörn Linse2014-12-08
|
* clipboard: handle linewise/charwise selections correctlyBjörn Linse2014-12-08
|
* clipboard: support separate '+' and '*' clipboardsBjörn Linse2014-12-08
|
* 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.
* Remove os/provider.{c,h} and all of its referencesThiago de Arruda2014-11-18
|
* eval/ex_cmds2/ops: Implement providers with eval_call_providerThiago de Arruda2014-11-18
| | | | | Replace references to provider_call/provider_has with the new functions eval_call_provider/eval_has_provider.
* Use bool for flags in oparg_T.Scott Prager2014-11-11
| | | | | | | | | | | | | | | | | | | | | | | Several opart_T members like use_reg_one, end_adjusted, empty, is_VIsual, and block_mode, only ever store TRUE or FALSE, so make this constraint explicit by changing them to bools, and TRUE to true and FALSE to false in the context of their uses. The member, inclusive, has several other uses such as in arithmetic equations and one inequality, but every single assignment (obtained with 'grep -r "inclusive \\="') sets it to either TRUE or FALSE. This also implies that the inequality, "oap->end.coladd < oap->inclusive", can only be true when coladd==0 and inclusive==true, so test for that instead. For consistency, change the first argument of findpar (which ends up being inclusive) to bool. Include stdbool.h for consistency with issue #918. This commit shrinks the size of oparg_T from 128 bytes to 112 (-13%) on my machine.
* Fix warnings: ops.c: cursor_pos_info(): Various (2): MI.Eliseo Martínez2014-11-06
| | | | | | | | | | | | | | | | | Problems: Result of operation is garbage or undefined @ 5087. http://neovim.org/doc/reports/clang/report-2e3118.html#EndPath Result of operation is garbage or undefined @ 5149. Diagnostic: Multithreading issues. Rationale : All reported problems can only occur if accesed globals change state while executing function, which could only happen in a multithreaded environment. Resolution: Use local variables (copy globals on entry). Note that this change alters function semantics, as now function only depends on global values at entry time. This shouldn't be a problem, though, as new semantics should be in fact better.
* Fix warnings: ops.c: do_join(): Nonnull violation: FP.Eliseo Martínez2014-11-06
| | | | | | | | | Problem: Argument with 'nonnull' attribute passed null @ 3540. http://neovim.org/doc/reports/clang/report-fc14e0.html#EndPath. Diagnostic: False potitive. Rationale : `count` should be >= 2 by function precondition. Resolution: Assert precondition.
* vim-patch:7.4.408Scott Prager2014-10-10
| | | | | | | Problem: Visual block insert breaks a multi-byte character. Solution: Calculate the position properly. (Yasuhiro Matsumoto) https://code.google.com/p/vim/source/detail?r=v7-4-408
* Merge pull request #1208 from war1025/dev/remove_for_all_windowsJustin M. Keyes2014-10-03
|\ | | | | Remove FOR_ALL_WINDOWS and replace with FOR_ALL_WINDOWS_IN_TAB(curtab)
| * Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab)Wayne Rowcliffe2014-09-24
| |
* | memory: xstrchrnul and xmemscan.Scott Prager2014-09-30
|/
* api/msgpack-rpc: Refactor msgpack_rpc_helpers.{c,h}Thiago de Arruda2014-09-12
| | | | | | - Move helpers that are specific to API types to api/private/helpers.{c,h} - Include headers with generated declarations - Delete unused macros
* Convert FOR_ALL_WINDOWS to use a locally declared pointerWayne Rowcliffe2014-09-08
|
* msgpack-rpc: Always use arrays when sending events or callsThiago de Arruda2014-08-29
| | | | | | This is required by the msgpack-RPC specification. Also, the send_call/send_event functions were refactored to accept a variable number of arguments
* Port vim's patch 7.4.338 ('breakindent')Felipe Morales2014-08-20
|
* vim-patch:7.4.331 #1017André Twupack2014-08-13
| | | | | | | Problem: Relative numbering not updated after a linewise yank. Issue 235. Solution: Redraw after the yank. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=6d984caa0409fd284722c44cb09a0a2b5360bd4f
* Remove EBCDIC: Clean up commentsPavel Platto2014-08-02
|
* provider: Add support for clipboard registers.Thiago de Arruda2014-07-17
| | | | | | | | | | | | | This reimplements the '+'/'*' clipboard registers(both are aliases to the same register, no dedicated storage for the X11 selection) on top of the provider infrastructure. This adds two new 'unnamedclip' option, has the same effect of setting 'clipboard' to 'unnamed/unnamedplus' in vim The 'clipboard' option was not reused because all values(except 'unnamedplus') seem to be useless for Neovim, and the code to parse the option was relatively big. The option remains for vim compatibility but it's silently ignored.
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* remove stdbool.h include from vim.h and globals.hBrandon Coleman2014-07-09
|
* No OOM in vim_strsave_escape_csi()Felipe Oliveira Carvalho2014-06-16
|