editor: Refactor EditorMode::Full (#28546)

This PR lightly refactors the `EditorMode::Full` exposing two new
methods: `is_full` and `set_mode`.

Motivation is to expose fields that modify the behavior when the editor
is in `Full` mode. By using is `mode.is_full()` instead of
`EditorMode::Full` we can introduce new fields without breaking other
places in the code.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
Danilo Leal
2025-04-10 23:22:27 +00:00
committed by GitHub
co-authored by Bennet Bo Fenner
parent 294a1b63c0
commit a2a3d1a4bd
13 changed files with 75 additions and 61 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
use crate::{
Copy, CopyAndTrim, CopyPermalinkToLine, Cut, DebuggerEvaluateSelectedText, DisplayPoint,
DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDeclaration, GoToDefinition,
DisplaySnapshot, Editor, FindAllReferences, GoToDeclaration, GoToDefinition,
GoToImplementation, GoToTypeDefinition, Paste, Rename, RevealInFileManager, SelectMode,
ToDisplayPoint, ToggleCodeActions,
actions::{Format, FormatSelections},
@@ -123,7 +123,7 @@ pub fn deploy_context_menu(
}
// Don't show context menu for inline editors
if editor.mode() != EditorMode::Full {
if !editor.mode().is_full() {
return;
}