robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:62d8f3d: runtime: Revert several "mark invalid contact addresses" commits (#37192)ab20681c52

master
819 B30 linesraw
1" Vim indent file
2" Language:         KDL
3" Author:           Aram Drevekenin <aram@poor.dev>
4" Maintainer:       Yinzuo Jiang <jiangyinzuo@foxmail.com>
5" Last Change:      2024-06-16
6
7" Only load this indent file when no other was loaded.
8if exists("b:did_indent")
9    finish
10endif
11let b:did_indent = 1
12
13setlocal indentexpr=KdlIndent()
14let b:undo_indent = "setlocal indentexpr<"
15
16function! KdlIndent(...)
17  let line = substitute(getline(v:lnum), '//.*$', '', '')
18  let previousNum = prevnonblank(v:lnum - 1)
19  let previous = substitute(getline(previousNum), '//.*$', '', '')
20
21  let l:indent = indent(previousNum)
22  if previous =~ "{" && previous !~ "}"
23    let l:indent += shiftwidth()
24  endif
25  if line =~ "}" && line !~ "{"
26    let l:indent -= shiftwidth()
27  endif
28  return l:indent
29endfunction
30" vim: sw=2 sts=2 et