diff options
Diffstat (limited to 'fnl')
-rw-r--r-- | fnl/nvrc/utils.fnl | 35 |
1 files changed, 1 insertions, 34 deletions
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} |