mjl- / duit

pure go, cross-platform, MIT-licensed ui toolkit for developers
MIT License
951 stars 38 forks source link

edit: add Size() method returning total size of Edit buffer #15

Closed knusbaum closed 3 years ago

knusbaum commented 4 years ago

Sometimes it's helpful when moving the cursor to know where the end of the buffer is. I think you could use len(edit.Text()) but that looks expensive. Internally, Edit uses ui.text.Size() so I am exposing that through a Size() method.

mjl- commented 3 years ago

thanks for the patch! i added Edit.Size just now. did a separate commit instead of merge because the PR has other changes.