diff --git a/README.md b/README.md index 652126f454fa..2f6a576654b8 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ This fork of Helix implements the following pull requests. Future pull requests 22. https://github.com/helix-editor/helix/pull/14453 (ruler chars) 23. https://github.com/helix-editor/helix/pull/12902 (File Explorer: create/delete/copy/move/rename) 24. https://github.com/helix-editor/helix/pull/13963 (auto reload buffers on focus / changes) +25. https://github.com/helix-editor/helix/pull/12311 (Make overlays (e.g. pickers) fullscreen) ## Setup @@ -508,3 +509,13 @@ periodic.interval = 5000 focus-gained = true periodic.enable = true periodic.interval = 5000 +``` + +### Picker Full Screen + +Enables that pickers cover full screen instead of only 90% + +```toml +[editor] +pickers-full-screen = true +``` diff --git a/book/src/editor.md b/book/src/editor.md index 4c125a6ebcd3..6903a8dc070b 100644 --- a/book/src/editor.md +++ b/book/src/editor.md @@ -67,6 +67,7 @@ | `editor-config` | Whether to read settings from [EditorConfig](https://editorconfig.org) files | `true` | | `rainbow-brackets` | Whether to render rainbow colors for matching brackets. Requires tree-sitter `rainbows.scm` queries for the language. | `false` | | `kitty-keyboard-protocol` | Whether to enable Kitty Keyboard Protocol. Can be `enabled`, `disabled` or `auto` | `"auto"` | +| `pickers-full-screen` | if pickers should be full screen. | `false` | [^3]: In most cases, you also need to enable the `auto-format` setting under `languages.toml`. You can find the reasoning [here](https://github.com/helix-editor/helix/discussions/9043#discussioncomment-7811497). @@ -293,10 +294,10 @@ name = "rust" ### `[editor.auto-reload]` Section -Controls auto reloading of externally modified files. | Key | Description | Default | |--|--|---------| +|--|--|---------| | `focus-gained` | Enable automatic reloading of externally modified files when Helix is focused. Requires [focus event support](https://github.com/helix-editor/helix/wiki/Terminal-Support) from your terminal | `false` | | `periodic.enable` | Enable periodic auto reloading of externally modified files | `false` | | `periodic.interval` | Time interval in milliseconds between auto reload checks | `3000` | diff --git a/helix-term/src/ui/overlay.rs b/helix-term/src/ui/overlay.rs index ff184d4073fa..90f7097c5595 100644 --- a/helix-term/src/ui/overlay.rs +++ b/helix-term/src/ui/overlay.rs @@ -7,6 +7,8 @@ use tui::buffer::Buffer; use crate::compositor::{Component, Context, Event, EventResult}; +pub const FULL_OVERLAID_MAX_WIDTH: u16 = 240; + /// Contains a component placed in the center of the parent component pub struct Overlay { /// Child component @@ -16,10 +18,15 @@ pub struct Overlay { } /// Surrounds the component with a margin of 5% on each side, and an additional 2 rows at the bottom -pub fn overlaid(content: T) -> Overlay { +pub fn overlaid(content: T, ctx: &Context) -> Overlay { Overlay { content, - calc_child_size: Box::new(|rect: Rect| clip_rect_relative(rect.clip_bottom(2), 90, 90)), + calc_child_size: Box::new(|rect: Rect| { + let overlay_full_screen = + ctx.editor.config().pickers_full_screen && rect.width < FULL_OVERLAID_MAX_WIDTH; + let percentage = if overlay_full_screen { 100 } else { 90 }; + clip_rect_relative(rect.clip_bottom(2), percentage, percentage) + }), } } diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 5017129f65ed..e7bb6960b080 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -499,6 +499,8 @@ pub struct Config { /// Completion Highlight configuration #[serde(default)] pub completion_highlight: CompletionHighlight, + /// If pickers should be full screen + pub pickers_full_screen: bool, } #[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, Clone, Copy)] @@ -1643,6 +1645,7 @@ impl Default for Config { gradient_borders: GradientBorderConfig::default(), notifications: NotificationConfig::default(), completion_highlight: CompletionHighlight::default(), + pickers_full_screen: false, } } }