annotate runtime/autoload/contextcomplete.vim @ 19750:aa674de6d813 v8.2.0431

patch 8.2.0431: some compilers don't support using e for Esc Commit: https://github.com/vim/vim/commit/56ba21a156c723d92a1929e2c500be7295efb0a8 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 23 19:17:29 2020 +0100 patch 8.2.0431: some compilers don't support using \e for Esc Problem: Some compilers don't support using \e for Esc. (Yegappan Lakshmanan) Solution: use \033 instead.
author Bram Moolenaar <Bram@vim.org>
date Mon, 23 Mar 2020 19:30:04 +0100
parents 07d2b5a3b7cc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10301
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Language: ConTeXt typesetting engine
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Latest Revision: 2016 Oct 15
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 let s:keepcpo= &cpo
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 set cpo&vim
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 " Complete keywords in MetaPost blocks
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 function! contextcomplete#Complete(findstart, base)
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 if a:findstart == 1
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 if len(synstack(line('.'), 1)) > 0 &&
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 \ synIDattr(synstack(line('.'), 1)[0], "name") ==# 'contextMPGraphic'
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 return syntaxcomplete#Complete(a:findstart, a:base)
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 else
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 return -3
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endif
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 else
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 return syntaxcomplete#Complete(a:findstart, a:base)
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 endif
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 endfunction
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 let &cpo = s:keepcpo
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 unlet s:keepcpo
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
07d2b5a3b7cc commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 " vim: sw=2 fdm=marker