Skip to content

Commit

Permalink
add option code_action.only_in_cursor
Browse files Browse the repository at this point in the history
this option mean show code action only when cursor has code action
if want in the line set this to false
  • Loading branch information
glepnir committed Aug 8, 2023
1 parent 671cbb9 commit a11b436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lspsaga/codeaction/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function act:code_action(options)

self.pending_request = true
options = options or {}
if not options.context then
if config.code_action.only_in_cursor and not options.context then
options.context = {
diagnostics = require('lspsaga.diagnostic'):get_cursor_diagnostic(),
}
Expand Down
1 change: 1 addition & 0 deletions lua/lspsaga/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ local default_config = {
num_shortcut = true,
show_server_name = false,
extend_gitsigns = false,
only_in_cursor = true,
max_height = 0.3,
keys = {
quit = 'q',
Expand Down

0 comments on commit a11b436

Please sign in to comment.