Permalink
Browse files

Line truncation now done in one place

  • Loading branch information...
1 parent 449552c commit bda09a386b91dd1f5f0b5c0adaa9cd04f1c48c39 @adaszko committed Mar 11, 2013
Showing with 1 addition and 21 deletions.
  1. +0 −17 autoload/chbuf.vim
  2. +1 −4 autoload/getline.vim
View
@@ -80,26 +80,9 @@ function! MatchBuffer(input) " {{{
return buffers
endfunction " }}}
-function! LongestPrefixFitting(elems, length) " {{{
- let curlen = 0
-
- for i in range(len(a:elems))
- let curlen += strlen(a:elems[i])
- if curlen > a:length
- if i == 0
- return []
- else
- return a:elems[:i-1]
- endif
- endif
- endfor
-
- return a:elems
-endfunction " }}}
function! BufferNameCallback(input) " {{{
let buffers = MatchBuffer(a:input)
let cols = &columns - len(buffers) - 1 - 1
- let buffers = LongestPrefixFitting(buffers, cols)
if len(buffers) == 0
return ''
View
@@ -1,12 +1,9 @@
-" TODO Multiply &columns by &cmdheight
-
-
let s:save_cpo = &cpo
set cpo&vim
function! s:Echo(line)
- echon strpart(a:line, 0, &columns-1)
+ echon strpart(a:line, 0, &columns - 1)
endfunction

0 comments on commit bda09a3

Please sign in to comment.