Commit Graph

955 Commits

Author SHA1 Message Date
zeertzjq
ef595e9b93 test: add a test for #13916 2022-04-01 20:14:01 +08:00
zeertzjq
139828cc7e vim-patch:8.2.4660: cursorcolumn is sometimes not correct
Problem:    Cursorcolumn is sometimes not correct.
Solution:   Recompute the cursor column when entering Insert mode and the
            cursor is on a character wider than a screen cell.
782c6744b4
2022-04-01 19:53:40 +08:00
bfredl
b2bd800416
Merge pull request #17890 from zeertzjq/conceal-virtcol-changed
perf: only redraw concealed line if cursor has moved horizontally
2022-03-31 10:56:15 +02:00
zeertzjq
0d4bd420c1
fix: correct vertical dragging room calculation with global statusline (#17928)
This fixes the bug that win_move_statusline() or mouse dragging cannot
reduce 'cmdheight' to 1 when global statusline is used.
2022-03-31 08:40:17 +08:00
zeertzjq
a9665bb12c
fix(event-loop): duplicate display updating logic in vgetorpeek() (#17913) 2022-03-30 05:25:00 +08:00
zeertzjq
ba257d74b1
fix(decorations): do not put empty virt_text (#17872) 2022-03-29 19:56:45 +08:00
zeertzjq
595c1a724a perf: only redraw concealed line if cursor has moved horizontally
Building upon #17889, this moves conceal redrawing logic into move.c, so
that concealed line is only redrawn if cursor has moved horizontally.
2022-03-28 10:23:32 +08:00
zeertzjq
ab02b28b4e vim-patch:8.2.4630: 'cursorline' not always updated with 'culopt' is "screenline"
Problem:    'cursorline' not always updated with 'cursorlineopt' is
            "screenline".
Solution:   Call check_redraw_cursorline() more often. (closes vim/vim#10013)
bf269ed0b0

Code was reverted in patch 8.2.4638, so this just ports the test.
2022-03-28 06:15:26 +08:00
zeertzjq
4baeb96c1b vim-patch:8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Problem:    Superfluous check if a redraw is needed for 'cursorline'.
Solution:   Remove check_redraw_cursorline(). (closes vim/vim#10030, closes vim/vim#10029)
3e559cd884

redraw_after_callback() is N/A.
Omits changes that just revert code from patch 8.2.4630.
2022-03-28 06:15:26 +08:00
dundargoc
61205c1def
chore: fix typos (#17755)
Co-authored-by: Jordan Haine <jhaine@securitycompass.com>
2022-03-25 19:57:59 +01:00
zeertzjq
3b28bd57f9
Merge pull request #17821 from zeertzjq/vim-patch-cursorline
vim-patch:8.2.{4591,4614}: cursorline redrawing
2022-03-24 20:28:46 +08:00
bfredl
ed88ca7503 feat(input): enable <tab>/<c-i>, <cr>/<c-m>, <esc>/<c-[> pairs unconditionally 2022-03-24 11:02:39 +01:00
zeertzjq
3e9b4e917d vim-patch:8.2.4591: cursor line not updated when a callback moves the cursor
Problem:    Cursor line not updated when a callback moves the cursor.
Solution:   Check if the cursor moved. (closes vim/vim#9970)
e7a74d5375

redraw_after_callback() is N/A. Nvim handles timers on the main loop.
2022-03-24 16:08:59 +08:00
zeertzjq
a72f338d76
fix(float): do not switch window before deleting last listed buffer (#17840)
Just allow close_windows() to close the current window instead.
This fixes wrong working directory or autocommands not being triggered.
2022-03-24 14:53:20 +08:00
zeertzjq
ff82b2785f
fix(float): don't always switch window when deleting last listed buffer (#17836) 2022-03-24 11:56:22 +08:00
zeertzjq
2e36117840
test: add test for deleting last listed buffer when there are floats (#17833) 2022-03-24 09:28:23 +08:00
zeertzjq
a9359dca37 fix(float): make laststatus=1 behave consistently with floating windows 2022-03-23 09:07:21 +08:00
zeertzjq
3fdb7b528d fix(float): handle buffer deletion with floating windows 2022-03-23 09:07:21 +08:00
zeertzjq
3539456f49 fix(win_close): count the window the be closed instead of curwin 2022-03-23 09:07:21 +08:00
zeertzjq
7735163652
fix(screen): do not do syntax highlighting at filler or folded lines (#17818) 2022-03-23 07:07:34 +08:00
bfredl
3c7e937a89
Merge pull request #17266 from famiu/feat/ui/global-statusline
feat(statusline): add global statusline
2022-03-17 20:16:39 +01:00
Famiu Haque
5ab1229174 feat: add support for global statusline
Ref: #9342

Adds the option to have a single global statusline for the current window at the bottom of the screen instead of a statusline at the bottom of every window. Enabled by setting `laststatus = 3`.

Due to the fact that statuslines at the bottom of windows are removed when global statusline is enabled, horizontal separators are used instead to separate horizontal splits. The horizontal separator character is configurable through the`horiz` item in `'fillchars'`. Separator connector characters are also used to connect the horizontal and vertical separators together, which are also configurable through the `horizup`, `horizdown`, `vertleft`, `vertright` and `verthoriz` items in `fillchars`.

The window separators are highlighted using the `WinSeparator` highlight group, which supersedes `VertSplit` and is linked to `VertSplit` by default in order to maintain backwards compatibility.
2022-03-18 00:21:41 +06:00
dundargoc
a7b1c8893c
chore: fix typos (#17331)
Co-authored-by: Hongyi Lyu <hongyi.lyu95@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: notomo <notomo.motono@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-10 14:34:55 +08:00
bfredl
a978d7689d
Merge pull request #17640 from lewis6991/virttextfix
fix(extmarks): fix signs
2022-03-09 13:41:13 +01:00
Lewis Russell
2ab2af598e fix(extmarks): fix signs
Don't add sign extmarks to state->active. Instead when drawing signs,
perform a full line scan for sign marks. This allows decor_redraw_line
to be moved back inside the `!number_only` block in screen.c, which
prevents decor scans when redrawing the number column when
'relativenumber' is set.

Fixes: #17638
2022-03-08 22:08:57 +00:00
zeertzjq
2adc24b18b test: add a Lua screen test for CursorLineNr in diff mode
Remove a useless test added in #14190
2022-03-08 10:11:20 +08:00
bfredl
72a04bda90
Merge pull request #16897 from lewis6991/signs
feat(decorations): support signs
2022-03-06 14:09:01 +01:00
Lewis Russell
30e4cc3b3f feat(decorations): support signs
Add the following options to extmarks:
  - sign_text
  - sign_hl_group
  - number_hl_group
  - line_hl_group
  - cursorline_hl_group

Note: ranges are unsupported and decorations are only applied to
start_row
2022-03-05 16:51:59 +00:00
Kirill Chibisov
f89fb41a7a
feat(tui): add support for CSI 4 : [2,4,5] m
This commit finishes support for colored and styled underlines adding
`CSI 4 : [2,4,5] m` support providing double, dashed, and dotted
underlines

Fixes #17362.
2022-03-03 23:35:36 +03:00
zeertzjq
85de9b06ed
Merge pull request #17578 from zeertzjq/test-warning-poke
test: mention poke_eventloop() instead of wait()
2022-03-03 06:23:10 +08:00
zeertzjq
ede4eac61f test: mention poke_eventloop() instead of wait() 2022-03-02 22:31:20 +08:00
bfredl
5ecb2cb539 fix(test): only use buffer completion in popupmenu timer test 2022-03-02 09:15:49 +01:00
zeertzjq
8bf3a3e303
Merge pull request #17432 from zeertzjq/vim-8.1.2336
vim-patch:8.1.2336,8.2.{4338,4401}: mapping cursor and redrawing patches
2022-02-27 10:51:11 +08:00
zeertzjq
41f309adeb
Merge pull request #17527 from zeertzjq/test-pending-win32
test: use helpers.pending_win32(pending) instead of iswin()
2022-02-26 21:17:38 +08:00
bfredl
8dd3d40f5c
Merge pull request #17472 from lewis6991/signcol_improvements
signcol improvements
2022-02-26 13:37:01 +01:00
zeertzjq
0545bd2180 test: use helpers.pending_win32(pending) instead of iswin() 2022-02-26 19:40:11 +08:00
Lewis Russell
9d53791cf8 fix(signcol): update cursor when signcol changes
Fixes #14195
2022-02-24 22:36:00 +00:00
Dundar Göc
82c5a02050 ci: skip tests that fail on windows 2022-02-20 10:22:39 +01:00
Jay Sandhu
80a3018a09 test: add some tests for :*map <expr>
Add tests for:
 - Cursor position restored after :map expr
 - Cursor position restored after :imap expr
 - Error in :cmap expr handled correctly

Cherry-picked from #12837
2022-02-17 08:45:15 +08:00
Christian Clason
1b73ae653f
Merge pull request #16914 from godlygeek/fix_14587
fix(screen): don't put empty sign text in line number column
2022-02-13 11:41:17 +01:00
zeertzjq
4ca522fd02 test: convert some colorcolumn tests to Lua screen tests 2022-02-12 06:36:17 +08:00
Rom Grk
85ae04dbfd fix: close floating windows when calling win_close() 2022-02-10 15:26:40 +00:00
bfredl
f0699f4356
Merge pull request #17279 from zeertzjq/state-enter-vpeekc
fix(event-loop): call vpeekc() directly first to check for character
2022-02-06 19:22:02 +01:00
zeertzjq
8215c05945
Merge pull request #17194 from zeertzjq/inccommand-prev-sub
fix(inccommand): do not change reg_prev_sub when previewing
2022-02-06 10:18:59 +08:00
zeertzjq
9b0363d365 vim-patch:8.2.1128: the write message mentions characters, but it's bytes
Problem:    The write message mentions characters, but it's actually bytes.
Solution:   Change "C" to "B" and "characters" to "bytes".
3f40ce78f5
2022-02-04 22:17:25 +08:00
zeertzjq
74998b0449 fix(event-loop): call vpeekc() directly first to check for character
Expand mappings first by calling `vpeekc()` directly.
2022-02-03 13:43:48 +08:00
bfredl
4b719e4a16
Merge pull request #17192 from zeertzjq/aucmd-redrawingdisabled
fix: set RedrawingDisabled before entering aucmd_win
2022-01-29 19:16:48 +01:00
bfredl
ca3e382a4f
Merge pull request #17183 from notomo/expose-extmark-right-gravity
feat(api): expose extmark right_gravity and end_right_gravity
2022-01-28 12:38:56 +01:00
zeertzjq
69f37197c0
fix(completion): update submode message when selecting from API (#17022) 2022-01-28 07:55:10 +08:00
bfredl
f1b91fcdbd
Merge pull request #17102 from zeertzjq/vim-8.2.1762
vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
2022-01-27 08:31:17 +01:00
zeertzjq
d11bbacf0f fix(inccommand): do not change reg_prev_sub when previewing 2022-01-25 16:18:58 +08:00
zeertzjq
dd21e21e97 fix: set RedrawingDisabled before entering aucmd_win 2022-01-25 09:44:37 +08:00
notomo
3d9ae9d2da feat(api): expose extmark right_gravity and end_right_gravity 2022-01-24 09:52:13 +09:00
bfredl
e07a4b97f6
Merge pull request #16936 from zeertzjq/no-escape-csi
input: never escape CSI bytes and clean up related names and comments
2022-01-21 18:04:40 +01:00
zeertzjq
ff7c3d1275 fix(input): never escape CSI bytes 2022-01-21 18:08:56 +08:00
notomo
5971b86338 feat(api): expose extmark more details 2022-01-20 13:25:46 +09:00
zeertzjq
8e945c2524 vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
Problem:    When a timer uses :stopinsert Insert mode completion isn't
            stopped. (Stanley Chan)
Solution:   Call ins_compl_prep(ESC).
d0e1b7103c
2022-01-15 22:33:16 +08:00
zeertzjq
c7aa64631d feat(completion): support selecting item via API from Lua mapping 2022-01-11 13:59:39 +08:00
Matt Wozniski
4ddd6c53bd fix(screen): don't put empty sign text in line number column
When `signcolumn=number` but no sign on a given line has any text,
display the line's line number instead of the (empty) sign text in the
line number column.
2022-01-04 01:49:40 -05:00
zeertzjq
e6d35b9e40 fix(pum_redraw): use grid_puts_len() to truncate the text
Nvim already resizes grid to the required width, so there is no need to
truncate the text in pum_redraw(). What's more, truncation is currently
done incorrectly because Vim patch 8.2.1995 was ported incorrectly.

This nearly reverts the truncation part of Vim patch 8.2.1995, but not
the part that reduces unnecessary calls to pum_redraw(). The original PR
https://github.com/vim/vim/pull/7306 didn't explain much about which
part of it actually reduces redraws.
2021-12-24 08:06:27 +08:00
Gregory Anders
ed35e20640
test(fold): add test for CursorLineFold 2021-12-08 21:47:59 -05:00
Gregory Anders
931f499d9a
test(sign): add test for culhl option 2021-12-08 21:47:59 -05:00
James McCoy
e8f9262125
vim-patch:8.2.3664: cannot adjust sign highlighting for 'cursorline'
Problem:    Cannot adjust sign highlighting for 'cursorline'.
Solution:   Add CursorLineSign and CursorLineFold highlight groups.
            (Gregory Anders, closes vim/vim#9201)
e413ea04b7
2021-12-08 21:47:58 -05:00
Björn Linse
be768be6b7
Merge pull request #16556 from zeertzjq/hl-change-update
fix(highlight): always update window highlight if highlight changed
2021-12-07 18:41:17 +01:00
zeertzjq
b326bf5f41 fix(screen): do not draw filler lines post eof if already at last row 2021-12-07 23:19:56 +08:00
zeertzjq
23dcef9269 fix(highlight): always update window highlight if highlight changed 2021-12-07 20:48:39 +08:00
Daniel Steinberg
e8631cb8a6
fix(float): skip non-focusable windows for :windo (#15378) 2021-11-11 11:05:18 -07:00
Björn Linse
77c54fc995
Merge pull request #16155 from zeertzjq/fix-redr-border-corruption
fix(float): fix potential heap corruption in win_redr_border
2021-11-06 22:32:28 +01:00
Gregory Anders
03b805aee6
feat(lua): enable stack traces in error output (#16228) 2021-11-06 08:26:10 -06:00
Björn Linse
995dbd2ca6 fix(extmark): fix missing virt_lines when using id param of set_extmark 2021-11-01 22:57:33 +01:00
Jaehwang Jerry Jung
bb79e05f81
vim-patch:8.2.3556: filler lines are incorrect for other window in diff mode (#16164)
Problem:    Filler lines are incorrect for other window in diff mode after
            making a change.
Solution:   Copy filler lines from the current window. (closes vim/vim#8809)
841c225b9e
2021-10-28 22:04:57 -04:00
zeertzjq
7ff1bc18a9 fix(float): redraw if w_border_adj changed 2021-10-28 06:32:36 +08:00
zeertzjq
de670f3809 fix(float): fix potential heap corruption in win_redr_border 2021-10-28 06:32:36 +08:00
Björn Linse
8d7816cf27 feat(decorations): support more than one virt_lines block 2021-10-23 14:17:09 +02:00
Björn Linse
810da1a702 fix(mouse): correct dragged position in composed layout 2021-10-04 21:00:42 +02:00
Björn Linse
3beea1fe1b
Merge pull request #15516 from bfredl/keyset
refactor(api): Represent option dicts as a structs in C and reduce conversion overhead from lua
2021-10-03 14:31:53 +02:00
Björn Linse
32565922ef refactor(api): handle option dicts properly
Do not copy a lot of lua strings (dict keys) to just strequal() them
Just compare them directly to a dedicated hash function.

feat(generators): HASHY McHASHFACE
2021-10-03 10:46:57 +02:00
Sean Dewar
0c06da1f0a
fix(nvim_open_win): crash if autocmds delete buffer/window #15549
win_set_buf can trigger autocmds if noautocmd=false. If they close the window,
code afterwards will dereference the freed win_T* wp pointer.

This interaction became possible after commit 1def3d1542.

The reason deleting curbuf crashes, and not the buf passed to
`nvim_open_win`, is because the float initially edits curbuf (`win_init`)
until it's later set to edit buf (windows from `:new` and `:split <buf>`
behave similiarly: approx. `:split`, then `:buffer <buf>`).

`do_buffer` closes windows when their edited buffer is deleted (unless
it's the only window; N/A for floats), so the float closes when curbuf
is deleted, so we need to check `win_valid` after `win_set_buf` too.

Closes #15548
2021-10-02 19:10:59 -07:00
zeertzjq
b3e815094b
fix(float)!: always anchor to corner of window including border #15832
N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the
window (including border). This line may also need change in this case (change
0 to -1):

This is most consistent and easiest to reason about, especially with GUIs whose
border do not need to have width/height of 1/1 in cell units.

Fix #15789
2021-10-02 17:36:24 -07:00
Daniel Steinberg
ae97f25e9d test: add a test for getmousepos() 2021-09-29 11:13:49 -04:00
Björn Linse
392c658d4d feat(decorations): support virtual lines (for now: only one block at a time) 2021-09-26 12:19:54 +02:00
itchyny
1f8c91bf72
fix(inccommand): ignore trailing commands only for *previewed* command #15638
Since the `State` is global, other scripts are unexpectedly affected during the
'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in
order to ignore trailing '|'-separated commands only for the command invoking
the preview.

fix #8796, update #7494
2021-09-20 07:33:10 -07:00
Jaehwang Jerry Jung
de406f651c
vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode (#15547)
Problem:    Filler lines are wrong when changing text in diff mode.
Solution:   Don't change the filler lines on every change.  Check
            scrollbinding when updating the filler lines. (closes vim/vim#8809)
04626c243c
2021-09-18 12:38:58 -04:00
Björn Linse
cd4ec810e9
Merge pull request #14770 from andrew-pa/fix13403
Fix relative float positioning
2021-09-12 09:23:47 +02:00
Yatao Li
086631cd92
feat(api): win_viewport also sends line_count #15613 2021-09-10 19:19:39 -07:00
Ville Hakulinen
0dcfd0e8d1
fix(mouse.c): fix mouse drag positions on multigrid #12667
Currently, multigrid mouse drag positions are handled incorrectly if the
drag event is not in the top left grid. Fix this by not adjusting the
position of the event in jump_to_mouse.

related: #15091
2021-09-10 07:24:41 -07:00
andrew-pa
9065730680 fix(windowing): positioning of relative floats
Fix relative floating windows so that they open in the correct position
relative to each other. Also make sure that their positions are correct
immediately after creation without a redraw.
2021-09-08 10:31:47 -06:00
Yatao Li
28ac6c00e6 fix(multigrid): #15075 mouse events crash neovim 2021-09-08 01:57:40 +08:00
Jit
db695cc4ca
fix(screen): missing search highlights when redrawing from timer #15380
* Revert "vim-patch:8.1.2294: cursor pos wrong with concealing and search causes a scroll"
* Add a test which covers #13074 910bbc3cca
  while reverting the screen.c code changes from there.

Fixes #14064
2021-09-06 15:18:33 -07:00
Justin M. Keyes
6751d6254b
refactor(tests): use assert_alive() #15546 2021-09-01 09:42:53 -07:00
zeertzjq
32024787b6
vim-patch:8.1.2229: color number column above/below cursor #15409
Problem:    Cannot color number column above/below cursor differently.
Solution:   Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624)
efae76ab1a
2021-08-27 05:50:37 -07:00
Gregory Anders
d8ab8cccd0 test: update tests to work with 'hidden' 2021-08-18 12:17:12 -06:00
zeertzjq
e9dd640897
vim-patch:8.2.3295: 'cursorline' should not apply to 'breakindent' #15281
Problem:    'cursorline' should not apply to 'breakindent'.
Solution:   Make 'cursorline' apply to 'breakindent' and 'showbreak'
            consistently. (closes vim/vim#8684)
4f33bc20d7
2021-08-16 00:27:04 -07:00
Sirisak Lueangsaksri
c8f57f6ded fix(sign): reset auto sign column with minimum in float win minimal style 2021-08-09 11:09:22 +07:00
zeertzjq
56b437a6c7 vim-patch:8.1.2117: CursorLine highlight used while 'cursorline' is off
Problem:    CursorLine highlight used while 'cursorline' is off.
Solution:   Check 'cursorline' is set. (cloes vim/vim#5017)
49474ca122
2021-08-02 05:41:17 +08:00
Björn Linse
d628e4250f
Merge pull request #15207 from gpanders/bye-syncolor
fix(highlight): remove syncolor.vim
2021-07-29 23:31:57 +02:00
Björn Linse
a4d81a8002 refactor(decorations): merge the two different code paths for virt_text
test(bufhl): CHANGE of tested behaviour (inb4 a proper priority mechanism)
test(decoration): change of test; previous behavior was buggy (ghost
buffer text)
2021-07-29 20:34:42 +02:00
Björn Linse
1495d36d63 feat(decorations): allow more than one stacked highlight in a virt_text 2021-07-29 20:34:20 +02:00
Björn Linse
cd353aa824 fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
fixes #15212
2021-07-29 12:59:56 +02:00
Gregory Anders
cab90f2ef1 fixup! fix(highlight): remove syncolor.vim 2021-07-28 09:11:07 -06:00
Björn Linse
7685fc9ecd
Merge pull request #14864 from seandewar/get-config-zindex
fix(api/win_get_config): include z-index
2021-07-02 14:52:08 +02:00
John Gehrig
5aaa1a1c04
[RDY] Add buffer information to tabline_update (#12481)
* Add buffer information to tabline_update

Most terminal implementations of the tabline display buffer and tab
information. Many neovim-qt users disable GuiTabline because it lacks
functionality provided in the terminal implementation.

The tabline_update event should include buffer information too, so client GUIs
can display rich useful tabs.
2021-06-27 15:30:09 -04:00
Sean Dewar
5f1b728621
fix(api/win_get_config): include z-index 2021-06-19 17:17:17 +01:00
Christian Clason
5b6edc852f feat(float): add rounded borders preset
Add `borders = "rounded"` preset for `nvim_open_win`, equivalent to

  border = {"╭", "─", "╮", "│", "╯", "─", "╰", "│"}

Also add undocumented "solid" preset to docs.
2021-06-14 11:10:57 +02:00
Jan Edmund Lazo
f376e67a53
vim-patch:8.2.0038: spell suggestions insufficiently tested
Problem:    Spell suggestions insufficiently tested.
Solution:   Add spell suggestion tests. (Dominique Pelle, closes vim/vim#5398)
e9a8d1f9ad

Requires latest en.utf-8.spl from
https://ftp.nluug.nl/pub/vim/runtime/spell/.

Include the following patch because patch v8.2.0946 was merged:

vim-patch:8.2.0948: spell test fails

Problem:    Spell test fails.
Solution:   Adjust expected text of the prompt.
d281b7c227
2021-06-12 13:06:49 -04:00
Jan Edmund Lazo
61117d89a3
vim-patch:8.1.1838: there is :spellwrong and :spellgood but not :spellrare
Problem:    There is :spellwrong and :spellgood but not :spellrare.
Solution:   Add :spellrare. (Martin Tournoij, closes vim/vim#4291)
08cc374dab
2021-06-12 13:06:48 -04:00
Serg Tereshchenko
8d23941af8 fix(ui): Fix pum incorrect position in multigrid mode
Refs #12985
2021-06-12 14:34:02 +02:00
Jan Edmund Lazo
39fdb86832
vim-patch:8.2.0946: cannot use "q" to cancel a number prompt
Problem:    Cannot use "q" to cancel a number prompt.
Solution:   Recognize "q" instead of ignoring it.
eebd555733
2021-05-21 23:01:11 -04:00
Björn Linse
0cd1430316
Merge pull request #14468 from bfredl/zindex
[WIP] z-index!
2021-05-15 14:44:22 +02:00
Björn Linse
edb5864a29 floats: z-index 2021-05-15 13:56:27 +02:00
Jan Edmund Lazo
dad725d5e5
vim-patch:8.1.1967: line() only works for the current window
Problem:    Line() only works for the current window.
Solution:   Add an optional argument for the window to use.
8e0a8e7eb7
2021-05-12 19:13:28 -04:00
Jan Edmund Lazo
5165513198
Merge pull request #13664 from ivechan/win_exectute
vim-patch:8.1.{1418,1425,1832,2124},8.2.{0137, 2340}
2021-05-07 08:34:28 -04:00
James McCoy
833a6fcb60
coverity/331378: Fix inserting new decor provider
Since the providers are ordered by ns_id, inserting a new provider may
require shifting existing providers around to maintain this ordering.

When this happens, we need to allocate a new element at the end of the
vector and then shift the larger elements to the right.  Rather than
iterating (incorrectly) with a loop and copying each item, use memmove
to copy the entire block.
2021-05-06 18:56:56 -04:00
jing
f6518e5516 vim-patch:8.1.1418: win_execute() is not implemented yet
Problem:    Win_execute() is not implemented yet.
Solution:   Implement it.
868b7b6712
2021-05-06 23:44:47 +08:00
Björn Linse
7fcc596557
Merge pull request #14483 from mjlbach/floating_window_border_fix
window.c: fix floating window border width calculation
2021-05-05 07:09:04 +02:00
Michael Lingelbach
ca058082ae tests: floating windows terminate border on edge of viewport when window extends past viewport 2021-05-04 15:43:53 -07:00
Björn Linse
0865f1238f decorations: right_align and win_col 2021-05-01 11:48:04 +02:00
Björn Linse
eeb1099bc4 ui_compositior: handle multiple displayed floats in the same tick
problem: the order of non-focuesed float opened before focused float is wrong (sunjon)
solution: check curwin and correct the order (bfredl)
2021-04-26 12:59:51 +02:00
Dan Aloni
f2ed7605da Handle 'orphaned signs' on line deletion for signcolumn >= 2 2021-04-17 10:11:17 +03:00
Björn Linse
3b01e37d09
Merge pull request #14358 from bfredl/decodeco
decoration: Clean up duplicate Decoration attributes + bonus hl_eol flag
2021-04-15 01:12:36 +02:00
Björn Linse
7b488314d0 decoration: Clean up duplicate Decoration attributes + bonus hl_eol flag 2021-04-14 13:04:33 +02:00
Marco Hinz
4a36ec6da0
float: add "solid" border style (#14310)
It looks solid with the default `FloatBorder` group.

If you set the bgcolor of FloatBorder to the same color as for FloatNormal, you
effectively get an "1-cell padding".
2021-04-12 20:51:05 +02:00
Jan Edmund Lazo
062c64e24c
test/ui/cmdline: set notimeout to remove indeterminism (#14338) 2021-04-10 12:36:54 -04:00
Björn Linse
9b2d4ff625
Merge pull request #14227 from bfredl/bordaa3
Border: allow to enable/disable specific border edges
2021-04-05 00:21:51 +02:00
Ghjuvan Lacambre
0f187700ab
vim-patch:8.2.0295: highlighting for :s wrong when using different separator (#14286)
Problem:    Highlighting for :s wrong when using different separator.
Solution:   Use separat argument for search direction and separator. (Rob
            Pilling, closes vim/vim#5665)
c036e87bd7
2021-04-04 14:43:22 -04:00
Björn Linse
a4d3804837 Border: allow to enable/disable specific border edges 2021-04-04 18:32:31 +02:00
erw7
8e496b9dfd
Merge pull request #14268 from erw7/fix-p_ch-problem
screen: fix problem with p_ch
2021-04-04 12:04:36 +09:00
erw7
581b2bcde0 screen: fix problem with p_ch
When the screen is resized, p_ch is not re-set to the appropriate value.
As a result, access to invalid addresses was occurring.
2021-04-03 15:27:46 +09:00
Jan Edmund Lazo
7959aaf781
vim-patch:8.2.2686: status line is not updated when going to cmdline mode
Problem:    Status line is not updated when going to cmdline mode.
Solution:   Redraw status lines if 'statusline' is set and going to status
            line mode. (based on patch from Justin M. Keyes et al.,
            closes vim/vim#8044)
ce0b75711a
2021-04-01 15:05:10 -04:00
Björn Linse
3000f6c56b floats: handle interaction with popupmenu and border correctly 2021-03-25 09:06:09 +01:00
Björn Linse
ed20089877
Merge pull request #14194 from bfredl/provide_virt
memory error with ephemeral virt_text
2021-03-23 15:54:09 +01:00
Matthieu Coudron
a1a0bc618f
Merge pull request #14190 from teto/fix-cursorlinenr
fix CursorLineNr with diff
2021-03-23 14:01:57 +01:00
Björn Linse
06c191848b decorations: memory error with ephemeral virt_text 2021-03-23 13:58:18 +01:00
Björn Linse
80e122ae5d screen: setup scrolling main screen when starting with display-=msgsep 2021-03-23 09:34:36 +01:00
Matthieu Coudron
e0d0e46cf2 chore: add test for CursorLineNr with filler lines 2021-03-22 23:33:17 +01:00
Matthieu Coudron
f2e1709d49 fix: stop using CursorLineNr in front of fillers
filling lines in diff mode.
2021-03-22 23:33:17 +01:00
Björn Linse
243820ebd0 floats: add borders (MS-DOS MODE) 2021-03-22 23:18:40 +01:00
Jan Edmund Lazo
dc8da7ba40
Merge pull request #14060 from andymass/vim-8.2.1703
[RFC] vim-patch:8.2.{1693,1703,1705}
2021-03-20 18:08:16 -04:00
Andy K. Massimino
79575cfe8a Fix a failing test (highlight_spec.lua) 2021-03-20 15:56:52 -04:00
Björn Linse
bb6d2c9b7c api: destabilize nvim_set_hl_ns
The sematics and signature of this API is going to change, but we
don't wanna delay 0.5 for it. Mark API as unstable for now.
2021-03-15 09:58:39 +01:00
Björn Linse
3c8583e43b
Merge pull request #14020 from chentau/float_resize
Update lines after shrinking floating window
2021-03-14 08:35:48 +01:00
tk-shirasaka
314b222c25
Fix click on foldcolumn with vsplit (#14127) 2021-03-13 23:12:18 +01:00
chentau
8fe19d9d89 screen: make ui_compositor aware of the intended size of a float 2021-03-11 12:27:29 -08:00
Björn Linse
7844ca2e05
Merge pull request #14065 from bfredl/overlaymode
more virt_text display options
2021-03-10 13:28:07 +01:00
Björn Linse
425bc438ae decorations: add additional styling of virt_text overlays 2021-03-10 12:11:05 +01:00
Björn Linse
f901149de4 state: throttle batched event processing when input is available
before, calling vim.schedule() from inside an event would execute
the scheduled callback immediately after this event without
checking for user input in between. Break event processing
whenever user input or an interrupt is available.
2021-03-08 16:08:58 +01:00
tk-shirasaka
f2fc44d50b
[RDY] Fix click on foldcolumn if it has tabline (#13982)
* Fix click on foldcolumn if it has tabline
* Fixes to correctly determine if tablie was clicked when multigrid is enabled
* Separate foldcolumn checks into functions
* Add test case for click on foldcolumn with split window
* Fix foldcolumn click used nvim_input() on multigrid enabled
2021-03-04 13:54:22 +01:00
Björn Linse
4781333a7a decorations: allow virt_text overlay at any column 2021-02-22 09:40:06 +01:00
glacambre
dbf3c5d953 Clear prompt_for_number messages
This fixes issues in GUIs:
https://github.com/akiyosi/goneovim/issues/94
https://github.com/glacambre/firenvim/issues/448
2021-02-10 13:04:02 +01:00
Sirisak Lueangsaksri
83ea08ddf3 opt: add tests (#13783) 2021-01-20 23:57:21 +07:00
Björn Linse
90f619f140
Merge pull request #13592 from bfredl/setmouse
ui: make 'mouse' handling in external UI more consistent
2021-01-01 20:04:09 +01:00
Björn Linse
6db86cb2d3 ui: make 'mouse' handling in external UI more consistent
before the behaviour of 'mouse' was inconsistent in external UI,
as some remapping logic would check has_mouse() and others don't
(no difference in TUI or vim classic). With this change, the behaviour
is consistently up to the UI decide (see ui.txt edit)

Behaviour of tui.c is unaffected by this change.
2021-01-01 15:47:44 +01:00
Jan Edmund Lazo
b01a60b1aa
Revert "vim-patch:8.1.0822: peeking and flushing output slows down execution"
This reverts commit 0519a75f6e.
2020-12-31 16:44:53 -05:00
Jan Edmund Lazo
723e009214
Revert "vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc"
This reverts commit 44bb7147e4.

Avoid regression mentioned in c64cce906e (commitcomment-45554271)
2020-12-31 16:44:53 -05:00
Matthieu Coudron
9c68aac37b tests: check highlights work in open folds
to prevent a regression we just witnessed
2020-12-30 23:32:40 +01:00
Matthieu Coudron
b0215afc84
fix(fold): dont highlight search results on folded lines (#13616)
Behavior may change in future but for now stick to legacy behavior.
2020-12-29 01:19:24 +01:00
Jan Edmund Lazo
44bb7147e4
vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc
Problem:    Mode is not cleared when leaving Insert mode with mapped Esc.
Solution:   Clear the mode when redraw_cmdline is set. (closes vim/vim#4269)
4c25bd785a
2020-12-26 02:34:13 -05:00
Jan Edmund Lazo
0519a75f6e
vim-patch:8.1.0822: peeking and flushing output slows down execution
Problem:    Peeking and flushing output slows down execution.
Solution:   Do not update the mode message when global_busy is set.  Do not
            flush when only peeking for a character. (Ken Takata)
cb574f4154
2020-12-25 19:25:30 -05:00
Lukas Reineke
88ae03bcdb
feat(sign):Allow signs to be 0 width (#13290)
Adds support for signs to be 0 cells wide. If all signs of the same
group have no width, the signcolumn will not be rendered for that group.
2020-12-24 17:33:52 +01:00
Jan Edmund Lazo
b1711e6f92
foldcolumn: support "auto" (#13571)
"set foldcolumn=auto" is documented but not supported.
Support it by making it behave as "auto:1", similar to "signcolumn".

Close https://github.com/neovim/neovim/pull/13561
2020-12-20 15:20:42 -05:00
shirasaka
9601e7c5d5 ui: Fix win_hide distination grid
When create tab, win_hide sent to new tab and new tab's previous tab.
So, if created tab that not next tab (eg. $tabnew cmd),
send win_hide to not current tab, and fixed this.
2020-12-05 20:18:51 +09:00
Jan Edmund Lazo
d80f262f89
Merge pull request #13428 from janlazo/nvim-8.0.1525
vim-patch:8.0.{858,953,1525}
2020-12-01 19:02:38 -05:00
Jan Edmund Lazo
518fe0e8a2
test/wildmode_spec: override $PS1
User config may set $PS1 for a colored prompt.
It breaks the screen tests.
2020-12-01 08:52:34 -05:00
Björn Linse
bed9839f46 ex_getln: add secret charm
Opt in to this secret world using

    set wildchar=0
    " already the default, but remove if non-zero existing config:
    set wildcharm=0

now you can map 'wildmode' just like any mode:

    cnoremap <tab> <c-z>
    function! Spacey()
      return getcmdline()[-1:] == "/" ? "\<bs>" : ""
    endfunc
    cnoremap <expr> / wildmenumode() ? Spacey()."/<c-z>" : "/"

Possibly asked questions:

What about backwards compatibility?
====

Just do nothing and your existing 'wildchar' and 'wildcharm' will keep working.

Doesn't `<c-z>` mean suspend?
====

Not in cmdline mode. If it would then the recommended wildcharm would not
have been `<c-z>` to start with.

My config relies on `:<c-z>` being a synonym to `:<nop>`!
====
just no.
2020-12-01 00:57:52 +01:00
Matthieu Coudron
15e616a057
folds: use Folded highlight even with spell on (#13393)
the highlight was not used with spell enabled on folded lines.
Thanks to lervag for the nice report.
2020-11-29 14:26:59 +01:00
shade-of-noon
2d5dd85eef
screen.c: Allow showbreak to override cursorline. (#13372)
I also added relevant tests.

Close #13369
2020-11-25 16:47:03 +01:00
Björn Linse
ca7fa2a43a
Merge pull request #13357 from vigoux/luahl-priority
feat(luahl): add priority mechanism
2020-11-25 12:43:08 +01:00
Thomas Vigouroux
c0a6989d93
feat(luahl): add priority mechanism
Base priority is 0x1000, in order to stay kinda backward compatible.
Also set tree-sitter default highlight to 100 (middle-ish value)
2020-11-25 10:10:05 +01:00
Matthieu Coudron
7eb0c16dc8 fix(fold): use Folded highlight even with spell on
Partially addresses https://github.com/neovim/neovim/issues/12982. It's
more a quickfix while reworking folds.
2020-11-23 21:06:56 +01:00
Jan Edmund Lazo
e192a4600a
Merge pull request #13307 from janlazo/vim-8.1.0777
vim-patch:8.1.{323,777,933,938},8.2.{178,248,547,581,592,646,658,793,1608,1975,1991,1992,1993,1994,1998,1999,2003,2007,2008,2009}
2020-11-21 10:52:16 -05:00
Björn Linse
3c2402e5c2
Merge pull request #13250 from bfredl/missinglink
allow nvim_set_hl to break existing links
2020-11-21 13:11:17 +01:00
Björn Linse
a4986ab47f decorations: allow nvim_set_hl to break existing links
also add `default` flag to NOT break existing links/defs
2020-11-21 11:24:14 +01:00
Jan Edmund Lazo
172d5b6561
test: rewrite powershell tests to remove timeout
TSAN kept failing and Appveyor sometimes fails on the same test.
2020-11-20 19:55:17 -05:00
James McCoy
a88bc4d95e
keymap: Preserve S- modifier when C- is present
Closes #12037
2020-11-16 18:52:23 -05:00
Thomas Vigouroux
6a2cd57886
fix(floatwin): don't always use winheight 2020-11-16 14:37:24 +01:00
Jan Edmund Lazo
d8c69adbab
Merge pull request #12698 from erw7/fix-popupmenu-with-rl
ui: fix problem with the popupmenu when rightleft is set
2020-11-13 23:09:57 -05:00
shirasaka
19bb177512 Add test case for fold on multigrid 2020-11-09 15:05:23 +09:00
Björn Linse
d1091bc658
Merge pull request #12870 from bfredl/themepark
Color themes (per window/line) and lua theme providers
2020-11-01 21:54:51 +01:00
Björn Linse
c146eddc8b api: add API for themes
co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function)

orange is sus??

NOVEMBER DAWN

erase the lie that is redraw_later()
2020-11-01 19:14:56 +01:00
Jan Edmund Lazo
3d6584223d
vim-patch:8.2.0131: command line is not cleared when switching tabs
Problem:    Command line is not cleared when switching tabs and the command
            line height differs.
Solution:   Set the "clear_cmdline" flag when needed. (Naruhiko Nishino,
            closes vim/vim#5495)
479950f6c9
2020-10-29 18:36:38 -04:00
erw7
f5c9065f3e Fix popupmenu position issue 2020-10-23 12:36:32 +09:00
Björn Linse
38efa1730f
Merge pull request #13118 from bfredl/mudholland
A Mudholland Dr. Recast
2020-10-19 23:14:55 +02:00
Björn Linse
07cc231142 A Mudholland Dr. Recast
The commit summary maybe does not make sense, but calling a function
that does not wait on anything `wait()` makes even less sense.
2020-10-19 21:48:06 +02:00
TJ DeVries
0ad5b34170
Merge pull request #12053 from tjdevries/tjdevries/nicer_validate
vim.validate(): include stacktrace in message
2020-10-17 16:47:18 -04:00
Björn Linse
0b615dae07 api: multiple decoration providers at once 2020-10-10 15:16:45 +02:00
Justin M. Keyes
8e77d70e29 test/vim.validate(): assert normalized stacktrace
- The previous commit lost information in the tests. Instead, add some
  more "normalization" substitutions in pcall_err(), so that the general
  shape of the stacktrace is included in the asserted text.
- Eliminate contains(), it is redundant with matches()
2020-10-05 09:47:59 -04:00
Jan Edmund Lazo
86ab4a1cb4
vim-patch:8.2.0841: 'verbose' value 16 causes duplicate output
Problem:    'verbose' value 16 causes duplicate output.
Solution:   Combine levels 15 and 16 into one message. (Christian Brabandt,
            closes vim/vim#6153)
823654bc06
2020-10-03 01:06:24 -04:00
Thomas Vigouroux
c10c2fab5b
Merge pull request #12968 from erw7/fix-substitute2
fix substitute problem with inccommand
2020-10-02 09:56:57 +02:00
erw7
620c8fdfe9 extmark: fix decoration ploblems with extmark
54ce101 changed the way undo entries are created when adding decorations.
This creates all sorts of problems.This change fixes the problem by
reverting to the previous behavior.
2020-10-02 11:41:30 +09:00
erw7
8154c77bef screen.c: fix buffer overflow due to folding
fixes #12988.
2020-10-01 17:25:19 +09:00
Jan Edmund Lazo
83ebe0c998
vim-patch:8.1.1992: the search stat moves when wrapping at the end of the buffer
Problem:    The search stat moves when wrapping at the end of the buffer.
Solution:   Put the "W" in front instead of at the end.
16b58ae9f3
2020-09-29 21:36:00 -04:00
Björn Linse
a958039f0a screen: more work on fold_line replacement 2020-09-24 19:31:58 +02:00
Matthieu Coudron
f8134f2fd1 screen.c: remove fold_line
as well as copy_text_attr, text_to_screenline.
Display of folded line is now done via win_line, which reduces code
deduplication.
As fold_line was a trimmed down version of win_line, this change brings
new features such CursorLineNr highighting even on folded line, as well
as CursorLine highlighting.
2020-09-24 15:43:25 +02:00
erw7
397be5d380 UI: fix cursor not displayed after hiding and un-hiding #12811
- TUI: Fix a case where the cursor was not displayed after hiding the
  cursor and then setting it to be displayed again.
- Change to reset everything before setting guicursor.

fixes #12800
close #12811

Steps to reproduce:

    nvim -u NORC
    :set termguicolors
    :hi nCursor guifg=red guibg=red
    :hi iCursor guifg=green guibg=green
    :hi cCursor guifg=blue guibg=blue
    :set guicursor=n:block-nCursor,i:hor25-iCursor,c:ver25-cCursor
    :set guicursor-=c:ver25-cCursor

Actual behaviour: Cursor is a blue vertical.
Expected behaviour: Cursor should be the default color block.
2020-09-12 11:42:42 -07:00
Jan Edmund Lazo
b23907e7ce
Merge pull request #12721 from aufarg/vim-8.1.0265
[RDY] vim-patch:8.1.{265,271,273,274,275,277,278,279,280,281,282,284,286,291,295,296,320,321,339,351,392,399,552}
2020-09-12 10:51:59 -04:00
Aufar Gilbran
e8a8b9ed08 vim-patch:8.1.0271: 'incsearch' doesn't work for :s, :g or :v
Problem:    'incsearch' doesn't work for :s, :g or :v.
Solution:   Also use 'incsearch' for other commands that use a pattern.
b0acacd767
2020-09-11 10:31:41 +08:00
Justin M. Keyes
c1d395a6d6
UI: forward 'mousefocus' option #12863
close #12849
ref eb4aab7173
2020-09-06 11:40:07 -07:00
Björn Linse
866308c3de API: be less breaking in the christmas tree decorations 2020-09-04 19:11:26 +02:00
Björn Linse
49f5b57587 decor: sketch new decorations API
return decorations back

lol no nvim_buf_get_virtual_text

share decorations that are hl only to avoid alloc avalanche
2020-09-03 15:40:24 +02:00
Justin M. Keyes
c2662210b5
docs, remove 'guifontset' #11708
- remove redundant autocmd list
  This "grouped" list is useless, it only gets in the way when searching
  for event names.
- intro.txt: cleanup
- starting.txt: update, revisit
- doc: `:help bisect`
- mbyte.txt: update aliases 1656367b90. closes #11960
- options: remove 'guifontset'. Why:
  - It is complicated and is used by almost no one.
  - It is unlikely to be implemented by Nvim GUIs (complicated to parse,
    specific to Xorg...).
2020-08-31 00:51:35 -07:00