Add option to support completion proposal with matching in middle of entered text. Closes #126

This commit is contained in:
Ansgar Becker
2020-04-12 15:03:47 +02:00
parent bce6796693
commit 3a29a2086e
5 changed files with 34 additions and 5 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: HeidiSQL\n" "Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n" "POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2020-04-05 13:09+0200\n" "PO-Revision-Date: 2020-04-12 15:03+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n" "Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n" "Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -6453,3 +6453,6 @@ msgstr "Note: The database file will not get deleted."
msgid "Show SQL completion proposal" msgid "Show SQL completion proposal"
msgstr "Show SQL completion proposal" msgstr "Show SQL completion proposal"
msgid "Find matches in middle of entered text"
msgstr "Find matches in middle of entered text"

View File

@ -177,7 +177,7 @@ type
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics, asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asMySQLBinaries, asCustomSnippetsDirectory, asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asMySQLBinaries, asCustomSnippetsDirectory,
asPromptSaveFileOnTabClose, asRestoreTabs, asWarnUnsafeUpdates, asQueryWarningsMessage, asPromptSaveFileOnTabClose, asRestoreTabs, asWarnUnsafeUpdates, asQueryWarningsMessage,
asCompletionProposal, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow, asAutoUppercase, asCompletionProposal, asCompletionProposalSearchOnMid, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow, asAutoUppercase,
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize, asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
asTheme, asIconPack, asWebSearchBaseUrl, asTheme, asIconPack, asWebSearchBaseUrl,
asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors, asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors,
@ -3655,6 +3655,7 @@ begin
InitSetting(asWarnUnsafeUpdates, 'WarnUnsafeUpdates', 0, True); InitSetting(asWarnUnsafeUpdates, 'WarnUnsafeUpdates', 0, True);
InitSetting(asQueryWarningsMessage, 'QueryWarningsMessage', 0, True); InitSetting(asQueryWarningsMessage, 'QueryWarningsMessage', 0, True);
InitSetting(asCompletionProposal, 'CompletionProposal', 0, True); InitSetting(asCompletionProposal, 'CompletionProposal', 0, True);
InitSetting(asCompletionProposalSearchOnMid, 'CompletionProposalSearchOnMid', 0, False);
InitSetting(asCompletionProposalWidth, 'CompletionProposalWidth', 350); InitSetting(asCompletionProposalWidth, 'CompletionProposalWidth', 350);
InitSetting(asCompletionProposalNbLinesInWindow,'CompletionProposalNbLinesInWindow', 12); InitSetting(asCompletionProposalNbLinesInWindow,'CompletionProposalNbLinesInWindow', 12);
InitSetting(asAutoUppercase, 'AutoUppercase', 0, True); InitSetting(asAutoUppercase, 'AutoUppercase', 0, True);

View File

@ -11782,6 +11782,11 @@ begin
Attri.Background := AppSettings.ReadInt(asHighlighterBackground, Attri.Name, Attri.Background); Attri.Background := AppSettings.ReadInt(asHighlighterBackground, Attri.Name, Attri.Background);
Attri.IntegerStyle := AppSettings.ReadInt(asHighlighterStyle, Attri.Name, Attri.IntegerStyle); Attri.IntegerStyle := AppSettings.ReadInt(asHighlighterStyle, Attri.Name, Attri.IntegerStyle);
end; end;
// Completion proposal
if AppSettings.ReadBool(asCompletionProposalSearchOnMid) then
SynCompletionProposal.Options := SynCompletionProposal.Options + [scoLimitToMatchedTextAnywhere]
else
SynCompletionProposal.Options := SynCompletionProposal.Options - [scoLimitToMatchedTextAnywhere];
end; end;

View File

@ -643,12 +643,11 @@ object optionsform: Toptionsform
object chkCompletionProposal: TCheckBox object chkCompletionProposal: TCheckBox
Left = 180 Left = 180
Top = 87 Top = 87
Width = 508 Width = 158
Height = 17 Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Enable autocompletion' Caption = 'Enable autocompletion'
TabOrder = 8 TabOrder = 8
OnClick = Modified OnClick = chkCompletionProposalClick
end end
object chkTabsToSpaces: TCheckBox object chkTabsToSpaces: TCheckBox
Left = 254 Left = 254
@ -819,6 +818,17 @@ object optionsform: Toptionsform
Items.Strings = ( Items.Strings = (
'Current custom settings') 'Current custom settings')
end end
object chkCompletionProposalSearchOnMid: TCheckBox
Left = 331
Top = 87
Width = 357
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Find matches in middle of entered text'
Enabled = False
TabOrder = 18
OnClick = Modified
end
end end
object tabGridFormatting: TTabSheet object tabGridFormatting: TTabSheet
Caption = 'Grid formatting' Caption = 'Grid formatting'

View File

@ -169,6 +169,7 @@ type
lblWebSearchBaseUrl: TLabel; lblWebSearchBaseUrl: TLabel;
comboWebSearchBaseUrl: TComboBox; comboWebSearchBaseUrl: TComboBox;
chkThemePreview: TCheckBox; chkThemePreview: TCheckBox;
chkCompletionProposalSearchOnMid: TCheckBox;
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure Modified(Sender: TObject); procedure Modified(Sender: TObject);
procedure Apply(Sender: TObject); procedure Apply(Sender: TObject);
@ -213,6 +214,7 @@ type
procedure comboThemeSelect(Sender: TObject); procedure comboThemeSelect(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure chkThemePreviewClick(Sender: TObject); procedure chkThemePreviewClick(Sender: TObject);
procedure chkCompletionProposalClick(Sender: TObject);
private private
{ Private declarations } { Private declarations }
FWasModified: Boolean; FWasModified: Boolean;
@ -374,6 +376,7 @@ begin
end; end;
AppSettings.WriteBool(asCompletionProposal, chkCompletionProposal.Checked); AppSettings.WriteBool(asCompletionProposal, chkCompletionProposal.Checked);
AppSettings.WriteBool(asCompletionProposalSearchOnMid, chkCompletionProposalSearchOnMid.Checked);
AppSettings.WriteBool(asAutoUppercase, chkAutoUppercase.Checked); AppSettings.WriteBool(asAutoUppercase, chkAutoUppercase.Checked);
AppSettings.WriteBool(asTabsToSpaces, chkTabsToSpaces.Checked); AppSettings.WriteBool(asTabsToSpaces, chkTabsToSpaces.Checked);
@ -681,6 +684,7 @@ begin
updownSQLFontSize.Position := SynMemoSQLSample.Font.Size; updownSQLFontSize.Position := SynMemoSQLSample.Font.Size;
updownSQLTabWidth.Position := SynMemoSQLSample.TabWidth; updownSQLTabWidth.Position := SynMemoSQLSample.TabWidth;
chkCompletionProposal.Checked := AppSettings.ReadBool(asCompletionProposal); chkCompletionProposal.Checked := AppSettings.ReadBool(asCompletionProposal);
chkCompletionProposalSearchOnMid.Checked := AppSettings.ReadBool(asCompletionProposalSearchOnMid);
chkAutoUppercase.Checked := AppSettings.ReadBool(asAutoUppercase); chkAutoUppercase.Checked := AppSettings.ReadBool(asAutoUppercase);
chkTabsToSpaces.Checked := AppSettings.ReadBool(asTabsToSpaces); chkTabsToSpaces.Checked := AppSettings.ReadBool(asTabsToSpaces);
comboSQLColElementChange(Sender); comboSQLColElementChange(Sender);
@ -845,6 +849,12 @@ begin
end; end;
procedure Toptionsform.chkCompletionProposalClick(Sender: TObject);
begin
chkCompletionProposalSearchOnMid.Enabled := TCheckBox(Sender).Checked;
Modified(Sender);
end;
procedure Toptionsform.chkLogToFileClick(Sender: TObject); procedure Toptionsform.chkLogToFileClick(Sender: TObject);
begin begin
editLogDir.Enabled := TCheckBox(Sender).Checked; editLogDir.Enabled := TCheckBox(Sender).Checked;