Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xvk is inconsistent with xjk #2822

Closed
txtyash opened this issue Jun 19, 2022 · 2 comments
Closed

xvk is inconsistent with xjk #2822

txtyash opened this issue Jun 19, 2022 · 2 comments
Labels
C-bug Category: This is a bug

Comments

@txtyash
Copy link
Contributor

txtyash commented Jun 19, 2022

Summary

xvj selects the entire first line, puts in visual mode(I know same can
be done with xx) but xvk doesn't select the entire first line, instead just selects the first character
on that line and then starts selecting entire lines upwards.

TLDR;
xvk is inconsistent with xjk

Reproduction Steps

No response

Helix log

No response

Platform

linux

Terminal Emulator

alacritty

Helix Version

helix 22.05-dev (595213c)

@txtyash txtyash added the C-bug Category: This is a bug label Jun 19, 2022
@EpocSquadron
Copy link
Contributor

I think this is consistent with how j and k work outside of visual mode. You may be interested in adding the extend_line_above action to your keybind. It's not bound by default. See #2117

@the-mikedavis the-mikedavis changed the title Broken visual mode xvk is inconsistent with xjk Jun 19, 2022
@the-mikedavis
Copy link
Member

This is the intended behavior of extend_line_up (vk) and extend_line_down (vj). It's based on the head and anchor of the selection. (#[|]# denotes a selection with | being the head (cursor)).

foo
b#[|a]#r
baz

x moves to

foo
#[bar|]#
baz

(note the head is on the newline and the anchor is before b). vj retains the anchor and extends the head a line down:

foo
#[bar
baz|]#

Consistently, vk retains the anchor and extends the head up a line:

foo#[|
]#bar
baz

In order to have them behave as you expect, you need to swap the head and anchor of your selection with A-; (Alt;).

@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants