aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
Commit message (Collapse)AuthorAge
* anchor float to buffer positionBjörn Linse2019-09-04
| | | | vim-patch:8.1.1645: cannot use a popup window for a balloon
* vim-patch:8.1.1086: too many curly bracesJan Edmund Lazo2019-07-28
| | | | | | | | | | Problem: Too many curly braces. Solution: Remove curly braces where they are not needed. (Hirohito Higashi, closes vim/vim#3982) https://github.com/vim/vim/commit/abab0b0fdd6535969447b03a4fffc1947918cf6c Neovim code style requires the opposite. Add curly braces to minimize lint errors when applying Vim patches.
* move: assert nonnull wp pointerJan Edmund Lazo2019-07-20
|
* vim-patch:8.1.0856: when scrolling a window the cursorline is not always updatedJan Edmund Lazo2019-07-20
| | | | | | | | | Problem: When scrolling a window other than the current one the cursorline highlighting is not always updated. (Jason Franklin) Solution: Call redraw_for_cursorline() after scrolling. Only set w_last_cursorline when drawing the cursor line. Reset the lines to be redrawn also when redrawing the whole window. https://github.com/vim/vim/commit/bbb5f8d4c2cbc5f48556008875f57cbe7fc4ac6c
* refactor: use int for Columns and RowsBjörn Linse2019-07-19
|
* vim-patch:8.1.0715: superfluous redraw_win_later() #10523Jan Edmund Lazo2019-07-17
| | | | | Problem: Superfluous call to redraw_win_later(). Solution: Remove the call. https://github.com/vim/vim/commit/6f7e555f7440df148350468ad8bc6d559d676d7c
* vim-patch:8.1.0543: fix memory leak #10001Jan Edmund Lazo2019-05-11
| | | | | | Problem: Coverity warns for leaking memory and using wrong struct. Solution: Free pointer when allocation fails. Change "boff" to "loff". (closes vim/vim#3634) https://github.com/vim/vim/commit/4e303c8ba8dcd0566a1ad7c82ff18eb016eea335
* signs: support multiple columns #9295Dan Aloni2019-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #990 closes #9295 - Support for multiple auto-adjusted sign columns. With this change, having more than one sign on a line, and with the 'auto' setting on 'signcolumn', extra columns will shown automatically to accomodate all the existing signs. For example, suppose we have this view: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } 5152 return 0; 5153 } 5154 We have GitGutter installed, so it tells us about modified lines that are not commmited. So let's change line 5152: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } ~ 5152 return 0; 5153 } 5154 Now we add a mark over line 5152 using 'ma' in normal mode: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } a ~ 5152 return 0; 5153 } 5154 Previously, Vim/Nvim would have picked only one of the signs, because there was no support for having multiple signs in a line. - Remove signs from deleted lines. Suppose we have highlights on a group of lines and we delete them: + 6 use std::ops::Deref; --+ 7 use std::borrow::Cow; --+ 8 use std::io::{Cursor}; 9 use proc_macro2::TokenStream; 10 use syn::export::ToTokens; --+ 11 use std::io::Write; >> 12 use std::ops::Deref; Without this change, these signs will momentarily accumulate in the sign column until the plugins wake up to refresh them. + --+ --+ --+ >> 6 Discussion: It may be better to extend the API a bit and allow this to happen for only certain types of signs. For example, VIM marks and vim-gitgutter removal signs may want to be presreved, unlike line additions and linter highlights. - 'signcolumn': support 'auto:NUM' and 'yes:NUM' settings - sort signs according to id, from lowest to highest. If you have git-gutter, vim-signature, and ALE, it would appear in this order: git-gutter - vim-signature - ALE. - recalculate size before screen update - If no space for all signs, prefer the higher ids (while keeping the rendering order from low to high). - Prevent duplicate signs. Duplicate signs were invisible to the user, before using our extended non-standard signcolumn settings. - multi signcols: fix bug related to wrapped lines. In wrapped lines, the wrapped parts of a line did not include the extra columns if they existed. The result was a misdrawing of the wrapped parts. Fix the issue by: 1. initializing the signcol counter to 0 when we are on a wrap boundary 2. allowing for the draw of spaces in that case.
* vim-patch:8.1.1026: unused conditionJan Edmund Lazo2019-03-21
| | | | | | Problem: Unused condition. (Coverity) Solution: Remove the condition. Also remove unused #define. https://github.com/vim/vim/commit/d00e024d9f2b631226c1dba83cb203739b0d02a3
* screen: cleanup allocation, clearing and validationBjörn Linse2019-02-07
| | | | | | grid_xx functions shouldn't randomly be called when the screen is not valid. Nvim deterministically initializes a default screen early in main(), so the default grid can be assumed to be allocated.
* screen: simplify scrolling codeBjörn Linse2019-02-07
| | | | | Since the separation between internal screen and TUI, internal scroll cannot FAIL. Delete the conditions for this.
* terminal: handle size when switching buffers in windowBjörn Linse2019-01-27
|
* window/ui: reorganize size variables, fix terminal window size with multigrid.Björn Linse2019-01-27
| | | | | | | wp->w_height_inner now contains the "inner" size, regardless if the window has been drawn yet or not. It should be used instead of wp->w_grid.Rows, for stuff that is not directly related to accessing the allocated grid memory, such like cursor movement and terminal size
* display: unify cursorline and concealcursor redraw logicBjörn Linse2019-01-13
| | | | | | | | | | | | | | | | There is various places where 'conceallevel' and 'concealcursor' necessitates additional redraws. This tries to separate the different cases and handle each accordingly: - Share code with 'cursorline' for the common case: vertical move of cursor within the same window (concealcursor not active) - Improve the logic for managing 'concealcursor' and switching modes: test for the case where the new mode behaves differently from the last one. - Clarify the special case for horizontal movement within a line when 'concealcursor' is active, now there is an if-statement only for this and not hidden in larger check mostly for the first point. - Keep the special case for moving between windows as is.
* remove dead argument of redrawWinlineBjörn Linse2019-01-09
|
* multigrid: various cleanup (types, unused parameters)Björn Linse2018-12-31
| | | | Handle the rare case of full highlight table properly
* multigrid: don't clear window grids on resizeBjörn Linse2018-12-31
| | | | Instead define that the shared top-left part of the grid is preserved.
* multigrid: Fix lint errorsUtkarsh Maheshwari2018-12-31
|
* multigrid: Allow UIs to set grid size different from window sizeUtkarsh Maheshwari2018-12-31
|
* multigrid: introduce grid abstractionBjörn Linse2018-12-31
|
* UI/TUI: improvements and cleanups for scrolling and clearingBjörn Linse2018-11-11
| | | | | | | | | | | | - TUI: _never_ rely on BCE for implicit clearing, only explicit commands. - TUI: use unibi_erase_chars when possible. - TUI: use end-exclusive ranges for invalid and cleared areas - screen: scrolling leaves scrolled in aree undefined. This is a conservative change, a client assuming the old semantics will still behave correctly. - screen: factor out vsep handling from line drawing. This is needed anyway for the multigrid refactor. - screen: simplifications of win_do_lines
* ui: disable clearing almost everywhereBjörn Linse2018-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid clearing the screen in most situations. NOT_VALID should be equivalent to CLEAR unless some external force messed up the terminal, for these situations <c-l> and :mode will still clear the screen. Also eliminate some obsolete code in screen.c, that dealt with that in vim drawing window 1 can mess up window 2, but this never happens in nvim. But what about slow terminals? There is two common meanings in which a terminal is said to be "slow": Most commonly (and in the sense of vim:s nottyfast) it means low bandwidth for sending bytes from nvim to the terminal. If the screen is very similar before and after the update_screen(CLEAR) this change should reduce bandwidth. If the screen is quite different, but there is no new regions of contiguous whitespace, clearing doesn't reduce bandwidth significantly. If the new screen contains a lot of whitespace, it will depend of if vsplits are used or not: as long as there is no vsplits, ce is used to cheaply clear the rest of the line, so full-screen clear is not needed to reduce bandwith. However a left vsplit currently needs to be padded with whitespace all the way to the separator. It is possible ec (clear N chars) can be used to reduce bandwidth here if this is a problem. (All of this assumes that one doesn't set Normal guibg=... on a non-BCE terminal, if you do you are doomed regardless of this change). Slow can also mean that drawing pixels on the screen is slow. E-ink screens is a recent example. Avoiding clearing and redrawing the unchanged part of the screen will always improve performance in these cases.
* vim-patch:8.1.0448: cursorline not removed when using 'cursorbind'Justin M. Keyes2018-10-16
| | | | | | Problem: Cursorline not removed when using 'cursorbind'. (Justin Keyes) Solution: Store the last cursor line per window. (closes vim/vim#3488) https://github.com/vim/vim/commit/4a5abbd6138240d109278fe1f0b45489d22f712d
* vim-patch:8.1.0435: cursorline highlight not removed in some situation (#9059)Justin M. Keyes2018-09-27
| | | | | | | Problem: Cursorline highlight not removed in some situation. (Vitaly Yashin) Solution: Reset last_cursorline when resetting 'cursorline'. (Christian Brabandt, closes vim/vim#3481) https://github.com/vim/vim/commit/8c63e0ec314ba07d54b881dc629fe19e6eda1fb8
* vim-patch:8.1.0374: moving the cursor is slow when 'relativenumber' is setJustin M. Keyes2018-09-13
| | | | | | Problem: Moving the cursor is slow when 'relativenumber' is set. Solution: Only redraw the number column, not all lines. https://github.com/vim/vim/commit/bd9a53c06c8869ad811cb3dd01a309c9be7d7a63
* vim-patch:8.1.0373: screen updating still slow when 'cursorline' is setJustin M. Keyes2018-09-13
| | | | | | Problem: Screen updating still slow when 'cursorline' is set. Solution: Fix setting last_cursorline. https://github.com/vim/vim/commit/1b7fefcbce5dd2fd337e217d4857b941da3f8bed
* vim-patch:8.1.0372: screen updating slow when 'cursorline' is set (#8986)Justin M. Keyes2018-09-12
| | | | | Problem: Screen updating slow when 'cursorline' is set. Solution: Only redraw the old and new cursor line, not all lines. https://github.com/vim/vim/commit/90a997987dbbe43af3c15118a35f658f0f037d1d
* move: dir in onepage() is DirectionJan Edmund Lazo2018-09-10
| | | | Move vim.h in move.h to implicitly include buffer_defs.h and pos.h.
* move: drop has_mbyte checkJan Edmund Lazo2018-09-10
| | | | has_mbyte is always true in nvim.
* vim-patch:8.1.0174: after paging up and down fold line is wrongJan Edmund Lazo2018-09-10
| | | | | | | Problem: After paging up and down fold line is wrong. Solution: Correct the computation of w_topline and w_botline. (Hirohito Higashi) https://github.com/vim/vim/commit/907dad72ef9d29422352fb74ba156e7085a3fc71
* vim-patch:8.0.0515: ml_get errors in silent Ex mode (#8452)KunMing Xie2018-05-30
| | | | | | Problem: ml_get errors in silent Ex mode. (Dominique Pelle) Solution: Clear valid flags when setting the cursor. Set the topline when not in full screen mode. https://github.com/vim/vim/commit/d5d37537d1fa46fd468bd378af2006dd09840f38
* screen.c: define column width by function (#5802)Matthieu Coudron2018-03-18
| | | | | | | This does not change the behavior but centralizes column size for future use (like dynamic signcolumn width depending on the maximum number of signs on a line). The returned value is limited by the size of the `extra` tab in win_line (currently allows for 18 ASCII characters).
* vim-patch:8.0.0448: some macros are lower case (#7936)KunMing Xie2018-01-30
| | | | | | | Problem: Some macros are in lower case, which can be confusing. Solution: Make a few lower case macros upper case. https://github.com/vim/vim/commit/b5aedf3e228d35821591da9ae8501b61cf2e264c ref #6297
* Merge #7593 'PVS static analysis fixes'Justin M. Keyes2017-11-22
|\
| * move.c: remove unreachable break statementPeter Kalauskas2017-11-22
|/ | | | n > 0 verified by while condition, (--n < 0) always false
* vim-patch: 8.0.0{181,182,188} (#7152)KunMing Xie2017-09-05
| | | | | | | | | | | | | | | | | | | | | vim-patch:8.0.0181 Problem: When 'cursorbind' and 'cursorcolumn' are both on, the column highlignt in non-current windows is wrong. Solution: Add validate_cursor(). (Masanori Misono, closes vim/vim#1372) https://github.com/vim/vim/commit/519d7785f4437762c07b2e04217f83a069a8c663 vim-patch:8.0.0182 Problem: When 'cursorbind' and 'cursorline' are set, but 'cursorcolumn' is not, then the cursor line highlighting is not updated. (Hirohito Higashi) Solution: Call redraw_later() with NOT_VALID. https://github.com/vim/vim/commit/e47683a0913f102b6ae08c8848d5aa675d99b188 vim-patch:8.0.0188 Problem: Using NOT_VALID for redraw_later() to update the cursor line/column highlighting is not efficient. Solution: Call validate_cursor() when 'cul' or 'cuc' is set. https://github.com/vim/vim/commit/9506cad7a1a6e52a613f356de969cbd980815777
* vim-patch:8.0.0044ckelsel2017-08-16
| | | | | | | | Problem: In diff mode the cursor may end up below the last line, resulting in an ml_get error. Solution: Check the line to be valid. https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
* vim-patch:8.0.0069ckelsel2017-07-23
| | | | | | | Problem: Compiler warning for self-comparison. Solution: Define ONE_WINDOW and add vim/vim#ifdef. https://github.com/vim/vim/commit/a1f4cb93ba50ea9e40cd4b1f5592b8a6d1398660
* *: Add comment to all C filesZyX2017-04-19
|
* move.c: add cursor adjustment for scrolloff (#6319)lonerover2017-03-21
|
* linter: make changes pass the linterraichoo2017-03-19
|
* vim-patch:7.4.2322raichoo2017-03-19
| | | | | | | Problem: Access memory beyond the end of the line. (Dominique Pelle) Solution: Adjust the cursor column. https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
* vim-patch:7.4.2101James McCoy2017-03-11
| | | | | | | Problem: Looping over windows, buffers and tab pages is inconsistant. Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07
* lintJames McCoy2016-12-28
|
* vim-patch:7.4.2201Chris Lucas2016-12-28
| | | | | | | Problem: The sign column disappears when the last sign is deleted. Solution: Add the 'signcolumn' option. (Christian Brabandt) https://github.com/vim/vim/commit/95ec9d6a6ab3117d60ff638670a803d43974ba51
* 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
* *: 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.
* vim-patch:7.4.856Jurica Bradaric2016-02-10
| | | | | | | Problem: "zt" still doesn't work well with filler lines. (Gary Johnson) Solution: Check for filler lines above the cursor. (Christian Brabandt) https://github.com/vim/vim/commit/a09a2c5857ab854f0870573b5160da1964c905a2
* vim-patch:7.4.853Jurica Bradaric2016-02-09
| | | | | | | Problem: "zt" in diff mode does not always work properly. (Gary Johnson) Solution: Don't count filler lines twice. (Christian Brabandt) https://github.com/vim/vim/commit/cf619daa8e0ef9a335f27f65eb74e422a17d4f92
* 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.