aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
Commit message (Collapse)AuthorAge
...
* Macro cleanup: FEAT_GUI_MOTIFHettomei2015-07-17
|
* 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.
* clipboard: don't overwrite before pasting in visual mode. #2945Björn Linse2015-07-04
| | | | | This occured when clipboard=unnamedplus and doing "+p in visual mode. Fixes #2942.
* Remove char_u: ex_docmd:do_cmdline_cmd()Michael Reed2015-05-13
|
* vim-patch:7.4.606 #2594Yamakaky2015-05-09
| | | | | | | Problem: May crash when using a small window. Solution: Avoid dividing by zero. (Christian Brabandt) https://github.com/vim/vim/commit/v7-4-606
* vim-patch:7.4.576 #2595Ewan Hemingway2015-05-09
| | | | | | | | | | Problem: Redrawing problem with 'relativenumber' and 'linebreak'. Solution: Temporarily reset 'linebreak' and restore it in more places. (Christian Brabandt) https://github.com/vim/vim/commit/v7-4-576 Closes #1946
* 'cpoptions': Remove "H" flag #2556David Bürgin2015-05-04
|
* coverity/109843: Nesting indent mismatch: RI.Eliseo Martínez2015-04-28
| | | | Introduction of asserts broke bracketless if's.
* Fix visual selection after left click on tablineMarco Hinz2015-04-28
| | | | | | After left clicking on a tab in the tabline, the "in_tab_line" variable wasn't set to 'false' and every following mouse action assumed still being on the tabline which messed up visual selection etc.
* 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>
* 'cpoptions': Remove "w" flag #2507David Bürgin2015-04-27
|
* 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: 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 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.
* 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>
* messages: Update common instances of Vim to Nvim #2031Michael Reed2015-04-08
|
* vim-patch:7.4.636 #2267David Bürgin2015-04-05
| | | | | | | | Problem: A search with end offset gets stuck at end of file. (Gary Johnson) Solution: When a search doesn't move the cursor repeat it with a higher count. (Christian Brabandt) https://github.com/vim/vim/releases/tag/v7-4-636
* buffer: Move b_p_ma(modifiable) checks into the MODIFIABLE macroThiago de Arruda2015-03-25
|
* 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
|
* 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`)
* coverity/13750: Negative array index read: FP.Eliseo Martínez2015-02-02
| | | | | | | | | | Problem : Negative array index read @ 909. Diagnostic : False positive. Rationale : Suggested error path assigns a negative value to idx at line 836 (`idx = find_command(ca.cmdchar);`). That's impossible, as `ca.cmdchar` is set to Ctrl_BSL just two lines above, so we know that value will be in the table. Resolution : Assert idx >= 0.
* "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.
* Merge pull request #1729 from fwalch/vim-7.4.490Justin M. Keyes2015-01-19
|\ | | | | vim-patch:7.4.490
| * vim-patch:7.4.490Florian Walch2015-01-04
| | | | | | | | | | | | | | | | Problem: Cannot specify the buffer to use for "do" and "dp", making them useless for three-way diff. Solution: Use the count as the buffer number. (James McCoy) https://code.google.com/p/vim/source/detail?r=v7-4-490
* | coverity/13763: Out-of-bounds read: FP.Eliseo Martínez2015-01-08
|/ | | | | | | | Problem : Out-of-bound read from a buffer. Diagnostic : False positive. Rationale : nv_max_linear should always be less than nv_cmd_idx size (NV_CMDS_SIZE). Resolution : Assert rationale.
* Use ARRAY_SIZE where Coccinelle wasn't able to do itFelipe Oliveira Carvalho2014-12-18
|
* 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; } ... ... ... } ```
* input: Recognize mouse events for abstract_uiThiago de Arruda2014-12-10
|
* docs: Remove Photon remnantsMichael Reed2014-12-09
| | | | | Also get rid of some platform references made irrelevant by the removal of their respective platform specific GUI code.
* clipboard: clean up unnamedclip logicBjörn Linse2014-12-08
|
* term: Move more mouse functions to mouse.cThiago de Arruda2014-12-02
|
* 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.467: Avoid a problem with unwanted linebreaks in block modeFelipe Morales2014-11-27
| | | | | | | | | | | | | | | | vim-patch:7.4.467 Avoid a problem with unwanted linebreaks in block mode https://code.google.com/p/vim/source/detail?r=v7-4-467
| * vim-patch:7.4.425: Adjust virtcol when showbreak is setFelipe Morales2014-11-27
| | | | | | | | | | | | | | | | | | | | vim-patch:7.4.425 Problem: When 'showbreak' is used "gj" may move to the wrong position. (Nazri Ramliy) Solution: Adjust virtcol when 'showbreak' is set. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-425
* | 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
|
* normal.c: Replace last TRUE/FALSE/OK/FAIL's w/bool.Scott Prager2014-11-11
|
* Use bool in signatures of functions in normal.h.Scott Prager2014-11-11
| | | | | | | | | | Return bool from checkclearop, checkclearopq, add_to_showcmd, find_decl, nv_screengo, get_visual_text, and unadjust_for_sel as these functions all return either TRUE or FALSE or OK or FAIL, but not MAYBE. Change to arguments toplevel of normal_cmd, check of do_check_scrollbind, and locally and thisblock of finddecl, to bools as they represent predicates.
* Use bool or int for local flag variables.Scott Prager2014-11-11
| | | | | | | | | In do_pending_operator(), nv_zet(), nv_indent(), nv_g_cmd(), and more, replace integer flags with bools when appropriate. However, do keep the TRUEs and FALSEs of nv_cmds[].cmd_arg. It may store values other than TRUE or FALSE, so it seems to make sense to use integral constants.
* Use bool in do_mouse().Scott Prager2014-11-11
| | | | | Change the signature of get_mouse_button() for consistency, and because only do_mouse() uses it.
* Use bool in normal_cmd().Scott Prager2014-11-11
| | | | Change signature of set_vcount_ca for consistency.
* 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.