Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ Notable changes are recorded here. The format follows
go, is sized by each monitor's display scaling, and shows in screen captures.
- "Find cursor" in the menu: pressing Ctrl twice (or Shift or Alt, as chosen there) puts a dark halo with a bright ring around
the cursor, on whichever monitor it is. A click, a key or three seconds' rest dismisses it.
- The colours of the cursor indicators can be chosen in the menu: the left and the right
click's spot under "Highlight mouse clicks", and the ring under "Find cursor", each from
a list or any colour with "Custom...".
- Rust port of the C# Windows original, running on Windows, macOS and Linux.
- Settings menu and dialogs drawn by the program.
- Automated builds and releases for all supported platforms.
Expand Down
86 changes: 43 additions & 43 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ cargo build --release
lock the screen, turn the monitor off, and more.
- 🔆 **Brightness panel.** Adjust every monitor from the tray, including **external monitors over
DDC/CI**, and use the mouse wheel to fine-tune.
- 🟡 **Click highlight.** Tick *Highlight mouse clicks* and every click shows a spot under the
- 🟡 **Click highlight.** Turn on *Highlight mouse clicks* and every click shows a spot under the
cursor, yellow for the left button and blue for the right, on whichever monitor you click.
Unlike the walkers it shows in recordings and screen shares, which is what it is for.
Both colours are yours to pick in the menu.
- 🔦 **Find cursor.** Tick *Find cursor* and press Ctrl twice: a dark halo closes in on the
cursor, wherever it is on your monitors. A click, a key or a few seconds' rest sends it away.
The key is yours to pick in the menu: Ctrl, Shift or Alt (Option on a Mac).
The key is yours to pick in the menu: Ctrl, Shift or Alt (Option on a Mac). So is the
colour of the ring.
- 💻 **Terminal prompt.** A window that sets up [Oh My Posh](https://ohmyposh.dev) for you:
installs or updates it, fetches its themes, puts the one you pick into every shell you have
(PowerShell, Windows PowerShell, bash, zsh, fish, Command Prompt through Clink, nu), installs
Expand Down
35 changes: 28 additions & 7 deletions crates/application/src/jsonc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,38 +527,59 @@ mod tests {
assert_eq!(opens.len(), 2);
assert_eq!(get_string_at(wt, opens[0], &["name"]).as_deref(), Some("a"));
assert_eq!(get_string_at(wt, opens[1], &["name"]).as_deref(), Some("b"));
assert_eq!(get_raw(wt, &["profiles", "defaults", "opacity"]).as_deref(), Some("90"));
assert_eq!(
get_raw(wt, &["profiles", "defaults", "opacity"]).as_deref(),
Some("90")
);
assert_eq!(unquoted("\"a \\\"b\\\"\"").as_deref(), Some("a \"b\""));
assert_eq!(unquoted("90"), None);
assert!(objects_in(wt, &["profiles", "defaults"]).is_empty());
assert!(objects_in("", &["x"]).is_empty());

let set = set_raw_at(wt, opens[1], &["font", "face"], &quoted("F")).unwrap();
assert!(set.contains("{ \"font\": { \"face\": \"F\" }, \"name\": \"b\" }"), "{set}");
assert!(
set.contains("{ \"font\": { \"face\": \"F\" }, \"name\": \"b\" }"),
"{set}"
);
let raw = set_raw(wt, &["profiles", "defaults", "opacity"], "50").unwrap();
assert_eq!(get_raw(&raw, &["profiles", "defaults", "opacity"]).as_deref(), Some("50"));
assert_eq!(
get_raw(&raw, &["profiles", "defaults", "opacity"]).as_deref(),
Some("50")
);

// Removal takes the comma with it, whichever side it is on, and the line when
// the member had one of its own.
let gone = remove(wt, &["profiles", "defaults", "fontFace"]).unwrap();
assert!(gone.contains("\"defaults\": { \"opacity\": 90 }"), "{gone}");
let last = remove(wt, &["profiles", "defaults", "opacity"]).unwrap();
assert!(last.contains("\"defaults\": { \"fontFace\": \"Cascadia Code\" }"), "{last}");
assert!(
last.contains("\"defaults\": { \"fontFace\": \"Cascadia Code\" }"),
"{last}"
);
let lines = "{\n \"k\": \"v\",\n \"a\": 1\n}\n";
assert_eq!(remove(lines, &["k"]).unwrap(), "{\n \"a\": 1\n}\n");
assert_eq!(remove(lines, &["a"]).unwrap(), "{\n \"k\": \"v\"\n}\n");
assert_eq!(remove(lines, &["missing"]).unwrap(), lines);
assert_eq!(remove("", &["a"]).unwrap(), "");
let inner = remove_at(wt, opens[0], &["font", "face"]).unwrap();
assert!(inner.contains("{ \"name\": \"a\", \"font\": { } }"), "{inner}");
assert!(
inner.contains("{ \"name\": \"a\", \"font\": { } }"),
"{inner}"
);

// A file with Windows line endings keeps them, and comes back as it was.
let crlf = "{\r\n \"a\": 1,\r\n \"o\": {}\r\n}\r\n";
let set = set_raw(crlf, &["k"], "true").unwrap();
assert_eq!(set, "{\r\n \"k\": true,\r\n \"a\": 1,\r\n \"o\": {}\r\n}\r\n");
assert_eq!(
set,
"{\r\n \"k\": true,\r\n \"a\": 1,\r\n \"o\": {}\r\n}\r\n"
);
assert_eq!(remove(&set, &["k"]).unwrap(), crlf);
let deep = set_raw(crlf, &["o", "k"], "1").unwrap();
assert!(deep.contains("\"o\": {\r\n \"k\": 1\r\n }"), "{deep:?}");
assert!(
deep.contains("\"o\": {\r\n \"k\": 1\r\n }"),
"{deep:?}"
);
}

#[test]
Expand Down
Loading
Loading