We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d9bfb3 commit b5f6e67Copy full SHA for b5f6e67
autoload/easycomplete/popup.vim
@@ -138,8 +138,11 @@ function! s:CurrCharIsChinese()
138
endfunction
139
140
function! s:GetCusorToLineRightEdgeDistance()
141
- let offset = s:CurrCharIsChinese()
142
- return strwidth(getline('.')) - virtcol('.') + 1 + offset
+ let l:chinese_offset = s:CurrCharIsChinese()
+ " 要计算当前行的 \t 的数量,根据&tabstop长度补上差的宽度
143
+ let l:ts_nr = len(substitute(getline('.'), '[^\t]', '', 'g'))
144
+ let l:offset = (&tabstop - 1) * l:ts_nr
145
+ return strwidth(getline('.')) + l:offset - virtcol('.') + 1 + l:chinese_offset
146
147
148
function! s:lint(content, hl, ft)
0 commit comments