Open mistakenelf opened 6 years ago
Hi!
It should be possible to implement a text editor using this library: the simplest version would just use a TextArea
, and simply implement ways to open/save files.
However, this trivial solution is not ideal for a few reasons:
TextArea
isn't currently super optimized for large content (it stores its content as a simple String
, not a rope).Note that those two points could be solved by writing your own EditorView
; the core mechanism of cursive should be feature-sufficient for that.
@knipferrc if you implement said EditorView
I wouldn't mind a library for this! :smile:
Also, if you (by any chance) implement a "tab" functionality, I would love to see a library for this as well!
But, as you're learning: No pressure! :smile:
I would definitely be interested in at least taking a swing at making an EditorView
, could be a fun learning experience.
Hell yeah, that is actually a freakin' nice idea! I will try to implemented a View
using Xi tomorrow, I guess.
I'd love to have a look! But it seems the project is not available - maybe it was removed? Or is not public?
Yes, I have to ask my company for release permission. I already filed for it, waiting for answer.
Maybe the EditorView
implementation I'm using in my text editor built on Cursive can serve as inspiration. There's no repo yet but you can view the sources on docs.rs
.
finally got clearance to share my code. The editor is sly_text_view.rs. It's a bit complicated (separate model from view, multiple cursors, some events bound to configurable input), but can be used as reference. Just make sure you know the license (Apache 2.0).
Asking for help
Problem description
Im looking to start learning rust and I would like to build a simple text editor, this seems to be the most well maintained TUI library for rust and was wondering if its feasible to use this to make a simple terminal text editor?
Environment
grep "define NCURSES_VERSION " /usr/include/curses.h
)locale
in a terminal). en_US