提交 ba54df53 编写于 作者: J Junegunn Choi

Better handling of tab characters using strdisplaywidth

上级 d041e17b
......@@ -67,9 +67,9 @@ let s:shorthand = {
\ 'mode_sequence': 'm', 'ignores': 'ig', 'filter': 'f'
\ }
if exists("*strwidth")
if exists("*strdisplaywidth")
function! s:strwidth(str)
return strwidth(a:str) + len(matchstr(a:str, '^\t*')) * (&tabstop - 1)
return strdisplaywidth(a:str)
endfunction
else
function! s:strwidth(str)
......
......@@ -117,4 +117,26 @@ Expect:
n2gv = {}
n2vt = {}
Given (Tab-indented code (#20)):
class MyUnitTest(unittest.TestCase):
def test_base(self):
# n2f= {}
## n2v= {}
# f2v = {}
## n2gv = {}
# n2vt = {}
Execute:
set tabstop=12
%EasyAlign=
Expect:
class MyUnitTest(unittest.TestCase):
def test_base(self):
# n2f = {}
## n2v = {}
# f2v = {}
## n2gv = {}
# n2vt = {}
Include: include/teardown.vader
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册