From 10356f2fa88162c0deb704511b72b4c26fdf56e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 7 Feb 2015 08:22:31 -0500 Subject: [PATCH] misc/vim: use separately class types, constructors and class declarations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- misc/vim/plugin/nit.vim | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/misc/vim/plugin/nit.vim b/misc/vim/plugin/nit.vim index d58df14..928643d 100644 --- a/misc/vim/plugin/nit.vim +++ b/misc/vim/plugin/nit.vim @@ -188,12 +188,24 @@ fun NitOmnifunc(findstart, base) call NitOmnifuncAddFromFile(a:base, matches, 'modules.txt') endif - " Classes - if count(['new', 'super', 'class', 'nullable'], prev_word) > 0 || + " Classes (instanciable only) + if prev_word == 'new' + let handled = 1 + call NitOmnifuncAddFromFile(a:base, matches, 'constructors.txt') + endif + + " Other class references + if count(['class', 'super'], prev_word) > 0 + let handled = 1 + call NitOmnifuncAddFromFile(a:base, matches, 'classes.txt') + endif + + " Types + if count(['class', 'super', 'nullable', 'isa', 'as'], prev_word) > 0 || \ line_prev_cursor =~ '[' || prev_char == ':' || \ (line_prev_cursor =~ 'fun' && line_prev_cursor =~ 'import' && (prev_word == 'import' || prev_char == ',')) let handled = 1 - call NitOmnifuncAddFromFile(a:base, matches, 'classes.txt') + call NitOmnifuncAddFromFile(a:base, matches, 'types.txt') endif " Properties -- 1.7.9.5