Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lua/marks/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ function M.setup(config)
M.bookmark_state.priority = config.sign_priority
end

if config.float ~= nil then
M.float = config.float
else
M.float = true
end

local refresh_interval = utils.option_nil(config.refresh_interval, 150)

local timer = vim.loop.new_timer()
Expand Down
24 changes: 15 additions & 9 deletions lua/marks/mark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,21 @@ function Mark.preview_mark()
local width = a.nvim_win_get_width(0)
local height = a.nvim_win_get_height(0)

a.nvim_open_win(pos[1], true, {
relative = "win",
win = 0,
width = math.floor(width / 2),
height = math.floor(height / 2),
col = math.floor(width / 4),
row = math.floor(height / 8),
border = "single"
})
if require('marks').float then
a.nvim_open_win(pos[1], true, {
relative = "win",
win = 0,
width = math.floor(width / 2),
height = math.floor(height / 2),
col = math.floor(width / 4),
row = math.floor(height / 8),
border = "single"
})
else
vim.cmd.pedit()
vim.cmd('silent! wincmd P')
end

vim.cmd("normal! `" .. mark)
vim.cmd("normal! zz")
end
Expand Down