virtual-text: inline variable values with sensible defaults
This commit is contained in:
2 files changed
+27
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
local config = require("tiny-debugger.config")
|
local config = require("tiny-debugger.config")
|
||||||
local help = require("tiny-debugger.help")
|
local help = require("tiny-debugger.help")
|
||||||
local ui = require("tiny-debugger.ui")
|
local ui = require("tiny-debugger.ui")
|
||||||
|
local virtual_text = require("tiny-debugger.virtual_text")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -107,6 +108,7 @@ function M.enter()
|
|||||||
set_keymaps(buf)
|
set_keymaps(buf)
|
||||||
set_cursor_highlight()
|
set_cursor_highlight()
|
||||||
ui.open()
|
ui.open()
|
||||||
|
virtual_text.enable()
|
||||||
|
|
||||||
if config.opts.help_on_enter then
|
if config.opts.help_on_enter then
|
||||||
help.open()
|
help.open()
|
||||||
@@ -122,6 +124,7 @@ function M.exit()
|
|||||||
restore_cursor_highlight()
|
restore_cursor_highlight()
|
||||||
help.close()
|
help.close()
|
||||||
ui.close()
|
ui.close()
|
||||||
|
virtual_text.disable()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.toggle()
|
function M.toggle()
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
local config = require("tiny-debugger.config")
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local initialized = false
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
if initialized then return end
|
||||||
|
initialized = true
|
||||||
|
require("nvim-dap-virtual-text").setup(config.opts.virtual_text)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.enable()
|
||||||
|
M.setup()
|
||||||
|
require("nvim-dap-virtual-text").enable()
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.disable()
|
||||||
|
if initialized then
|
||||||
|
require("nvim-dap-virtual-text").disable()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
Reference in new issue
Block a user