Canop / bacon

background rust code check
https://dystroy.org/bacon
GNU Affero General Public License v3.0
1.95k stars 72 forks source link

Option to stay scrolled to the bottom when command finishes #244

Open net opened 4 weeks ago

net commented 4 weeks ago

Auto-scroll doesn't work for me. The output always remains at the top, and I have to press G after running to jump to the bottom.

Correction: auto-scroll works, but Bacon jumps to the top when the command finishes running. An option to stay at the bottom would be great!

Bacon 3.0.0

Canop commented 3 weeks ago

When there's a long output during compilation, autoscroll to the bottom automatically happens. In such case, without user action, you see the output auto scrolling, then the whole is replaced by the report, and you see its top, most interesting part.

Autoscroll detection purpose is to detect when you scrolled to read something which isn't at the bottom, so that it doesn't get away.

The problem is we can't really detect that you want to be at the bottom and stay there after the scrolling output is replaced. What interaction do you suggest ?

net commented 3 weeks ago

The top is not always the interesting part:

[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
    Finished `release` profile [optimized] target(s) in 0.02s
[INFO]: ⬇️   Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: ✨   Done in 1.08s
[INFO]: 📦   Your wasm pkg is ready to publish at ...
watchman warning:  Recrawled this watch 29 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del ... ; watchman watch-project ...`

 PASS  js/index.test.ts
  findOccurances
    ✓ should work (3 ms)
    ✓ supports word boundaries (1 ms)
    ✓ supports syllable boundaries (1 ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        0.259 s, estimated 1 s
Ran all test suites.

I suggest a scroll_to_top_on_finish job property that defaults to true, that when false disables the jump to the top when the command finishes and keeps your scrolled-to place instead.

Or, if the way bacon works doesn't really support the idea of keeping your scolled-to place, then a scroll_to_on_finish property that can be top or bottom.