631 current 2024-05-14 21:53:23 24.05.20240512.2057814 6.8.6-zen1 *
This commit is contained in:
parent
c20dc11ab4
commit
ea3d650b2f
1 changed files with 21 additions and 0 deletions
|
|
@ -17,6 +17,25 @@ local select = function(prompt, callback)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function set_marks()
|
||||||
|
-- Exit visual mode temporarily
|
||||||
|
vim.cmd("normal! gv")
|
||||||
|
|
||||||
|
-- Get the positions of the start and end of the visual selection
|
||||||
|
local start_pos = vim.fn.getpos("'<")
|
||||||
|
local end_pos = vim.fn.getpos("'>")
|
||||||
|
|
||||||
|
-- Set mark 'a' at the start of the selection
|
||||||
|
vim.fn.setpos("'a", start_pos)
|
||||||
|
|
||||||
|
-- Set mark 'b' at the end of the selection
|
||||||
|
vim.fn.setpos("'b", end_pos)
|
||||||
|
|
||||||
|
-- Optionally, print a confirmation or reselect the visual area
|
||||||
|
print("Marks set: 'a' at start, 'b' at end")
|
||||||
|
vim.cmd("normal! gv") -- Reselect the visual area if desired
|
||||||
|
end
|
||||||
|
|
||||||
M.freeze = function()
|
M.freeze = function()
|
||||||
local path = "./._freeze.png"
|
local path = "./._freeze.png"
|
||||||
|
|
||||||
|
|
@ -28,6 +47,8 @@ M.freeze = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
M.freeze_selection = function()
|
M.freeze_selection = function()
|
||||||
|
set_marks()
|
||||||
|
|
||||||
local path = "./._freeze.png"
|
local path = "./._freeze.png"
|
||||||
|
|
||||||
-- Save and exit visual mode
|
-- Save and exit visual mode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue