mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-02 18:00:49 +02:00
commit bash-20201019 snapshot
This commit is contained in:
+3
-1
@@ -1812,7 +1812,7 @@ static const struct {
|
||||
{ "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 },
|
||||
{ "disable-completion", &rl_inhibit_completion, 0 },
|
||||
{ "echo-control-characters", &_rl_echo_control_chars, 0 },
|
||||
{ "enable-bracketed-paste", &_rl_enable_bracketed_paste, 0 },
|
||||
{ "enable-bracketed-paste", &_rl_enable_bracketed_paste, V_SPECIAL },
|
||||
{ "enable-keypad", &_rl_enable_keypad, 0 },
|
||||
{ "enable-meta-key", &_rl_enable_meta, 0 },
|
||||
{ "expand-tilde", &rl_complete_with_tilde_expansion, 0 },
|
||||
@@ -1878,6 +1878,8 @@ hack_special_boolean_var (int i)
|
||||
}
|
||||
else if (_rl_stricmp (name, "show-mode-in-prompt") == 0)
|
||||
_rl_reset_prompt ();
|
||||
else if (_rl_stricmp (name, "enable-bracketed-paste") == 0)
|
||||
_rl_enable_active_region = _rl_enable_bracketed_paste;
|
||||
}
|
||||
|
||||
typedef int _rl_sv_func_t PARAMS((const char *));
|
||||
|
||||
@@ -357,7 +357,7 @@ _rl_isearch_dispatch (_rl_search_cxt *cxt, int c)
|
||||
|
||||
/* XXX - experimental code to allow users to bracketed-paste into the search
|
||||
string even when ESC is one of the isearch-terminators. Not perfect yet. */
|
||||
if (_rl_enable_bracketed_paste && c == ESC && strchr (cxt->search_terminators, c) && (n = _rl_nchars_available ()) > (2*BRACK_PASTE_SLEN-1))
|
||||
if (_rl_enable_bracketed_paste && c == ESC && strchr (cxt->search_terminators, c) && (n = _rl_nchars_available ()) > (BRACK_PASTE_SLEN-1))
|
||||
{
|
||||
j = _rl_read_bracketed_paste_prefix (c);
|
||||
if (j == 1)
|
||||
@@ -680,7 +680,8 @@ opcode_dispatch:
|
||||
free (paste);
|
||||
break;
|
||||
}
|
||||
rl_activate_mark ();
|
||||
if (_rl_enable_active_region)
|
||||
rl_activate_mark ();
|
||||
if (cxt->search_string_index + pastelen + 1 >= cxt->search_string_size)
|
||||
{
|
||||
cxt->search_string_size += pastelen + 2;
|
||||
@@ -805,7 +806,8 @@ opcode_dispatch:
|
||||
{
|
||||
cxt->prev_line_found = cxt->lines[cxt->history_pos];
|
||||
rl_replace_line (cxt->lines[cxt->history_pos], 0);
|
||||
rl_activate_mark ();
|
||||
if (_rl_enable_active_region)
|
||||
rl_activate_mark ();
|
||||
rl_point = cxt->sline_index;
|
||||
if (rl_mark_active_p () && cxt->search_string_index > 0)
|
||||
rl_mark = rl_point + cxt->search_string_index;
|
||||
|
||||
+2
-1
@@ -729,7 +729,8 @@ rl_bracketed_paste_begin (int count, int key)
|
||||
buf = _rl_bracketed_text (&len);
|
||||
rl_mark = rl_point;
|
||||
retval = rl_insert_text (buf) == len ? 0 : 1;
|
||||
rl_activate_mark ();
|
||||
if (_rl_enable_active_region)
|
||||
rl_activate_mark ();
|
||||
|
||||
xfree (buf);
|
||||
return (retval);
|
||||
|
||||
@@ -321,7 +321,8 @@ int _rl_show_mode_in_prompt = 0;
|
||||
/* Non-zero means to attempt to put the terminal in `bracketed paste mode',
|
||||
where it will prefix pasted text with an escape sequence and send
|
||||
another to mark the end of the paste. */
|
||||
int _rl_enable_bracketed_paste = 1; /* XXX - for now */
|
||||
int _rl_enable_bracketed_paste = BRACKETED_PASTE_DEFAULT; /* XXX - for now */
|
||||
int _rl_enable_active_region = BRACKETED_PASTE_DEFAULT;
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
|
||||
@@ -312,6 +312,8 @@ extern int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int));
|
||||
extern int _rl_search_getchar PARAMS((_rl_search_cxt *));
|
||||
|
||||
/* kill.c */
|
||||
#define BRACKETED_PASTE_DEFAULT 1
|
||||
|
||||
#define BRACK_PASTE_PREF "\033[200~"
|
||||
#define BRACK_PASTE_SUFF "\033[201~"
|
||||
|
||||
@@ -532,6 +534,7 @@ extern int _rl_revert_all_at_newline;
|
||||
extern int _rl_echo_control_chars;
|
||||
extern int _rl_show_mode_in_prompt;
|
||||
extern int _rl_enable_bracketed_paste;
|
||||
extern int _rl_enable_active_region;
|
||||
extern char *_rl_comment_begin;
|
||||
extern unsigned char _rl_parsing_conditionalized_out;
|
||||
extern Keymap _rl_keymap;
|
||||
|
||||
@@ -192,7 +192,7 @@ noninc_dosearch (char *string, int dir, int flags)
|
||||
|
||||
make_history_line_current (entry);
|
||||
|
||||
if (_rl_enable_bracketed_paste && ((flags & SF_PATTERN) == 0) && ind > 0 && ind < rl_end)
|
||||
if (_rl_enable_active_region && ((flags & SF_PATTERN) == 0) && ind > 0 && ind < rl_end)
|
||||
{
|
||||
rl_point = ind;
|
||||
rl_mark = ind + strlen (string);
|
||||
|
||||
Reference in New Issue
Block a user