From 16259eb4e7259e281eb24483858f7e5efe4f5d82 Mon Sep 17 00:00:00 2001 From: ray-x Date: Wed, 21 Apr 2021 12:12:48 +1000 Subject: [PATCH] update symbol nerdfonts --- README.md | 4 ++++ lua/navigator/gui.lua | 16 +++++++++------- lua/navigator/lspclient/lspkind.lua | 29 +---------------------------- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index b78c62f..52763dd 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,10 @@ Use or `:q!` to kill the floating window, to move and to o ![incomming](https://github.com/ray-x/files/blob/master/img/navigator/incomming.jpg?raw=true) +### LSP symbol nerdfont/emoji + +![nerdfont](https://github.com/ray-x/files/blob/master/img/navigator/icon_nerd.jpg?raw=true) + # Todo - Early phase, bugs expected diff --git a/lua/navigator/gui.lua b/lua/navigator/gui.lua index 2211910..ec37082 100644 --- a/lua/navigator/gui.lua +++ b/lua/navigator/gui.lua @@ -40,7 +40,10 @@ function M._preview_location(opts) --location, width, pos_x, pos_y -- local range = opts.location.targetRange or opts.location.range - if range.start == nil then print('error invalid range') return end + if range.start == nil then + print("error invalid range") + return + end local contents = api.nvim_buf_get_lines(bufnr, range.start.line, (range["end"].line or 1) + 10, false) -- @@ -53,7 +56,7 @@ function M._preview_location(opts) --location, width, pos_x, pos_y local win_opts = {syntax = syntax, width = opts.width, pos_x = opts.offset_x or 0, pos_y = opts.offset_y or 10} win_opts.items = contents win_opts.hl_line = opts.lnum - range.start.line - log (opts.lnum, range.start.line, win_opts.hl_line) + log(opts.lnum, range.start.line, win_opts.hl_line) local w = M.new_preview(win_opts) return w @@ -119,8 +122,7 @@ function M.new_list_view(opts) util.open_file_at(l.filename, l.lnum) end end, - on_move = opts.on_move or - function(pos) + on_move = opts.on_move or function(pos) if pos == 0 then pos = 1 end @@ -130,9 +132,9 @@ function M.new_list_view(opts) if l.uri == nil then l.uri = "file:///" .. l.filename end - return M.preview_uri( - {uri = l.uri, width = width, lnum = l.lnum, col = l.col, offsetx = 0, offset_y = offset_y} - ) + return M.preview_uri( + {uri = l.uri, width = width, lnum = l.lnum, col = l.col, offsetx = 0, offset_y = offset_y} + ) end } ) diff --git a/lua/navigator/lspclient/lspkind.lua b/lua/navigator/lspclient/lspkind.lua index dbe87f9..2aaaa28 100644 --- a/lua/navigator/lspclient/lspkind.lua +++ b/lua/navigator/lspclient/lspkind.lua @@ -87,34 +87,7 @@ local SymbolKind = { } local SymbolItemKind = { - " ", - " ", - " ", - " ", - "פּ ", - "ƒ ", - " ", - "ﴲ ", - " ", - "了", - "蘒", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "ﳠ ", - " ", - " ", - "ﳅ ", - " ", - " ", - "" -} + " ", " ", " ", " ", "פּ ", "ƒ ", " ", "ﴲ ", " ", "𝕰 ", "蘒", " ", " ", " ", " ", " ", " ", " ", " ", " ", "ﳠ ", " ", " ", "ﳅ ", " ", " ", " " } local lspkind = {} function lspkind.comp_kind(kind)