Repository navigation
Close backticked names that end or start with an escaped backtick - #2457
Merged
Merged
Conversation
_find_doubled_backticks() iterated with a for loop, so index += 2 had no effect and a run of three backticks was marked as two overlapping pairs. A name such as `a``` then looked unclosed to the completer.
rolandwalker
approved these changes
Nov 22, 2026
Contributor
|
Nice! |
|
|
||
| for index in range(0, length): | ||
| index = 0 | ||
| while index < length: |
Contributor
There was a problem hiding this comment.
It looks like while was always the intention.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
_find_doubled_backticks()walks the text withfor index in range(...), so theindex += 2after a pair does nothing and the next position is checked again. In a run of three backticks the middle one is paired twice and all three are marked as doubled.So a name with an escaped backtick at the end (or start) never closes:
This shows up now that
escape_name()doubles internal backticks (#2455), e.g. completing a column nameda`inserts`a```.Fix: use a
whileloop so a pair is consumed once. Runs of two are unchanged, so `select ``` is still treated as an escaped pair, as the existing tests expect.Tests: new
is_inside_quotescases for names ending and starting with an escaped backtick, plus aWHEREsuggestion case. They fail before the change and pass after. Full suite on Linux: 3563 passed, 88 skipped.Checklist
changelog.mdfile.mycli/AUTHORS.txtfile (or it's already there).