inconsistency in selecting empty line followed by closing bun at the start of line · Issue #161 · machakann/vim-sandwich · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I want to select the lines surrounded by a pair of comment markers like this:
/*
line 1
line 2
*/
So I tried the following recipes, but they don't work properly for empty lines.
Run with vim --clean -u repro.vim, and use ic and iC mappings to select the lines.
" repro.vimsetnocompatiblesetrtp^=~/.vim/plugged/vim-sandwichletg:sandwich#recipes = [
\ {'buns': ['\v^/\*\n', '\v\n\*/$'], 'regex': 1, 'kind': ['textobj'], 'input': ['c']},
\ {'buns': ['\v^/\*\n', '\v^\*/$'], 'regex': 1, 'kind': ['textobj'], 'input': ['C']},
\ ]
xmapic<Plug>(textobj-sandwich-query-i)cxmapiC<Plug>(textobj-sandwich-query-i)Cinsert
/*
But if the lastlineisempty,
`ic` doesn'tinclude the lastline, and
`iC` includes the comment marker
*/
.
ic:
iC:
Is it possible to make a recipe that properly selects the entire lines surrounded by the markers, like this?
The text was updated successfully, but these errors were encountered:
tomtomjhj
changed the title
empty line, EOL, and closing bun
empty line followed by closing bun at the start of line
Jun 6, 2023
tomtomjhj
changed the title
empty line followed by closing bun at the start of line
inconsistency in selecting empty line followed by closing bun at the start of line
Jun 6, 2023
Hi, I want to select the lines surrounded by a pair of comment markers like this:
So I tried the following recipes, but they don't work properly for empty lines.
Run with
vim --clean -u repro.vim
, and useic
andiC
mappings to select the lines.ic
:iC
:Is it possible to make a recipe that properly selects the entire lines surrounded by the markers, like this?

The text was updated successfully, but these errors were encountered: