diff --git a/lua/lspsaga/codeaction/init.lua b/lua/lspsaga/codeaction/init.lua index 2d7267e0b..e5f91fa70 100644 --- a/lua/lspsaga/codeaction/init.lua +++ b/lua/lspsaga/codeaction/init.lua @@ -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(), } diff --git a/lua/lspsaga/init.lua b/lua/lspsaga/init.lua index 4920d032c..707cade30 100644 --- a/lua/lspsaga/init.lua +++ b/lua/lspsaga/init.lua @@ -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',