diff options
| author | William Boman <william@redwill.se> | 2021-09-17 16:05:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-17 16:05:20 +0200 |
| commit | 9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6 (patch) | |
| tree | 58da4fff57cc3aff4380f501b1845310dff4f2e8 /lua/nvim-lsp-installer/ui | |
| parent | texlab: fix ensure_executables (diff) | |
| download | mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.gz mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.bz2 mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.lz mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.xz mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.zst mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.zip | |
optimize io (70%+ startup speedups) (#93)
Diffstat (limited to 'lua/nvim-lsp-installer/ui')
| -rw-r--r-- | lua/nvim-lsp-installer/ui/display.lua | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lua/nvim-lsp-installer/ui/display.lua b/lua/nvim-lsp-installer/ui/display.lua index beeb3277..48ff5881 100644 --- a/lua/nvim-lsp-installer/ui/display.lua +++ b/lua/nvim-lsp-installer/ui/display.lua @@ -1,5 +1,6 @@ local Ui = require "nvim-lsp-installer.ui" local log = require "nvim-lsp-installer.log" +local process = require "nvim-lsp-installer.process" local state = require "nvim-lsp-installer.ui.state" local M = {} @@ -13,22 +14,6 @@ function _G.lsp_install_redraw(winnr) end end -local function debounced(debounced_fn) - local queued = false - local last_arg = nil - return function(a) - last_arg = a - if queued then - return - end - queued = true - vim.schedule(function() - debounced_fn(last_arg) - queued = false - end) - end -end - local function get_styles(line, render_context) local indentation = 0 @@ -161,7 +146,7 @@ function M.new_view_only_win(name) return win end - local draw = debounced(function(view) + local draw = process.debounced(function(view) local win = vim.fn.win_findbuf(buf)[1] if not win or not vim.api.nvim_buf_is_valid(buf) then -- the window has been closed or the buffer is somehow no longer valid |
