Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions autoload/textobj/fold.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ endfunction
function! textobj#fold#select_i()
call s:move_to_the_start_point()
let start_pos = getpos('.')
if &foldmethod ==# 'marker'
" Next line
let start_pos[1] += 1
endif
for i in range(v:count1 - 1)
call s:move_to_the_end_point('i', 0)
normal! j
endfor
call s:move_to_the_end_point('i', 0)
let end_pos = getpos('.')
if &foldmethod ==# 'marker'
" Previous line
let end_pos[1] -= 1
endif

return ['V', start_pos, end_pos]
endfunction
Expand Down
6 changes: 3 additions & 3 deletions doc/textobj-fold.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ KEY MAPPINGS *textobj-fold-key-mappings*
Leading or trailing lines which are not in any foldings are also
counted too.

If the current |foldmethod| is "foldmarker", ignore the lines that
contain the marker.

Note that this object is linewise. In Visual mode, the current
selection will be switched to linewise. In Operator-pending mode,
affected text will be linewise.
Expand Down Expand Up @@ -105,9 +108,6 @@ BUGS *textobj-fold-bugs*
- Even if user explicitly specify a wise for an operator by |o_v| or others,
|<Plug>(textobj-fold-a)| and |<Plug>(textobj-fold-i)| are always linewise.

- |<Plug>(textobj-fold-a)| is not perfectly implemented. Currently, it
behaves as same as |<Plug>(textobj-fold-i)|.

- In Visual-mode, the current selection is overriden by new selection.

- In Visual-mode, repeating |<Plug>(textobj-fold-a)| and other mappings don't
Expand Down