neovim

Personal neovim configuration files
git clone git://gtms.dev/neovim
Log | Files | Refs

commit ff05c17e635cbdf7d6567f5551011953f16f4314
parent c9e8394d3e7cba0364fd4d0cc6019b50fd6c975e
Author: Tomas Nemec <owl@gtms.dev>
Date:   Thu,  1 Feb 2024 15:17:36 +0100

update

Diffstat:
Mafter/plugin/cmp.lua | 43++++++++++++++++++++++++++-----------------
Mcolors/tms.lua | 1+
Mplugin/diagflow.lua | 32++++++++++++++++++--------------
3 files changed, 45 insertions(+), 31 deletions(-)

diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua @@ -113,30 +113,39 @@ cmp.setup({ -- }, { { name = 'buffer' } }), sources = cmp.config.sources({ - { name = 'snippets' }, - { name = 'nvim_lsp' }, + { name = 'snippets', max_item_count = 3 }, + { + name = 'nvim_lsp', + -- entry_filter = function(entry, ctx) + -- vim.print({ entry.id, entry.score, entry.exact, entry.completion_item }) + -- return true + -- end, + }, { name = 'nvim_lsp_signature_help' }, { name = 'nvim_lua' }, { name = 'path' }, { name = 'spell' }, { name = 'calc' }, -- { name = 'treesitter' }, - { name = 'buffer', group_index = 1 }, }, { -- { name = 'buffer' }, }), - -- sorting = { - -- priority_weight = 2, - -- comparators = { - -- cmp.config.compare.offset, - -- cmp.config.compare.exact, - -- cmp.config.compare.score, - -- cmp.config.compare.kind, - -- cmp.config.compare.sort_text, - -- cmp.config.compare.length, - -- cmp.config.compare.order, - -- }, - -- }, + sorting = { + priority_weight = 2, + comparators = { + -- cmp.config.compare.offset, + -- cmp.config.compare.exact, + -- compare.scopes, + cmp.config.compare.sort_text, + -- cmp.config.compare.score, + -- cmp.config.compare.recently_used, + -- cmp.config.compare.locality, + -- cmp.config.compare.kind, + -- compare.sort_text, + -- cmp.config.compare.length, + cmp.config.compare.order, + }, + }, -- experimental = { ghost_text = false }, }) @@ -192,9 +201,9 @@ cmp.setup.cmdline(':', { }, sources = cmp.config.sources({ -- { name = 'path' }, - }, { -- + }, { -- { name = 'cmdline' }, - }, { -- + }, { -- { name = 'cmdline_history' }, }), }) diff --git a/colors/tms.lua b/colors/tms.lua @@ -285,6 +285,7 @@ vim.api.nvim_set_hl(0, 'javaOperator', { fg = gui0D, ctermfg = cterm0D }) vim.api.nvim_set_hl(0, 'LineNr', { fg = gui03, bg = 'background' }) vim.api.nvim_set_hl(0, 'WinBar', { fg = gui03, bg = 'background' }) +vim.api.nvim_set_hl(0, 'WinBarNC', { fg = gui03, bg = 'background' }) vim.api.nvim_set_hl(0, 'SignColumn', { fg = gui03, bg = 'background' }) vim.api.nvim_set_hl(0, 'StatusLine', { fg = gui03, bg = 'background' }) vim.api.nvim_set_hl(0, 'StatusLineNC', { fg = gui03, bg = 'background' }) diff --git a/plugin/diagflow.lua b/plugin/diagflow.lua @@ -99,27 +99,31 @@ local function render(diagnostics, bufnr) return end - local cursor_lnum = vim.fn.getcurpos(winnr)[2] - vim.fn.getwininfo(winnr)[1].topline + local cursor_lnum = vim.fn.getcurpos(winnr)[2] local padding = get_padding(bufnr, winnr) local line_offset = vim.fn.getwininfo(winnr)[1].topline - 1 + padding local skipped_some = false for _, diagnostic in ipairs(diagnostics) do local message_lines = vim.split(diagnostic.message, '\n') - -- local message_lines = create_boxed_text(vim.split(diagnostic.message, '\n')) + + -- Enable/Disable boxed text + -- message_lines = create_boxed_text(message_lines) + + if ((line_offset + #message_lines) >= cursor_lnum) then + skipped_some = true + break + end + for _, message in ipairs(message_lines) do local hl_group = severity_hl_map[diagnostic.severity] - if line_offset < cursor_lnum then - vim.api.nvim_buf_set_extmark(bufnr, ns, line_offset, 0, { - virt_text = { { message, hl_group } }, - virt_text_pos = 'right_align', - virt_text_hide = true, - strict = false, - priority = vim.highlight.priorities.user, - }) - line_offset = line_offset + 1 - else - skipped_some = true - end + vim.api.nvim_buf_set_extmark(bufnr, ns, line_offset, 0, { + virt_text = { { message, hl_group } }, + virt_text_pos = 'right_align', + virt_text_hide = true, + strict = false, + priority = vim.highlight.priorities.user, + }) + line_offset = line_offset + 1 end end