diff options
author | mityu <mityu.email@gmail.com> | 2020-01-21 11:59:51 +0900 |
---|---|---|
committer | mityu <mityu.email@gmail.com> | 2020-01-21 11:59:51 +0900 |
commit | b75b06bd0b099cb7e2c54863dbe91bc3a3028d5f (patch) | |
tree | c80588d1397cd845d1df2be2bc32d759758f5079 /autoload | |
parent | 670e2e61d089bafacab4d3994578c58794307ef2 (diff) | |
download | vim-sonictemplate-b75b06bd0b099cb7e2c54863dbe91bc3a3028d5f.tar.gz vim-sonictemplate-b75b06bd0b099cb7e2c54863dbe91bc3a3028d5f.tar.bz2 vim-sonictemplate-b75b06bd0b099cb7e2c54863dbe91bc3a3028d5f.zip |
Squashed commit of the following:
commit e972aa09aa158189c36913b62a4344cb3ca78c76
Merge: 0925277 4d00bdb
Author: mattn <mattn.jp@gmail.com>
Date: Tue Jan 14 18:26:58 2020 +0900
Merge pull request #39 from sgur/fix/error_on_normal
Prefix noautocmd to "normal!" commands which trigger TextChange events.
commit 4d00bdb4b7e60e0466d3a6e5791779f8ebe7d8fc
Author: sgur <sgurrr@gmail.com>
Date: Tue Jan 14 16:28:05 2020 +0900
Prefix noautocmd to normal! commands which trigger TextChange events.
Fix #38
commit 0925277597e5db0e4b601aecc290b79db239b174
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Fri Dec 27 15:59:12 2019 +0900
Add snippets for typescript
commit 20a19f48f9db3a32c3ebc0352fe094bd9816cd38
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Wed Dec 25 17:04:37 2019 +0900
Add base-main.scala
commit e746cdf5c5dc8d3849b7e2517c4a24e57d931dd3
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Sat Dec 21 23:11:46 2019 +0900
Strictly
commit c512546f04de8a185d40292dd0860d81d1896130
Merge: 859adef 47c0d77
Author: mattn <mattn.jp@gmail.com>
Date: Thu Nov 14 19:01:33 2019 +0900
Merge pull request #37 from anekos/fix/dont-kill-my-register
Avoid updating register
commit 47c0d77f6cad63ea17b0fa6c87d585768c35cf89
Author: anekos <anekos@snca.net>
Date: Thu Nov 14 18:46:36 2019 +0900
Avoid updating register
commit 859adef1e67cc0fb1a99e4e3f3d58360f5464f02
Merge: 4e1b1a3 5e752a5
Author: mattn <mattn.jp@gmail.com>
Date: Tue Oct 8 16:00:33 2019 +0900
Merge pull request #36 from wallysslima/master
replace deprecated MANTAINER with LABEL in Dockerfile
commit 4e1b1a36a95e899ad4415d7b4373e2c0e3ff05af
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Sun Oct 6 21:29:01 2019 +0900
Add build.gradle for kotlin
commit 5e752a5bf606ec50fffca5a2269ade32a22c1fe4
Author: Wallyss Lima <wallysslima@gmail.com>
Date: Thu Oct 3 11:58:22 2019 -0300
replace deprecated MANTAINER with LABEL in Dockerfile
commit 51a9cec47ad815451a8cdf1408a50ea525111442
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Wed Oct 2 11:26:01 2019 +0900
Fix feedkeys
commit 807562bbebb7b7c033823ebd3b13b32a814d4f7f
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Wed Oct 2 10:41:10 2019 +0900
Use flag n for feedkeys
commit 7db10f422f61819a1a8f45d0dade1de17ecab2b6
Merge: 31de6a5 39cf197
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Wed Oct 2 10:06:35 2019 +0900
Merge branch 'master' of https://github.com/mattn/sonictemplate-vim
commit 31de6a5e48b65dface121e654e40e06de6bf364a
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Wed Oct 2 09:25:34 2019 +0900
Update postfix completion
commit 39cf197d0e46eeff8f905063ba5030e8690169b3
Merge: df88ac3 2f49560
Author: mattn <mattn.jp@gmail.com>
Date: Thu Sep 26 14:28:34 2019 +0900
Merge pull request #34 from hiroebe/fix-shiftwidth
Use shiftwidth() instead of &shiftwidth
commit 2f49560db7699d7988a817a4f69f8b684cecdfee
Author: hiroebe <hiro.ebe.albirex12@gmail.com>
Date: Mon Sep 16 17:17:12 2019 +0900
Use shiftwidth() instead of &shiftwidth
commit df88ac36ed24e68d7d9d7e4d9aa471575d3c79bd
Author: mattn <mattn.jp@gmail.com>
Date: Wed Aug 14 15:01:05 2019 +0900
Create FUNDING.yml
commit c1ec4cdaf215f22c86040584cb1eef2b3ac2b741
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Date: Fri Jul 12 22:29:15 2019 +0900
Fix socket server
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/sonictemplate.vim | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index a7476f8..15fac9a 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -1,7 +1,7 @@ "============================================================================= " sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> -" Last Change: 04-Jun-2019. +" Last Change: 21-Jan-2020. let s:save_cpo = &cpo set cpo&vim @@ -68,7 +68,7 @@ function! s:get_candidate(fts, lead) endif try let ft = s:get_filetype() - let cxt = sonictemplate#lang#{ft!=""?ft:"_"}#guess() + let cxt = sonictemplate#lang#{ft !=# '' ? ft : '_'}#guess() if has_key(cxt, 'prefix') let prefix = cxt['prefix'] call s:setopt('prefix', cxt['prefix']) @@ -281,11 +281,11 @@ function! sonictemplate#apply(name, mode, ...) abort if !buffer_is_not_empty let c = substitute(c, '{{_inline_}}\s*', '', 'g') if &expandtab || (&shiftwidth && &tabstop != &shiftwidth) - let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') + let c = substitute(c, "\t", repeat(' ', shiftwidth()), 'g') endif silent! %d _ silent! put = c - silent! normal! ggdd + silent! normal! gg"_dd else if c[len(c)-1] == "\n" let c = c[:-2] @@ -295,7 +295,7 @@ function! sonictemplate#apply(name, mode, ...) abort let c = join(split(c, "\n"), "") let oldindentexpr = &indentexpr let &indentexpr = '' - silent! exe "normal! a\<c-r>=c\<cr>" + noautocmd silent! exe "normal! a\<c-r>=c\<cr>" let &indentexpr = oldindentexpr return else @@ -309,12 +309,12 @@ function! sonictemplate#apply(name, mode, ...) abort endif let c = indent . substitute(substitute(c, "\n", "\n".indent, 'g'), "\n".indent."\n", "\n\n", 'g') if len(indent) && (&expandtab || (&shiftwidth && &tabstop != &shiftwidth) || indent =~ '^ \+$') - let c = substitute(c, "\t", repeat(' ', min([len(indent), &shiftwidth])), 'g') + let c = substitute(c, "\t", repeat(' ', min([len(indent), shiftwidth()])), 'g') elseif &expandtab || (&shiftwidth && &tabstop != &shiftwidth) - let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') + let c = substitute(c, "\t", repeat(' ', shiftwidth()), 'g') endif if line('.') < line('$') - silent! normal! dd + silent! normal! "_dd endif silent! put! =c endif @@ -354,9 +354,9 @@ function! sonictemplate#postfix() if c =~ "\n" let c = indent . substitute(substitute(c, "\n", "\n".indent, 'g'), "\n".indent."\n", "\n\n", 'g') if len(indent) && (&expandtab || (&shiftwidth && &tabstop != &shiftwidth) || indent =~ '^ \+$') - let c = substitute(c, "\t", repeat(' ', min([len(indent), &shiftwidth])), 'g') + let c = substitute(c, "\t", repeat(' ', min([len(indent), shiftwidth()])), 'g') elseif &expandtab || (&shiftwidth && &tabstop != &shiftwidth) - let c = substitute(c, "\t", repeat(' ', &shiftwidth), 'g') + let c = substitute(c, "\t", repeat(' ', shiftwidth()), 'g') endif call setline('.', line) if line('.') < line('$') @@ -367,7 +367,7 @@ function! sonictemplate#postfix() call setline('.', line) let oldindentexpr = &indentexpr let &indentexpr = '' - silent! exe "normal! a\<c-r>=c\<cr>" + noautocmd silent! exe "normal! a\<c-r>=c\<cr>" let &indentexpr = oldindentexpr endif if stridx(c, '{{_cursor_}}') != -1 |