robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
5a304b7864
master
1" ConTeXt indent file 2" Language: ConTeXt typesetting engine 3" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> 4" Last Change: 2016 Oct 15 5 6if exists ( "b:did_indent" ) 7finish 8endif 9 10if ! get ( b:, 'context_metapost' , get ( g:, 'context_metapost' , 1 )) 11finish 12endif 13 14" Load MetaPost indentation script 15runtime ! indent/mp.vim 16 17let s: keepcpo = & cpo 18set cpo & vim 19 20setlocal indentexpr = GetConTeXtIndent () 21 22let b: undo_indent = "setl indentexpr<" 23 24function ! GetConTeXtIndent () 25" Use MetaPost rules inside MetaPost graphic environments 26if len ( synstack ( v: lnum , 1 )) > 0 && 27 \synIDattr ( synstack ( v: lnum , 1 )[ 0 ], "name" ) ==# 'contextMPGraphic' 28return GetMetaPostIndent () 29endif 30return -1 31endfunc 32 33let & cpo = s: keepcpo 34unlet s: keepcpo 35 36" vim:sw=2