aligrudi / neatvi

A small vi/ex editor for editing UTF-8 text
http://litcave.rudi.ir/
305 stars 25 forks source link

r<CR> #86

Closed polluks closed 2 months ago

polluks commented 2 months ago

I expected a line split... but it behaves as D without yanking.

aligrudi commented 2 months ago

Stefan @.***> wrote:

I suspected a line split... but it behaves as D without yanking.

Must be fixed now.

Thanks, Ali

polluks commented 2 months ago

Better... what about an extra refresh?

aligrudi commented 2 months ago

Stefan @.***> wrote:

Better... what about an extra refresh?

For commands that usually modify a single line, such as ~, r, D, and x, only the current line is updated, unless xrow or xleft changes, in which case the whole screen is updated. Do you mean the update in the second case?

Ali
polluks commented 2 months ago

I was thinking of r<CR> should be equivalent to i<CR><ESC>, therefore the second case.

aligrudi commented 2 months ago

Stefan @.***> wrote:

I was thinking of r<CR> should be equivalent to i<CR><ESC>, therefore the second case.

OK.

Sorry, I am not sure if I understand the second problem. Do you mean that neatvi must redraw the screen but it does not, or that neatvi redraws the screen unnecessarily?

Ali
kyx0r commented 2 months ago

Hello Ali,

I think the confusion is that in your version mod = 2 redraws more than 1 line. This op has to redraw 2 lines, original and the new line. That would imply comment about mod = 2 is wrong.

Kind Regards, Kyryl

aligrudi commented 2 months ago

Hello Kyryl.

Kyryl @.***> wrote:

I think the confusion is that in your version mod = 2 redraws more than 1 line. This op has to redraw 2 lines, original and the new line. That would imply comment about mod = 2 is wrong.

Is it OK then? I was worried that the screen is not updated in some cases.

Ali
polluks commented 2 months ago

works fine but...


[...]
test/e14.sh: Failed
--- /tmp/.neatvi1   2024-06-25 20:25:02
+++ /tmp/.neatvi2   2024-06-25 20:25:02
@@ -1,3 +1,2 @@
-a
 b
 c
aligrudi commented 2 months ago

Stefan @.***> wrote:

works fine but...


[...]
test/e14.sh: Failed
--- /tmp/.neatvi1 2024-06-25 20:25:02
+++ /tmp/.neatvi2 2024-06-25 20:25:02
@@ -1,3 +1,2 @@
-a
 b
 c

Thanks, fixed.

Missed this one after renaming ye command to rs. Now we have rs and rx.

Ali