Skip to content

Commit d93f027

Browse files
authored
Merge pull request #45 from PangPangPangPangPang/master
add 'ignore_case' config
2 parents d058e58 + 1229bea commit d93f027

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

MANUAL.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
QuickUI is fully customizable, and can be easily configurated.
44

5-
# Content
5+
# Content
66

77
<!-- TOC -->
88

@@ -252,7 +252,9 @@ open the context menu:
252252
quickui#context#open(content, opts)
253253
```
254254

255-
Parameter `content` is a list of `[text, command]` items. `opts` is a dictionary of options, has similar options in `listbox`.
255+
Parameter `content` is a list of `[text, command]` items. `opts` is a dictionary of options, has similar options in `listbox` but an additional option:
256+
257+
- `ignore_case`: ignore case of the keyword, default 1.
256258

257259
**Sample code**:
258260

@@ -404,8 +406,8 @@ There is a builtin buffer switcher using `listbox`, open it by:
404406

405407
call quickui#tools#list_buffer('e')
406408

407-
or
408-
409+
or
410+
409411
call quickui#tools#list_buffer('tabedit')
410412

411413
Then `hjkl` to navigate, `enter`/`space` to switch buffer and `ESC`/`CTRL+[` to quit:
@@ -550,4 +552,3 @@ It is time for me to bring these ideas to reality, just start from this plugin.
550552
## Credit
551553

552554
like vim-quickui? Follow the repository on [GitHub](https://github.com/skywind3000/vim-quickui) and vote for it on [vim.org](https://www.vim.org/scripts/script.php?script_id=5845). And if you're feeling especially charitable, follow skywind3000 on [Twitter](https://twitter.com/skywind3000) and [GitHub](https://github.com/skywind3000).
553-

autoload/quickui/context.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function! s:vim_create_context(textlist, opts)
132132
let hwnd.hotkey = {}
133133
for item in hwnd.items
134134
if item.enable != 0 && item.key_pos >= 0
135-
let key = tolower(item.key_char)
135+
let key = ignore_case ? tolower(item.key_char) : item.key_char
136136
if get(a:opts, 'reserve', 0) == 0
137137
let hwnd.hotkey[key] = item.index
138138
elseif get(g:, 'quickui_protect_hjkl', 0) != 0
@@ -491,6 +491,7 @@ endfunc
491491
"----------------------------------------------------------------------
492492
function! s:nvim_create_context(textlist, opts)
493493
let border = get(a:opts, 'border', g:quickui#style#border)
494+
let ignore_case = get(a:opts, 'ignore_case', 1)
494495
let hwnd = quickui#context#compile(a:textlist, border)
495496
let bid = quickui#core#scratch_buffer('context', hwnd.image)
496497
let hwnd.bid = bid
@@ -519,7 +520,7 @@ function! s:nvim_create_context(textlist, opts)
519520
let hwnd.hotkey = {}
520521
for item in hwnd.items
521522
if item.enable != 0 && item.key_pos >= 0
522-
let key = tolower(item.key_char)
523+
let key = ignore_case ? tolower(item.key_char) : item.key_char
523524
if get(a:opts, 'reserve', 0) == 0
524525
let hwnd.hotkey[key] = item.index
525526
elseif get(g:, 'quickui_protect_hjkl', 0) != 0

0 commit comments

Comments
 (0)