| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vim-patch:9.2.1175: setreg() block width wrong for unprintable chars
When yanking, the width of a <c-v>{motion}y register
is determined by the virtual colums of the text. However
in setreg() in 'b' mode use an idosyncratic width measurement
where C0 control chars (ASCII 0x00 - 0x19) and invalid UTF-8 bytes
have width 1 instead of their display width (2 or 4 cells).
Consider the following test case:
let strings = ['"reference', '"Übel', "\"aa\x07bb", "\"qq\x82", "\"x\nbabbel"]
for string in strings
call append('$', string)
exec "normal G0\<c-v>$\"ay"
let one = getregtype('a')
if string != strings[-1]
call setreg("b", string, 'b')
let two = getregtype('b')
else
let two = "na"
endif
call setreg("c", [string], 'b')
let three = getregtype('c')
call append('$', '"yank: '.one.", string: ".two.", list: ".three)
endfor
AFter this fix, all the three ways of measuring the width gives
equal values (or two, in the case of not being able to use setreg()
with a plain string in the first case)
|
| |
|
|
|
|
|
|
| |
part of a series, next big one is gonna be bring utf_ptr2schar and
friends into the New world. after that it might be worth brushing of
some benchmarks and re-microoptimize the hottest loops.
also some const-y constess but it is fine.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This applies to the callsites which already used utf_ptr2CharInfo
and then utfc_next. There is more work to be done, but this
is a lagom bisectable unit.
A lot of code is still wounded by the historical distinction between
"low" characters (c < 128) and "high" characters, with the UTF-8
specific rules behind compiler flags and virtual function calls. As a
result, there are both ptr2cells() and utf_ptr2cells(). My work aims at
slowly reintegrating the realms. As such, we consider ptr2cells() the
"correct" abstraction as is matches what actually is printed in a
displayed message and buffer text without extra bells and whistles,
except for tabs.
|
| |
|
|
|
|
|
|
|
| |
These are not needed after #35129 but making uncrustify still play nice
with them was a bit tricky.
Unfortunately `uncrustify --update-config-with-doc` breaks strings
with backslashes. This issue has been reported upstream,
and in the meanwhile auto-update on every single run has been disabled.
|
| |
|
|
|
|
| |
We have changed too much to consider it a mere bundled dependency (such
as unicode handling in e3bfcf2fd4a4ebf00b104b082cfe83c8144a842d), and
can consider it our own at this point.
|
| |
|
|
|
|
|
|
|
| |
Use the grapheme break algorithm from utf8proc to support grapheme
clusters from recent unicode versions.
Handle variant selector VS16 turning some codepoints into double-width
emoji. This means we need to use ptr2cells rather than char2cells when
possible.
|
| |
|
|
|
|
|
|
|
|
|
| |
Before this change, "static inline" functions in headers needed to have
their function attributes specified in a completely different way. The
prototype had to be duplicated, and REAL_FATTR_ had to be used instead
of the public FUNC_ATTR_ names.
TODO: need a check that a "header.h.inline.generated.h" file is not
forgotten when the first "static inline" function with attributes
is added to a header (they would just be silently missing).
|
| |
|
|
|
|
| |
Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.
|
| |
|
| |
Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
The optimized virtual column calculation loop in getvcol()
was decoding the current character twice: once in ptr2cells()
and the second time in utfc_ptr2len(). For combining charcters, they were
decoded up to 2 times in utfc_ptr2len(). Additionally, the function used to
decode the character could be further optimised.
|
| |
|
|
|
|
| |
Remove `export` pramgas from defs headers as it causes IWYU to believe
that the definitions from the defs headers comes from main header, which
is not what we really want.
|
| |
|
|
| |
Reference: https://github.com/neovim/neovim/issues/6371.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| | |
|
| |
|
| |
Because typval_defs.h is enough for most of them.
|
| |
|
|
|
|
|
|
|
|
| |
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.
Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
|
| |
|
|
|
|
|
|
|
| |
Done automatically using the following perl command:
perl -pi -0777pe 's#\n\K */\*\n(.+?)\s*\*/\n#join("\n", map { $_ =~ s:^\s*\K \*://:; $_ } split("\n", $1)) . "\n"#sge' src/nvim/**/*.c
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
|
| |
Problem: It is not possible to specify cell widths of characters.
Solution: Add setcellwidths().
https://github.com/vim/vim/commit/08aac3c6192f0103cb87e280270a32b50e653be1
Co-Authored-By: delphinus <me@delphinus.dev>
|
| |
|
|
|
| |
This just avoids including mbyte.h in eval/typval.h, so that mbyte.h can
include eval/typval.h in Vim patch 8.2.1535.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
* refactor: format all C files under nvim
* refactor: disable formatting for Vim-owned files:
* src/nvim/indent_c.c
* src/nvim/regexp.c
* src/nvim/regexp_nfa.c
* src/nvim/testdir/samples/memfile_test.c
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Remove occurences of these macros.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
First step towards implemening issue #7401.
The same can be done for all deprecated mb_ functions in follow-up
patches.
|
| |
|
|
| |
wchar_t has better cross-platform support and seems to fix an issue
on MinGW when building with `-std=c99`.
|
| | |
|
| |
|
| |
Retires g:Nvim_color_expr callback.
|
| | |
|
| |\
| |
| | |
Closes #7149
|
| | | |
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #6463
refactor/single-include: file_search.h
Closes #6455
refactor/single-include: hardcopy.h
Closes #6457
refactor/single-include: if_cscope.h
Closes #6458
refactor/single-include: mark.h
Closes #6461
refactor/single-include: mbyte.h
Closes #6462
refactor/single-include: memline.h
Closes #6464
refactor/single-include: menu.h
Closes #6468
refactor/single-include: ops.h
Closes #6470
|
| | |
|
| |
|
|
| |
Also fixes buffer reusage in setmatches() and complete().
|
| | |
|