aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
Commit message (Collapse)AuthorAge
...
| * Merge pull request #25724 from luukvbaal/signmergebfredl2023-11-18
| |\ | | | | | | refactor(sign): move legacy signs to extmarks
| | * refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
| * | refactor: remove B_SPELL macro (#26063)zeertzjq2023-11-16
| |/
| * refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | | | | | | It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
| * build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | | | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
| * refactor: the long goodbyedundargoc2023-10-09
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * refactor: the long goodbyedundargoc2023-10-03
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * Merge pull request #25386 from glepnir/toggle_floatbfredl2023-09-30
| |\ | | | | | | feat(float): support toggle show float window
| | * feat(float): support toggle show float windowglepnir2023-09-30
| | |
| * | refactor: align set_chars_option() with Vim (#25438)zeertzjq2023-09-30
| | | | | | | | | Needed for completion of 'listchars'/'fillchars' values.
| * | refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | | | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
| * | refactor: remove longdundargoc2023-09-29
| | | | | | | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
| * | vim-patch:8.2.3517: TextChanged does not trigger after TextChangedI (#25384)zeertzjq2023-09-27
| |/ | | | | | | | | | | | | | | | | Problem: TextChanged does not trigger after TextChangedI. Solution: Store the tick separately for TextChangedI. (Christian Brabandt, closes vim/vim#8968, closes vim/vim#8932) https://github.com/vim/vim/commit/db3b44640d69ab27270691a3cab8d83cc93a0861 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * Merge pull request #25214 from bfredl/glyphcachebfredl2023-09-19
| |\ | | | | | | refactor(grid): change schar_T representation to be more compact
| | * refactor(grid): change schar_T representation to be more compactbfredl2023-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a screen cell would occupy 28+4=32 bytes per cell as we always made space for up to MAX_MCO+1 codepoints in a cell. As an example, even a pretty modest 50*80 screen would consume 50*80*2*32 = 256000, i e a quarter megabyte With the factor of two due to the TUI side buffer, and even more when using msg_grid and/or ext_multigrid. This instead stores a 4-byte union of either: - a valid UTF-8 sequence up to 4 bytes - an escape char which is invalid UTF-8 (0xFF) plus a 24-bit index to a glyph cache This avoids allocating space for huge composed glyphs _upfront_, while still keeping rendering such glyphs reasonably fast (1 hash table lookup + one plain index lookup). If the same large glyphs are using repeatedly on the screen, this is still a net reduction of memory/cache consumption. The only case which really gets worse is if you blast the screen full with crazy emojis and zalgo text and even this case only leads to 4 extra bytes per char. When only <= 4-byte glyphs are used, plus the 4-byte attribute code, i e 8 bytes in total there is a factor of four reduction of memory use. Memory which will be quite hot in cache as the screen buffer is scanned over in win_line() buffer text drawing A slight complication is that the representation depends on host byte order. I've tested this manually by compling and running this in qemu-s390x and it works fine. We might add a qemu based solution to CI at some point.
| * | Merge pull request #25148 from glepnir/fixed_optbfredl2023-09-19
| |\ \ | | |/ | |/| fix(float): add fixed option
| | * fix(float): add fixd optionglepnir2023-09-18
| | |
| * | vim-patch:8.2.4173: cannot use an import in 'foldexpr' (#25215)zeertzjq2023-09-17
| |/ | | | | | | | | | | | | | | | | Problem: Cannot use an import in 'foldexpr'. Solution: Set the script context to where 'foldexpr' was set. (closes vim/vim#9584) Fix that the script context was not set for all buffers. https://github.com/vim/vim/commit/e70dd11ef41f69bd5e94f630194e6b3c4f3f2102 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * feat(float): implement footerEvgeni Chasnovski2023-08-26
| | | | | | | | | | | | | | | | Problem: Now way to show text at the bottom part of floating window border (a.k.a. "footer"). Solution: Allows `footer` and `footer_pos` config fields similar to `title` and `title_pos`.
| * refactor(float): extract "title" and "title_pos" handlingEvgeni Chasnovski2023-08-26
| |
| * refactor: move some structs out of buffer_defs.h (#24878)zeertzjq2023-08-26
| |
| * vim-patch:9.0.1710: scrolloff options work slightly differentzeertzjq2023-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: sidescrolloff and scrolloff options work slightly different than other global-local options Solution: Make it behave consistent for all global-local options It was noticed, that sidescrolloff and scrolloff options behave differently in comparison to other global-local window options like 'listchars' So make those two behave like other global-local options. Also add some extra documentation for a few special local-window options. Add a few tests to make sure all global-local window options behave similar closes: vim/vim#12956 closes: vim/vim#12643 https://github.com/vim/vim/commit/4a8eb6e7a9df10f79bf95301ced012f0d6a13088 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:9.0.1772: Cursor may be adjusted in 'splitkeep'ed windows (#24811)zeertzjq2023-08-21
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Cursor is adjusted in window that did not change in size by 'splitkeep'. Solution: Only check that cursor position is valid in a window that has changed in size. closes: vim/vim#12509 https://github.com/vim/vim/commit/16af913eeefb288ce968fb87e09a597413861900 Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
| * fix(events): avoid unnecessary CursorMoved (#24675)zeertzjq2023-08-12
| | | | | | | | | | | | Problem: Temporarily changing current window in a script causes CursorMoved to be triggerd. Solution: Don't trigger CursorMoved if neither curwin nor cursor changed between two checks.
| * perf(ui-ext): approximate scroll_delta when scrolling too much (#24234)zeertzjq2023-07-04
| |
| * fix(ui-ext): "scroll_delta" handle topfill and skipcol (#24249)zeertzjq2023-07-04
| |
| * refactor: adjust headers according to the style guide (#23934)dundargoc2023-06-06
| | | | | | System headers should be included first to prevent naming conflicts.
| * fix(statusline): redraw when VIsual_mode changes (#23933)zeertzjq2023-06-06
| |
| * vim-patch:9.0.0130: cursor position wrong when inserting around virtual textIbby2023-05-22
| | | | | | | | | | | | | | | | | | Problem: Cursor position wrong when inserting around virtual text. Solution: Update the cursor position properly. https://github.com/vim/vim/commit/1f4ee19eefecd8f70b7cbe8ee9db8ace6352e23e Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
| * refactor: remove typval.h from most header files (#23601)zeertzjq2023-05-13
| | | | | | Because typval_defs.h is enough for most of them.
| * vim-patch:9.0.0746: breakindent test cases are commented outLuuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | | | | Problem: Breakindent test cases are commented out. Solution: Adjust expected result to slightly different behavior. Correct computations for cursor position. https://github.com/vim/vim/commit/856c5d2bc7c3864f8b63a0ab3e376d5c5e51f1d5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.0734: cursor position invalid when scrolling with 'smoothscroll'Luuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | | | | | | Problem: Cursor position invalid when scrolling with 'smoothscroll' set. (Ernie Rael) Solution: Add w_valid_skipcol and clear flags when it changes. Adjust w_skipcol after moving the cursor. https://github.com/vim/vim/commit/2fbabd238a94022c99506e920186a5b6cdf15426 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.0640: cannot scroll by screen line if a line wrapsLuuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot scroll by screen line if a line wraps. Solution: Add the 'smoothscroll' option. Only works for CTRL-E and CTRL-Y so far. https://github.com/vim/vim/commit/f6196f424474e2a9c160f2a995fc2691f82b58f9 vim-patch:9.0.0641: missing part of the new option code Problem: Missing part of the new option code. Solution: Add missing WV_SMS. https://github.com/vim/vim/commit/bbbda8fd81f6d720962b67ae885825bad9be4456 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: uncrustifydundargoc2023-04-26
| | | | | | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
| * fix(ui): recording change doesn't trigger statusline redrawLuuk van Baal2023-04-01
| |
| * feat(ui): add scroll_delta to win_viewport event #19270Matthias Deiml2023-03-12
| | | | | | | | | | | | | | | | | | | | scroll_delta contains how much the top line of a window moved since the last time win_viewport was emitted. It is expected to be used to implement smooth scrolling. For this purpose it only counts "virtual" or "displayed" so folds should count as one line. Because of this it adds extra information that cannot be computed from the topline parameter. Fixes #19227
| * perf(statusline): UI elements are always redrawn on K_EVENTLuuk van Baal2023-03-08
| | | | | | | | | | Problem: 'statusline'-format UI elements are redrawn on each K_EVENT. Solution: Only redraw UI elements when something relevant has changed.
| * Merge pull request #22108 from luukvbaal/statuscolumnLewis Russell2023-02-14
| |\ | | | | | | perf(column): only build fold/sign column when present in 'statuscolumn'
| | * refactor(statusline): move statusline defs to statusline_defs.hLuuk van Baal2023-02-04
| | |
| | * perf(column): only build fold/sign column when present in 'statuscolumn'Luuk van Baal2023-02-04
| | | | | | | | | | | | | | | | | | | | | | | | Problem: The fold and sign column is built and stored regardless of whether the corresponding item is present in 'statuscolumn'. Solution: Since the 'statuscolumn' parses itself, we can defer building the columns until the corresponding item is actually encountered.
| * | fix(folds): cursorline highlight is not always applied on closed folds (#22242)luukvbaal2023-02-14
| | | | | | | | | | | | | | | | | | | | | Problem: The cursorline highlight logic checks for `w_cursor.lnum` which may be different from the line number passed to `win_line()` even when the cursor is actually on that line. Solution: Update cursor line highlight logic to check for the line number of the start of a closed fold if necessary.
| * | fix(decoration): don't show signcolumn for non-sign_text extmark (#22135)Lewis Russell2023-02-05
| |/ | | | | Fixes: #22127
| * fix(column): estimate 'statuscolumn' width appropriatelyluukvbaal2023-02-02
| | | | | | | | | | | | | | | | | | | | | | Problem: The 'statuscolumn' width is being estimated without the proper context. In particular, this resulted in the fact that a custom fold column could be included in the estimated `number_width()`, and doubly added when actually drawing the statuscolumn due to `win_col_off()` also adding the `'foldcolumn'` width. Resulting in a status column that is `'foldcolumn'` cells wider than necessary. Solution: Estimate 'statuscolumn' width in `get_statuscol_str()` when a buffer's line count has changed.
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2023-01-25
|\|
| * fix(statuscolumn): foldcolumn buffer is too small (#21761)luukvbaal2023-01-12
| | | | | | Resolve https://github.com/neovim/neovim/issues/21759.
| * fix(statuscolumn): fix crashes and clang/PVS warnings (#21725)zeertzjq2023-01-10
| |
| * feat(float): open float relative to mouse #21531Sebastian Lyng Johansen2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No easy way to position a LSP hover window relative to mouse. Solution: Introduce another option to the `relative` key in `nvim_open_win()`. With this PR it should be possible to override the handler and do something similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674 to have hover information displayed from the mouse. Test case: ```lua local util = require('vim.lsp.util') local function make_position_param(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) local row, col local mouse = vim.fn.getmousepos() row = mouse.line col = mouse.column offset_encoding = offset_encoding or util._get_offset_encoding(buf) row = row - 1 local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1] if not line then return { line = 0, character = 0 } end if #line < col then return { line = 0, character = 0 } end col = util._str_utfindex_enc(line, col, offset_encoding) return { line = row, character = col } end local make_params = function(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) offset_encoding = offset_encoding or util._get_offset_encoding(buf) return { textDocument = util.make_text_document_params(buf), position = make_position_param(window, offset_encoding), } end local hover_timer = nil vim.o.mousemoveevent = true vim.keymap.set({ '', 'i' }, '<MouseMove>', function() if hover_timer then hover_timer:close() end hover_timer = vim.defer_fn(function() hover_timer = nil local params = make_params() vim.lsp.buf_request( 0, 'textDocument/hover', params, vim.lsp.with(vim.lsp.handlers.hover, { silent = true, focusable = false, relative = 'mouse', }) ) end, 500) return '<MouseMove>' end, { expr = true }) ```
| * feat(ui): add 'statuscolumn' optionluukvbaal2023-01-09
| | | | | | | | | | | | | | | | Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
| * vim-patch:8.2.{3773,3774}zeertzjq2022-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.2.3773: wrong window size when a modeline changes 'columns' Problem: Wrong window size when a modeline changes 'columns' and there is more than one tabpage. (Michael Soyka) Solution: Adjust the frames of all tabpages. (closes vim/vim#9315) https://github.com/vim/vim/commit/8a7374f8c4eb4c016270ad908a43af4ddedcbf56 vim-patch:8.2.3774: test for command line height fails Problem: Test for command line height fails. Solution: Use another way to handle window size change. https://github.com/vim/vim/commit/b711814cb64b60ec4918e3e1fb2ca5c50d6e9340 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: replace char_u with char 16 - remove STRNCMP (#21208)dundargoc2022-12-21
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459