nvim-telescope/telescope-live-grep-args.nvim

Bug in visual selection

Fabian-programmer opened this issue · 2 comments

Description

Hey, thanks for the plugin.

I just encountered the problem, I was visual selecting a text from right to left.
grafik

I think here lies the problem:

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

when you select text from right to left, then cs is bigger than ce.

so there needs to be a condition:

if cs > ce
  swap(cs,ce)
  swap(ls,le)

https://github.com/nvim-telescope/telescope-live-grep-args.nvim/blob/master/lua/telescope-live-grep-args/shortcuts.lua#L8

Neovim version

nvim 0.9.4

Operating system and version

ubuntu 22

Telescope version / branch / rev

latest

Telescope live grep args version / branch / rev

latest

checkhealth telescope

.

Steps to reproduce

.

Expected behavior

No response

Actual behavior

.

Minimal config

.

Thank you for reporting the issue @Fabian-programmer

This bug was already reported before #63 Also a pull request exists, which should be merged soon.

Duplicate of #63