rhysd / tui-textarea

Simple yet powerful multi-line text editor widget for ratatui and tui-rs
https://crates.io/crates/tui-textarea
MIT License
341 stars 63 forks source link

hard tab now adds extra padding character on display #43

Closed pm100 closed 1 year ago

pm100 commented 1 year ago

on current head

run minimal sample with hard tab set on (I set width to 10),

enter a\tb\na\b

display is

image

now cursor left into the gap

image

the tab space grew by one character

I have tried an initial debug but its not obvious

rhysd commented 1 year ago

Thank you for reporting. This is a bug. I could reproduce it. I'll take a look.

pm100 commented 1 year ago

Did you see my question about hard tabs ? In the insert_str closed issue

rhysd commented 1 year ago

@pm100 I haven't seen it. I'll check.

I confirmed the root cause of this issue and now fixing it with refactoring highlight.rs.

rhysd commented 1 year ago

I confirmed the fix:

tmp