aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
Commit message (Collapse)AuthorAge
...
* 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.0538: evaluating a modeline might invoke using a shell commandJan Edmund Lazo2019-03-23
| | | | | | | Problem: Evaluating a modeline might invoke using a shell command. (Paul Huber) Solution: Set the sandbox flag when setting options from a modeline. https://github.com/vim/vim/commit/5958f95a40a4a44bd9e7f3b7ec6554a6ef3e42ca
* vim-patch:8.1.0384: sign ordering #9758Jan Edmund Lazo2019-03-19
| | | | | | Problem: Sign ordering depends on +netbeans feature. Solution: Also order signs without +netbeans. (Christian Brabandt, closes vim/vim#3224) https://github.com/vim/vim/commit/8aeb504fc68e3fea9da5567d2d9a31a132fbf90f
* vim-patch:8.1.0826: too many #ifdefsJan Edmund Lazo2019-03-08
| | | | | | Problem: Too many #ifdefs. Solution: Graduate FEAT_VIRTUALEDIT. Adds about 10Kbyte to the code. https://github.com/vim/vim/commit/29ddebef4038d2d2b3bc9d8d3b0109f4046d6fbf
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* API/buffer-updates: always detach on buf-reload #9643KillTheMule2019-03-01
| | | | | | Independently of the 'undoreload' option and the length of the file. closes #9642 closes #9643
* api: add nvim_create_buf to create a new empty buffer.Björn Linse2019-02-09
| | | | | | | | | | | | Loading existing files into a buffer is non-trivial and requires a window. Creating an unnamed emtpy buffer is trivial and safe though, thus worth a special case. Change nvim_buf_set_option to use aucmd_prepbuf. This is necessary to allow some options to be set on a not yet displayed buffer, such as 'buftype' option. vim-patch:7.4.1858: Add BLN_NEW to enforce buflist_new creating new buffer
* vim-patch:8.0.1073: may get an endless loop if 'statusline' changes a highlightJan Edmund Lazo2019-02-03
| | | | | | Problem: May get an endless loop if 'statusline' changes a highlight. Solution: Do not let evaluating 'statusline' trigger a redraw. https://github.com/vim/vim/commit/ba2929b6afd2fc20479912a8dec789be26a38244
* Merge #9539 "options: make 'listchars' and 'fillchars' local to window"Marco Hinz2019-01-28
|\
| * linter: fix issuesMarco Hinz2019-01-26
| |
| * options: make 'fillchars'/'listchars' local to windowMarco Hinz2019-01-26
| | | | | | | | | | | | | | | | | | | | Using 'listchars' is a nice way to highlight tabs that were included by accident for buffers that set 'expandtab'. But maybe one does not want this for buffers that set 'noexpandtab', so now one can use: autocmd FileType go let &l:listchars .= ',tab: '
* | terminal: handle size when switching buffers in windowBjörn Linse2019-01-27
|/
* clang/"null pointer dereference": close_bufferJustin M. Keyes2019-01-13
| | | | False positive: win_valid_any_tab() already checks `win != NULL`.
* bufhl: simplify redraw logicBjörn Linse2019-01-09
| | | | | using changed_lines_buf was technically incorrect, as the buffer wasn't modififed.
* api: make nvim_buf_set_virtual_text use correct namespace counterBjörn Linse2018-12-07
|
* api: implement object namespacesBjörn Linse2018-11-24
| | | | | | | | | Namespaces is a lightweight concept that should be used to group objects for purposes of bulk operations and introspection. This is initially used for highlights and virtual text in buffers, and is planned to also be used for extended marks. There is no plan use them for privileges or isolation, neither to introduce nanespace-level options.
* api: simplify nvim_buf_get_offset functionBjörn Linse2018-11-01
|
* signs: Add "numhl" argument #9113Reto Schnyder2018-10-13
| | | | | close #9113 ref #9040
* lintJan Edmund Lazo2018-09-29
|
* globals: arg_had_last is boolJan Edmund Lazo2018-09-29
|
* vim-patch:8.1.0310: file info msg with 'F' in 'shortmess'Justin M. Keyes2018-09-21
| | | | | | | | | | Problem: File info message not always suppressed with 'F' in 'shortmess'. (Asheq Imran) Solution: Save and restore msg_silent. (Christian Brabandt, closes vim/vim#3221) https://github.com/vim/vim/commit/2f0f871159b2cba862fcd41edab65b17da75c422 ref #8840 ref #9027
* vim-patch:8.0.1215: newer gcc warns for implicit fallthroughJan Edmund Lazo2018-09-20
| | | | | | Problem: Newer gcc warns for implicit fallthrough. Solution: Consistently use a FALLTHROUGH comment. (Christian Brabandt) https://github.com/vim/vim/commit/2f40d129bf45cd35976e4120336ae6d504f5a5dd
* buffer: add support for virtual text annotationsBjörn Linse2018-09-17
|
* lintJan Edmund Lazo2018-09-06
|
* window: refactor boolean variables in win_close()Jan Edmund Lazo2018-09-06
| | | | free_buf (param) and help_window (variable) are bool.
* vim-patch:8.0.0782: using freed memory in quickfix codeJan Edmund Lazo2018-09-06
| | | | | | Problem: Using freed memory in quickfix code. (Dominique Pelle) Solution: Handle a help window differently. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/d28cc3f55d4a5a980f6ac6fa682382822a223720
* ops: refactor get_spec_reg()Jan Edmund Lazo2018-08-16
| | | | | | Return value is bool. errmsg (param) is bool in here and in getaltfname(). allocated (param) is bool.
* vim-patch:8.0.1633: a TextChanged autocmd triggers when it is definedJan Edmund Lazo2018-08-15
| | | | | | | | Problem: A TextChanged autocmd triggers when it is defined after creating a buffer. Solution: Set b_last_changedtick when opening a buffer. (Hirohito Highlight, closes vim/vim#2742) https://github.com/vim/vim/commit/8c64a36e40b8746404f7151abe6849393396af10
* lintJan Edmund Lazo2018-08-11
|
* vim-patch:8.0.1361: some users don't want to diff with hidden buffersJan Edmund Lazo2018-08-11
| | | | | | Problem: Some users don't want to diff with hidden buffers. Solution: Add the "hiddenoff" item to 'diffopt'. (Alisue, closes vim/vim#2394) https://github.com/vim/vim/commit/97ce419201421f65f4764549ed80307a7ef9c7a6
* lint: clean-up after parent commitZviRackover2018-08-06
|
* Remove all occurences of the mb_ptr2char macroZviRackover2018-08-06
| | | | | | | First step towards implemening issue #7401. The same can be done for all deprecated mb_ functions in follow-up patches.
* vim-patch:8.1.0240: g:actual_curbuf set in wrong scope (#8818)Daniel Hahler2018-08-06
| | | | | Problem: g:actual_curbuf set in wrong scope. (Daniel Hahler) Solution: Prepend the "g:" name space. (closes vim/vim#3279) https://github.com/vim/vim/commit/3cb4448b8a5c0192988f4e349aba6d7a91a9a4bd
* vim-patch:8.0.1512: warning for possibly using NULL pointerJan Edmund Lazo2018-07-23
| | | | | | Problem: Warning for possibly using NULL pointer. (Coverity) Solution: Skip using the pointer if it's NULL. https://github.com/vim/vim/commit/e4db7aedab65abadcc84c78e7a10ec7bb62f11cf
* highlight: extract low-level highlight logic from syntax, uiBjörn Linse2018-07-21
|
* terminal: handle &confirm and :confirm on unloading (#8726)Marco Hinz2018-07-12
| | | | | | Show a proper confirmation dialog when trying to unload a terminal buffer while the confirm option is set or when :confirm is used. Fixes https://github.com/neovim/neovim/issues/4651
* test: build_stl_str_hl (#8703)ZviRackover2018-07-10
| | | | Improve coverage of `build_stl_str_hl`. Minor removal of dead code in the tested function.
* Merge pull request #7551 from bfredl/setl_bufwinBjörn Linse2018-06-22
|\ | | | | fix copying setl options for buffer currently displayed in another window
| * buffer: fix copying setl options for buffer currently displayed in another ↵Björn Linse2018-06-21
| | | | | | | | | | | | | | | | | | | | | | window vim-patch:8.0.1836: buffer-local window options may not be recent Problem: Buffer-local window options may not be recent if the buffer is still open in another window. Solution: Copy the options from the window instead of the outdated window options. (Bjorn Linse, closes vim/vim#2336) https://github.com/vim/vim/commit/25782a7ff4755daf16c2e1cb5e5f826b13b672ce
* | *: Replace b_changedtick with new always-inline functionsZyX2018-06-22
| | | | | | Ref #8474
* | vim-patch:8.0.0648: possible use of NULL pointerJan Edmund Lazo2018-06-21
| | | | | | | | | | | | | | Problem: Possible use of NULL pointer if buflist_new() returns NULL. (Coverity) Solution: Check for NULL pointer in set_bufref(). https://github.com/vim/vim/commit/fadacf01d0dbcc7a96ef5eee0ad57956eeab04d7
* | vim-patch:8.0.0621: :stag does not respect 'switchbuf'Jan Edmund Lazo2018-06-21
|/ | | | | | | | Problem: The ":stag" command does not respect 'switchbuf'. Solution: Check 'switchbuf' for tag commands that may open a new window. (Ingo Karkat, closes vim/vim#1681) Define macros for the return values of getfile(). https://github.com/vim/vim/commit/8ad80dea089ffeb1a845199c013e9bb4be1cd22e
* 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
* Merge #7917 'API: buffer updates'Justin M. Keyes2018-06-08
|\
| * Some renamings and doc changesKillTheMule2018-05-23
| |
| * The grand renamingKillTheMule2018-05-23
| |
| * LintKillTheMule2018-05-23
| |
| * API: Implement buffer updatesPeter Hodge2018-05-23
|/ | | | | Originally written by @phodge in https://github.com/neovim/neovim/pull/5269.
* *: Fix clint errorsZyX2018-04-22
|
* buffer: Fix PVS/V560: condition was checked three lines aboveZyX2018-04-09
|