aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
Commit message (Collapse)AuthorAge
...
* Replace vim_isxdigit() with to ascii_isxdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Replace vim_iswhite with ascii_iswhite() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Fix warnings: ops.c: op_yank_reg(): Dead assignment: HI.Eliseo Martínez2015-04-23
| | | | | | | Problem : Dead assignment @ 2480. Diagnostic : Harmless issue. Rationale : It's true `reg` is not used any more after that point. Resolution : Delete line.
* clipboard: cleanup `valid_yank_reg` and use it for `:redir`Björn Linse2015-04-17
| | | | | | | This fixes missing clipboard support for `:redir` Helped-By: Michael Reed <m.reed@mykolab.com> Helped-By: Scott Prager <splinterofchaos@gmail.com>
* clipboard: simplify handling of of put in visual mode.Björn Linse2015-04-17
| | | | | When clipboard=unnamed and put over visual selection, reduces number of provider calls from 6 to 2. Also add test.
* ops.c: eliminate unneccesary static variable `y_append`Björn Linse2015-04-17
|
* ops.c: eliminate static variable `y_current`Björn Linse2015-04-17
| | | | | | | This variable isn't stateful, and should be passed around instead. Helped-By: Scott Prager <splinterofchaos@gmail.com> Helped-By: Michael Reed <m.reed@mykolab.com>
* 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.
* ops.c: cleanup of `get_yank_register`Björn Linse2015-04-11
|
* clipboard: fix "" register not updated when clipboard=unnamedBjörn Linse2015-04-11
| | | | Helped-By: Scott Prager <splinterofchaos@gmail.com>
* clipboard: adjust v:register when clipboard=unnamedBjörn Linse2015-04-11
| | | | | Helped-By: Nicolas Hillegeer <nicolas@hillegeer.com> Helped-By: Michael Reed <m.reed@mykolab.com>
* 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>
* 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: show "* and "+ in :registersBjörn Linse2015-04-05
| | | | | Helped-by: Robin Allen <r@foon.uk> Helped-by: Scott Prager <splinterofchaos@gmail.com>
* 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.