diff --git a/book/src/configuration.md b/book/src/configuration.md index be25441f5ed37..0ccc536f247c1 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -23,6 +23,7 @@ To override global configuration parameters, create a `config.toml` file located | `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` | | `completion-trigger-len` | The min-length of word under cursor to trigger autocompletion | `2` | | `auto-info` | Whether to display infoboxes | `true` | +| `file-picker-width` | File picker percentage width | `0.5` | ## LSP diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index c44b762500a16..61f3d9b1d62e6 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -166,7 +166,7 @@ impl Component for FilePicker { surface.clear_with(area, background); let picker_width = if render_preview { - area.width / 2 + (area.width as f32 * cx.editor.config.file_picker_width).round() as u16 } else { area.width }; diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 7650d217f459a..2c70c5ee001f6 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -61,6 +61,8 @@ pub struct Config { pub completion_trigger_len: u8, /// Whether to display infoboxes. Defaults to true. pub auto_info: bool, + /// File picker percentage width. Defaults to 0.5. + pub file_picker_width: f32, } #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] @@ -92,6 +94,7 @@ impl Default for Config { idle_timeout: Duration::from_millis(400), completion_trigger_len: 2, auto_info: true, + file_picker_width: 0.5, } } }