Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 27dc4523..57e13088 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -278,6 +278,9 @@ pub struct Config {
/// either absolute or relative to the current opened document or current working directory (if the buffer is not yet saved).
/// Defaults to true.
pub path_completion: bool,
+ /// Configures completion of words from open buffers.
+ /// Defaults to enabled with a trigger length of 7.
+ pub word_completion: WordCompletion,
/// Automatic formatting on save. Defaults to true.
pub auto_format: bool,
/// Default register used for yank/paste. Defaults to '"'
@@ -974,6 +977,22 @@ pub enum PopupBorderConfig {
Menu,
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
+pub struct WordCompletion {
+ pub enable: bool,
+ pub trigger_length: NonZeroU8,
+}
+
+impl Default for WordCompletion {
+ fn default() -> Self {
+ Self {
+ enable: true,
+ trigger_length: NonZeroU8::new(7).unwrap(),
+ }
+ }
+}
+
impl Default for Config {
fn default() -> Self {
Self {
@@ -993,6 +1012,7 @@ impl Default for Config {
auto_pairs: AutoPairConfig::default(),
auto_completion: true,
path_completion: true,
+ word_completion: WordCompletion::default(),
auto_format: true,
default_yank_register: '"',
auto_save: AutoSave::default(),