Add vim-style editor features: hybrid line numbers, cursor-centered viewport, and rendered markdown #10
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/010-add-vim-style-editor-features-hybrid-line-numb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add vim-style editor features: hybrid line numbers, cursor-centered viewport, and rendered markdown
Along the way:
Touches 16 files:
Cargo.lock,ck-editor/Cargo.toml,ck-editor/src/buffer/mod.rs,ck-editor/src/view/gutter.rs,ck-editor/src/view/input.rs,ck-editor/src/view/mod.rsand 10 more.Reads well. One question on
ck-editor/src/view/render_markdown.rs, nothing blocking.@ -582,1 +582,4 @@/// Search forward for `pattern` starting after `from`. Wraps around./// Returns the position of the first char of the match, or None.pub fn search_forward(&self, from: Position, pattern: &str) -> Option<Position> {search_forwardis public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise.@ -0,0 +407,4 @@..Default::default()};// Pad with thin spaces for visual breathing roomself.job.append("\u{2009}", 0.0, format.clone());appendis cloned on what looks like a hot path. Is the ownership forced here, or can this borrow?It can borrow. The clone of
appendwas left over from before the lifetime was threaded throughck-editor/src/view/render_markdown.rs, and it is gone.Nothing outside calls
search_forward. It is pub(crate) inck-editor/src/buffer/mod.rsnow.