#791 add profiling for some operations (#1108)

This commit is contained in:
Alexander Courtis
2022-03-26 23:22:28 +11:00
committed by GitHub
parent 015234e032
commit 54c78dbca2
8 changed files with 46 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
local log = require "nvim-tree.log"
local utils = require "nvim-tree.utils"
local view = require "nvim-tree.view"
local _padding = require "nvim-tree.renderer.padding"
@@ -238,6 +239,9 @@ function M.draw()
if not core.get_explorer() or not bufnr or not api.nvim_buf_is_loaded(bufnr) then
return
end
local ps = log.profile_start "draw"
local cursor
if view.is_visible() then
cursor = api.nvim_win_get_cursor(view.get_winnr())
@@ -266,6 +270,8 @@ function M.draw()
if cursor and #lines >= cursor[1] then
api.nvim_win_set_cursor(view.get_winnr(), cursor)
end
log.profile_end(ps, "draw")
end
function M.render_hl(bufnr)