Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

不再使用自定义的 Strwidth 函数

  • Loading branch information...
commit 8fa0192ba813ca92a240f924546ac3f6422b31db 1 parent 159681c
@lilydjwg authored
Showing with 13 additions and 13 deletions.
  1. +13 −4 plugin/bufexplorer.vim
  2. +0 −9 vimrc
View
17 plugin/bufexplorer.vim
@@ -46,6 +46,16 @@ if v:version < 700
finish
endif
+if exists("*strwidth")
+ function s:strwidth(s)
+ return strwidth(a:s)
+ endfunction
+else
+ function s:strwidth(s)
+ return len(a:s)
+ endfunction
+endif
+
" Public Interface {{{1
if maparg("<Leader>be") =~ 'BufExplorer'
nunmap <Leader>be
@@ -617,7 +627,7 @@ function! s:BEGetBufferInfo(bufnr)
if b.attributes !~ "u"
" lilydjwg: support CJK chars
- call add(listedwidths[n], Strwidth(b[n]))
+ call add(listedwidths[n], s:strwidth(b[n]))
endif
endfor
endfor
@@ -667,8 +677,7 @@ function! s:BEBuildBufferList()
let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"
let path = buf[type]
let pad = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname
- " lilydjwg: support CJK chars
- let line .= buf.shortname." ".strpart(pad.path, Strwidth(buf.shortname))
+ let line .= buf.shortname." ".strpart(pad.path, s:strwidth(buf.shortname))
else
let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname"
let path = buf[type]
@@ -678,7 +687,7 @@ function! s:BEBuildBufferList()
let pads = (g:bufExplorerShowUnlisted) ? s:allpads : s:listedpads
if !empty(pads[type])
- let line .= strpart(pads[type], Strwidth(path))." "
+ let line .= strpart(pads[type], s:strwidth(path))." "
endif
let line .= buf.line
View
9 vimrc
@@ -355,15 +355,6 @@ function Lilydjwg_remark()
highlight def MarkWord5 ctermbg=Magenta ctermfg=Black guibg=#FFB3FF guifg=Black
highlight def MarkWord6 ctermbg=Blue ctermfg=Black guibg=#9999FF guifg=Black
endfunction
-if exists("*strwidth")
- function Strwidth(s)
- return strwidth(a:s)
- endfunction
-else
- function Strwidth(s)
- return len(a:s)
- endfunction
-endif
" set 相关[[[1
" 一般设置[[[2
" set guifont=文泉驿等宽正黑\ Medium\ 10
Please sign in to comment.
Something went wrong with that request. Please try again.