zsh-workers
 help / color / mirror / code / Atom feed
* [zsh bug report] vi-change-whole-line does not kill whole line in some cases
@ 2018-12-02 18:15 Kuba
  2018-12-03  8:11 ` Jun T
  0 siblings, 1 reply; 2+ messages in thread
From: Kuba @ 2018-12-02 18:15 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 692 bytes --]

Hi,
I believe I found a bug in `vi-change-whole-line`.

Minimal zshrc allowing to reproduce the issue:
```
bindkey -v
```

## Steps to reproduce:
1. type 2 words, for example `word1 word2`
2. enter vicmd mode and move cursor to the beginning of first word (`esc`
`0`)
3. use `vi-change` to change word then go back to vicmd (`c` `w` `esc`)
4. use `vi-change-whole-line`

## Expected result:
Kill the current line and enter insert mode.

## Actual result:
The line is killed but the cursor is positioned one place to the right
making the line not empty (line contains single space)

I attach gif recording presenting the issue.
zsh version: 5.6.2 (x86_64-debian-linux-gnu)

All the best,
Kuba

[-- Attachment #1.2: Type: text/html, Size: 1114 bytes --]

[-- Attachment #2: zsh_bug1.gif --]
[-- Type: image/gif, Size: 53185 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [zsh bug report] vi-change-whole-line does not kill whole line in some cases
  2018-12-02 18:15 [zsh bug report] vi-change-whole-line does not kill whole line in some cases Kuba
@ 2018-12-03  8:11 ` Jun T
  0 siblings, 0 replies; 2+ messages in thread
From: Jun T @ 2018-12-03  8:11 UTC (permalink / raw)
  To: zsh-workers


> 2018/12/03 3:15、Kuba <lxkuba@wp.pl>のメール:
> 
> ## Expected result:
> Kill the current line and enter insert mode.
> 
> ## Actual result:
> The line is killed but the cursor is positioned one place to the right making the line not empty (line contains single space)

I think this is intensional.
Blanks at the start of lines are retained to keep the indentation;
this is the behavior compatible with vim editor with autoindent ON.
If you want a behavior of pure vi (or vim with autoindent OFF),
you may try

bindkey -a -s S cc


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-03  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-02 18:15 [zsh bug report] vi-change-whole-line does not kill whole line in some cases Kuba
2018-12-03  8:11 ` Jun T

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).