From e5b41ce81a7fbf73f46b0b230947de772a5452f7 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sat, 19 Jul 2014 12:32:54 +0200 Subject: [PATCH] Make xolox#misc#complete#keywords() respect &ignorecase --- README.md | 2 +- autoload/xolox/misc.vim | 4 ++-- autoload/xolox/misc/complete.vim | 8 ++++++-- doc/misc.txt | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index af0983d..05136a6 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ from the source code of the miscellaneous scripts using the Python module The documentation of the 93 functions below was extracted from -19 Vim scripts on July 7, 2014 at 19:00. +19 Vim scripts on July 19, 2014 at 12:32. ### Asynchronous Vim script evaluation diff --git a/autoload/xolox/misc.vim b/autoload/xolox/misc.vim index 44e18bc..74a93e1 100644 --- a/autoload/xolox/misc.vim +++ b/autoload/xolox/misc.vim @@ -1,7 +1,7 @@ " The version of my miscellaneous scripts. " " Author: Peter Odding -" Last Change: July 7, 2014 +" Last Change: July 19, 2014 " URL: http://peterodding.com/code/vim/misc/ -let g:xolox#misc#version = '1.14.1' +let g:xolox#misc#version = '1.14.2' diff --git a/autoload/xolox/misc/complete.vim b/autoload/xolox/misc/complete.vim index 763e0b9..e3818d4 100644 --- a/autoload/xolox/misc/complete.vim +++ b/autoload/xolox/misc/complete.vim @@ -1,7 +1,7 @@ " Tab completion for user defined commands. " " Author: Peter Odding -" Last Change: May 19, 2013 +" Last Change: July 9, 2014 " URL: http://peterodding.com/code/vim/misc/ function! xolox#misc#complete#keywords(arglead, cmdline, cursorpos) @@ -16,7 +16,11 @@ function! xolox#misc#complete#keywords(arglead, cmdline, cursorpos) let words[word] = 1 endfor endfor - return sort(keys(filter(words, 'v:key =~# a:arglead'))) + let arguments = [keys(filter(words, 'v:key =~# a:arglead'))] + if &ignorecase + call add(arguments, 1) + endif + return call('sort', arguments) endfunction " vim: ts=2 sw=2 et diff --git a/doc/misc.txt b/doc/misc.txt index b121655..2a6eff4 100644 --- a/doc/misc.txt +++ b/doc/misc.txt @@ -168,7 +168,7 @@ from the source code of the miscellaneous scripts using the Python module 'vimdoctool.py' included in vim-tools [5]. The documentation of the 93 functions below was extracted from 19 Vim scripts -on July 7, 2014 at 19:00. +on July 19, 2014 at 12:32. ------------------------------------------------------------------------------- *misc-asynchronous-vim-script-evaluation*