Skip to content

Commit 7a1878c

Browse files
authored
fix(eval): open the floating window under the cursor (#332)
1 parent d845ebd commit 7a1878c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/dapui/init.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ function dapui.eval(expr, args)
186186
prev_expr = expr
187187
local elem = dapui.elements.hover
188188
elem.set_expression(expr, args.context)
189-
local line_no = async.fn.screenrow()
190-
local col_no = async.fn.screencol()
191-
local position = { line = line_no, col = col_no }
189+
local win_pos = async.api.nvim_win_get_position(0)
190+
local position = {
191+
line = win_pos[1] + async.fn.winline(),
192+
col = win_pos[2] + async.fn.wincol() - 1,
193+
}
192194
open_float = require("dapui.windows").open_float("hover", elem, position, args)
193195
if open_float then
194196
open_float:listen("close", function()

0 commit comments

Comments
 (0)