1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: Double-clicking a string selects the closing double quotes (#1862)

This is a simple fix for a simple issue. Just check if the last char in
the selection is a double quote and if it is, make the selection one
char shorter.

---------

Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
paxcut 2024-09-15 06:27:24 -07:00 committed by GitHub
parent e0b4931a54
commit 414e7d36a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -392,8 +392,13 @@ TextEditor::Coordinates TextEditor::FindWordEnd(const Coordinates &aFrom) const
while (cindex < (line.size()) && !isWordChar(line[cindex].mChar))
++cindex;
while (cindex < (line.size()) && isWordChar(line[cindex].mChar))
++cindex;
if (prevspace != !!isspace(c)) {
if (isspace(c))
while (cindex < (int)line.size() && isspace(line[cindex].mChar))
++cindex;
break;
}
cindex += d;
if (line[cindex-1].mChar == '\"')
--cindex;