Skip to content

Commit

Permalink
fix(ui): explicitly disable signcolumn for floating windows (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Feb 27, 2024
1 parent 9f4e740 commit b5342fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ 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.10.1] - 2024-02-27

### Fixed

- UI: Explicitly disable signcolumn for grouped code action
and hover action windows [[#262](https://github.com/mrcjkb/rustaceanvim/issues/262)].

## [4.10.0] - 2024-02-23

### Added
Expand Down
8 changes: 6 additions & 2 deletions lua/rustaceanvim/commands/code_action_group.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ local function on_code_action_results(results, ctx)
end

M.state.primary.bufnr = vim.api.nvim_create_buf(false, true)
M.state.primary.winnr = vim.api.nvim_open_win(M.state.primary.bufnr, true, {
local primary_winnr = vim.api.nvim_open_win(M.state.primary.bufnr, true, {
relative = 'cursor',
width = M.state.primary.geometry.width,
height = vim.tbl_count(M.state.actions.grouped) + vim.tbl_count(M.state.actions.ungrouped),
Expand All @@ -174,6 +174,8 @@ local function on_code_action_results(results, ctx)
row = 1,
col = 0,
})
vim.wo[primary_winnr].signcolumn = 'no'
M.state.primary.winnr = primary_winnr

local idx = 1
for key, value in pairs(M.state.actions.grouped) do
Expand Down Expand Up @@ -291,7 +293,7 @@ function M.on_cursor_move()
M.state.secondary.geometry = compute_width(value.actions, false)

M.state.secondary.bufnr = vim.api.nvim_create_buf(false, true)
M.state.secondary.winnr = vim.api.nvim_open_win(M.state.secondary.bufnr, false, {
local secondary_winnr = vim.api.nvim_open_win(M.state.secondary.bufnr, false, {
relative = 'win',
win = M.state.primary.winnr,
width = M.state.secondary.geometry.width,
Expand All @@ -301,6 +303,8 @@ function M.on_cursor_move()
row = line - 2,
col = M.state.primary.geometry.width + 1,
})
M.state.secondary.winnr = secondary_winnr
vim.wo[secondary_winnr].signcolumn = 'no'

local idx = 1
for _, inner_value in pairs(value.actions) do
Expand Down
3 changes: 3 additions & 0 deletions lua/rustaceanvim/hover_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ function M.handler(_, result, ctx)
-- makes more sense in a dropdown-ish ui
vim.wo[winnr].cursorline = true

-- explicitly disable signcolumn
vim.wo[winnr].signcolumn = 'no'

-- run the command under the cursor
vim.keymap.set('n', '<CR>', function()
run_command(ctx)
Expand Down

0 comments on commit b5342fc

Please sign in to comment.