Skip to content
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

Click into empty area selects non-existent items, crashes on subsequent execute() #312

Closed
Korkman opened this issue May 2, 2020 · 0 comments
Labels

Comments

@Korkman
Copy link

Korkman commented May 2, 2020

Version: 0.8.1

Start with a short list, then click into the area above / below items. Note the right hand index does change to an invalid item number. Any execute() bind then crashes skim.

Edit: also happens using pgDn key: select last valid entry, press pgDn - the index is set beyond the valid range. Off by one in this case (set to index 24, for 24 items, but index starts at zero).

Example:
echo -e "1\n2\n3" | sk --bind 'enter:execute(echo ping)'

Trace:

thread 'main' panicked at 'model:act_output: failed to get item 27', src/selection.rs:268:36
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:472
  11: rust_begin_unwind
             at src/libstd/panicking.rs:380
  12: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:334
  13: skim::selection::Selection::get_selected_wrapped_items::{{closure}}
  14: skim::selection::Selection::get_selected_wrapped_items
  15: skim::model::Model::act_execute_silent
  16: skim::model::Model::start
  17: skim::Skim::run_with
  18: sk::real_main
  19: sk::main
  20: std::rt::lang_start::{{closure}}
  21: main
  22: __libc_start_main
  23: _start
@lotabout lotabout added the bug label Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants