| Commit message (Collapse) | Author | Age |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
|
|
|
|
|
| |
- reduce variable scope
- prefer initialization over declaration and assignment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: buffer text with composing chars are converted from UTF-8
to an array of up to seven UTF-32 values and then converted back
to UTF-8 strings.
Solution: Convert buffer text directly to UTF-8 based schar_T values.
The limit of the text size is now in schar_T bytes, which is currently
31+1 but easily could be raised as it no longer multiplies the size
of the entire screen grid when not used, the full size is only required
for temporary scratch buffers.
Also does some general cleanup to win_line text handling, which was
unnecessarily complicated due to multibyte rendering being an "opt-in"
feature long ago. Nowadays, a char is just a char, regardless if it consists
of one ASCII byte or multiple bytes.
|
|
|
|
|
|
| |
- reduce variable scope
- prefer initialization over declaration and assignment
- use bool to represent boolean values
|
|
|
|
|
|
|
| |
We already have an extensive suite of static analysis tools we use,
which causes a fair bit of redundancy as we get duplicate warnings. PVS
is also prone to give false warnings which creates a lot of work to
identify and disable.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
append/change operations, and when
opening a new line,
fixes: vim/vim#13367
closes: vim/vim#13375
https://github.com/vim/vim/commit/4bca4897a12dfb91b3b27e3083fd5f370bd857d1
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#25656)
Problem: `TextChangedI` can trigger on entering Insert mode if there
was previously a change not in Insert mode.
Solution: Make it trigger only when text is actually changed in Insert
mode.
closes: vim/vim#13265
closes: vim/vim#13338
https://github.com/vim/vim/commit/d7ae263af8f6a2da55ce3702d18c53ab1418bca7
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This finalizes the long running refactor from the old TUI-focused grid
implementation where text-drawing cursor was not separated from the
visible cursor.
Still, the pattern of setting cursor position together with updating a
line was convenient. Introduce grid_line_cursor_goto() to still allow
this but now being explicit about it.
Only having batched drawing functions makes code involving drawing
a bit longer. But it is better to be explicit, and this highlights
cases where multiple small redraws can be grouped together. This was the
case for most of the changed places (messages, lastline, and :intro)
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
- 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: there are too many different functions in message.c
solution: fold some of the functions into themselves
|
|
|
|
|
|
|
|
|
| |
Problem: CursorHoldI event interferes with "CTRL-G U". (Naohiro Ono)
Solution: Restore the flag for "CTRL-G U" after triggering CursorHoldI.
(closes vim/vim#8937)
https://github.com/vim/vim/commit/5a9357d0bff9059f547906d8d03b31bca7215af1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a step in an ongoing refactor where the "grid_puts" and
"grid_put_linebuf" code paths will share more of the implementation (in
particular for delta calculation, doublewidth and 'arabicshape'
handling). But it also makes sense by its own as a cleanup, and is thus
committed separately.
Before this change many of the low level grid functions grid_puts,
grid_fill etc could both be used in a standalone fashion but also as
part of a batched line update which would be finally transmitted as a
single grid_line call (via ui_line() ). This was initially useful to
quickly refactor pre-existing vim code to use batched logic safely.
However, this pattern is not really helpful for maintainable and newly
written code, where the "grid" and "row" arguments are just needlessly
repeated. This simplifies these calls to just use grid and row as
specified in the initial grid_line_start(grid, row) call.
This also makes the intent clear whether any grid_puts() call is actually
part of a batch or not, which is better in the long run when more things
get refactored to use effective (properly batched) updates.
|
|
|
|
|
|
|
| |
When tabstop and shiftwidth are not equal, tabs are inserted as individual
spaces and then rewritten as tab characters in a second pass. That second pass
did not call changed_bytes which resulted in events being omitted.
Fixes #25092
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode
closes: vim/vim#13001
closes: vim/vim#12115
https://github.com/vim/vim/commit/d69aecf141ff05a645d02f39f1cbf6381ed7d0c0
Co-authored-by: pierreganty <pierreganty@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the messy things when changing a non-current buffer is
not about the buffer, it is about windows. In particular, it is about
`curwin`.
When editing a non-current buffer which is displayed in some other
window in the current tabpage, one such window will be "borrowed" as the
curwin. But this means if two or more non-current windows displayed the buffers,
one of them will be treated differenty. this is not desirable.
In particular, with nvim_buf_set_text, cursor _column_ position was only
corrected for one single window. Two new tests are added: the test
with just one non-current window passes, but the one with two didn't.
Two corresponding such tests were also added for nvim_buf_set_lines.
This already worked correctly on master, but make sure this is
well-tested for future refactors.
Also, nvim_create_buf no longer invokes autocmds just because you happened
to use `scratch=true`. No option value was changed, therefore OptionSet
must not be fired.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ml_get_buf() takes a third parameters to indicate whether the
caller wants to mutate the memline data in place. However
the vast majority of the call sites is using this function
just to specify a buffer but without any mutation. This makes
it harder to grep for the places which actually perform mutation.
Solution: Remove the bool param from ml_get_buf(). it now works
like ml_get() except for a non-current buffer. Add a new
ml_get_buf_mut() function for the mutating use-case, which can
be grepped along with the other ml_replace() etc functions which
can modify the memline.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Wrong display with wrapping virtual text or unprintable chars,
'showbreak' and 'smoothscroll'.
Solution: Don't skip cells taken by 'showbreak' in screen lines before
"w_skipcol". Combined "n_skip" and "skip_cells".
closes: vim/vim#12597
https://github.com/vim/vim/commit/b557f4898208105b674df605403cac1b1292707b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: The mouse code is spread out.
Solution: Move all the mouse code to mouse.c. (Yegappan Lakshmanan,
closes vim/vim#4959)
https://github.com/vim/vim/commit/b20b9e14ddd8db111e886ad0494e15b955159426
Also move getmousepos() there.
N/A patches for version.c:
vim-patch:8.1.2070: mouse code is spread out
Problem: Mouse code is spread out.
Solution: Move mouse terminal code parsing to mouse.c. (Yegappan Lakshmanan,
closes vim/vim#4966)
https://github.com/vim/vim/commit/b8ff5c271ee5dcef6f63436b77e228e062ff9a0e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
Problem: No easy way to process postponed work. (Paul Jolly)
Solution: Add the SafeState autocommand event.
https://github.com/vim/vim/commit/8aeec40207b5adcd3a155277dc4f29189343b963
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
long is 32-bits even on 64-bit windows which makes the type suboptimal
for a codebase meant to be cross-platform.
|
|
|
|
|
|
|
|
|
|
|
| |
(#23884)
Problem: Cursor not adjusted when near top or bottom of window and
'splitkeep' is not "cursor".
Solution: Move boundary checks to outer cursor move functions, inner
functions should only return valid cursor positions. (Luuk van
Baal, closes vim/vim#12480)
https://github.com/vim/vim/commit/a109f39ef54bc3894768170f02c1b6ac56164488
|
|
|
|
|
|
|
|
|
|
|
| |
'cpo'
Problem: Bad redrawing with spell checking, using "C" and "$" in 'cpo'.
Solution: Do not redraw the next line when "$" is in 'cpo'. (closes vim/vim#11285)
https://github.com/vim/vim/commit/f3ef026c9897f1d2e3fba47166a4771d507dae91
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
line
Problem: With spell checking, deleting a full stop at the end of a line
does not update SpellCap at the start of the next line.
Solution: Update the next line when characters have been deleted. Also when
using undo.
https://github.com/vim/vim/commit/26f09ea54b2c60abf21df42c60bdfc60eca17b0d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: After exiting Insert mode spelling is not checked in the next
line.
Solution: When spelling is enabled redraw the next line after exiting Insert
mode in case the spell highlight needs updating.
https://github.com/vim/vim/commit/ee09fcc9b6cf24e02899461809da9a5148208ea5
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
Problem: Reading before the start of the line.
Solution: When displaying "$" check the column is not negative.
https://github.com/vim/vim/commit/e98c88c44c308edaea5994b8ad4363e65030968c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
| |
(#23599)
Problem: Text not scrolled when cursor moved with "g0" and "h".
Solution: Adjust w_skipcol when needed. (Luuk van Baal, closes vim/vim#12387)
https://github.com/vim/vim/commit/8667a5678f983ba899825b810ab849952d49bcb8
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Making a mapping work in all modes is complicated.
Solution: Add the <Cmd> special key. (Yegappan Lakshmanan, closes vim/vim#7282,
closes 4784, based on patch by Bjorn Linse)
https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d
Change docs to match Vim if it's wording is better.
Change error numbers to match Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
Problem: 'scrolloff' does not work well with 'smoothscroll'.
Solution: Make positioning the cursor a bit better. Rename functions.
https://github.com/vim/vim/commit/c9121f798f49fa71e814912cb186d89c164090c3
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>
|
|
|
|
| |
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
|
| |
|
|
|
| |
Closes https://github.com/neovim/neovim/issues/459
|
|
|
|
|
|
|
|
| |
Problem: Invalid memory access when ending insert mode.
Solution: Check if the insert_skip value is valid.
https://github.com/vim/vim/commit/1a08a3e2a584889f19b84a27672134649b73da58
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
|
|
|
|
|
|
|
| |
Problem: Cursor in wrong position when leaving insert mode.
Solution: Update the w_valid flags. Position the cursor also when not
redrawing. (closes vim/vim#12137)
https://github.com/vim/vim/commit/c174c2e58c9e24a75b189e01143e6d057b84e96e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|