helix
helix copied to clipboard
Fix: switching windows during a search no longer crashes
Closes #5632
Search keeps some state around including the current document id and a snapshot of its selection. The crash was caused by changing the document while staying in the search. We saw this bug with using the mouse to switch because it wouldn't close the search.
Now if there is a mismatch of current doc id and saved, we update the saved and the associated state.
I'm trying to implement this and a problem I'm running in to is that I am unsure of how to acquire a reference to the compositor. Looking at the code, I think things are happening that I don't understand. There are a bunch of places where a compositor variable appears to be moved out of thin air? I'm not sure what is going on and would appreciate some advice on what to look up, or an explanation of what is happening.
Examples: helix-term/src/commands.rs:273 helix-term/src/commands.rs:3394 helix-term/src/commands.rs:6597
I'm trying to implement this and a problem I'm running in to is that I am unsure of how to acquire a reference to the compositor. Looking at the code, I think things are happening that I don't understand. There are a bunch of places where a compositor variable appears to be moved out of thin air? I'm not sure what is going on and would appreciate some advice on what to look up, or an explanation of what is happening.
Examples: helix-term/src/commands.rs:273 helix-term/src/commands.rs:3394 helix-term/src/commands.rs:6597
So I learned a bit more about closures and I understand them a bit more.
New change is on handling DocumentFocusLost, we remove all ui::Prompts from the compositor. If this approach is the right direction, should we close Pickers as well?
I think we should leave pickers open. In particular pressing A-ret in the file picker should open a new document but leave the picker open