Skip to content

Fix select branch list scrolling #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 31, 2020

Conversation

WizardOhio24
Copy link
Contributor

Closes #368

The scrolling in branch list is now the same as the commit-list and the file-list, in that it scrolls only at the top or the bottom and can change speed.

@extrawurst
Copy link
Collaborator

this crashes on small terminals:

panic: PanicInfo { payload: Any, message: Some(attempt to subtract with overflow), location: Location { file: "src/components/select_branch.rs", line: 62, col: 35 } }
trace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.53/src/backtrace/libunwind.rs:100:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.53/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.53/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.53/src/capture.rs:176:9
   3: backtrace::capture::Backtrace::new
             at /Users/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.53/src/capture.rs:140:22
   4: gitui::set_panic_handlers::{{closure}}
             at src/main.rs:300:25
   5: std::panicking::rust_panic_with_hook
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:573:17
   6: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:476:9
   7: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:153:18
   8: rust_begin_unwind
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475:5
   9: core::panicking::panic_fmt
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:85:14
  10: core::panicking::panic
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:50:5
  11: <gitui::components::select_branch::SelectBranchComponent as gitui::components::DrawableComponent>::draw
             at src/components/select_branch.rs:62:35
  12: gitui::app::App::draw_popups
             at src/app.rs:626:9
  13: gitui::app::App::draw
             at src/app.rs:205:9
  14: gitui::draw::{{closure}}
             at src/main.rs:184:25
  15: tui::terminal::Terminal<B>::draw
             at /Users/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.12.0/src/terminal.rs:259:9
  16: gitui::draw
             at src/main.rs:183:5
  17: gitui::main
             at src/main.rs:149:13
  18: core::ops::function::FnOnce::call_once
             at /Users/stephan/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
  19: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /Users/stephan/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:137:18
  20: std::rt::lang_start::{{closure}}
             at /Users/stephan/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:66:18
  21: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:373:40
      std::panicking::try
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:337:19
      std::panic::catch_unwind
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panic.rs:379:14
      std::rt::lang_start_internal
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:51:25
  22: std::rt::lang_start
             at /Users/stephan/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:65:5
  23: _main

@WizardOhio24
Copy link
Contributor Author

Fixed

@extrawurst extrawurst merged commit bbc0488 into gitui-org:master Oct 31, 2020
@extrawurst
Copy link
Collaborator

@WizardOhio24 thank you so much for for continuing support!❤️

extrawurst pushed a commit that referenced this pull request May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

correct scrolling on branches list
2 participants