Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit52ef7ab

Browse files
committed
moved functions that restore cursor position near to where cursor is moved
1 parent60c638d commit52ef7ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎autoload/pymode/folding.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ fun! pymode#folding#foldcase(lnum) "{{{
137137
endif"}}}
138138

139139
" Blocks. {{{
140+
lets:save_cursor=getcurpos()
140141
let line_block_start=s:BlockStart(a:lnum)
141142
let line_block_end=s:BlockEnd(a:lnum)
142143
let prev_line_block_start=s:BlockStart(a:lnum-1)
@@ -154,7 +155,10 @@ fun! pymode#folding#foldcase(lnum) "{{{
154155
letl:foldlevel=indent(line_block_start) / &shiftwidth+1
155156
endif
156157
endif
158+
callsetpos('.',s:save_cursor)
157159
return {'foldcase':l:foldcase,'foldlevel':l:foldlevel}
160+
else
161+
callsetpos('.',s:save_cursor)
158162
endif
159163
" endif " }}}
160164

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp