Commit Graph

781 Commits

Author SHA1 Message Date
91c192922d vim-patch:9.0.0915: WinScrolled may trigger immediately when defined
Problem:    WinScrolled may trigger immediately when defined.
Solution:   Initialize the fields in all windows. (closes vim/vim#11582)

2996773276

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-20 21:24:22 +08:00
035d41ac5e vim-patch:partial:9.0.0913: only change in current window triggers the WinScrolled event
Problem:    Only a change in the current window triggers the WinScrolled
            event.
Solution:   Trigger WinScrolled if any window scrolled or changed size.
            (issue vim/vim#11576)

0a60f79fd0

Skip locking of window layout and E1312.
Copy the latest version of all WinScrolled tests from Vim.
Note: patch 9.0.0915 is needed for the Lua tests to pass.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-20 21:11:37 +08:00
66360675cf build: allow IWYU to fix includes for all .c files
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.
2022-11-15 10:30:03 +01:00
69507c0204 refactor: move tabline code to statusline.c (#21008)
* refactor: move tabline code to statusline.c

Problem:	Tabline code is closely related to statusline, but still left over in drawscreen.c and screen.c.
Solution:	Move it to statusline.c.

* refactor: add statusline_defs.h
2022-11-10 19:05:16 +08:00
fae7540732 Merge pull request #20821 from dundargoc/refactor/clang-tidy
refactor: fix clang-tidy warnings
2022-11-08 09:48:48 +01:00
1af4bd04f9 feat(ui): add support to display a title in the border of a float (#20184)
add "title" and "title_pos" keys to win config dict.
2022-11-06 11:59:43 +01:00
731cdde28e refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning.

Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
2022-11-06 11:44:10 +01:00
a79d28e4d7 vim-patch:9.0.0265: no good reason why the "gf" command isn't in the tiny version (#20964)
Problem:    No good reason why the "gf" command is not in the tiny version.
Solution:   Graduate the file_in_path feature.

f80f40a55c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-06 17:58:13 +08:00
419ee612e6 vim-patch:9.0.0825: cannot drag an entry in the tabpage line
Problem:    Cannot drag an entry in the tabpage line.
Solution:   Clear dragwin instead of got_click. (closes vim/vim#11483,
            closes vim/vim#11482)

8e0ccb6bc2

Omit Test_term_mouse_drag_to_move_tab(): covered by ui/mouse_spec.lua.
2022-11-02 08:06:44 +08:00
20bd4d8997 vim-patch:9.0.0823: mouse drag test fails
Problem:    Mouse drag test fails.
Solution:   Only reset the mouse click flag when actually switching to another
            tab page.  Disable test that keeps failing.

7a7db047dc

Omit test_termcodes.vim change: reverted in patch 9.0.0825.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-02 08:06:23 +08:00
a600e73007 vim-patch:9.0.0822: crash when dragging the statusline with a mapping
Problem:    Crash when dragging the statusline with a mapping.
Solution:   Check for valid window pointer. (issue vim/vim#11427)

8ab9ca93ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-02 08:03:44 +08:00
784e498c4a refactor: clang-tidy fixes to silence clangd warning (#20683)
* refactor: readability-uppercase-literal-suffix

* refactor: readability-named-parameter

* refactor: bugprone-suspicious-string-compare

* refactor: google-readability-casting

* refactor: readability-redundant-control-flow

* refactor: bugprone-too-small-loop-variable

* refactor: readability-non-const-parameter

* refactor: readability-avoid-const-params-in-decls

* refactor: google-readability-todo

* refactor: readability-inconsistent-declaration-parameter-name

* refactor: bugprone-suspicious-missing-comma

* refactor: remove noisy or slow warnings
2022-10-21 20:47:44 +08:00
a5a5e27323 refactor(window.c): reduce scope of locals (#20301) 2022-10-18 23:06:10 +01:00
46eabe1ac1 fix: 'scroll' is not set correctly for floats with 'splitkeep'
vim-patch:9.0.0780: 'scroll' value computed in unexpected location

Problem:    'scroll' value computed in unexpected location.
Solution:   Compute 'scroll' when the window height is changed. (Luuk van
            Baal, closes vim/vim#11387)
a1a46da87d
2022-10-17 21:28:30 +08:00
0578c67767 vim-patch:9.0.0747: too many #ifdefs (#20641)
Problem:    Too many #ifdefs.
Solution:   Gradudate the +cmdline_info feature. (Martin Tournoij,
            closes vim/vim#11330)
ba43e76fcd
2022-10-14 07:29:58 +08:00
cd1e0bb87d vim-patch:8.2.4462: not enough testing for quickfix code
Problem:    Not enough testing for quickfix code.
Solution:   Add more tests. Fix uncovered problem. (Yegappan Lakshmanan,
            closes vim/vim#9839)
9c9be05b17

Omit Test_helpgrep_vim9_restore_cpo().
Cherry-pick test_quickfix.vim change from patch 8.2.0644.
2022-10-13 10:20:42 +08:00
0ef6aaa3a7 refactor: clint (#20600) 2022-10-12 14:53:40 +01:00
3b562535c3 vim-patch:8.2.4523: when gvim is started maximized the 'window' option isn't set
Problem:    When gvim is started maximized the 'window' option isn't set
            properly. (Christian J. Robinson)
Solution:   Check if 'windows' was already set or not. (Ken Takata,
            closes vim/vim#9904)
6ca883dd8a
2022-10-12 07:48:25 +08:00
cfdb4cbada fix: find multibyte file name in line (#20519)
And remove unnecessary unsigned casts in fold marker comparison.
2022-10-07 09:43:16 +08:00
d191070913 fix(ui): setting 'cmdheight' with global statusline (#20515) 2022-10-07 08:52:51 +08:00
25dea99ce5 vim-patch:9.0.0670: no space for command line when there is a tabline (#20512)
Problem:    No space for command line when there is a tabline.
Solution:   Correct computation of where the command line should be.
            (closes vim/vim#11295)
c9f5f73206
2022-10-06 20:03:59 +08:00
5acf52e19b feat(window/ui): add splitkeep option (#19243)
vim-patch:9.0.0445: when opening/closing window text moves up/down

Problem:    When opening/closing window text moves up/down.
Solution:   Add the 'splitscroll' option.  When off text will keep its
            position as much as possible.
29ab524358

vim-patch:9.0.0455: a few problems with 'splitscroll'

Problem:    A few problems with 'splitscroll'.
Solution:   Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117)
5ed391708a

vim-patch:9.0.0461: 'scroll' is not always updated

Problem:    'scroll' is not always updated.
Solution:   Call win_init_size() at the right place.
470a14140b

vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off

Problem:    Cursor moves when cmdwin is closed when 'splitscroll' is off.
Solution:   Temporarily set 'splitscroll' when jumping back to the original
            window. (closes vim/vim#11128)
e697d48890

vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off

Problem:    Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution:   Skip win_fix_cursor if called when cmdwin is open or closing.
            (Luuk van Baal, closes vim/vim#11134)
3735f11050

vim-patch:9.0.0478: test for 'splitscroll' takes too much time

Problem:    Test for 'splitscroll' takes too much time.
Solution:   Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139)
594f9e09cd

vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help

Problem:    Text scrolled with 'nosplitscroll', autocmd win opened and help
            window closed.
Solution:   Skip win_fix_scroll() in more situations. (Luuk van Baal,
            closes vim/vim#11150)
d5bc762dea

vim-patch:9.0.0505: various problems with 'nosplitscroll'

Problem:    Various problems with 'nosplitscroll'.
Solution:   Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166)
faf1d412f5

vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin

Problem:    Scrolling with 'nosplitscroll' in callback changing curwin.
Solution:   Invalidate w_cline_row in the right place. (Luuk van Baal,
            closes vim/vim#11185)
20e58561ab

vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly

Problem:    With 'nosplitscroll' folds are not handled correctly.
Solution:   Take care of closed folds when moving the cursor. (Luuk van Baal,
            closes vim/vim#11234)
7c1cbb6cd4

vim-patch:9.0.0605: dump file missing

Problem:    Dump file missing.
Solution:   Add the missing dump file. (issue vim/vim#11234)
439a2ba174

vim-patch:9.0.0647: the 'splitscroll' option is not a good name

Problem:    The 'splitscroll' option is not a good name.
Solution:   Rename 'splitscroll' to 'splitkeep' and make it a string option,
            also supporting "topline". (Luuk van Baal, closes vim/vim#11258)
13ece2ae1d

vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen"

Problem:    ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution:   Check the botline is not too large. (Luuk van Baal,
            closes vim/vim#11293, closes vim/vim#11292)
346823d3e5
2022-10-06 14:57:52 +08:00
bc64aa435b vim-patch:9.0.0665: setting 'cmdheight' has no effect if last window was resized (#20500)
Problem:    Setting 'cmdheight' has no effect if last window was resized.
Solution:   Do apply 'cmdheight' when told to.  Use the frame height instead
            of the cmdline_row.  (closes vim/vim#11286)
0816f473ab
2022-10-06 09:03:49 +08:00
7746f641b8 fix(options): no matter what is said, 'cmdheight' is tab-local (susy baka) 2022-10-05 20:12:59 +02:00
cb310d2901 vim-patch:9.0.0622: matchaddpos() can get slow when adding many matches
Problem:    matchaddpos() can get slow when adding many matches.
Solution:   Update the next available match ID when manually picking an ID and
            remove check if the available ID can be used. (idea by Rick Howe)
9f573a8df0
2022-10-02 07:28:38 +08:00
df646572c5 docs: fix typos (#20394)
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-30 09:53:52 +02:00
e6c214033a fix(window): fix equalization with cmdheight=0 (#20369) 2022-09-28 06:22:11 +08:00
c28f00b101 vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
Problem:    Crash when closing a tabpage and buffer is NULL.
Solution:   Adjust how autocommands are triggered when closing a window.
            (closes vim/vim#11198, closes vim/vim#11197)
62de54b48d
2022-09-23 07:38:22 +08:00
2083c1771a fix(window): close floats first when closing buffer in other tab (#20284) 2022-09-22 20:25:34 +08:00
00cfc1dceb fix(redraw): avoid unnecessary redraws and glitches with floats+messages
fixes #20106
fixes #20229
2022-09-22 10:36:23 +02:00
708bd68651 feat(ui): use msg_grid based implementation for cmdheight=0 2022-09-15 12:13:43 +02:00
3ff46544c9 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-11 13:28:59 +02:00
ead524656d vim-patch:9.0.0403: 'equalalways' may be off when 'laststatus' is zero (#20109)
Problem:    'equalalways' may be off when 'laststatus' is zero.
Solution:   call last_status() before win_equal(). (Luuk van Baal,
            closes https://github.com/vim/vim/pull/11070)
fd7e60a33d
2022-09-07 18:08:00 +02:00
87e037e26c fix(cmdheight=0): various issues part3 #19816
And fixed in https://github.com/neovim/neovim/pull/19801 regression.

Fix #19834
Fix #19184
2022-09-06 07:33:25 -07:00
12afc344de refactor: migrate comment style 2 #20080 2022-09-06 07:23:00 -07:00
1ffd527c83 refactor: migrate comment style (#20012)
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>
2022-09-02 17:39:49 +01:00
69456f3414 Merge pull request #20026 from dundargoc/refactor/char_u/7
refactor: replace char_u with char 7: remove `vim_strnsave`
2022-09-02 17:06:00 +02:00
c65b1f3e15 vim-patch:9.0.0342: ":wincmd =" equalizes in two directions
Problem:    ":wincmd =" equalizes in two directions.
Solution:   Make ":vertical wincmd =" equalize vertically only and
            ":horizontal wincmd =" equalize horizontally only.
21c3a80a7f
2022-09-01 20:25:29 +08:00
49e893f296 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-01 10:47:42 +02:00
fb1edb2f57 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 13:47:18 +02:00
518b5c65b0 vim-patch:8.1.2037: can call win_gotoid() in cmdline window (#20015)
Problem:    Can call win_gotoid() in cmdline window.
Solution:   Disallow switching windows. (Yasuhiro Matsumoto, closes vim/vim#4940)
a046b37c22
2022-08-31 06:58:28 +08:00
2828aae7b4 refactor: replace char_u with char 4 (#19987)
* refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2022-08-30 14:52:09 +02:00
8fd66ff5c5 fix(redraw): handle switching to a tabpage with larger p_ch value 2022-08-29 21:58:07 +02:00
58f30a326f refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-29 15:48:56 +02:00
1dcaa75a65 fix(events): triggered WinScrolled when only skipcol changed (#19972)
fix(events): trigger WinScrolled when only skipcol changed

vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes

Problem:    WinScrolled is not triggered when only skipcol changes.
Solution:   Add w_last_skipcol and use it. (closes vim/vim#10998)
670ab0334b
2022-08-29 06:16:20 +08:00
2498e9feb0 refactor: change FALSE/TRUE to false/true
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-26 09:36:55 +01:00
40855b0143 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-25 18:59:12 +02:00
93f24403f8 refactor: pre-incr to post-incr 2022-08-25 13:10:41 +01:00
a4e4609d62 fix(path): path_is_url returns false for "foo:/" #19797
Problem:
path_to_url() returns false for single-slash URIs ("foo:/" vs "foo://").
This is not compliant with the URI spec. https://url.spec.whatwg.org/#url-representation
LSP in particular allows single-slash URIs.

Solution:
Relax path_to_url() to accept single-slash URIs. This is not fully
compliant (only ":" is required by the spec), but it is hopefully good
enough without causing false-positives in typical text files.

ref https://url.spec.whatwg.org/#windows-drive-letter
ref https://github.com/neovim/neovim/pull/19773
ref https://github.com/neovim/neovim/pull/19773#issuecomment-1214763769
2022-08-23 23:38:06 -07:00
6cc6e11929 vim-patch:9.0.0206: redraw flags are not named specifically (#19913)
Problem:    Redraw flags are not named specifically.
Solution:   Prefix "UPD_" to the flags, for UPDate_screen().
a4d158b3c8
2022-08-23 22:00:19 +08:00