Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5917574

Browse files
committed
Allow tab-completion of :variable even as first word on a line.
Christoph Berg
1 parentd309acf commit5917574

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,17 @@ psql_completion(char *text, int start, int end)
761761
if (text[0]=='\\')
762762
COMPLETE_WITH_LIST(backslash_commands);
763763

764+
/* Variable interpolation */
765+
elseif (text[0]==':'&&text[1]!=':')
766+
{
767+
if (text[1]=='\'')
768+
matches=complete_from_variables(text,":'","'");
769+
elseif (text[1]=='"')
770+
matches=complete_from_variables(text,":\"","\"");
771+
else
772+
matches=complete_from_variables(text,":","");
773+
}
774+
764775
/* If no previous word, suggest one of the basic sql commands */
765776
elseif (!prev_wd)
766777
COMPLETE_WITH_LIST(sql_commands);
@@ -2772,17 +2783,6 @@ psql_completion(char *text, int start, int end)
27722783
)
27732784
matches=completion_matches(text,filename_completion_function);
27742785

2775-
/* Variable interpolation */
2776-
elseif (text[0]==':'&&text[1]!=':')
2777-
{
2778-
if (text[1]=='\'')
2779-
matches=complete_from_variables(text,":'","'");
2780-
elseif (text[1]=='"')
2781-
matches=complete_from_variables(text,":\"","\"");
2782-
else
2783-
matches=complete_from_variables(text,":","");
2784-
}
2785-
27862786
/*
27872787
* Finally, we look through the list of "things", such as TABLE, INDEX and
27882788
* check if that was the previous word. If so, execute the query to get a

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp