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
2 changes: 1 addition & 1 deletion autoload/braceless.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let s:pattern_cache = {}
" Default patterns
let s:pattern_default = {}
let s:pattern_default.python = {
\ 'start': '\<\%(if\|def\|for\|try\|elif\|else\|with\|class\|while\|except\|finally\)\>\_.\{-}:\ze\s*\%(\_$\|#\)',
\ 'start': '\<\%(if\|async\|def\|for\|try\|elif\|else\|with\|class\|while\|except\|finally\)\>\_.\{-}:\ze\s*\%(\_$\|#\)',
\ 'decorator': '\_^\s*@\%(\k\|\.\)\+\%((\_.\{-})\)\?\_$',
\ 'end': '\S',
\}
Expand Down
30 changes: 30 additions & 0 deletions test/selection.vader
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,33 @@ Expect python (innermost function replaced):
def example():
x
return example


Given python (async function):
==========================================
async def example():
async with foo:
a
b
c
return 42

Do (replace inner block):
================================
3GciPx

Expect python (innermost function replaced):
============================================
async def example():
async with foo:
x
return 42

Do (replace inner block):
================================
ciPx

Expect python (innermost function replaced):
============================================
async def example():
x