From a80769d2f20cb82d59cc3c42b874b75d2c9e9144 Mon Sep 17 00:00:00 2001 From: Moritz Sauter Date: Thu, 6 Apr 2023 13:59:42 +0200 Subject: [PATCH] feat: Make inlay_hints priority configurable --- README.md | 3 +++ lua/rust-tools/config.lua | 3 +++ lua/rust-tools/inlay_hints.lua | 1 + 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 72f67a8..a78abd5 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,9 @@ local opts = { -- The color of the hints highlight = "Comment", + + -- priority of the virtual text + priority = 100, }, -- options same as lsp hover / vim.lsp.util.open_floating_preview() diff --git a/lua/rust-tools/config.lua b/lua/rust-tools/config.lua index d4ce0ac..db690af 100644 --- a/lua/rust-tools/config.lua +++ b/lua/rust-tools/config.lua @@ -56,6 +56,9 @@ local defaults = { -- The color of the hints highlight = "Comment", + + -- priority of the virtual text + priority = 100, }, -- options same as lsp hover / vim.lsp.util.open_floating_preview() diff --git a/lua/rust-tools/inlay_hints.lua b/lua/rust-tools/inlay_hints.lua index 0df31a1..51b8edf 100644 --- a/lua/rust-tools/inlay_hints.lua +++ b/lua/rust-tools/inlay_hints.lua @@ -251,6 +251,7 @@ local function render_line(line, line_hints, bufnr, max_line_len) { virt_text, opts.highlight }, }, hl_mode = "combine", + priority = opts.priority }) end end