Skip to content

Commit 5902827

Browse files
committed
refactor: change use_cmd config to show_prompt
1 parent d65aaad commit 5902827

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ require 'window-picker'.setup({
6363
-- "smart" means to use winbar if cmdheight=0 and statusline if cmdheight > 0
6464
use_winbar = 'never', -- "always" | "never" | "smart"
6565

66-
-- whether to show 'Pick window:' message in command line
67-
use_cmd = true,
66+
-- whether to show 'Pick window:' prompt
67+
show_prompt = true,
6868

6969
-- if you want to manually filter out the windows, pass in a function that
7070
-- takes two parameters. you should return window ids that should be

dev/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ end
3333
---@diagnostic disable-next-line: undefined-global
3434
local set_keymap = vim.api.nvim_set_keymap
3535

36-
set_keymap('n', ',r', '<cmd>luafile dev/init.lua<cr>', {})
37-
set_keymap('n', ',w', '<cmd>lua Reload_and_run()<cr>', {})
36+
set_keymap('n', '<leader><leader>r', '<cmd>luafile dev/init.lua<cr>', {})
37+
set_keymap('n', '<leader><leader>w', '<cmd>lua Reload_and_run()<cr>', {})

lua/window-picker/config.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ local config = {
2222
-- "smart" means to use winbar if cmdheight=0 and statusline if cmdheight > 0
2323
use_winbar = 'never', -- "always" | "never" | "smart"
2424

25-
-- whether to show 'Pick window:' message in command line
26-
use_cmd = true,
25+
-- whether to show 'Pick window:' prompt
26+
show_prompt = true,
2727

2828
-- if you want to manually filter out the windows, pass in a function that
2929
-- takes two parameters. you should return window ids that should be

lua/window-picker/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function M.pick_window(custom_config)
180180

181181
if not use_winbar then
182182
v.o.laststatus = 2
183-
if conf.use_cmd then
183+
if conf.show_prompt then
184184
v.o.cmdheight = 1
185185
end
186186
end
@@ -208,7 +208,7 @@ function M.pick_window(custom_config)
208208
end
209209

210210
v.cmd('redraw')
211-
if conf.use_cmd then
211+
if conf.show_prompt then
212212
print('Pick window: ')
213213
end
214214
local _, resp = pcall(util.get_user_input_char)

0 commit comments

Comments
 (0)