arxanas / scm-record

`scm-record` is a UI component to interactively select changes to include in a commit. It's meant to be embedded in source control tooling.
23 stars 9 forks source link

Rendered lines disappear when CRLF is present #57

Closed hymkor closed 1 month ago

hymkor commented 2 months ago

Description of the bug

scm-record-20240705

first.txt second.txt

Expected behavior

Whether line terminates with LF or CRLF, the text where cursor exists does not disappear.

Actual behavior

Version of rustc

rustc 1.74.1 (a28077b28 2023-12-04)

s4uliu5 commented 2 months ago

The same issue exists on Linux (e.g. Manjaro Linux) too -- scm-diff-editor (8df3f452eb826d52b14c40306e84e4bfb08ab3fc) behaves exactly the same (lines just disappear).

arxanas commented 2 months ago

I put up https://github.com/arxanas/scm-record/pull/61 for this. I'm not sure what the best way is to decide if a character is non-printing. I checked if the Unicode width is zero.

s4uliu5 commented 2 months ago

0d59b0fd23746f099ae10ee743bd4c6d3e6d4fea fixed the issue for me :smile:

hymkor commented 2 months ago

I confirmed that it was fixed after git pull && cargo build --release. And jj split by jj 0.19 with new scm-diff-editor.exe as a add-on also works as I expected.

@arxanas , @s4uliu5 , thank you !