2 Commits

Author SHA1 Message Date
Wezhon
a4dfb6e189 Merge 03432a7ef4 into 3fb2f63799 2024-07-13 14:50:24 -07:00
wezhon_in_NUC
03432a7ef4 The 'A Chinese translation of the tutorial:' link in the readme.mkd file
is inaccessible

On branch develop
Changes to be committed:
       modified:   README.mkd
2021-10-09 09:16:14 +08:00
3 changed files with 4 additions and 33 deletions

View File

@@ -196,5 +196,5 @@ Update this in your .vimrc file.
### A Chinese translation of the tutorial:
* <http://www.zfanw.com/blog/zencoding-vim-tutorial-chinese.html>
* <https://blog.zfanw.com/zencoding-vim-tutorial-chinese/>

View File

@@ -379,12 +379,8 @@ function! emmet#getFileType(...) abort
endif
endif
if get(g:, 'loaded_nvim_treesitter', 0)
let type = luaeval('require"emmet_utils".get_node_at_cursor()')
else
let pos = emmet#util#getcurpos()
let type = synIDattr(synID(max([pos[1], 1]), max([pos[2], 1]), 1), 'name')
endif
let pos = emmet#util#getcurpos()
let type = synIDattr(synID(max([pos[1], 1]), max([pos[2], 1]), 1), 'name')
" ignore htmlTagName as it seems to occur too often
if type == 'htmlTagName'
@@ -430,7 +426,7 @@ function! emmet#getFileType(...) abort
endfor
endif
return empty(type) ? 'html' : type
return len(type) == 0 ? 'html' : type
endfunction
function! emmet#getDollarExprs(expand) abort

View File

@@ -1,25 +0,0 @@
local M = {}
M.get_node_at_cursor = function()
local ts_utils = require("nvim-treesitter.ts_utils")
local node = ts_utils.get_node_at_cursor()
if not node then
return nil
end
while node do
local node_type = node:type()
if node_type == "element" then
return "html"
elseif node_type == "stylesheet" then
return "css"
end
node = node:parent()
end
return ""
end
return M