aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
Commit message (Collapse)AuthorAge
...
* Remove char_u: ex_docmd:do_cmdline_cmd()Michael Reed2015-05-13
|
* vim-patch:7.4.653 #2527Florian Walch2015-04-30
| | | | | | | | | Problem: Insert mode completion with complete() may have CTRL-L work like CTRL-P. Solution: Handle completion with complete() differently. (Yasuhiro Matsumoto, Christian Brabandt, Hirohito Higashi) https://github.com/vim/vim/commit/v7-4-653
* Enable -Wconversion: normal.c.Eliseo Martínez2015-04-27
| | | | | | | | | | | | | | | | | | | | | | | | Refactor summary: - extern int opcount --> extern long opcount - bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...) * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...) - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...) - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen) * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...) - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen) - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...) - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp) * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...) - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len) - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...) * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...) - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...) * int spell_move_to(...) --> size_t spell_move_to(...) - int spell_check(...) --> size_t spell_check(...) - static int spell_bad_len --> static size_t spell_bad_len - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...) Helped-by: Justin M. Keyes <justinkz@gmail.com>
* Replace vim_isspace() with ascii_isspace() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* 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
|
* 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.
* 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.
* Merge pull request #2346 from splinterofchaos/fix-terminalScott Prager2015-04-08
|\ | | | | [RFC] terminal: Handle loss of focus in event loop.
| * 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
* | 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>
* 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.
* 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).
* Remove redundant castsAnton Ovchinnikov2015-03-09
|
* 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: mark.c.Eliseo Martínez2015-02-18
| | | | | | Refactoring summary: - MB_STRNICMP: Inlined. - MB_STRNCMP: Inlined.
* Remove nonnullret deadcode: xcalloc.Eliseo Martínez2015-01-27
|
* Remove nonnullret deadcode: vim_strsave.Eliseo Martínez2015-01-27
|
* Remove nonnullret deadcode: str_foldcase & vim_strnsave.Eliseo Martínez2015-01-27
|
* Remove nonnullret deadcode: addstar.Eliseo Martínez2015-01-27
|
* vim-patch:7.4.514Florian Walch2015-01-26
| | | | | | | Problem: Memory access error. (Dominique Pelle) Solution: Update tpos. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-514
* "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.
* vim-patch:7.4.492Pavel Platto2015-01-19
| | | | | | | | | Problem: In Insert mode, after inserting a newline that inserts a comment leader, CTRL-O moves to the right. (ZyX) Issue 57. Solution: Correct the condition for moving the cursor back to the NUL. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-492
* 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
|
* ui: Test for abstract_ui whenever a minimal t_colors value is requiredThiago de Arruda2015-01-10
| | | | | t_colors should not be checked when abstract_ui is active, because nvim UI is not limited to a terminal.
* 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; } ... ... ... } ```
* Fix warnings: edit.c: ins_compl_next_buf(): Np dereference: MI.Eliseo Martínez2014-12-06
| | | | | | | | Problem : Dereference of null pointer @ 3247. Diagnostic : Multithreading issue. Rationale : Problem only occurs if global `ctrl_x_mode` is modified while calling function is executing. Solution : Use local copy instead of global.
* Merge pull request #1516 from fmoralesc/new-patchesJustin M. Keyes2014-11-27
|\ | | | | vim-patch:7.4.425,435,467,472,473,478
| * vim-patch:7.4.435: Disable linebreak temporarily when formatting lines.Felipe Morales2014-11-27
| | | | | | | | | | | | | | | | | | | | vim-patch:7.4.435 Problem: Line formatting behaves differently when 'linebreak' is set. (mvxxc) Solution: Disable 'linebreak' temporarily. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-435
* | Remove code defined under USE_IM_CONTROL #ifdefsThiago de Arruda2014-11-27
| | | | | | | | This is not being used and should not be part of the core anyway.
* | ui: Extract mouse.c/mouse.hThiago de Arruda2014-11-27
| |
* | 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.
* | event: No longer process K_EVENT automaticallyThiago de Arruda2014-11-21
|/ | | | | | | Two new functions, `event_enable_deferred()`/`event_disable_deferred()` have to be called by code that is capable of handling asynchronicity. User-dialog states like "press ENTER to continue" or the swap file confirmation no longer will generate K_EVENT.
* Convert some values from buffer_defs.h to boolsWayne Rowcliffe2014-11-12
|
* Fix warnings: edit.c: ins_bs(): Garbage result: MI.Eliseo Martínez2014-11-06
| | | | | | | | Problem : Result of operation is garbage or undefined @ 7460. Diagnostic : Multithreading issue. Rationale : Problem occurs if any of globals `enc_utf8`, `p_deco is modified while function is executing. Resolution : Use local copy of globals.
* Fix warnings: edit.c: replace_do_bs(): Garbage value: MI.Eliseo Martínez2014-11-06
| | | | | | | | Problem : Assigned value is garbage or undefined @ 6359. Diagnostic : Multithreading issue. Rationale : Problem only occurs if global `State` changes while function is executing. Resolution : Use local copy of global in function.
* Fix warnings: edit.c: mb_replace_pop_ins(): Unitilialized arg: FP.Eliseo Martínez2014-11-06
| | | | | | | | | Problem : Uninitialized argument value @ 6296. Diagnostic : False positive. Rationale : Error occurs if n <= 1. That's not possible because n >= 1 due to `MB_BYTE2LEN` postcondition and n != 1 because we are in the else branch. Resolution : Assert n > 1.
* Fix warnings: edit.c: ins_compl_get_exp(): Np dereference (2): FP.Eliseo Martínez2014-11-06
| | | | | | | | | | | | | | Problems : Dereference of null pointer @ 3615. Dereference of null pointer @ 3764. Diagnostic : False positives. Rationale : `ins_buf` is local static, so maintains value between calls. This function will be called first when `compl_started` is false, and in that case it initializes `ins_buf`. After that, it can be called multiple times with `compl_started` true, where `ins_buf` will be updated but not to null. So, when arriving to both points, `ins_buf` should never be null. Resolution : Assert `ins_buf` at both points.
* Fix warnings: edit.c: ins_compl_next_buf(): Np dereference: FP.Eliseo Martínez2014-11-06
| | | | | | | | | Problem : Dereference of null pointer @ 3234. Diagnostic : False positive. Rationale : `wp` is local static, so maintains value between calls. First time function is called for a given flag will have `buf == curbuf`, implying `wp` initialization. Resolution : Assert variable always having been initialized.
* vim-patch:7.4.440 #1244Naveen Kumar Molleti2014-10-16
| | | | | | | | Problem: Omni complete popup drawn incorrectly. Solution: Call validate_cursor() instead of check_cursor(). (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=v7-4-440
* vim-patch:7.4.407André Twupack2014-09-19
| | | | | | | | Problem: Inserting text for Visual block mode, with cursor movement, repeats the wrong text. (Aleksandar Ivanov) Solution: Reset the update_Insstart_orig flag. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-407
* vim-patch: 7.4.381Shougo Matsushita2014-09-18
| | | | | | | | Problem: Get u_undo error when backspacing in Insert mode deletes more than one line break. (Ayberk Ozgur) Solution: Also decrement Insstart.lnum. https://code.google.com/p/vim/source/detail?r=v7-4-381
* vim-patch:7.4.387Naveen Kumar Molleti2014-09-15
| | | | | | | | Problem: "4gro" replaces one character then executes "ooo". (Urtica Dioica) Solution: Write the ESC in the second stuff buffer. https://code.google.com/p/vim/source/detail?r=v7-4-387
* vim-patch:7.4.376André Twupack2014-09-12
| | | | | | | | | Problem: Popup menu flickers too much. Solution: Remove the forced redraw. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=v7-4-376 Includes: vim-patch:7.4.357 vim-patch:7.4.367 vim-patch:7.4.376
* Port vim's patch 7.4.338 ('breakindent')Felipe Morales2014-08-20
|