stormasm / zed-ijsnow-textinput

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initial work by Isaac Snow

Release Notes:

Adds an element to gpui that allows editing the data in a Model Test with the editable_text example.

cargo run -p gpui --example editable_text

There is definitely some fine tuning to be done, but I wanted to put a draft up to see if there were any comments on the design or direction. Everything is pretty basic but it seems to work for just basic string manipulation. Here are some known problems:

  • Mouse down doesn't get reset when mouse up happens outside the text (should be a quick fix)
  • Multi line text data can be passed to the element in single line mode and not much changes
  • Need to do select down/select up for multi line. I forgot about it
  • Multiline support in general is a bit off
  • If a line contains only a newline, you cant move the cursor to it by clicking it. The index_for_position code needs to be modified a bit more
  • Much more I'm sure. I just kind of brute forced the design. For example it would probably make sense to accept a view that implements ViewInputHandler as well as just a Model with a custom InputHandler.
  • I'm sure there are some optimizations that could be done.

References

About

License:Other


Languages

Language:Rust 97.5%Language:Scheme 1.1%Language:Shell 0.3%Language:Metal 0.2%Language:JavaScript 0.2%Language:WGSL 0.2%Language:Rich Text Format 0.2%Language:Swift 0.2%Language:Python 0.1%Language:TypeScript 0.0%Language:Objective-C 0.0%Language:Procfile 0.0%Language:C 0.0%