forked from Civitasv/cmake-tools.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to run and build current file(with virtual text sup…
…port)
- Loading branch information
Showing
4 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local hints = { | ||
ns_id = vim.api.nvim_create_namespace("cmaketools"), | ||
} | ||
|
||
function hints.show(buf, line, target_type, target) | ||
vim.api.nvim_buf_clear_namespace(buf, hints.ns_id, 0, -1) | ||
local vl = vim.fn.line("w0") | ||
local mark_id = vim.api.nvim_buf_set_extmark(buf, hints.ns_id, vl, 0, { | ||
virt_text = { { target_type .. "(" .. target .. ")", "@type" } }, | ||
virt_text_pos = "right_align", | ||
hl_mode = "combine", | ||
}) | ||
end | ||
|
||
return hints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters