aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
Commit message (Collapse)AuthorAge
...
| * edit.c: fix incorrect redo buffersolawing2016-01-29
| |
| * edit.c: fix flicker in popup menusolawing2016-01-29
| |
* | vim-patch:7.4.688 #4159watiko2016-02-05
|/ | | | | | | | | | | Problem: When "$" is in 'cpo' the popup menu isn't undrawn correctly. (Issue 166) Solution: When using the popup menu remove the "$". https://github.com/vim/vim/commit/478c46e50fd94f270369ec1c5f76aa65af7ee671 NOTE: To reproduce in nvim: nvim -u NONE -c 'exe "norm iaaa iabbbbbb acc" | norm yyp' -c 'set cpo+=$'
* vim-patch:7.4.680Justin Gassner2016-01-22
| | | | | | | | Problem: CTRL-W in Insert mode does not work well for multi-byte characters. Solution: Use mb_get_class(). (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/310f2d59b2b20c642088feb5e6dfe323cc570923
* fileio: Replace some event checking functions with one has_eventCharles Joachim2016-01-11
|
* Fix linting errors.Johan Klokkhammer Helsing2015-12-13
|
* vim-patch:7.4.803Johan Klokkhammer Helsing2015-12-13
| | | | | | | Problem: C indent does not support C11 raw strings. (Mark Lodato) Solution: Do not change indent inside the raw string. https://github.com/vim/vim/commit/f7bb86dc593913d055e4cce16cec43f6271adda3
* Merge pull request #3838 from Shougo/vim-7.4.658Justin M. Keyes2015-12-13
|\ | | | | vim-patch:7.4.658
| * vim-patch:7.4.658Shougo Matsushita2015-12-13
| | | | | | | | | | | | | | | | Problem: 'formatexpr' is evaluated too often. Solution: Only invoke it when beyond the 'textwidth' column, as it is documented. (James McCoy) https://github.com/vim/vim/commit/0f8dd840fc6a614450db60ebe405d6201a2ecc3e
* | vim-patch:7.4.640Shougo Matsushita2015-12-13
|/ | | | | | | | Problem: After deleting characters in Insert mode such that lines are joined undo does not work properly. (issue 324) Solution: Use Insstart instead of Insstart_orig. (Christian Brabandt) https://github.com/vim/vim/commit/c3bbad085c3ec304b111dc95aed97fea4c38a177
* src/*: Remove `VIM - Vi improved ...` headerMichael Reed2015-11-27
| | | | | | | | | | | | | | | | | | | Regarding the individual items in the header: `Vim - Vi improved by Bram Moolenar` Bram Moolenar is already mentioned throughout the documentation, as well as the intro screen. `:help uganda` It's already shown to all users who don't use `shortmess+=I` upon starting nvim, and is already placed prominently in help.txt, i.e., `:help` run with no arguments. `:help credits` Already mentioned near the top of help.txt. `README.md` Already mentioned in develop.txt.
* Remove unnecessary includes for errno.hRui Abreu Ferreira2015-11-25
|
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* Implement handling of terminal focus eventsJoe Hermaszewski2015-11-17
| | | | | | | | | | | | | | | | | | | | Two new keys have been added to key_name_entry in keymap.c: `FocusGained` and `FocusLost`. Two cases have been added to the key handing switch in edit.c each applying their respective autocmds. In normal.c two functions have been added alongside nv_cursorhold doing a similar job of applying the autocmd for the appropriate key. tui/input.c has a new function `handle_focus_event` which eats either of the control sequences for focus gained or lost. This function is checked before handle_bracketed_paste and handle_forced_escape. tui.c registers neovim as able to receive these control sequences in terminfo_start and undoes that in terminfo_stop. Closes #2302
* edit.c: Fix one clint warningThiago de Arruda2015-10-26
|
* edit: Extract some functions from `insert_execute`Thiago de Arruda2015-10-26
| | | | | | | | | - `insert_handle_key`: Contains the big insert mode switch statement. - `insert_do_complete`: Code that used to be in the `docomplete` label. - `insert_do_cindent`: Code that used to be in the `force_cindent` label. Also move some code after the switch statement into the beginning of `insert_check`.
* edit: Move most code from `edit()` to `insert_{enter,check,execute}`Thiago de Arruda2015-10-26
| | | | | | | | | | | | | Refactor insert mode to use `state_enter` as an event loop: - Move o_lnum(static variable) outside function - Move code before the insert mode loop into `insert_enter` - Move code before `safe_vgetc()` call into `insert_check` - Move code after `safe_vgetc()` call into `insert_execute` - Remove doESCkey label and handle insert mode repeating in the `insert_enter` function - Remove do_intr label(this is not the place for platform-specific interrupt charts)
* edit: Extract local variables from edit() and fix code styleThiago de Arruda2015-10-26
| | | | | | | Begin refactoring edit() into a state that can be managed by the `state_enter()`: - Move local variables into a local InsertState structure - Fix code style in the entire function.
* input: Remove CURSORHOLD keyThiago de Arruda2015-10-26
| | | | | | | | | | | Refactor input.c, normal.c and edit.c to use the K_EVENT special key to trigger the CURSORHOLD event. In normal and edit mode, K_EVENT is treated as K_CURSORHOLD, which enables better handling of arbitrary actions in those states(eg: In normal mode the previous operator counts will be restored). Also fix a test in vim_spec.lua. The test had a wrong assumption: cmdheight is only used to determine when the press enter screen will be shown, not to limit how many lines or control pagination.
* vim-patch:7.4.849Justin M. Keyes2015-10-26
| | | | | | | | | | Problem: Moving the cursor in Insert mode starts new undo sequence. Solution: Add CTRL-G U to keep the undo sequence for the following cursor movement command. (Christian Brabandt) https://github.com/vim/vim/commit/8b5f65a527c353b9942e362e719687c3a7592309 Closes #3492
* vim-patch:7.4.793Johan Klokkhammer Helsing2015-10-18
| | | | | | | Problem: Can't specify when not to ring the bell. Solution: Add the 'belloff' option. (Christian Brabandt) https://github.com/vim/vim/commit/165bc69d1b7f70ca9d5b657f35d0584ecb7b5183
* viminfo: First version of ShaDa file dumpingZyX2015-10-08
| | | | | | | | | | | | | | | | | | | | What works: 1. ShaDa file dumping: header, registers, jump list, history, search patterns, substitute strings, variables. 2. ShaDa file reading: registers, global marks, variables. Most was not tested. TODO: 1. Merging. 2. Reading history, local marks, jump and buffer lists. 3. Documentation update. 4. Converting some data from &encoding. 5. Safer variant of dumping viminfo (dump to temporary file then rename). 6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for reference).
* terminal: Don't enter terminal mode from `:normal`Thiago de Arruda2015-09-18
| | | | Ref: https://github.com/junegunn/fzf.vim/issues/8#issuecomment-139209765
* event: Refactor async event processingThiago de Arruda2015-08-13
| | | | | | | | | | - Improve the implementation of deferred/immediate events. - Use the new queue module to change how/when events are queued/processed by giving a private queue to each emitter. - Immediate events(which only exist to break uv_run recursion) are now represented in the `loop->fast_events` queue. - Events pushed to child queues are propagated to the event loop main queue and processed as K_EVENT keys.
* loop: Simplify loop.c and move some code to input.cThiago de Arruda2015-08-13
| | | | | | - Declare poll timer in Loop structure instead of a loop_poll_events local variable. - Move deferred event management to input.c
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
* Add complete() noinsert/noselect support #2792Shougo Matsushita2015-06-11
|
* Add noinsert and noselect features in completeopt #2564Shougo Matsushita2015-06-04
| | | | | | | | | | | | Backported from vim_dev: https://groups.google.com/forum/#!searchin/vim_dev/completeopt/vim_dev/tVsk0pdOGvs/fCzBbPkA4w0J Use case: https://github.com/Shougo/neocomplcache.vim/issues/426 Reviewed-by: Felipe Morales <hel.sheep@gmail.com> Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com>
* 'cpoptions': Remove "j" flagDavid Bürgin2015-05-25
|
* completion: Add v:completed_item feature #2563Shougo Matsushita2015-05-24
| | | | | | | Reviewed-by: Michael Reed <m.reed@mykolab.com> Reviewed-by: Luke Andrew <luke.github@la.id.au> Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Florian Walch <florian@fwalch.com>
* 'cpoptions': Remove "-" flag #2655David Bürgin2015-05-21
|
* 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