We need highlight to use Lexer

This commit is contained in:
Amos Bird 2022-01-29 03:13:01 +08:00
parent 666313b51a
commit 556cce9f3c
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
2 changed files with 7 additions and 3 deletions

View File

@ -191,7 +191,8 @@ ReplxxLineReader::ReplxxLineReader(
auto commit_action = [this](char32_t code)
{
/// If we allow multiline and there is already something in the input, start a newline.
if (multiline && !replxx_last_is_delimiter)
/// NOTE: Lexer is only available if we use highlighter.
if (highlighter && multiline && !replxx_last_is_delimiter)
return rx.invoke(Replxx::ACTION::NEW_LINE, code);
replxx_last_is_delimiter = false;
return rx.invoke(Replxx::ACTION::COMMIT_LINE, code);

View File

@ -1,7 +1,7 @@
#!/usr/bin/expect -f
log_user 0
set timeout 60
set timeout 10
match_max 100000
expect_after {
@ -11,6 +11,9 @@ expect_after {
timeout { exit 1 }
}
# useful debugging configuration
# exp_internal 1
set basedir [file dirname $argv0]
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion"
expect ":) "
@ -41,7 +44,7 @@ expect ":) "
send -- ""
expect eof
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion --multiline"
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion --highlight 0 --multiline"
expect ":) "
send -- "SELECT 1;\r"