Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a max results setting

commit 6e4fb3b45faf96a7fb500d2920cfeeab24aa39fb 1 parent aa026c0
@kien authored
Showing with 9 additions and 2 deletions.
  1. +5 −1 autoload/ctrlp.vim
  2. +4 −1 doc/ctrlp.txt
View
6 autoload/ctrlp.vim
@@ -259,6 +259,10 @@ fu! s:match_window_opts()
\ s:mw =~ 'min:[^,]\+' ? str2nr(matchstr(s:mw, 'min:\zs\d\+')) : 1
let [s:mw_max, s:mw_min] = [max([s:mw_max, 1]), max([s:mw_min, 1])]
let s:mw_min = min([s:mw_min, s:mw_max])
+ let s:mw_res =
+ \ s:mw =~ 'results:[^,]\+' ? str2nr(matchstr(s:mw, 'results:\zs\d\+'))
+ \ : min([s:mw_max, &lines])
+ let s:mw_res = max([s:mw_res, 1])
endf
"}}}1
" * Open & Close {{{1
@@ -576,7 +580,7 @@ fu! s:Update(str)
let s:martcs = &scs && str =~ '\u' ? '\C' : ''
let pat = s:matcher == {} ? s:SplitPattern(str) : str
let lines = s:nolim == 1 && empty(str) ? copy(g:ctrlp_lines)
- \ : s:MatchedItems(g:ctrlp_lines, pat, s:winmaxh)
+ \ : s:MatchedItems(g:ctrlp_lines, pat, s:mw_res)
cal s:Render(lines, pat)
endf
View
5 doc/ctrlp.txt
@@ -123,7 +123,7 @@ heights of the match window: >
let g:ctrlp_match_window = ''
<
Example: >
- let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10'
+ let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10'
<
The position: (default: bottom)
top - show the match window at the top of the screen.
@@ -137,6 +137,9 @@ The minimum and maximum heights:
min:{n} - show minimum {n} lines (default: 1).
max:{n} - show maximum {n} lines (default: 10).
+The maximum number of results:
+ results:{n} - list maximum {n} results (default: sync with max height).
+
Note: When a setting isn't set, its default value will be used.
*'g:ctrlp_switch_buffer'*
Please sign in to comment.
Something went wrong with that request. Please try again.