Skip to content

Commit

Permalink
Add context filetype support
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Aug 9, 2020
1 parent ed05448 commit 0e15e3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions autoload/deoppet/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ function! deoppet#util#_indent_snippet(begin, end) abort
call setpos('.', pos)
endtry
endfunction

function! deoppet#util#_get_context_filetype() abort
return exists('*context_filetype#get_filetype') ?
\ context_filetype#get_filetype() : &filetype
endfunction
2 changes: 1 addition & 1 deletion rplugin/python3/deoppet/deoppet.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _load_snippets(self) -> None:
snippets: typing.Dict[str, Snippet] = {}
buf = self._vim.current.buffer
filetype: str = self._vim.call(
'getbufvar', buf.number, '&filetype')
'deoppet#util#_get_context_filetype')
if not filetype:
filetype = 'nothing'
# debug(self._vim, filetype)
Expand Down

0 comments on commit 0e15e3a

Please sign in to comment.