runtime(sass): Provide sass_recommended_style option
Commit:
https://github.com/vim/vim/commit/a907c91992167e41da41008d4370e434e324cbf2
Author: Tim Pope <[email protected]>
Date: Thu Dec 28 12:49:07 2023 -0500
runtime(sass): Provide sass_recommended_style option
diff --git a/runtime/ftplugin/sass.vim b/runtime/ftplugin/sass.vim
index 9ce446137..e650be931 100644
--- a/runtime/ftplugin/sass.vim
+++ b/runtime/ftplugin/sass.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Sass
" Maintainer: Tim Pope <[email protected]>
-" Last Change: 2019 Dec 05
+" Last Change: 2023 Dec 28
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -23,6 +23,11 @@ if &filetype =~# '\<s[ac]ss]\>'
let b:undo_ftplugin .= ' isk<'
endif
+if get(g:, 'sass_recommended_style', 1)
+ setlocal shiftwidth=2 softtabstop=2 expandtab
+ let b:undo_ftplugin .= ' sw< sts< et<'
+endif
+
let &l:define = '^\C
\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
diff --git a/runtime/indent/sass.vim b/runtime/indent/sass.vim
index 8c0ecd074..45dc869a5 100644
--- a/runtime/indent/sass.vim
+++ b/runtime/indent/sass.vim
@@ -1,14 +1,14 @@
" Vim indent file
" Language: Sass
" Maintainer: Tim Pope <[email protected]>
-" Last Change: 2022 Mar 15
+" Last Change: 2023 Dec 28
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
-setlocal autoindent sw=2 et
+setlocal autoindent
setlocal indentexpr=GetSassIndent()
setlocal indentkeys=o,O,*<Return>,<:>,!^F
@@ -26,10 +26,8 @@ function! GetSassIndent()
let lnum = prevnonblank(v:lnum-1)
let line = substitute(getline(lnum),'\s\+$','','')
let cline =
substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
- let lastcol = strlen(line)
let line = substitute(line,'^\s\+','','')
let indent = indent(lnum)
- let cindent = indent(v:lnum)
if line !~ s:property && line !~ s:extend && cline =~ s:property
return indent + shiftwidth()
else
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1rIytC-001GLW-JN%40256bit.org.