Problem: Vim gets confused by OSC handling, causing Vim to start in
search mode (Shane Harper, after v9.1.1703)
Solution: In handle_mapping(), check if we are handling OSC sequences
and if yes go straight to check_termcode() (Foxe Chen)
fixes: #19426closes: #19435
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Stop mentioning "home directory" in the rtp search locations 1. and 5.,
which is incorrect in case of XDG scheme. $MYVIMDIR is correct, so use
this instead.
closes: #19438
Signed-off-by: Andrey Butirsky <butirsky@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Unsafe string functions may lead to buffer overflows
Solution: Use vim_strncpy() instead of strpcy(), replace sprintf() by
vim_snprintf() (Yasuhiro Matsumoto)
closes: #19412
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: parallel make invocation may break Wayland header generation
Solution: Use single make target to generate Wayland protocol files.
(Jan Palus)
$(WAYLAND_SRC) contains up to 4 files which, given right timing and
parallelization level, can spawn 4 independent `make` processes during
parallel build. Each process generates same set of files intermittently
leading to inconsistent results. Instead use one common target each
source file depends on.
fixes: #19419closes: #19420
Signed-off-by: Jan Palus <jpalus@fastmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Build fails when wayland is not defined
(fjaell, after v9.2.0010)
Solution: Add ifdef GDK_WINDOWING_WAYLAND
(Christoffer Aasted)
fixes: #19429closes: #19428
Signed-off-by: Christoffer Aasted <chr.aasted@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Using the Wayland backend in GTK, rendering remains slow due
to per-line redraws, unnecessary Cairo push/pop groups, and
scroll operations that allocate new surfaces repeatedly.
Solution: Improve rendering performance (Christoffer Aasted).
This commit does the following:
- Add gui.is_wayland to detect Wayland backend
- Avoid blocking the input loop
- Skip early redraws; let the compositor handle full-screen redraws
- Use CAIRO_OPERATOR_SOURCE to overwrite instead of blend
- Reuse scroll source region for destination scroll region
- Optimize fast scroll-up
- Remove cairo_push_group/pop_group and cairo_clip in scroll path
to reduce allocations (~50MB saved on 4K fractional scale)
Since Wayland redraws the entire screen between updates (unlike X11),
further performance gains are possible by batching drawing in other code
paths, e.g.:
- message.c: batch lines to avoid scroll
- term.c: batch terminal redraws
These could be refactored later to deferred redraw with Wayland.
closes: #19062
Signed-off-by: Christoffer Aasted <dezzadk@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: the tests test_cindent_* functions were numbered
inconsistently, causing them to be executed in wrong order.
Solution: Rename the test_cindent functions with zero-padded numbers.
Signed-off-by: Christian Brabandt <cb@256bit.org>
- ':!' is not stable, so use system() to get more consistent behaviour.
- Only warns when using 'pwsh'.
- Remove trailing spaces.
closes: #19370
Co-Authored-by: @lxhillwind
Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: font size calculation may be wrong when font does
not specify a valid ascent value. (Char, after v9.1.2129)
Solution: Calculate ascent as a ratio of ascent to total font height
with a fallback if metrics are zero.
Fallback to default value when font does not specify ascent value.
As proposed in https://github.com/vim/vim/pull/19318#issuecomment-3864669253
related: #19318
closes: #19367
Signed-off-by: Char <peacech@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Comment lines which start like a label are recognized as a
label and indented based on that.
Solution: Check if the position is in a comment after recognizing a label
in cin_islabel (Anttoni Erkkilä)
closes: #19397
Signed-off-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: powershell commands wrongly wrapped when executed
Solution: Use &{ ... } to wrap commands when powershell/pwsh is in use
(Peter Lustig).
Allow compound commands with 'system()' when 'shell' is 'pwsh'
When the 'shell' option was set to 'powershell' or 'pwsh' and the
'system()' vimscript function was called with an argument containing two
or more shell commands (delimited by ';' or '&'), the function would
always fail with 'E282'.
The cause of the error was that VIM would wrap the shell command string
with parentheses (to allow the entire output to be redirected to a
temporary file for capturing) before actually passing it to the
PowerShell process for execution.
Unlike the typical shell that uses parentheses to group commands (and
possibly spawn a subshell), PowerShell uses them to resolve a single
command (pipeline) to an expression. To group multiple commands with
PowerShell, you must instead wrap them with either the subexpression
operator '$(...)' or an immediately evaluated script block '& { ... }'.
The latter option may be more efficient since it does not buffer its
output like for the former one does.
closes: #19401
Signed-off-by: Peter Lustig <tiamatX18@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity reports unreachable code, CID: 1681310
Solution: Drop the ternary checking for non-NULL of from_encoding_raw.
closes: #19402
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Makefile: dosrt target fails because of duplicate lang directories
Solution: Rename the parent lang/ directory to readme/
Signed-off-by: Christian Brabandt <cb@256bit.org>
Remove `nextgroup=shComment` from the `shEscape` syntax pattern.
This was causing `#` characters after escape sequences inside
double-quoted strings to be misinterpreted as comments, breaking
highlighting for the rest of the file.
Add a test case for escaped characters followed by # in double quotes.
fixes: #19053closes: #19414
Signed-off-by: Bozhidar Batsov <bozhidar@batsov.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: str2specialbuf() can be improved
Solution: Optimize str2specialbuf function in message.c
(Yasuhiro Matsumoto)
closes: #19415
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_popup_setbuf fails, because the dump file contains
a reference to Vim version 9.1 (after v9.2.0000)
Solution: Replace Version number by 9.1 always.
closes: #19406
Signed-off-by: Christian Brabandt <cb@256bit.org>
Effective use of 'formatprg' requires both an understanding of the
specific capabilities of the formatting tool and Vim's formatting
commands. This is overly burdensome for some users.
Rather than address each complaint on a filetype by filetype basis,
remove 'formatprg' settings from all ftplugins.
It is expected that formatter plugins will be available in the near
future as a better solution. See #17145 (Add "formatter" feature using
"compiler" as a template).
Note: 'formatprg' will be removed from older ftplugins after the release
of Vim 9.2. The setting was added to the go and gleam ftplugins during
the current development cycle and have not been included in a Vim
release.
See: #18650 (rust.vim: stop setting formatprg to rustfmt)
closes: #19108
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The username/group/netgroup patterns used \l\+ which only matched
lowercase letters. Linux usernames commonly contain hyphens, digits,
and underscores (e.g. www-data, deploy01, test_user).
Update the pattern to \l[-a-z0-9_]* to allow matching the additional
characters "-_" and numbers.
fixes: #18963closes: #19396
Signed-off-by: Bozhidar Batsov <bozhidar@batsov.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Use ellipses, matching the file's general style, rather than hard
truncation of overlength tail comments in examples.
closes: #19298
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Installing man pages does not change the placeholder file paths
Solution: Update the sed patterns in installman.sh
Additionally we remove the sed command to update the path to the ps Vim
files for those reasons:
- All the postscript files were moved to the print/ subdirectory in
Commit e37d50a
- the sed command was wrongly quoting $vimloc so would wrongly try to
search for the literal value $vimloc instead of using the expanded
value.
related: ce6fe84db2
closes: #19382
Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Amend syntax highlighting to allow for ksh93 discipline function names
(e.g. 'foo.get()') and mksh's odd function naming idiosyncrasies
(shNamespaceOne was introduced to enforce stricter naming rules for
ksh93 namespaces).
- Remove 'bind' from ksh93 syntax (such a builtin has never been
implemented in ksh93).
- 'xgrep' is only available in ksh93v- as an alternative way to
invoke the builtin 'grep -X', so reflect that in the syntax
highlighting.
- Forbid bash-style 'function name() {' syntax when highlighting
ksh88 and ksh93 scripts.
- Fix bug causing ' ()' to be incorrectly validated in mksh scripts.
- Add the many ksh93/ksh2020 .sh.* variables to the list of special
variables.
- Amend iskeyword to allow '.' so that '.sh.tilde.get' and such are
valid function names/variable names. (For mksh functions starting
with odd characters like '%' and '@' this would probably have too
many bad side effects, so I've omitted such a change for that shell.)
- Add new syntax tests and regenerate syntax dump files
closes: #19383
Signed-off-by: Johnothan King <johnothanking@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
We add new key exchange algorithms and new enums for PubkeyAuthOptions.
We also add new keywords from sshd_config.5 not present here and remove
keywords present here that are not present in the official
documentation, with the exception of those patched in by Debian and
Fedora, as well as ChallengeResponseAuthentication which is deprecated
but still functional.
closes: #19347
Signed-off-by: Fionn Fitzmaurice <git@fionn.computer>
Signed-off-by: Jakub Jelen <jakuje@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Dynamically set mark "`" to pair disparate lines and
initially set marks "`a", "`b", etc. for as many lines in
the difference part. Note that users are free to delete
or change any set alphabetic marks without it affecting
the dynamic updating of mark "`"; alphabetic marks only
serve to help with arriving at "summary" lines, e.g.
"`a````".
- Create a fold for the difference part (but defer to users
the closing of it) so that disparate lines that fit real
estate can be viewed at the same time, as an alternative
to the builtin "s" keystroke that swaps top and bottom
parts in place.
- Fold and mark lines with the "git difftool" extension too.
closes: #19380
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: `gf` in Vim script fails if multiple target files exist.
Solution: Use globpath() which returns an array.
In a Vim script, `gf` on `some#func()` will jump to `autoload/some.vim`.
In this case, if there are multiple `autoload/foo.vim`s in
'runtimepath', `globpath(&runtimepath, path)` will return multiple
paths, separated by newlines.
As a result, the second and subsequent paths will be executed as
commands in `autoload/vimgoto.vim:195`, causing an error.
This change fixes this issue by making the result of `globpath()` an
array.
closes: #19379
Signed-off-by: thinca <thinca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>