Mercurial > vim
comparison runtime/indent/context.vim @ 10301:07d2b5a3b7cc
commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 23 21:21:08 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 23 Oct 2016 21:30:06 +0200 |
parents | |
children | f00c56ee8118 |
comparison
equal
deleted
inserted
replaced
10300:1888d5ca413c | 10301:07d2b5a3b7cc |
---|---|
1 " ConTeXt indent file | |
2 " Language: ConTeXt typesetting engine | |
3 " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> | |
4 " Last Change: 2016 Oct 15 | |
5 | |
6 if exists("b:did_indent") | |
7 finish | |
8 endif | |
9 | |
10 if !get(b:, 'context_metapost', get(g:, 'context_metapost', 1)) | |
11 finish | |
12 endif | |
13 | |
14 " Load MetaPost indentation script | |
15 runtime! indent/mp.vim | |
16 | |
17 let s:keepcpo= &cpo | |
18 set cpo&vim | |
19 | |
20 setlocal indentexpr=GetConTeXtIndent() | |
21 | |
22 let b:undo_indent = "setl indentexpr<" | |
23 | |
24 function! GetConTeXtIndent() | |
25 " Use MetaPost rules inside MetaPost graphic environments | |
26 if len(synstack(v:lnum, 1)) > 0 && | |
27 \ synIDattr(synstack(v:lnum, 1)[0], "name") ==# 'contextMPGraphic' | |
28 return GetMetaPostIndent() | |
29 endif | |
30 return -1 | |
31 endfunc | |
32 | |
33 let &cpo = s:keepcpo | |
34 unlet s:keepcpo | |
35 | |
36 " vim:sw=2 |