mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
Added option for switch beetween 'collect completions before cursor'
and 'collect completions in entire file' Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
fdbd5b8a86
commit
d5381e862e
@ -59,6 +59,7 @@
|
||||
#include "../src/charsets.h"
|
||||
#include "../src/selcodepage.h"
|
||||
#include "../src/strutil.h" /* utf string functions */
|
||||
#include "../src/mcconfig/mcconfig.h"
|
||||
|
||||
#include "../edit/edit-impl.h"
|
||||
#include "../edit/edit.h"
|
||||
@ -2365,12 +2366,18 @@ edit_collect_completions (WEdit *edit, long start, int word_len,
|
||||
GString *temp;
|
||||
mc_search_t *srch;
|
||||
|
||||
long last_byte = start;
|
||||
long last_byte;
|
||||
|
||||
srch = mc_search_new(match_expr, -1);
|
||||
if (srch == NULL)
|
||||
return 0;
|
||||
|
||||
if (mc_config_get_bool(mc_main_config, CONFIG_APP_SECTION, "editor_wordcompletion_collect_entire_file", 0)){
|
||||
last_byte = edit->last_byte;
|
||||
} else {
|
||||
last_byte = start;
|
||||
}
|
||||
|
||||
srch->search_type = MC_SEARCH_T_REGEX;
|
||||
srch->is_case_sentitive = TRUE;
|
||||
srch->search_fn = edit_search_cmd_callback;
|
||||
|
Loading…
Reference in New Issue
Block a user