From 7c3c5232b33939b19b98ef4ec15f7bb3f119fa95 Mon Sep 17 00:00:00 2001
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Sat, 23 Jan 2021 11:58:19 -0600
Subject: Make completion collect entire file.
---
src/editor/edit.c | 1 +
src/editor/edit.h | 1 +
src/editor/editcmd.c | 5 +----
src/setup.c | 1 +
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/editor/edit.c b/src/editor/edit.c
index edda1f832..de1c96f05 100644
a
|
b
|
gboolean option_line_state = FALSE; |
90 | 90 | int option_line_state_width = 0; |
91 | 91 | gboolean option_cursor_after_inserted_block = FALSE; |
92 | 92 | gboolean option_state_full_filename = FALSE; |
| 93 | gboolean option_completion_collect_entire_file = TRUE; |
93 | 94 | |
94 | 95 | gboolean enable_show_tabs_tws = TRUE; |
95 | 96 | gboolean option_check_nl_at_eof = FALSE; |
diff --git a/src/editor/edit.h b/src/editor/edit.h
index 6c519e9d3..01fdbc5f0 100644
a
|
b
|
extern gboolean option_drop_selection_on_copy; |
42 | 42 | extern gboolean option_cursor_beyond_eol; |
43 | 43 | extern gboolean option_cursor_after_inserted_block; |
44 | 44 | extern gboolean option_state_full_filename; |
| 45 | extern gboolean option_completion_collect_entire_file; |
45 | 46 | extern gboolean option_line_state; |
46 | 47 | extern int option_save_mode; |
47 | 48 | extern gboolean option_save_position; |
diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
index 0d2caa923..fcbb8edbc 100644
a
|
b
|
edit_collect_completions (WEdit * edit, off_t word_start, gsize word_len, |
1233 | 1233 | if (srch == NULL) |
1234 | 1234 | return 0; |
1235 | 1235 | |
1236 | | entire_file = |
1237 | | mc_config_get_bool (mc_global.main_config, CONFIG_APP_SECTION, |
1238 | | "editor_wordcompletion_collect_entire_file", 0); |
1239 | | |
| 1236 | entire_file = option_completion_collect_entire_file; |
1240 | 1237 | last_byte = entire_file ? edit->buffer.size : word_start; |
1241 | 1238 | |
1242 | 1239 | srch->search_type = MC_SEARCH_T_REGEX; |
diff --git a/src/setup.c b/src/setup.c
index 77c07649d..499169593 100644
a
|
b
|
static const struct |
357 | 357 | { "editor_show_right_margin", &show_right_margin }, |
358 | 358 | { "editor_group_undo", &option_group_undo }, |
359 | 359 | { "editor_state_full_filename", &option_state_full_filename }, |
| 360 | { "editor_wordcompletion_collect_entire_file", &option_completion_collect_entire_file }, |
360 | 361 | #endif /* USE_INTERNAL_EDIT */ |
361 | 362 | { "editor_ask_filename_before_edit", &editor_ask_filename_before_edit }, |
362 | 363 | { "nice_rotating_dash", &nice_rotating_dash }, |