1 Star 0 Fork 0

killf/python-mode

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
textobject.vim 664 Bytes
一键复制 编辑 原始数据 按行查看 历史
Lie Ryan 提交于 2020-04-26 07:17 +08:00 . Add test for textobjects selection
" Load sample python file.
" With 'def'.
execute "normal! idef func1():\<CR> a = 1\<CR>"
execute "normal! idef func2():\<CR> b = 2"
normal 3ggdaMggf(P
" Assert changes.
let content=getline('^', '$')
call assert_true(content == ['def func2():', ' b = 2', 'def func1():', ' a = 1'])
" Clean file.
%delete
" With 'class'.
execute "normal! iclass Class1():\<CR> a = 1\<CR>"
execute "normal! iclass Class2():\<CR> b = 2\<CR>"
normal 3ggdaCggf(P
" Assert changes.
let content=getline('^', '$')
call assert_true(content == ['class Class2():', ' b = 2', '', 'class Class1():', ' a = 1'])
if len(v:errors) > 0
cquit!
else
quit!
endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/killf/python-mode.git
git@gitee.com:killf/python-mode.git
killf
python-mode
python-mode
develop

搜索帮助