Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: E701: Invalid type for len() when trying to expand in file without treesitter #560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions autoload/emmet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,21 @@ endfunction

function! emmet#getFileType(...) abort
let flg = get(a:000, 0, 0)

if has_key(s:emmet_settings, &filetype)
let type = &filetype
if emmet#getResource(type, 'ignore_embeded_filetype', 0)
return type
return type
endif
endif
endif

let node = v:null
if get(g:, 'loaded_nvim_treesitter', 0)
let type = luaeval('require"emmet_utils".get_node_at_cursor()')
let node = luaeval('require"emmet_utils".get_node_at_cursor()')
endif

if node
let type = node
else
let pos = emmet#util#getcurpos()
let type = synIDattr(synID(max([pos[1], 1]), max([pos[2], 1]), 1), 'name')
Expand Down