mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
commit
f343803891
@ -97,8 +97,7 @@
|
|||||||
#define BRACK_PASTE_LAST '~'
|
#define BRACK_PASTE_LAST '~'
|
||||||
#define BRACK_PASTE_SLEN 6
|
#define BRACK_PASTE_SLEN 6
|
||||||
|
|
||||||
/// Make sure we don't get ^J for the enter character.
|
/// This handler bypasses some unused macro/event checkings.
|
||||||
/// This handler also bypasses some unused macro/event checkings.
|
|
||||||
static int clickhouse_rl_bracketed_paste_begin(int /* count */, int /* key */)
|
static int clickhouse_rl_bracketed_paste_begin(int /* count */, int /* key */)
|
||||||
{
|
{
|
||||||
std::string buf;
|
std::string buf;
|
||||||
@ -106,10 +105,10 @@ static int clickhouse_rl_bracketed_paste_begin(int /* count */, int /* key */)
|
|||||||
|
|
||||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||||
SCOPE_EXIT(RL_UNSETSTATE(RL_STATE_MOREINPUT));
|
SCOPE_EXIT(RL_UNSETSTATE(RL_STATE_MOREINPUT));
|
||||||
char c;
|
int c;
|
||||||
while ((c = rl_read_key()) >= 0)
|
while ((c = rl_read_key()) >= 0)
|
||||||
{
|
{
|
||||||
if (c == '\r' || c == '\n')
|
if (c == '\r')
|
||||||
c = '\n';
|
c = '\n';
|
||||||
buf.push_back(c);
|
buf.push_back(c);
|
||||||
if (buf.size() >= BRACK_PASTE_SLEN && c == BRACK_PASTE_LAST && buf.substr(buf.size() - BRACK_PASTE_SLEN) == BRACK_PASTE_SUFF)
|
if (buf.size() >= BRACK_PASTE_SLEN && c == BRACK_PASTE_LAST && buf.substr(buf.size() - BRACK_PASTE_SLEN) == BRACK_PASTE_SUFF)
|
||||||
|
Loading…
Reference in New Issue
Block a user