Commit Graph

204 Commits

Author SHA1 Message Date
edb5864a29 floats: z-index 2021-05-15 13:56:27 +02:00
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
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
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
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
ca058082ae tests: floating windows terminate border on edge of viewport when window extends past viewport 2021-05-04 15:43:53 -07:00
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
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
a4d3804837 Border: allow to enable/disable specific border edges 2021-04-04 18:32:31 +02:00
3000f6c56b floats: handle interaction with popupmenu and border correctly 2021-03-25 09:06:09 +01:00
243820ebd0 floats: add borders (MS-DOS MODE) 2021-03-22 23:18:40 +01:00
8fe19d9d89 screen: make ui_compositor aware of the intended size of a float 2021-03-11 12:27:29 -08:00
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
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
6a2cd57886 fix(floatwin): don't always use winheight 2020-11-16 14:37:24 +01:00
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
a02a267f8a Reuse inccommand preview window (fix #11529) (#12612)
* Reuse inccommand preview window

Currently, show_sub (inside ex_substitute) creates a new split on each
run for its existing buffer, and ex_substitute calls close_windows for
it. This functionality seems to relay in delayed operations on window
structures where the close event on the newest window is "cancelled" by
win_grid_alloc. But for multigrid, there is optimization in place in
win_grid_alloc which causes any (unnecessary?) allocations to be
skipped, and thus inccommand preview window is not preserved but closed
immediately. Alternative fix would be to remove said optimization, but
the whole "lets create a new split each time and trash the earlier
window" seems too wasteful.

Fix #11529

* Update failing test

The failing test sets inccommand=split and does `:%s/.`, but isn't
expecting to get any contents for the preview window, other than the
windows status line. Update the test to include the preview window
contents too.
2020-07-15 08:46:47 -04:00
1fe0b329fe api/ui: win_viewport event for visible range and cursor position in window 2020-04-01 19:43:55 +02:00
f6e7857c54 floatwin: show error if window is closed immediately #11476
Autocmds may close window while it is being entered, then
win_set_minimal_style(wp) operates on an invalid pointer.

We could silently ignore this instead, but it is unlikely to be
intentional, so it is more useful to show an error.

fix #11383
2019-11-29 23:48:14 -08:00
d5f14b8372 Clear 'cc' in nvim_open_win 'minimal' style #11361 (#11427)
* Clear 'cc' in nvim_open_win 'minimal' style #11361

Add 'colorcolumn' to the list of options that should be cleared when creating
a 'minimal'-style floating window.
2019-11-22 10:55:04 +01:00
06bfb07e35 doc
fix #10127
fix #5972
2019-09-11 00:10:27 -07:00
af946046b9 test: Rename meth_pcall to pcall_err
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
  expected.
2019-09-06 17:19:07 -07:00
d5162afa2a anchor float to buffer position
vim-patch:8.1.1645: cannot use a popup window for a balloon
2019-09-04 23:57:02 +02:00
e04b9e7c78 test/ui: update tests for new msg_grid implementation 2019-09-01 15:55:10 +02:00
628f8f3dfd ui: transmit "blend=" property of highlight attributes 2019-08-18 13:52:32 +02:00
6b2d67eb59 test/ui: properly test win_hide by explicitly marking hidden grids 2019-08-17 21:46:11 +02:00
f9f238b21a api: nvim_win_open() style="minimal" should disable 'foldcolumn' 2019-08-14 14:49:27 +02:00
cb9e0a051f floats: fix 'winblend' on top of doublewidth chars.
The interaction between 'winblend' and doublewidth chars in the background
does not look very good. But check no chars get incorrectly placed
at least.

Also check that hidden EndOfBuffer region (from style="minimal") blends
correctly.
2019-07-13 14:27:06 +02:00
7cf7c0a0b8 Merge pull request #9575 from bfredl/redrawdebug
ui: implement better redrawdebug for the compositor
2019-07-09 17:56:30 +02:00
2c2f160a27 ui: add 'redrawdebug' option for flexible debugging of redrawing 2019-07-09 15:13:24 +02:00
4af1ada9ef compositor: handle float overlapping left half of doublewidth char 2019-07-09 14:46:58 +02:00
d11a146516 window: allow resize wincmds for floats 2019-07-08 19:45:57 +02:00
ef3e32d57e api/window: add style="minimal" flag to nvim_open_win() 2019-07-07 20:52:15 +02:00
2a2d288228 compositor: handle scrolling of blended window 2019-06-26 08:37:36 +02:00
4c4d964eeb ui: add 'winblend' to support blending of floating windows
Also add `hi blend=` attribute to override transparency of indiviual attributes.
2019-06-25 18:08:21 +02:00
c8acbe3b62 windows: float config changes
- Allow floating windows of width 1. #9846
- For a new floating window the size must be specified. Later on we
  might try to calculate a reasonable size by buffer contents
- Remember the configured size of a window, just like its position.
- Make get_config and set_config more consistent. Handle relative='' properly in set_config.
  get_config doesn't return keys that don't make sense for a non-floating window.
- Don't use width=0 for non-changed width, just omit the key.
2019-04-14 10:12:09 +02:00
ae88e46563 float: always change to valid windows (#9878)
Using `:wincmd j` and friends doesn't make much sense to a floating window. For
convenience though, any direction will simply change to the previous window.

Make sure the previous window is valid, not the current window, and not another
floating window. Change to the first window (which is never a floating window)
otherwise.
2019-04-11 20:20:17 +02:00
344c69b66b api/window: validate cursor in nvim_win_set_buf
validate_cursor() is called regularly, but only for the current window.
When changing the buffer for a non-current window, we need to invoke it
in the context of that window.
2019-04-08 12:39:08 +02:00
2a618e0ad0 Update test 2019-03-23 22:14:03 +01:00
31fa064c68 floating-window.c: fix crash when using inccommand 2019-03-23 22:14:03 +01:00
ae49e8da58 window: don't crash when closing two floats in a row
prevwin can be set to the current window. Then we can't jump to it
after closing a float.
2019-03-23 20:12:37 +01:00
3edf7fc64f api: ignore floating windows for laststatus=1 (#9771)
ONE_WINDOW considers all windows whereas one_window() ignores floating windows.

Fixes https://github.com/neovim/neovim/issues/9768
2019-03-22 17:17:33 +01:00
9ef8d0d6b0 Merge pull request #9726 from mhinz/nvim_win_get_config
Closes #9723
2019-03-17 02:34:50 +01:00
b557654f36 api: add tests for new code paths 2019-03-16 21:44:15 +01:00
be8ebba325 Allow using internal popupmenu or ext_popupmenu for wildmenu
Deprecate ext_wildmenu. ext_popupmenu already contains more state (anchor
position), and will allow further expansion (info about items).
2019-03-16 19:53:21 +01:00
86992a7bb1 api: numerous small fixes 2019-03-16 15:02:56 +01:00
96edbe7b1d api: add width/height to FloatConfig 2019-03-16 12:35:58 +01:00
3c88bbecb8 api: nvim_win_config() -> nvim_win_set_config() 2019-03-16 12:35:58 +01:00
ca5f919965 compositor: fix rendering issues with floats opened after popupmenu 2019-03-14 10:43:49 +01:00
81e84f2aae floats: add NormalFloat highlight and 'nonumber' default 2019-03-12 17:17:54 +01:00