diff options
author | sefidel <contact@sefidel.net> | 2022-02-26 22:48:04 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2022-02-26 22:48:04 +0900 |
commit | 50221c9e9c73be4d28e3bc3ce85c69938ec410c1 (patch) | |
tree | dc6a5bbd1fb2d1b369b1da36ce71f2676eeb7d3c /fnl | |
parent | 984feefe0c4de184eed8151260d475c99ac1eeab (diff) | |
download | nvimrc-50221c9e9c73be4d28e3bc3ce85c69938ec410c1.tar.gz nvimrc-50221c9e9c73be4d28e3bc3ce85c69938ec410c1.zip |
feat(utils): remove redundant functions
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} |