| Commit message (Collapse) | Author | Age |
... | |
| |\
| | |
| | | |
refactor(sign): move legacy signs to extmarks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/ |
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |\
| | |
| | | |
feat(float): support toggle show float window
|
| | | |
|
| | |
| | |
| | | |
Needed for completion of 'listchars'/'fillchars' values.
|
| | |
| | |
| | |
| | |
| | |
| | | |
- 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
|
| | |
| | |
| | |
| | |
| | | |
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |\
| | |
| | | |
refactor(grid): change schar_T representation to be more compact
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \
| | |/
| |/| |
fix(float): add fixed option
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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`.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| | |
System headers should be included first to prevent naming conflicts.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| | |
Because typval_defs.h is enough for most of them.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Problem: 'statusline'-format UI elements are redrawn on each K_EVENT.
Solution: Only redraw UI elements when something relevant has changed.
|
| |\
| | |
| | | |
perf(column): only build fold/sign column when present in 'statuscolumn'
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/
| |
| | |
Fixes: #22127
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\| |
|
| |
| |
| | |
Resolve https://github.com/neovim/neovim/issues/21759.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 })
```
|
| |
| |
| |
| |
| |
| |
| |
| | |
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: 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
Work on https://github.com/neovim/neovim/issues/459
|