Ticket #4160: EntireFileCompletionDefault.patch

File EntireFileCompletionDefault.patch, 2.5 KB (added by psprint, 3 years ago)
  • src/editor/edit.c

    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; 
    9090int option_line_state_width = 0; 
    9191gboolean option_cursor_after_inserted_block = FALSE; 
    9292gboolean option_state_full_filename = FALSE; 
     93gboolean option_completion_collect_entire_file = TRUE; 
    9394 
    9495gboolean enable_show_tabs_tws = TRUE; 
    9596gboolean option_check_nl_at_eof = FALSE; 
  • src/editor/edit.h

    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; 
    4242extern gboolean option_cursor_beyond_eol; 
    4343extern gboolean option_cursor_after_inserted_block; 
    4444extern gboolean option_state_full_filename; 
     45extern gboolean option_completion_collect_entire_file; 
    4546extern gboolean option_line_state; 
    4647extern int option_save_mode; 
    4748extern gboolean option_save_position; 
  • src/editor/editcmd.c

    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, 
    12331233    if (srch == NULL) 
    12341234        return 0; 
    12351235 
    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; 
    12401237    last_byte = entire_file ? edit->buffer.size : word_start; 
    12411238 
    12421239    srch->search_type = MC_SEARCH_T_REGEX; 
  • src/setup.c

    diff --git a/src/setup.c b/src/setup.c
    index 77c07649d..499169593 100644
    a b static const struct 
    357357    { "editor_show_right_margin", &show_right_margin }, 
    358358    { "editor_group_undo", &option_group_undo }, 
    359359    { "editor_state_full_filename", &option_state_full_filename }, 
     360    { "editor_wordcompletion_collect_entire_file", &option_completion_collect_entire_file }, 
    360361#endif /* USE_INTERNAL_EDIT */ 
    361362    { "editor_ask_filename_before_edit", &editor_ask_filename_before_edit }, 
    362363    { "nice_rotating_dash", &nice_rotating_dash },