95 Commits
Author SHA1 Message Date
leafOfTree ed9e40037f Fix indent after an empty tag with '>' in attributes
A line like <input @input="(e) => update(e)" /> was taken as an empty
tag without '/>', as '>' in '=>' matched its end, so the next line was
indented one level less. Skip '>' in quotes, and don't take '/>' as the
end of an empty tag.
2026-10-21 14:03:35 +00:00
leafOfTree de9fbec1ad Handle syntax without syntax or indent files
A syntax in the config without a syntax file, like postcss, showed
E484 on opening a file. Skip loading it, with a warning in debug.

A syntax without an indent file used cindent, which broke indent of
languages like pug, stylus without their plugins, or toml. Keep the
indent instead. Lines outside blocks still use cindent.
2026-10-21 13:51:38 +00:00
leaf 25e386280c Merge pull request #45 from leafOfTree/undo-ftplugin
Undo ftplugin and indent settings when filetype changes
2026-10-21 20:22:29 +08:00
leaf 047a73947b Merge pull request #43 from leafOfTree/shiftwidth-zero
Support shiftwidth=0 in indent and fold
2026-10-21 20:21:36 +08:00
leafOfTree 07df7903af Undo ftplugin and indent settings when filetype changes
Set b:undo_ftplugin for matchpairs, matchit variables, b:syng_str and
the foldexpr settings, and b:undo_indent for indent settings, instead of
relying on whichever indent file was loaded last.
2026-10-21 12:12:56 +00:00
leafOfTree abb7144824 Support shiftwidth=0 in indent and fold
With shiftwidth=0, Vim uses the value of tabstop, but &sw is 0. So
multiline tags and brackets got wrong indent, and fold levels were wrong
as indent was divided by 0. Use shiftwidth() instead, which is the same
as &sw when it isn't 0.
2026-10-21 12:11:58 +00:00
leafOfTree acdcadc39b Fix undefined a:block in indent
s:AdjustBlockIndent() had `let block = a:block` without such an argument,
so GetVueIndent() hit E121 for every line in template, script and style.
It was hidden as errors in 'indentexpr' are silent and the function goes
on, but showed up when calling GetVueIndent() directly.

Also return [0, 0] in s:PrevMultilineEmptyTag() when no tag start is
found, instead of no value.

Add ExpectIndentEachLine() for tests to call GetVueIndent() for each
line and check the result.
2026-10-21 12:11:30 +00:00
leafOfTree 4d31393b03 Remove timer usage 2023-01-31 17:29:23 +08:00
leafOfTree 0e68102487 Improve multiple line tag syntax and custom tag indent 2021-08-04 11:14:15 +08:00
leafOfTree 3d2680a859 Support view block 2021-07-30 14:41:13 +08:00
leafOfTree 6a94c30ec7 Add new 'initial indent' option 2021-04-16 13:33:56 +08:00
leafOfTree 87922641ad Fix various indent issues 2021-04-15 18:49:29 +08:00
leafOfTree 3ed1e89f55 Defer indent load time 2021-04-15 13:10:22 +08:00
leafOfTree ed7e1a9898 Use runtime typescript indent for javascript 2021-04-14 22:50:37 +08:00
leafOfTree c71f55019b Fix Vim built-in javascript indent on closing parenthesis 2021-04-14 12:01:33 +08:00
leafOfTree 5be2325222 Fix Vim built-in javascript indent 2021-04-14 11:44:14 +08:00
leafOfTree 11c04aaf7b Fix no highlight after loading session 2021-04-01 10:33:38 +08:00
leafOfTree b617e1e110 Fix indent for blocks in template 2021-03-31 18:37:28 +08:00
leafOfTree fc75f3c474 Fix template in pug indent error 2021-03-30 13:20:42 +08:00
leafOfTree 665d8a18b3 Fix syntax for template inside template 2021-03-30 10:29:56 +08:00
leafOfTree d90b18e1c7 Update doc/message 2021-03-29 17:31:39 +08:00
leafOfTree e1dab23589 Improve code and performance 2021-03-29 15:58:50 +08:00
leafOfTree 2b050c42c1 Refactor the whole plugin 2021-03-23 11:50:46 +08:00
leafOfTree 9af7723bd1 Support custom blocks syntax and indent 2021-03-11 14:52:38 +08:00
leafOfTree f3813ab0e4 Preserve shiftwidth across loading sub-syntax indent files 2021-01-13 12:42:10 +08:00
leafOfTree 2802a661bd Not set local 'tabstop' and 'shiftwidth' in plugin 2020-12-11 10:13:11 +08:00
leafOfTree de581bc075 Add Vue subtype onChange event 2020-10-13 14:51:25 +08:00
leafOfTree 9be92aa256 Highlight keywords with required indent 2020-08-12 15:13:38 +08:00
leafOfTree 042284ed01 Add a: to function arg 'lnum' 2020-08-12 14:38:49 +08:00
leafOfTree 1d99d84ef2 Fix indent after empty tag 2020-07-17 09:05:13 +08:00
leafOfTree b22a41fb6b Use a help function to get user config 2020-07-17 08:45:06 +08:00
leafOfTree 1eeb7b4d42 Support third party scss plugins 2020-07-14 19:53:19 +08:00
leafOfTree 34dff9369e Change sass syntax name to sassVueStyle to support emmet 2020-05-14 07:32:10 +08:00
Chris Vincent 18d23d2add Add skeleton stylus support 2020-04-26 00:38:07 -06:00
leafOfTree 6a958cedcc Handle folding in script and template/style separately 2020-04-13 14:53:02 +08:00
leafOfTree 640a874b2f Restore formatoptions changed by pug 2020-01-09 17:51:35 +08:00
leafOfTree 74cd78ba77 Fix local formatoptions value changed by pug 2020-01-09 17:47:36 +08:00
leafOfTree d9c0860388 Fix indentation after empty tags for vim8.1 2020-01-09 12:58:33 +08:00
leafOfTree 685c3f59d0 Support TypeScript indent 2020-01-06 17:27:29 +08:00
leafOfTree 8ce5b2d3e6 Improve code 2019-10-21 18:56:23 +08:00
leafOfTree e413df775e Add init indent if ind < 1 2019-10-12 15:37:34 +08:00
leafOfTree 915689d653 Check current line syntax instead of previous 2019-10-11 15:32:02 +08:00
DCRichards 2da2a2fe03 15: Moved Log function to autoload and replace echom 2019-10-08 10:34:52 +01:00
leafOfTree 2124cbbe77 Add ':' to indentkeys 2019-09-11 11:25:04 +08:00
leafOfTree d567055d3d Fix pug template indentation error 2019-09-11 10:32:59 +08:00
leafOfTree 64662a93ef Extract vim builtin css/xml indent files 2019-09-10 11:01:27 +08:00
leafOfTree 02c545c691 Support coffee indent 2019-08-29 11:34:50 +08:00
yemai d0caaa7618 fix: less/scss indentation error 2019-08-25 15:29:10 +08:00
yemai 5a6b508859 refact: improve pre-processors syntax 2019-08-24 22:14:44 +08:00
yemai 42be0e3549 fix: indentation error that is caused by comments following <script> 2019-08-24 19:49:51 +08:00