Mercurial > vim
view runtime/indent/sass.vim @ 33361:241a1c2d30fd v9.0.1942
patch 9.0.1942: Vim9: execution stack invalidated with null object
Commit: https://github.com/vim/vim/commit/c1946267f22efe3ec5eb0a1a914f30782a538983
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Sep 25 21:00:46 2023 +0200
patch 9.0.1942: Vim9: execution stack invalidated with null object
Problem: Vim9: execution stack invalidated with null object
Solution: Check for a null object before adjusting the execution stack
closes: #13186
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 25 Sep 2023 21:15:07 +0200 |
parents | dce918af0c00 |
children | 92fd65eac53a |
line wrap: on
line source
" Vim indent file " Language: Sass " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2022 Mar 15 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent sw=2 et setlocal indentexpr=GetSassIndent() setlocal indentkeys=o,O,*<Return>,<:>,!^F let b:undo_indent = "setl ai< inde< indk<" " Only define the function once. if exists("*GetSassIndent") finish endif let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)' let s:extend = '^\s*\%(@extend\|@include\|+\)' 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 return -1 endif endfunction " vim:set sw=2: