Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ lto = "thin" # Similarly, speed up linking by a ton

[workspace.dependencies]
edit = { path = "./crates/edit" }
lsh = { path = "./crates/lsh" }
stdext = { path = "./crates/stdext" }
unicode-gen = { path = "./crates/unicode-gen" }
62 changes: 62 additions & 0 deletions assets/highlighting-tests/COMMIT_EDITMSG
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
lsh: flip legacy flag, add follow-up hook & diff test

Refactors placeholder logic and introduces a lightweight follow-up hook.
Adds diff highlighting test and removes outdated asset to streamline visuals.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch foobar
# Your branch is up to date with 'origin/foobar'.
#
# Changes to be committed:
# renamed: foo.rs -> bar.rs
# modified: src/lsh/definitions.rs
# deleted: assets/old_logo.svg
# new file: baz.rs
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/src/lsh/definitions.rs b/src/lsh/definitions.rs
index a1b2c3d..d4c3b2a 100644
--- a/src/lsh/definitions.rs
+++ b/src/lsh/definitions.rs
@@ -12,9 +12,11 @@ // context line 12
// context line 13
-// old placeholder logic A
-const LEGACY_FLAG: bool = true;
-// end legacy block
+// updated placeholder logic A
+const LEGACY_FLAG: bool = false; // flipped for test
+// added note: migration in progress
+// end legacy block
// context line 19
// context line 20
@@ -42,7 +44,12 @@ // context line 42
// context line 43
- do_placeholder_action(alpha, beta);
+ // Split actions for clarity
+ do_placeholder_prepare(alpha);
+ do_placeholder_action(alpha, beta);
+ if (enable_extra()) {
+ do_placeholder_followup(beta);
+ }
// context line 50
// context line 51
// context line 52
@@ -90,6 +97,15 @@ // context line 90
// context line 91
// context line 92
+/// Added lightweight fake helper
+fn enable_extra() -> bool {
+ // Pretend this consults a config value
+ true
+}
+
+// Temporary debug instrumentation (to be removed)
+const _DEBUG_HOOK: &str = "lsh:extra";
+
// context line 93
// context line 94
// context line 95
142 changes: 142 additions & 0 deletions assets/highlighting-tests/diff.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
diff --git a/src/lsh/definitions.rs b/src/lsh/definitions.rs
index a1b2c3d..d4c3b2a 100644
--- a/src/lsh/definitions.rs
+++ b/src/lsh/definitions.rs
@@ -12,9 +12,11 @@ // context line 12
// context line 13
-// old placeholder logic A
-const LEGACY_FLAG: bool = true;
-// end legacy block
+// updated placeholder logic A
+const LEGACY_FLAG: bool = false; // flipped for test
+// added note: migration in progress
+// end legacy block
// context line 19
// context line 20
@@ -42,7 +44,12 @@ // context line 42
// context line 43
- do_placeholder_action(alpha, beta);
+ // Split actions for clarity
+ do_placeholder_prepare(alpha);
+ do_placeholder_action(alpha, beta);
+ if (enable_extra()) {
+ do_placeholder_followup(beta);
+ }
// context line 50
// context line 51
// context line 52
@@ -90,6 +97,15 @@ // context line 90
// context line 91
// context line 92
+/// Added lightweight fake helper
+fn enable_extra() -> bool {
+ // Pretend this consults a config value
+ true
+}
+
+// Temporary debug instrumentation (to be removed)
+const _DEBUG_HOOK: &str = "lsh:extra";
+
// context line 93
// context line 94
// context line 95

diff --git a/src/tui.rs b/src/tui.rs
index 1122334..5566778 100644
--- a/src/tui.rs
+++ b/src/tui.rs
@@ -5,8 +5,13 @@ // context line 5
// context line 6
// context line 7
-// previous rendering stub
-render_placeholder(frame);
+// refined rendering sequence
+begin_frame(frame);
+render_header(frame);
+render_body(frame);
+render_footer(frame);
+end_frame(frame);
+
// context line 14
// context line 15
// context line 16

diff --git a/README.md b/README.md
index 9aa9aa9..1bb1bb1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,11 @@
# Project Title
-Some brief description here.
+Some brief description here (updated).
+
+Experimental notes:
+- Added fake diff example
+- Demonstrates multi-hunk & multi-file patch
+
## Usage
Run the binary as needed.

diff --git a/Cargo.toml b/Cargo.toml
index cafe123..fade321 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,10 @@ edition = "2021"
# context
[features]
-default = []
+default = ["experimental-preview"]
+experimental-preview = []
+
+# NOTE: Above feature is placeholder & fake

[dependencies]
# context
@@ -20,6 +23,7 @@ anyhow = "1"
# context
# instrumentation (fake addition)
tracing = "0.1"
+tracing-subscriber = "0.3"

diff --git a/src/feature/experimental.rs b/src/feature/experimental.rs
new file mode 100644
index 0000000..abc1234
--- /dev/null
+++ b/src/feature/experimental.rs
@@ -0,0 +1,24 @@
+//! Placeholder experimental module (fake content).
+//! This file exists only to demonstrate a multi-file diff.
+#![allow(dead_code)]
+
+pub struct ExperimentalToggle {
+ enabled: bool,
+}
+
+impl ExperimentalToggle {
+ pub fn new() -> Self {
+ Self { enabled: true }
+ }
+ pub fn enabled(&self) -> bool {
+ self.enabled
+ }
+}
+
+pub fn run_experimental_path() {
+ if ExperimentalToggle::new().enabled() {
+ // Fake behavior
+ eprintln!("(fake) running experimental path");
+ }
+}
+

diff --git a/assets/old_logo.svg b/assets/old_logo.svg
deleted file mode 100644
index 55aa55a..0000000
--- a/assets/old_logo.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- Fake removed asset -->
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
- <rect width="10" height="10" fill="#FF00FF"/>
- <text x="1" y="9" font-size="3">X</text>
-</svg>
54 changes: 54 additions & 0 deletions assets/highlighting-tests/git-rebase-todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
pick 3f9d2ab # chore(ci): add initial pipeline
pick e12c0ff # feat(io): introduce streaming reader
reword 7ac14d0 feat(io): add zero-copy buffered writer
edit 4d92b67 fix(io): handle partial UTF-8 sequences at buffer boundary
pick 8bb3a21 docs: expand README performance section
squash 1c02f55 docs: tidy wording in performance section
pick 54ae91b feat(cli): add --color=auto detection
fixup 0b77c3e feat(cli): typo in help text
fixup -c 2f4e8ab feat(cli): adjust arg parsing error message
pick 6d8e5f1 refactor(core): split large module into submodules
break
pick a41e9d3 test(core): add regression tests for issue #410
exec cargo test --package edit --lib --quiet
pick c3bb921 perf(render): SIMD accelerate line diffing
drop 91d0f2e debug(render): temporary logging (to be dropped)
label pre-merge-split
pick d2f7ac4 feat(ui): add mouse wheel smooth scrolling
pick f1a4bd9 feat(ui): add high-DPI awareness
label post-ui
update-ref refs/heads/feature/ui-stack-post
reset pre-merge-split
merge -C 5ab77e3 post-ui # Merge UI feature stack
pick d8c4b91 build: bump version to 0.9.0

# Rebase 3f9d2ab..d8c4b91 onto d8c4b91 (18 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
# commit's log message, unless -C is used, in which case
# keep only this commit's message; -c is same as -C but
# opens the editor
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# create a merge commit using the original merge commit's
# message (or the oneline, if no original merge commit was
# specified); use -c <commit> to reword the commit message
# u, update-ref <ref> = track a placeholder for the <ref> to be updated
# to this position in the new commits. The <ref> is
# updated at the end of the rebase
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
2 changes: 1 addition & 1 deletion crates/edit/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2501,7 +2501,7 @@ impl TextBuffer {
}

/// Extracts the contents of the current selection the user made.
/// This differs from [`TextBuffer::extract_selection()`] in that
/// This differs from `TextBuffer::extract_selection()` in that
/// it does nothing if the selection was made by searching.
pub fn extract_user_selection(&mut self, delete: bool) -> Option<Vec<u8>> {
if !self.has_selection() {
Expand Down
Loading