From 50221c9e9c73be4d28e3bc3ce85c69938ec410c1 Mon Sep 17 00:00:00 2001 From: sefidel Date: Sat, 26 Feb 2022 22:48:04 +0900 Subject: feat(utils): remove redundant functions --- fnl/nvrc/utils.fnl | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'fnl/nvrc/utils.fnl') diff --git a/fnl/nvrc/utils.fnl b/fnl/nvrc/utils.fnl index 156cff8..6fd315a 100644 --- a/fnl/nvrc/utils.fnl +++ b/fnl/nvrc/utils.fnl @@ -32,39 +32,6 @@ (fn merge [...] (merge! {} ...)) -(fn lsp_fidget [] - "Simple implementation of LSP fidget. Returns current LSP status with a spinner" - (let [lsp (. (vim.lsp.util.get_progress_messages) 1)] - (when lsp - (let [msg (or lsp.message "") - percentage (or lsp.percentage 0) - title (or lsp.title "") - spinners ["⠋" - "⠙" - "⠹" - "⠸" - "⠼" - "⠴" - "⠦" - "⠧" - "⠇" - "⠏"] - success-icon "^.^!" - ms (/ (vim.loop.hrtime) 1000000) - frame (% (math.floor (/ ms 120)) (length spinners))] - (when (>= percentage 70) - (let [ertn [(string.format " %%<%s %s %s (%s%%%%) " success-icon - title msg percentage)]] - (lua "return (table.unpack or _G.unpack)(ertn)"))) - (let [ertn [(string.format " %%<%s %s %s (%s%%%%) " - (. spinners (+ frame 1)) title msg percentage)]] - (lua "return (table.unpack or _G.unpack)(ertn)"))))) - "") - -(fn will_it_fit [width winid] - "Returns whether this module will fit in the given width" - (> (vim.api.nvim_win_get_width (or (tonumber winid) 0)) width)) - (fn del_buf [] (let [buflisted (vim.fn.getbufinfo {:buflisted 1}) (cur-winnr cur-bufnr) (values (vim.fn.winnr) (vim.fn.bufnr))] @@ -86,4 +53,4 @@ ((. (require :packer) :loader) pack)) after))) -{: merge : lsp_fidget : will_it_fit : del_buf : defer_unpack} +{: merge : del_buf : defer_unpack} -- cgit 1.4.1