tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.8k stars 87 forks source link

Color issue with single quotes #689

Closed hacherix closed 1 week ago

hacherix commented 1 week ago

Before Proceeding, please acknowledge:

Describe the bug When a string ends with %' it creates color issues.

To Reproduce Use the following queries:

select *
from table
where col like '%hello'
and col2 = 290
and col2 not true;

select *
from table
where col like '%hello%'
and col2 = 290
and col2 not true;

Expected behavior Pink color should not go beyond the single quotes.

Actual behavior image

Contributing Are you interested in contributing a fix?

Additional context

What is the output of harlequin --version?

harlequin, version 1.25.2

Installed Adapters:
  - duckdb, version 1.25.2
  - sqlite, version 1.25.2

What database adapter are you using with Harlequin? (Default is duckdb) duckdb

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here). None.

Can you tell us more about your system?

[!TIP] For example, for my system, these are:

  • Bash
  • Windows Terminal
  • Ubuntu 22.04 / WSL2
  • Windows 11
  • en_US/UTF-8

How did you install Harlequin?

tconbeer commented 1 week ago

yeah, I'm sorry about this; it's a known issue: https://github.com/tconbeer/harlequin/discussions/444

basically, the upstream package we depend on for syntax highlighting isn't very good. Unfortunately there aren't great, easy alternatives right now.