fix tree winnr
This commit is contained in:
parent
9c3bc7d031
commit
4b1fa51e4f
@ -270,7 +270,7 @@ local M = {}
|
|||||||
function M.draw(tree, reload)
|
function M.draw(tree, reload)
|
||||||
if not tree.bufnr then return end
|
if not tree.bufnr then return end
|
||||||
api.nvim_buf_set_option(tree.bufnr, 'modifiable', true)
|
api.nvim_buf_set_option(tree.bufnr, 'modifiable', true)
|
||||||
local cursor = api.nvim_win_get_cursor(tree.winnr)
|
local cursor = api.nvim_win_get_cursor(tree.winnr())
|
||||||
if reload then
|
if reload then
|
||||||
index = 0
|
index = 0
|
||||||
lines = {}
|
lines = {}
|
||||||
@ -281,10 +281,10 @@ function M.draw(tree, reload)
|
|||||||
api.nvim_buf_set_lines(tree.bufnr, 0, -1, false, lines)
|
api.nvim_buf_set_lines(tree.bufnr, 0, -1, false, lines)
|
||||||
M.render_hl(tree.bufnr)
|
M.render_hl(tree.bufnr)
|
||||||
if #lines >= cursor[1] then
|
if #lines >= cursor[1] then
|
||||||
api.nvim_win_set_cursor(tree.winnr, cursor)
|
api.nvim_win_set_cursor(tree.winnr(), cursor)
|
||||||
end
|
end
|
||||||
api.nvim_buf_set_option(tree.bufnr, 'modifiable', false)
|
api.nvim_buf_set_option(tree.bufnr, 'modifiable', false)
|
||||||
api.nvim_win_set_option(tree.winnr, 'wrap', false)
|
api.nvim_win_set_option(tree.winnr(), 'wrap', false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.render_hl(bufnr)
|
function M.render_hl(bufnr)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user