Skip to content

Commit

Permalink
Custom file picker percentage width
Browse files Browse the repository at this point in the history
  • Loading branch information
Rational-Curiosity committed Nov 12, 2021
1 parent 6d4409c commit 074310c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl<T: 'static> Component for FilePicker<T> {
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
};
Expand Down
3 changes: 3 additions & 0 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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,
}
}
}
Expand Down

0 comments on commit 074310c

Please sign in to comment.