aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
Commit message (Collapse)AuthorAge
* fix(statuscolumn): fix sign column highlights (#21727)luukvbaal2023-01-11
| | | Resolve #21726.
* feat(float): open float relative to mouse #21531Sebastian Lyng Johansen2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No easy way to position a LSP hover window relative to mouse. Solution: Introduce another option to the `relative` key in `nvim_open_win()`. With this PR it should be possible to override the handler and do something similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674 to have hover information displayed from the mouse. Test case: ```lua local util = require('vim.lsp.util') local function make_position_param(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) local row, col local mouse = vim.fn.getmousepos() row = mouse.line col = mouse.column offset_encoding = offset_encoding or util._get_offset_encoding(buf) row = row - 1 local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1] if not line then return { line = 0, character = 0 } end if #line < col then return { line = 0, character = 0 } end col = util._str_utfindex_enc(line, col, offset_encoding) return { line = row, character = col } end local make_params = function(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) offset_encoding = offset_encoding or util._get_offset_encoding(buf) return { textDocument = util.make_text_document_params(buf), position = make_position_param(window, offset_encoding), } end local hover_timer = nil vim.o.mousemoveevent = true vim.keymap.set({ '', 'i' }, '<MouseMove>', function() if hover_timer then hover_timer:close() end hover_timer = vim.defer_fn(function() hover_timer = nil local params = make_params() vim.lsp.buf_request( 0, 'textDocument/hover', params, vim.lsp.with(vim.lsp.handlers.hover, { silent = true, focusable = false, relative = 'mouse', }) ) end, 500) return '<MouseMove>' end, { expr = true }) ```
* fix(ui): set stc to empty in floatwin with minimal style (#21720)Raphael2023-01-10
| | | fix(ui): set stc to emtpy in floatwin with minimal style
* fix(ui): add test caseRaphael2023-01-09
|
* fix(win_close): remove float grid after closing buffer (#21551)zeertzjq2022-12-27
| | | | It is not safe to remove the float grid when autocommands can still be triggered, as autocommands may use the float grid.
* fix(float): fix crash with bufpos and non-existent window (#21319)zeertzjq2022-12-07
|
* test: add more tests for float window bufpos (#21318)zeertzjq2022-12-07
|
* fix(tests): only get the color map once, even for multiple test filesbfredl2022-11-27
| | | | | | | | | Problem: test/functional/ui/screen.lua would be reloaded for each *_spec.lua file, which causes an extra nvim session to be started to get the color map each time. solution: Mark screen.lua as a preloaded file, but defer the loading of the color map to the first time Screen object is initialised.
* feat(test): add Lua forms for API methods (#20152)Lewis Russell2022-11-14
|
* feat(ui): add support to display a title in the border of a float (#20184)Raphael2022-11-06
| | | add "title" and "title_pos" keys to win config dict.
* test: add a test for #20684zeertzjq2022-10-17
|
* docs: fix typos (#20394)dundargoc2022-09-30
| | | | | Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(window): close floats first when closing buffer in other tab (#20284)zeertzjq2022-09-22
|
* fix(redraw): avoid unnecessary redraws and glitches with floats+messagesbfredl2022-09-22
| | | | | fixes #20106 fixes #20229
* fix(options): properly free string options (#19510)zeertzjq2022-07-27
|
* test(float_spec): make indent more consistentzeertzjq2022-07-10
|
* fix(float): fix mouse drag position if float window turned to a splitzeertzjq2022-07-10
|
* fix(float): fix glitch when making float window with border a splitzeertzjq2022-07-10
|
* fix(float): fix float window with winbar cannot have screen heightzeertzjq2022-07-10
|
* fix(float): fix float window border drawing with winbarzeertzjq2022-07-10
|
* feat: add preview functionality to user commandsFamiu Haque2022-05-31
| | | | Adds a Lua-only `preview` flag to user commands which allows the command to be incrementally previewed like `:substitute` when 'inccommand' is set.
* fix(mouse): fix mouse drag position with winbar or border in multigridzeertzjq2022-05-19
|
* fix(ui): make winbar work with floats and multigridbfredl2022-05-18
|
* refactor(ui)!: link `VertSplit` to `Normal` by defaultFamiu Haque2022-05-15
| | | | | Avoids using `gui=reverse` on `VertSplit` and makes window separators look much nicer by default.
* test: correct order of arguments to eq() and neq()zeertzjq2022-04-26
|
* fix(float): do not switch window before deleting last listed buffer (#17840)zeertzjq2022-03-24
| | | | Just allow close_windows() to close the current window instead. This fixes wrong working directory or autocommands not being triggered.
* fix(float): don't always switch window when deleting last listed buffer (#17836)zeertzjq2022-03-24
|
* test: add test for deleting last listed buffer when there are floats (#17833)zeertzjq2022-03-24
|
* fix(float): make laststatus=1 behave consistently with floating windowszeertzjq2022-03-23
|
* fix(float): handle buffer deletion with floating windowszeertzjq2022-03-23
|
* fix(win_close): count the window the be closed instead of curwinzeertzjq2022-03-23
|
* fix: close floating windows when calling win_close()Rom Grk2022-02-10
|
* fix(float): skip non-focusable windows for :windo (#15378)Daniel Steinberg2021-11-11
|
* fix(float): redraw if w_border_adj changedzeertzjq2021-10-28
|
* fix(float): fix potential heap corruption in win_redr_borderzeertzjq2021-10-28
|
* fix(mouse): correct dragged position in composed layoutBjörn Linse2021-10-04
|
* Merge pull request #15516 from bfredl/keysetBjörn Linse2021-10-03
|\ | | | | refactor(api): Represent option dicts as a structs in C and reduce conversion overhead from lua
| * refactor(api): handle option dicts properlyBjörn Linse2021-10-03
| | | | | | | | | | | | | | 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
* | fix(nvim_open_win): crash if autocmds delete buffer/window #15549Sean Dewar2021-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 1def3d1542d6a65f057e743faea39a760b50db87. 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
* | fix(float)!: always anchor to corner of window including border #15832zeertzjq2021-10-02
|/ | | | | | | | | | 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
* Merge pull request #14770 from andrew-pa/fix13403Björn Linse2021-09-12
|\ | | | | Fix relative float positioning
| * fix(windowing): positioning of relative floatsandrew-pa2021-09-08
| | | | | | | | | | | | 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.
* | feat(api): win_viewport also sends line_count #15613Yatao Li2021-09-10
| |
* | refactor(tests): use assert_alive() #15546Justin M. Keyes2021-09-01
| |
* | test: update tests to work with 'hidden'Gregory Anders2021-08-18
| |
* | fix(sign): reset auto sign column with minimum in float win minimal styleSirisak Lueangsaksri2021-08-09
| |
* | fix(api/win_get_config): include z-indexSean Dewar2021-06-19
| |
* | feat(float): add rounded borders presetChristian Clason2021-06-14
| | | | | | | | | | | | | | | | Add `borders = "rounded"` preset for `nvim_open_win`, equivalent to border = {"╭", "─", "╮", "│", "╯", "─", "╰", "│"} Also add undocumented "solid" preset to docs.
* | fix(ui): Fix pum incorrect position in multigrid modeSerg Tereshchenko2021-06-12
|/ | | | Refs #12985
* Merge pull request #14468 from bfredl/zindexBjörn Linse2021-05-15
|\ | | | | [WIP] z-index!