Edit titles in their boxes, with vim keys inside the text
Titles are typed right in their boxes on the canvas: the box grows with the text, the terminal's cursor sits in it (a bar while typing, a block on the letter with vim keys), and the border turns the insert color. `i`, `A` and Enter edit at the end, `I` at the start, `cc` and `S` type the title anew. The document follows the text as it's typed, so the layout stays current, and the whole edit is one undo step. Esc gives vim's normal mode inside the text (TextEditor, in ui/): h l w b e 0 ^ $, f t F T with ; and ,, the d c y operators with any of those motions or the iw aw i" a" i( a( text objects, x X s S D C Y, r ~, p P, counts, u and Ctrl-r for the edit's own changes, and `.` for the last one, typing included. j k gg G and J work on lines, for bodies. It follows vim where it's quirky too: cw acts like ce, dw stops at the end of the line, Esc steps back onto the last letter. Keys have two new tables, `text` and `insert`, and in text an operator takes motions as targets (`dw`, `c$`, `2d3fx`), which which-key lists. Rapid entry: after `o`, `O` or `a`, the new idea's title is typed at once; Enter starts the next idea, Tab puts the one being typed under the idea above, Shift-Tab takes it out a level, and Enter on an empty idea stops. An idea left empty goes away without a trace in the undo history (a group whose edits cancel out leaves no step); a title left empty comes back as it was. Inside a title, `o` and `O` start a new sibling. Registers are shared by the whole app, so text yanked in one title pastes into another; `"a`-`"z` and `"_` work, and `"+` stays inside cumulus until the app core connects the clipboard. The mouse while editing: a click in the text moves the text cursor, a click anywhere else keeps the text and finishes the edit, and a double-click on a title starts editing at that letter. `>>` and `<<` now move nodes: under the node above, as its last child, or out a level, right after the old parent, with counts taking in the next siblings. The command line's input became TextInput, line-aware so the editor can use it for bodies too; bodies themselves get edited in the Note view. The example's tests type every key above into the app and check the text and the cursor after each one against what vim does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
6eedbe0ce2
commit
84aefbecdb
31 files changed
+3289
-341
No files matched your search
+5
-2
@@ -4,11 +4,12 @@
|
||||
//! 1. A key goes through the key engine and comes out as a command; the
|
||||
//! focused view answers it with [`action`]s, and [`commands::shared`]
|
||||
//! answers what the view leaves. A `:` command line is answered by
|
||||
//! [`calls::actions_for`] instead.
|
||||
//! [`calls::actions_for`] instead, and keys while a title is edited by
|
||||
//! its [`text_edit`].
|
||||
//! 2. Document actions go to the [`buffer`] holding the document: the one
|
||||
//! place a document changes. The rest change the [`mode`] or the app.
|
||||
//!
|
||||
//! So far this is what stages 2 to 4 needed; stage 8 adds the main loop,
|
||||
//! So far this is what stages 2 to 6 needed; stage 8 adds the main loop,
|
||||
//! panes, files and settings.
|
||||
|
||||
pub mod action;
|
||||
@@ -16,3 +17,5 @@ pub mod buffer;
|
||||
pub mod calls;
|
||||
pub mod commands;
|
||||
pub mod mode;
|
||||
pub mod registers;
|
||||
pub mod text_edit;
|
||||
Reference in new issue
Block a user