Use some default regex for completion support in other filetypes

This commit is contained in:
w0rp committed 2017-11-21 16:18:08 +00:00
1 parent 3ef98f42bd
commit 8be85c2997
2 files changed
+6 -3

No files matched your search

+3 -3
View File
@@ -12,14 +12,14 @@ function! s:GetRegex(map, filetype) abort
endif
endfor
return ''
" Use the default regex for other files.
return s:should_complete_map['<default>']
endfunction
" Regular expressions for checking the characters in the line before where
" the insert cursor is. If one of these matches, we'll check for completions.
let s:should_complete_map = {
\ 'javascript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
\ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
\}
" Check if we should look for completions for a language.