echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
5.26k stars 189 forks source link

[mini.indentscope]: cursor placed at wrong location during visual selection inside object scope #445

Closed Subjective closed 1 year ago

Subjective commented 1 year ago

Contributing guidelines

Module(s)

Indentscope

Description

This is purely aesthetic, but when visually selecting "inside" an object scope text object, the cursor is placed at the first non-whitespace character of the last line instead of at the end of the overal selection. Selecting "around" any object scope places the cursor at the end, so it seems inconsistent for selecting "inside" to not behave the same, especially since every other text object I know of places the cursor at the end of the visual selection.

Neovim version

NVIM v0.10.0-dev-886+gb263c73b0

Steps to reproduce

  1. Place the cursor within an object scope
  2. Hit vio to visually select "inside" the object scope

Expected behavior

I would expect the cursor to be placed at the end of the selection.

Actual behavior

The cursor is placed at the first non-whitespace character of the last line of the selection.

image
echasnovski commented 1 year ago

Thanks for the issue!

I can't fully reproduce the issue:

So I don't see this as an inconsistency issue within 'mini.indentscope'.

Furthermore:

Having this in mind, I'll revisit it later to possibly update to be more align with 'mini.ai' design.

Subjective commented 1 year ago

Alright, thanks for the explanation, it all makes sense now :)