diff: Change spacebar behavior

48d993e3479f60c48743ed2c617954399107bc67
Alexis Sellier committed ago 1 parent 4f226cb3
crates/diff/src/bin/rustik-diff.rs +1 -2
340 340
            DiffAction::Scroll(Scroll::Lines(LINE_SCROLL_ROWS))
341 341
        }
342 342
        Event::Key(Key::Char('k') | Key::Up) => {
343 343
            DiffAction::Scroll(Scroll::Lines(-LINE_SCROLL_ROWS))
344 344
        }
345 -
        Event::Key(Key::Char(' ')) => DiffAction::NextHunk,
346 -
        Event::Key(Key::PageDown) => DiffAction::Scroll(Scroll::Pages(1)),
345 +
        Event::Key(Key::Char(' ') | Key::PageDown) => DiffAction::Scroll(Scroll::Pages(1)),
347 346
        Event::Key(Key::PageUp) => DiffAction::Scroll(Scroll::Pages(-1)),
348 347
        Event::Key(Key::Ctrl('d')) => {
349 348
            DiffAction::Scroll(Scroll::Lines((area.rows / 2).max(1) as isize))
350 349
        }
351 350
        Event::Key(Key::Ctrl('u')) => {
+0 -0
+0 -0
a.rs +0 -0
a.rs\x1b[m +0 -0
crates/diff/tests/golden.rs +1 -1
3 3
use std::collections::BTreeSet;
4 4
5 5
use rustik_diff::{
6 6
    Decode, DiffAction, DiffDocument, DiffOptions, DiffViewer, FileId, HighlightResult,
7 7
};
8 -
use rustik_tui::{Buffer, Color, Label, Line, Rect, Scroll, Style, colors};
8 +
use rustik_tui::{Buffer, Color, Label, Line, Rect, Scroll};
9 9
10 10
#[test]
11 11
fn expanded_file_card_matches_golden_frame() {
12 12
    assert_golden(
13 13
        "expanded_file_card_64x9.txt",
crates/tui-core/src/ansi.rs +1 -1
38 38
        }
39 39
40 40
        match chars.peek().copied() {
41 41
            Some('[') => {
42 42
                chars.next();
43 -
                while let Some(ch) = chars.next() {
43 +
                for ch in chars.by_ref() {
44 44
                    if ('\u{40}'..='\u{7e}').contains(&ch) {
45 45
                        break;
46 46
                    }
47 47
                }
48 48
            }
f\x1b[m").as_ref(), +0 -0
f" +0 -0
scripts/check +3 -3
19 19
  cat "$log" >&2
20 20
  exit 1
21 21
}
22 22
23 23
run "format" cargo fmt --check
24 -
run "clippy" cargo clippy --all-targets --all-features
25 -
run "build" cargo build --all-targets --all-features
26 -
run "test" cargo test --all-targets --all-features
24 +
run "clippy" cargo clippy --all-targets --all-features -- -D warnings
25 +
run "build" env RUSTFLAGS="-D warnings" cargo build --all-targets --all-features
26 +
run "test" env RUSTFLAGS="-D warnings" cargo test --all-targets --all-features
27 27
run "docs" env RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --document-private-items