Skip to content
Open
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
9 changes: 1 addition & 8 deletions lua/telescope-live-grep-args/shortcuts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ local live_grep_args = require("telescope").extensions.live_grep_args
local helpers = require("telescope-live-grep-args.helpers")

local function get_visual()
local _, ls, cs = unpack(vim.fn.getpos("v"))
local _, le, ce = unpack(vim.fn.getpos("."))

-- nvim_buf_get_text requires start and end args be in correct order
ls, le = math.min(ls, le), math.max(ls, le)
cs, ce = math.min(cs, ce), math.max(cs, ce)

return vim.api.nvim_buf_get_text(0, ls - 1, cs - 1, le - 1, ce, {})
return vim.fn.getregion(vim.fn.getpos("v"), vim.fn.getpos("."))
end

local grep_under_default_opts = {
Expand Down