Skip to content

Commit

Permalink
fix(ui): don't override Neovim defaults in default float_win_config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 12, 2024
1 parent 187ba89 commit 1c3d3a7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 28 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.23.1] - 2024-05-12

### Fixed

- UI/Config: Don't override Neovim defaults in default `float_win_config`.

## [4.23.0] - 2024-05-11

### Added
Expand Down
4 changes: 3 additions & 1 deletion doc/rustaceanvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,12 @@ RustaceanExecutorOpts *RustaceanExecutorOpts*
FloatWinConfig *FloatWinConfig*

Fields: ~
{open_split} ("horizontal"|"vertical")
{auto_focus?} (boolean)
{open_split?} ("horizontal"|"vertical")

See: ~
|vim.lsp.util.open_floating_preview.Opts|
|vim.api.nvim_open_win|


executor_alias *executor_alias*
Expand Down
3 changes: 0 additions & 3 deletions lua/rustaceanvim/config/check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ function M.validate(cfg)
end
local float_win_config = tools.float_win_config
ok, err = validate('tools.float_win_config', {
border = { float_win_config.border, { 'table', 'string' } },
max_height = { float_win_config.max_height, 'number', true },
max_width = { float_win_config.max_width, 'number', true },
auto_focus = { float_win_config.auto_focus, 'boolean' },
open_split = { float_win_config.open_split, 'string' },
})
Expand Down
4 changes: 3 additions & 1 deletion lua/rustaceanvim/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ vim.g.rustaceanvim = vim.g.rustaceanvim
---@field bufnr? integer The buffer from which the executor was invoked.

---@class FloatWinConfig
---@field open_split 'horizontal' | 'vertical'
---@field auto_focus? boolean
---@field open_split? 'horizontal' | 'vertical'
---@see vim.lsp.util.open_floating_preview.Opts
---@see vim.api.nvim_open_win

---@alias executor_alias 'termopen' | 'quickfix' | 'toggleterm' | 'vimux' | 'neotest'

Expand Down
24 changes: 1 addition & 23 deletions lua/rustaceanvim/config/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,31 +139,9 @@ local RustaceanDefaultConfig = {

--- options same as lsp hover
---@see vim.lsp.util.open_floating_preview
---@see vim.api.nvim_open_win
---@type table Options applied to floating windows.
float_win_config = {

-- the border that is used for floating windows
---@see vim.api.nvim_open_win()
---@type string[][] | string
border = {
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
{ '', 'FloatBorder' },
}, -- maybe: 'double', 'rounded', 'shadow', 'single',

--- maximal width of floating windows. Nil means no max.
---@type integer | nil
max_width = nil,

--- maximal height of floating windows. Nil means no max.
---@type integer | nil
max_height = nil,

--- whether the window gets automatically focused
--- default: false
---@type boolean
Expand Down

0 comments on commit 1c3d3a7

Please sign in to comment.