Skip to content

Commit a8cfbd8

Browse files
committed
fix(picker): allow "select" for preferred_picker
1 parent 6c140d7 commit a8cfbd8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Install the plugin with your favorite package manager. See the [Configuration](#
9494
```lua
9595
-- Default configuration with all available options
9696
require('opencode').setup({
97-
preferred_picker = nil, -- 'telescope', 'fzf', 'mini.pick', 'snacks', if nil, it will use the best available picker. Note mini.pick does not support multiple selections
97+
preferred_picker = nil, -- 'telescope', 'fzf', 'mini.pick', 'snacks', 'select', if nil, it will use the best available picker. Note mini.pick does not support multiple selections
9898
preferred_completion = nil, -- 'blink', 'nvim-cmp','vim_complete' if nil, it will use the best available completion
9999
default_global_keymaps = true, -- If false, disables all default global keymaps
100100
default_mode = 'build', -- 'build' or 'plan' or any custom configured. @see [OpenCode Agents](https://opencode.ai/docs/modes/)

lua/opencode/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
---@field get_key_for_function fun(scope: 'editor'|'input_window'|'output_window', function_name: string): string|nil
151151

152152
---@class OpencodeConfig
153-
---@field preferred_picker 'telescope' | 'fzf' | 'mini.pick' | 'snacks' | nil
153+
---@field preferred_picker 'telescope' | 'fzf' | 'mini.pick' | 'snacks' | 'select' | nil
154154
---@field preferred_completion 'blink' | 'nvim-cmp' | 'vim_complete' | nil -- Preferred completion strategy for mentons and commands
155155
---@field default_global_keymaps boolean
156156
---@field default_mode 'build' | 'plan' | string -- Default mode

lua/opencode/ui/picker.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ function M.get_best_picker()
44
local config = require('opencode.config')
55

66
local preferred_picker = config.preferred_picker
7-
if preferred_picker and preferred_picker ~= '' then
7+
if preferred_picker and type(preferred_picker) == 'string' and preferred_picker ~= '' then
8+
if preferred_picker == 'select' then
9+
return nil
10+
end
11+
812
return preferred_picker
913
end
1014

0 commit comments

Comments
 (0)