-
Notifications
You must be signed in to change notification settings - Fork 0
2. Buffer framing
Here is an update of my work on the editor so far.
I am now sure how to setup a good way for making this project contribution frindly. I will have to think a bit more about that. Any suggestions and thoughts are welcome.
Displaying buffers inside a frame now works.
When the cursor is out of bounds the scrolling has been implemented. It is a first draft that just scrolls enough, for the cursor to be within bounds. It will also not work correctly, if a line is big enough to accupy the whole frame. It is a rare case, but it needs to be handled. The function is there and it works (liq2.tty-output/recalculate-tow), next step is to make it work better. Vim-like behavior will be the target. TOW means Top Of Window. It is the first character to draw when drawing a buffer in a frame. When the cursor is out of bounds TOW is what needs to be recalculated. Better algorithm means better UX.
I decided not to create the sub-editor datastructure anyway. It seem to provide an unnecessary extra abstraction. The buffer is used directly. It should be thought of as a vim-buffer without display. So every action on text should be possible, including change of mode.
There are 3 kinds of modes. Each buffer has mode corresponding to vim modes, like "insert" and "normal". There will be a major mode, more Emacs style, which can overwrite the behavior of "insert" and "normal". Then there will be a list of Emacs style minor modes, which may modify some part, like keybindings on the major mode. In Emacs a mode has one keymapping table. Think of this editor as the same, but with more mappings, to support a vim-like behavior in a Emacs-like setup.
I have started on a fundamental-mode. It just needs more keybindings to be implemented.
I am thinking about implementing status lines as buffers as well. They just needs some special handling. I am not done thinking about how. But I hope it will be a simplification to have the same buffer-type handling all text.
I have not considered syntax highlighting yet, but I have prepared the structure of the text in the buffer to be able to contain color information.
Until now everything works using both clj and Lumo. I have not yet tried how loading file content and evaluation works through Lumo. I will investigate that soon.