rhysd / tui-textarea

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

Add a non-regex search #67

Open russellbanks opened 6 months ago

russellbanks commented 6 months ago

I try to avoid using regex in my application due to the increase in binary size. It would be helpful to have a non-regex search that just highlights direct matches of the input text.

Alternatively, or alongside this, exposing a means of highlighting text (like how text selection currently is) would be helpful.

rhysd commented 6 months ago

regex::escape can be used for this.

rhysd commented 6 months ago

due to the increase in binary size

How does it increase the size and what is your real-world issue due to the increase?

rhysd commented 6 months ago

Measurement on my desktop (Windows x86_64) using examples:

minimal editor
395 KiB 2078 KiB

So the point is if 2078 - 395 = 1683 KiB size increasement causes some issues or not. Personally I haven't seen a trouble due to this difference.