summaryrefslogtreecommitdiffstats
path: root/autoload/scss_indent.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-04-23 11:32:40 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-04-23 11:32:40 +0200
commit4d18a5e5dd427a2962fe34c6a12007cac67ce89c (patch)
tree1a7cb73806c54fbbdc1e3645e0ee1d7e5559c1a0 /autoload/scss_indent.vim
parenta55b6aa3aa797c989a4979a13a5bd2ae11cfd4a5 (diff)
downloadvim-polyglot-4d18a5e5dd427a2962fe34c6a12007cac67ce89c.tar.gz
vim-polyglot-4d18a5e5dd427a2962fe34c6a12007cac67ce89c.zip
Update
Diffstat (limited to 'autoload/scss_indent.vim')
-rw-r--r--autoload/scss_indent.vim41
1 files changed, 0 insertions, 41 deletions
diff --git a/autoload/scss_indent.vim b/autoload/scss_indent.vim
deleted file mode 100644
index 27caa780..00000000
--- a/autoload/scss_indent.vim
+++ /dev/null
@@ -1,41 +0,0 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1
- finish
-endif
-
-" usage:
-" set indentexpr=scss_indent#GetIndent(v:lnum)
-fun! scss_indent#GetIndent(lnum)
- " { -> increase indent
- " } -> decrease indent
- if a:lnum == 1
- " start at 0 indentation
- return 0
- endif
-
- " try to find last line ending with { or }
- " ignoring // comments
- let regex = '\([{}]\)\%(\/\/.*\)\?$'
- let nr = search(regex, 'bnW')
- if nr > 0
- let last = indent(nr)
- let m = matchlist(getline(nr), regex)
- let m_curr = matchlist(getline(a:lnum), regex)
- echoe string(m).string(m_curr)
- if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{'
- " last was open, current is close, use same indent
- return last
- elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}'
- " } line and last line was }: decrease
- return last - &sw
- endif
- if m[1] == '{'
- " line after {: increase indent
- return last + &sw
- else
- " line after } or { - same indent
- return last
- endif
- else
- return 0
- endif
-endfun