From: Alexis Laferrière Date: Sat, 7 Feb 2015 13:22:31 +0000 (-0500) Subject: misc/vim: use separately class types, constructors and class declarations X-Git-Tag: v0.7.2~19^2~2 X-Git-Url: http://nitlanguage.org?hp=b21c507fe4e3792dc16f47f57e5f142d4ada5b5e misc/vim: use separately class types, constructors and class declarations Signed-off-by: Alexis Laferrière --- 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