rhysd / tui-textarea

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

Allow masking a text with a specific character #32

Closed pm100 closed 11 months ago

pm100 commented 11 months ago

A second attempt. The plan was to use ratatui's new Masked feature, but that got very fiddly with feature combinations. So instead I borrowed the code from Masked and found the correct place to put it

pm100 commented 11 months ago

@rhysd - I also note that the hard tab expansion seems wrong to me. It always inserts 'tab_len' spaces. Surely it should insert spaces up to the next tab stop, just like the soft tab mode does


            let len = self.tab_len - (self.cursor.1 % self.tab_len as usize) as u8;
            spaces(len)
rhysd commented 11 months ago

Surely it should insert spaces up to the next tab stop, just like the soft tab mode does

It's the current behavior. Could you try cargo run --example minimal?

rhysd commented 11 months ago

This was included in v0.2.3 release.

https://github.com/rhysd/tui-textarea/releases/tag/v0.2.3