Skip to content
This repository was archived by the owner on Mar 5, 2020. It is now read-only.
Closed
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
4 changes: 4 additions & 0 deletions autoload/minisnip.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function! minisnip#Minisnip() abort
" adjust the indentation, use the current line as reference
let l:ws = matchstr(getline(line('.')), '^\s\+')
let l:lns = map(readfile(s:snippetfile), 'empty(v:val)? v:val : l:ws.v:val')
let l:nlines = len(l:lns)

" remove the snippet keyword
" go to the position at the beginning of the snippet
Expand Down Expand Up @@ -74,6 +75,9 @@ function! minisnip#Minisnip() abort
" go to the beginning of the snippet
execute ':normal! '.(s:begcol - strchars(s:cword)).'|'

" auto indent
execute ':normal! =' . l:nlines . 'j'

" select the first placeholder
call s:SelectPlaceholder()
else
Expand Down