Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions plugin/commandline_complete.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"***************************************************************************************************
" File: commandline_complete.vim
"
" Version: 0.5.0
" Version: 0.5.0
"
" Author: Jia Shi <j5shi.vip@gmail.com>
"
Expand All @@ -10,7 +10,7 @@
" License: The VIM License
"
" Usage: When editing the command-line, press <c-j> or <c-k> to complete
" the word before the cursor with the matched keywords found in
" the word before the cursor with the matched keywords found in
" the current buffer and $MYVIMRC, if any.
"
" If you want to use other keys instead of default <c-j> <c-k> to
Expand All @@ -21,7 +21,7 @@
"
" This will use <C-p> <C-n> to search backward and forward.
"
" Without python, the complete speed will be a bit slow with large
" Without python, the complete speed will be a bit slow with large
" file (e.g. > 100K). Compile your vim with python is recommended.
"***************************************************************************************************
" Anti-reinclusion guards
Expand Down Expand Up @@ -320,7 +320,7 @@ function! s:CmdlineComplete(backward)
let s:sought_fw = 0
endif

if (s:sought_bw + s:sought_fw <= line("$")) &&
if (s:sought_bw + s:sought_fw <= line("$")) &&
\ ((a:backward && s:comp_i == 0) || !a:backward && (s:comp_i == len(s:completions) - 1))
let success = 0

Expand Down Expand Up @@ -362,3 +362,5 @@ function! s:CmdlineComplete(backward)

return substitute(old, ".", "\<c-h>", "g") . new
endfunction

let &cpo = s:save_cpo