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

Zed panicked when trying to tab over text #155

Closed
JosephTLyons opened this issue Sep 18, 2021 · 6 comments
Closed

Zed panicked when trying to tab over text #155

JosephTLyons opened this issue Sep 18, 2021 · 6 comments
Labels
defect [core label]

Comments

@JosephTLyons
Copy link
Contributor

This is another issue filed on behalf of someone else in the beta.

Text was selected in Zed and the user tried to hit tab and zed crashed:

I believe this is the error associated with it:

15:17:24 [ERROR] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value': zed/src/editor.rs:488
   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: log_panics::init::{{closure}}
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_handler::{{closure}}
   5: std::sys_common::backtrace::__rust_end_short_backtrace
   6: _rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic
   9: zed::editor::Editor::autoscroll_vertically
  10: gpui::app::ViewHandle<T>::update
  11: <zed::editor::element::EditorElement as gpui::elements::Element>::layout
  12: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  13: gpui::presenter::LayoutContext::layout
  14: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  15: <gpui::elements::flex::Expanded as gpui::elements::Element>::layout
  16: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  17: gpui::elements::flex::Flex::layout_flex_children
  18: <gpui::elements::flex::Flex as gpui::elements::Element>::layout
  19: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  20: gpui::presenter::LayoutContext::layout
  21: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  22: <gpui::elements::flex::Expanded as gpui::elements::Element>::layout
  23: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  24: gpui::elements::flex::Flex::layout_flex_children
  25: <gpui::elements::flex::Flex as gpui::elements::Element>::layout
  26: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  27: <gpui::elements::stack::Stack as gpui::elements::Element>::layout
  28: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  29: <gpui::elements::flex::Expanded as gpui::elements::Element>::layout
  30: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  31: gpui::elements::flex::Flex::layout_flex_children
  32: <gpui::elements::flex::Flex as gpui::elements::Element>::layout
  33: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  34: <gpui::elements::container::Container as gpui::elements::Element>::layout
  35: <gpui::elements::Lifecycle<T> as gpui::elements::AnyElement>::layout
  36: gpui::presenter::LayoutContext::layout
  37: gpui::presenter::Presenter::build_scene
  38: gpui::app::MutableAppContext::flush_effects
  39: gpui::app::MutableAppContext::open_platform_window::{{closure}}
  40: gpui::platform::mac::window::handle_view_event
  41: <unknown>
  42: <unknown>
  43: gpui::platform::mac::window::send_event
  44: <unknown>
  45: gpui::platform::mac::platform::send_event
  46: <unknown>
  47: <unknown>
  48: <gpui::platform::mac::platform::MacForegroundPlatform as gpui::platform::ForegroundPlatform>::run
  49: gpui::app::App::run
  50: Zed::main
  51: std::sys_common::backtrace::__rust_begin_short_backtrace
  52: std::rt::lang_start::{{closure}}
  53: std::rt::lang_start_internal
  54: _main
@JosephTLyons JosephTLyons added the defect [core label] label Sep 18, 2021
@JosephTLyons JosephTLyons changed the title App crashed when trying to tab text Zed crashed when trying to tab-over text Sep 18, 2021
@JosephTLyons JosephTLyons changed the title Zed crashed when trying to tab-over text Zed panicked when trying to tab-over text Sep 18, 2021
@JosephTLyons
Copy link
Contributor Author

JosephTLyons commented Sep 18, 2021

I have not personally been able to reproduce this bug.

@JosephTLyons JosephTLyons changed the title Zed panicked when trying to tab-over text Zed panicked when trying to tab over text Sep 20, 2021
@maxbrunsfeld
Copy link
Collaborator

It looks like somehow, this Editor view ended up with an empty selection set, and I'm not clear on how it could get into that state. I think I might want to hold off on working on this one until someone hits it again and can find a way to reproduce it.

@maxbrunsfeld
Copy link
Collaborator

@as-cii Was able to identify exactly how this occurred. ⚡

@JosephTLyons
Copy link
Contributor Author

JosephTLyons commented Sep 23, 2021

@as-cii Was able to identify exactly how this occurred. ⚡

Amazing, I tried a bunch of different things and couldn't reproduce it.

@maxbrunsfeld
Copy link
Collaborator

maxbrunsfeld commented Sep 23, 2021

You had to type a keystroke while dragging with the mouse to create a selection.

@JosephTLyons
Copy link
Contributor Author

Nice work! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label]
Projects
None yet
Development

No branches or pull requests

2 participants