aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
Commit message (Collapse)AuthorAge
* vim-patch:7.4.1897 (#5747)Shougo2016-12-10
| | | | | | Problem: Various typos, long lines and style mistakes. Solution: Fix the typos, wrap lines, improve style. https://github.com/vim/vim/commit/fd89d7ea81b18d32363456b16258174dc9e095dc
* 'inccommand': Detect "non-interactive", "too slow".Justin M. Keyes2016-11-15
| | | | | | | | | | | | | | | | | | | | | command_line_changed: - Check (current_SID == 0) instead of KeyTyped - We want to update during mappings (KeyTyped is false then). - Check vpeekc_any() - Avoids unnecessary work. - Avoids triggering live preview during macros. - Caveat: This makes the redraw "stutter" if user spams (holds a key) in the replace pattern. But that scenario is not important. - Update screen if the command is changed to a non-live command. (`s->live` goes from true => false) => clears the preview command_line_execute: - Let CTRL-C cancel live preview do_sub: - Enforce a time limit ('redrawtime'). - Unset 'inccommand' if time limit is reached. Closes #5602 Closes #5585
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* vim-patch:7.4.1151Michael Ennen2016-06-07
| | | | | | | Problem: Missing change to eval.c Solution: Also change feedkeys(). https://github.com/vim/vim/commit/5f8a14b9dea094b8bbab94cfc1e8da8e633fbc01
* vim-patch:7.4.1150Michael Ennen2016-06-04
| | | | | | | | | Problem: 'langmap' applies to the first character typed in Select mode. (David Watson) Solution: Check for SELECTMODE. (Christian Brabandt, closes #572) Add the 'x' flag to feedkeys(). https://github.com/vim/vim/commit/25281634cda03ce302aaf9f906a9520b5f81f91e
* getchar.c wconversion: Change typessach1t2016-05-07
|
* Enable -Wconversion for getchar.csach1t2016-05-07
|
* *: Fix new linter errorsZyX2016-05-01
| | | | Originally there were 128 new errors, so I thought this is a good idea to fix all of them. Of course, this commit also fixes many suppressed errors.
* Merge pull request #4649 from justinmk/vimpatchesJustin M. Keyes2016-04-27
|\ | | | | vim-patch:7.4.1092
| * remove disable_char_avail_for_testing()Justin M. Keyes2016-04-26
| | | | | | | | | | | | | | | | test_cursor_func.vim hangs at the call to disable_char_avail_for_testing(). The test does not actually need this function (and it correctly fails if the fix from 7.4.1300 is reverted). Given that disable_char_avail_for_testing is a gigantic hack, if we can avoid it let's do so.
| * Satisfy the linter.KillTheMule2016-04-25
| |
| * vim-patch:7.4.1300KillTheMule2016-04-25
| | | | | | | | | | | | | | | | | | Problem: Cannot test CursorMovedI because there is typeahead. Solution: Add disable_char_avail_for_testing(). https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63 Most of it manually applied.
* | keymap: Make replace_termcodes and friends accept length and cpo_flagsZyX2016-04-18
|/ | | | | | | Reasons: - One does not have to do `s[len] = NUL` to work with these functions if they do not need to replace the whole string: thus `s` may be const. - One does not have to save/restore p_cpo to work with them.
* bufhl: new mechanism for plugins to add highlights to a bufferBjörn Linse2016-02-23
|
* vim-patch:7.4.870Jurica Bradaric2016-02-20
| | | | | | | | Problem: May get into an invalid state when using getchar() in an expression mapping. Solution: Anticipate mod_mask to change. (idea by Yukihiro Nakadaira) https://github.com/vim/vim/commit/2455c4ede8d4ff6f0754977b548708eec08869eb
* terminal: less babysitting of mapped_ctrl_cJustin M. Keyes2016-01-13
| | | | | process_interrupts() checks get_real_state() so we can avoid some housekeeping of mapped_ctrl_c in terminal-mode.
* vim-patch:7.4.569/573Shougo Matsushita2016-01-13
| | | | | | | | | | | | | | | | | vim-patch:7.4.569 vim-patch:7.4.573 Helped-by: @glts https://github.com/neovim/neovim/pull/2621 Problem: Having CTRL-C interrupt or not does not check the mode of the mapping. (Ingo Karkat) Solution: Use a bitmask with the map mode. (Christian Brabandt) https://github.com/vim/vim/commit/651863c94a882a97aec7968fc87a638ff78e56ff Problem: Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat) Solution: Call get_real_state() instead of using State directly. https://github.com/vim/vim/commit/5000869712f799d9ca25c0e45dc21d332edae5f4
* 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.
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* main: Refactor normal_enter to call `os_inchar` directlyThiago de Arruda2015-10-26
| | | | | | | | | This makes it impossible for K_EVENT to interfere with mappings, but it also disables processing of events while in the middle of a mapping (Though this will be fixed later as this refactoring progresses). `may_sync_undo` is now called when K_EVENT is received. This is necessary to correctly update undo entry lists before executing some action.
* tui: Don't use 'pastetoggle' for automatic pastingThiago de Arruda2015-10-01
| | | | | | | Add a new special key that can be used by UIs to toggle the 'paste' option and use it in the TUI instead of the user's 'pastetoggle' value. Close #2843 #2092
* fix strict-overflow cases #3236Nikolay Orlyuk2015-08-25
|
* vim-patch:7.4.773 #3066Marco Hinz2015-08-09
| | | | | | | | Problem: 'langmap' is used in command-line mode when checking for mappings. Solution: Do not use 'langmap' in command-line mode. (Larry Velazquez) Original patch: https://code.google.com/p/vim/source/detail?r=5b1eefbf9a532f32a66fa13abbd671488aaafd5c
* 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.
* Enable -Wconversion: menu.c #2885Ismail Badawi2015-06-25
|
* Replace vim_isspace() with ascii_isspace() 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
|
* 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.
* 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.
* 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
* ui: Refactor so that busy state won't be the defaultThiago de Arruda2015-03-18
| | | | | | | | | | | Even though assuming nvim is busy most times is simpler, it has a problem: A lot of unnecessary busy_start/busy_stop notifications are sent to the UI. That's because in the majority of scenarios almost no time is spent between `event_poll` calls. This restores the normal behavior which is to call busy_start only when nvim is going to perform some task that can take a significant amount of time. Also improve the usage of buffering in the TUI when changing the cursor state.
* 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).
* 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
* 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`)
* input: Remove input_buffer_{save,restore}Thiago de Arruda2015-02-16
| | | | | | | The input buffer is only used for data that really came from another process and is only visible to os/input.c. Remove the input_buffer_{save,restore} functions, they are not necessary(Also can result in problems if data comes while the typeahead is saved).
* 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.
* vim-patch:7.4.552Florian Walch2014-12-26
| | | | | | | Problem: Langmap applies to Insert mode expression mappings. Solution: Check for Insert mode. (Daniel Hahler) https://code.google.com/p/vim/source/detail?r=v7-4-552
* coverity/90712: Remove unnecessary check for NULL.oni-link2014-12-26
| | | | | | | | ** CID 90712: Dereference after null check (FORWARD_NULL) /src/nvim/getchar.c: 3654 in check_abbr() vim_strsave() never returns NULL, so q is never NULL. Removing the NULL check for q should fix this warning.
* vim-patch:7.4.485Florian Walch2014-12-23
| | | | | | | | Problem: Abbreviations don't work. (Toothpik) Solution: Move the length computation inside the for loop. Compare against the unescaped key. https://code.google.com/p/vim/source/detail?r=v7-4-485
* vim-patch:7.4.483Florian Walch2014-12-23
| | | | | | | Problem: A 0x80 byte is not handled correctly in abbreviations. Solution: Unescape special characters. Add a test. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-483
* vim-patch:7.4.468Florian Walch2014-12-23
| | | | | | | | Problem: Issue 26: CTRL-C does not interrupt after it was mapped and then unmapped. Solution: Reset mapped_ctrl_c. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-468
* 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; } ... ... ... } ```
* ui: Add abstract_ui termcap and split UI layerThiago de Arruda2014-12-08
| | | | | | | | | | | | | | | | | | This is how Nvim behaves when the "abstract_ui" termcap is activated: - No data is written/read to stdout/stdin by default. - Instead of sending data to stdout, ui_write will parse the termcap codes and invoke dispatch functions in the ui.c module. - The dispatch functions will forward the calls to all attached UI instances(each UI instance is an implementation of the UI layer and is registered with ui_attach). - Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by input_enqueue and the translated strings are pushed to the input buffer. With this new input model, its not possible to send mouse events yet. Thats because mouse sequence parsing happens in term.c/check_termcodes which must return early when "abstract_ui" is activated.
* 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: 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.
* ui: Remove ui_inchar/ui_char_availThiago de Arruda2014-11-27
| | | | | | | | | Also: - Remove NO_CONSOLE_INPUT/NO_CONSULE preprocessor conditionals - Remove ctrl_c_interrupts variable, check for mapped_ctrl_c directly in process_interrupts() - Move ui_inchar profiling to input_poll which is where Nvim blocks for input.
* 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.
* ui: Refactor input buffer handlingThiago de Arruda2014-10-18
| | | | | All input buffer code was moved to os/input.c, and `inbuf` is now a `RBuffer` instance(which abstracts static buffer manipulation).