aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
Commit message (Collapse)AuthorAge
* screen: truncate showmode messagesBjörn Linse2018-07-12
| | | | | Before this, bottom of screen got messed up when modemsg (+ one extra space to not force terminal scroll) didn't fit on one line.
* vim-patch:8.0.0686: extra redraw when using CTRL-L in second windowJan Edmund Lazo2018-07-03
| | | | | | | Problem: When typing CTRL-L in a window that's not the first one, another redraw will happen later. (Christian Brabandt) Solution: Reset must_redraw after calling screenclear(). https://github.com/vim/vim/commit/9f5f7bf4d5f757ef885acf74ce03c25429a328aa
* highlight: high-priority CursorLine if fg is set. #8578Yichao Zhou2018-06-28
| | | | | | | | | | | | closes #7383 closes #7715 This implements the compromise described in #7383: * low-priority CursorLine if foreground is not set * high-priority ("same as Vim" priority) CursorLine if foreground is set ref d1874ab2821d076397290cc154d87ec2dc352c79 ref 56eda2aa17c80ba380b606f9466f288fb8162dd3
* Merge #8526 from janlazo/vim-8.0.0451Justin M. Keyes2018-06-16
|\
| * vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | | | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* | Add ‘eob’ option to fillcharsJack Bracewell2018-06-13
| | | | | | | | | | This option allows configuring what character is shown on the empty lines at the end of a buffer, previously hardcoded to ‘~’
* | screen: use UTF-8 representationBjörn Linse2018-06-13
|/ | | | | | | | | | | | | | Store text in ScreenLines as UTF-8, so it can be sent as-is to the UI layer. `utfc_char2bytes(off,buf)` is removed, as `ScreenLines[off]` now already contains this representation. To recover the codepoints that the screen arrays previously contained, use utfc_ptr2char (or utf_ptr2char to ignore composing chars). NB: This commit does NOT change how screen.c processes incoming UTF-8 data from buffers, cmdline, messages etc. Any algorithm that operates on UCS-4 (like arabic shaping, treatment of non-printable chars) is left unchanged for now.
* vim-patch:8.0.0520: using a function pointer while the function is known (#8513)KunMing Xie2018-06-10
| | | | | | | Problem: Using a function pointer instead of the actual function, which we know. Solution: Change mb_ functions to utf_ functions when already checked for Unicode. (Dominique Pelle, closes vim/vim#1582) https://github.com/vim/vim/commit/ace95989ed81929a84e205b26d0972cb9d6b4b19
* vim-patch:8.0.0466: still macros that should be all-caps (#8510)Jan Edmund Lazo2018-06-10
| | | | | Problem: There are still a few macros that should be all-caps. Solution: Make a few more macros all-caps. https://github.com/vim/vim/commit/8820b48654b62472821d9b155fe03ab7ac13a05c
* vim-patch:8.0.0675: 'colorcolumn' has a higher priority than 'hlsearch' (#8483)Jan Edmund Lazo2018-06-05
| | | | | | Problem: 'colorcolumn' has a higher priority than 'hlsearch', it should be the other way around. (Nazri Ramliy) Solution: Change the priorities. (LemonBoy, closes vim/vim#1794) https://github.com/vim/vim/commit/774e5a9673260b1b8b88463669213a96637f72e8
* vim-patch:8.0.0454: compiler warnings for "always true" comparison (#8431)KunMing Xie2018-05-24
| | | | | | Problem: Compiler warnings for comparing unsigned char with 256 always being true. (Manuel Ortega) Solution: Add type cast. https://github.com/vim/vim/commit/977d03733601948ab334fec24d0da82bc18c57c3
* terminal: tickle statusline on entering #8323raichoo2018-05-18
|
* Merge pull request #8358 from mhinz/screenJames McCoy2018-05-04
|\ | | | | [RFC] screen: avoid artifacts
| * screen: avoid artifactsMarco Hinz2018-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Put back the condition that was accidentally removed in https://github.com/neovim/neovim/commit/d42f934bcb3e9e876e5e7ba0ab5cd824175fd10c - if (enc_utf8 && ScreenLinesUC[off] != 0) - bytes[utfc_char2bytes(off, bytes)] = NUL; - else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e) { - bytes[0] = ScreenLines[off]; - bytes[1] = ScreenLines2[off]; - bytes[2] = NUL; - } else if (enc_dbcs && MB_BYTE2LEN(bytes[0]) > 1) { - bytes[1] = ScreenLines[off + 1]; - bytes[2] = NUL; - } + bytes[utfc_char2bytes(off, bytes)] = NUL; Fixes #8357
* | messages: redraw tabline if it was overdrawn by messagesBjörn Linse2018-05-04
|/ | | | | | | fixes #8354 Regression from #8088, where we try to avoid clearing the screen if not absolutely necessary
* Merge #8218 'Fix errors reported by PVS'Justin M. Keyes2018-04-27
|\ | | | | closes #4983
| * *: Fix clint errorsZyX2018-04-22
| |
| * screen: Fix PVS/V560: col never reassigned in this part of codeZyX2018-04-22
| |
| * screen: Fix PVS/V519: duplicate successive assignmentZyX2018-04-22
| |
| * screen: Fix PVS/V560: condition was checked in surrounding ifZyX2018-04-22
| |
| * screen: Get rid of ScreenLines2 as it is no longer usedZyX2018-04-22
| | | | | | Should also fix some PVS warnings in process.
| * charset,*: Refactor transstr()ZyX2018-04-09
| |
* | screen: winhl=Normal:Background should not override syntax (#8093)Björn Linse2018-04-02
|/ | | fixes #7375
* msg: do not scroll entire screen (#8088)Björn Linse2018-03-31
|
* getchar: implement <Cmd> key to invoke command in any modeBjörn Linse2018-03-23
|
* 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).
* screen.c: make negative 'writedelay' show all redrawsBjörn Linse2018-02-24
| | | | | | | | | | | | | | | | | | | | Currently writedelay shows the sequence of characters that are sent to the UI/TUI module. Here nvim has already applied an optimization: when attempting to put a char in a screen cell, if the same char already was there with the same attributes, UI output is disabled. When debugging redrawing it it sometimes more useful to inspect the redraw stream one step earlier, what region of the screen nvim actually is recomputing from buffer contents (win_line) and from evaluating statusline expressions. Take the popupmenu as an example. When closing the popupmenu (in the TUI), currently 'writedelay' looks like vim only is redrawing the region which the pum covered. This is not what happens internally: vim redraws the entire screen, even if only outputs the changed region. This commit allows negative values of 'writedelay', which causes a delay for all redrawn characters, even if the character already was displayed by the UI before.
* 'fillchars': fix defaults logic; handle ambiwidth=double #7986Matthieu Coudron2018-02-23
| | | | Update tests.
* defaults: 'fillchars'Justin M. Keyes2018-02-23
| | | | | | | | | | | Most fonts should have these by now. Both are a significant visual improvement. - Vertical connecting bar `│` is used by tmux, pstree, Windows 7 cmd.exe and nvim-qt.exe. - Middle dot `·` works on Windows 7 cmd.exe, nvim-qt.exe. For reference: tmux uses these chars to draw lines: │ ├ ─
* screen: win_del_lines/win_ins_lines cleanupBjörn Linse2018-02-21
|
* screen: remove dead code emulating terminals without scroll regionsBjörn Linse2018-02-21
| | | | This logic is now in tui/tui.c
* Merge #7939 "fix crash: 'spell' and long lines"Justin M. Keyes2018-02-11
|\
| * screen.c: resolve neovim issue #7937Michael Brailsford2018-02-07
| |
* | ui/tui: highlighting refactorBjörn Linse2018-02-11
|/ | | | | | | | Make HlAttr contain highlighting state for both color modes (cterm and rgb). This allows us to implement termguicolors completely in the TUI. Simplify some logic duplicated between ui.c and screen.c. Also avoid some superfluous highlighting reset events.
* vim-patch:8.0.0380: with 'linebreak' double wide char wraps badlyckelsel2018-01-14
| | | | | | | | | Problem: With 'linebreak' set and 'breakat' includes ">" a double-wide character results in "<<" displayed. Solution: Check for the character not to be replaced. (Ozaki Kiichi, closes vim/vim#1456) https://github.com/vim/vim/commit/38632faf635f6434441827e136bceb5a930c59ad
* :terminal : fix crash on resize (#7547)Justin M. Keyes2017-11-13
| | | | | | closes #7538 Fix wrong window references from #7440 Remove some eager resizing. Still mostly doesn't address #4997.
* Merge #7173 'api/ui: externalize cmdline'Justin M. Keyes2017-10-29
|\ | | | | | | closes #6162
| * ext_cmdline: implement redraw!Björn Linse2017-10-26
| |
* | test: :terminal + numberwidth=9Justin M. Keyes2017-10-28
| |
* | terminal: Account for number column (#5310)Sam Wilson2017-10-27
|/
* syntax: 'cursorline': revert priority change (#7400)Justin M. Keyes2017-10-16
| | | | | ref #7383 reverts d1874ab2821d076397290cc154d87ec2dc352c79 ref #6380
* syntax: 'cursorline': low priority #6380Justin M. Keyes2017-10-07
|
* syntax: 'cursorcolumn', 'colorcolumn': low priority #6380Justin M. Keyes2017-10-07
|
* terminal.c: need maketitle() in terminal-modeJustin M. Keyes2017-09-09
| | | | | | | | | | | normal_redraw() usually takes care of this, but that doesn't happen during terminal-mode. regression by c484323dc67f steps to reproduce: nvim -u NORC --cmd 'execute("set titlestring=" . $NVIM_LISTEN_ADDRESS) | set title | startinsert | !sleep 1' term://sh closes #7248
* doc: screen_resize(): remove mention of "mustset"Justin M. Keyes2017-08-14
| | | | | "mustset" is from Vim term.c:set_shellsize(), not relevant here: we behave as if mustset=true always.
* ui: disable 'lazyredraw' during ui_refresh.Justin M. Keyes2017-08-14
| | | | | | | | | | | | Could also try `do_redraw = true` instead of save/restore `p_lz`, but the nice thing about save/restore of `p_lz` is that it is "atomic". The semantics of `do_redraw` are not clear to me. Closes #4884 References #6202 References https://github.com/neovim/neovim/pull/6202#issuecomment-284379503 References #3929 #5692 #6157 References #5866
* vim-patch:8.0.0235Justin M. Keyes2017-08-12
| | | | | | | Problem: Memory leak detected when running tests for diff mode. Solution: Free p_extra_free. https://github.com/vim/vim/commit/b031c4ea04eb1e37a873fbb85e90d835aa1e2b1c
* vim-patch:8.0.0524Justin M. Keyes2017-08-12
| | | | | | | Problem: Folds are messed up when 'encodin' is "utf-8". Solution: Also set the fold character when it's not multi-byte. https://github.com/vim/vim/commit/8da1e6cedf839902e15987a98733ebd31b5f1b81
* vim-patch:8.0.0518Justin M. Keyes2017-08-12
| | | | | | | | | | | Closes #7086 Problem: Storing a zero byte from a multi-byte character causes fold text to show up wrong. Solution: Avoid putting zero in ScreenLines. (Christian Brabandt, closes vim/vim#1567) https://github.com/vim/vim/commit/c6cd8409c2993b1476e123fba11cb4b8d743b896
* vim-patch:8.0.0290 vim-patch:8.0.0394Justin M. Keyes2017-08-12
| | | | | | | | | | | | | | | | | vim-patch:8.0.0290: cursor positioning wrong if wide character wraps Problem: If a wide character doesn't fit at the end of the screen line, and the line doesn't fit on the screen, then the cursor position may be wrong. (anliting) Solution: Don't skip over wide character. (Christian Brabandt, closes vim/1408) vim-patch:8.0.0394 Problem: Tabs are not aligned when scrolling horizontally and a Tab doesn't fit. (Axel Bender) Solution: Handle a Tab as a not fitting character. (Christian Brabandt) Also fix that ":redraw" does not scroll horizontally to show the cursor. And fix the test that depended on the old behavior. https://github.com/vim/vim/commit/abc39ab642791ae3d22a524516eeedb673a95d9d