- Notifications
You must be signed in to change notification settings - Fork5
Commit9b181b0
committed
In psql's tab completion, change most TailMatches patterns to Matches.
In the refactoring in commitd37b816,we mostly kept to the original design whereby only the last few wordson the line were matched to identify a completable pattern. However,after commitd854118, there's reallyno reason to do it like that: where it's sensible, we can use patternsthat expect to match the entire input line. And mostly, it's sensible.Matching the entire line greatly reduces the odds of a false match thatleads to offering irrelevant completions. Moreover (though I've nottried to measure this), it should make tab completion faster sincemany of the patterns will be discarded after a single integer comparisonthat finds that the wrong number of words appear on the line.There are certain identifiable places where we still need to useTailMatches because the statement in question is allowed to appearembedded in a larger statement. These are just a small minority ofthe existing patterns, though, so the benefit of switching wherepossible is large.It's possible that this patch has removed some within-line matchingbehaviors that are in fact desirable, but we can put those back whenwe get complaints. Most of the removed behaviors are certainly silly.Michael Paquier, with some further adjustments by me1 parent7debf36 commit9b181b0
1 file changed
+341
-363
lines changed0 commit comments
Comments
(0)