editor, fix identifier markup, all trailing blank chars marked

This commit is contained in:
Basile Burg 2016-01-20 10:32:35 +01:00
parent 491042dd85
commit e2ac5ddf31
4 changed files with 31 additions and 13 deletions

View File

@ -5,9 +5,6 @@ object CEMainForm: TCEMainForm
Width = 745 Width = 745
AllowDropFiles = True AllowDropFiles = True
Caption = 'Coedit' Caption = 'Coedit'
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ClientHeight = 49
ClientWidth = 745
Icon.Data = { Icon.Data = {
F1B500000000010001000000000001002000DBB500001600000089504E470D0A F1B500000000010001000000000001002000DBB500001600000089504E470D0A
1A0A0000000D49484452000001000000010008060000005C72A8660000B5A249 1A0A0000000D49484452000001000000010008060000005C72A8660000B5A249
@ -1467,11 +1464,11 @@ object CEMainForm: TCEMainForm
07F7DABF1C7571F38F0000000049454E44AE426082 07F7DABF1C7571F38F0000000049454E44AE426082
} }
Menu = mainMenu Menu = mainMenu
OnClose = FormClose
OnCloseQuery = FormCloseQuery OnCloseQuery = FormCloseQuery
OnDropFiles = FormDropFiles OnDropFiles = FormDropFiles
ShowHint = True ShowHint = True
LCLVersion = '1.6.0.2' LCLVersion = '1.6.0.2'
Visible = False
object mainMenu: TMainMenu object mainMenu: TMainMenu
Images = imgList Images = imgList
top = 1 top = 1

View File

@ -146,6 +146,7 @@ type
procedure actProjNewDubJsonExecute(Sender: TObject); procedure actProjNewDubJsonExecute(Sender: TObject);
procedure actProjNewNativeExecute(Sender: TObject); procedure actProjNewNativeExecute(Sender: TObject);
procedure actSetRunnableSwExecute(Sender: TObject); procedure actSetRunnableSwExecute(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure updateDocumentBasedAction(sender: TObject); procedure updateDocumentBasedAction(sender: TObject);
procedure updateProjectBasedAction(sender: TObject); procedure updateProjectBasedAction(sender: TObject);
procedure updateDocEditBasedAction(sender: TObject); procedure updateDocEditBasedAction(sender: TObject);
@ -904,7 +905,7 @@ begin
if not widg.isDockable then continue; if not widg.isDockable then continue;
DockMaster.GetAnchorSite(widg).Header.HeaderPosition := adlhpTop; DockMaster.GetAnchorSite(widg).Header.HeaderPosition := adlhpTop;
if not DockMaster.GetAnchorSite(widg).HasParent then if not DockMaster.GetAnchorSite(widg).HasParent then
DockMaster.GetAnchorSite(widg).Close DockMaster.GetAnchorSite(widg).Close;
end; end;
end; end;
end; end;
@ -1116,6 +1117,13 @@ begin
end; end;
end; end;
procedure TCEMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
// saving doesnt work when csDestroying in comp.state (i.e in destroy)
if CloseAction = caFree then
SaveDocking;
end;
destructor TCEMainForm.destroy; destructor TCEMainForm.destroy;
begin begin
SaveSettings; SaveSettings;
@ -1157,8 +1165,6 @@ begin
if not fMultidoc.closeDocument(i) then exit; if not fMultidoc.closeDocument(i) then exit;
canClose := true; canClose := true;
closeProj; closeProj;
// saving doesnt work when csDestroying in comp.state (in Free)
SaveDocking;
end; end;
procedure TCEMainForm.updateDocumentBasedAction(sender: TObject); procedure TCEMainForm.updateDocumentBasedAction(sender: TObject);

View File

@ -948,15 +948,29 @@ begin
end; end;
procedure TCESynMemo.highlightCurrentIdentifier; procedure TCESynMemo.highlightCurrentIdentifier;
var
str: string;
i: integer;
begin begin
fIdentifier := GetWordAtRowCol(LogicalCaretXY); fIdentifier := GetWordAtRowCol(LogicalCaretXY);
if (length(fIdentifier) > 2) and (not SelAvail) then if (length(fIdentifier) > 2) and (not SelAvail) then
SetHighlightSearch(fIdentifier, fMatchIdentOpts) SetHighlightSearch(fIdentifier, fMatchIdentOpts)
else if SelAvail then else if SelAvail then
SetHighlightSearch(SelText,fMatchSelectionOpts) begin
else str := SelText;
for i := 1 to length(str) do
begin
if not (str[i] in [' ', #10, #13]) then
begin
SetHighlightSearch(str, fMatchSelectionOpts);
break;
end;
if i = length(str) then
SetHighlightSearch('', []); SetHighlightSearch('', []);
end; end;
end
else SetHighlightSearch('', []);
end;
procedure TCESynMemo.setMatchOpts(value: TIdentifierMatchOptions); procedure TCESynMemo.setMatchOpts(value: TIdentifierMatchOptions);
begin begin

View File

@ -9,7 +9,8 @@ object CEWidget: TCEWidget
ClientWidth = 332 ClientWidth = 332
ShowHint = True ShowHint = True
ShowInTaskBar = stNever ShowInTaskBar = stNever
LCLVersion = '1.4.2.0' LCLVersion = '1.6.0.2'
Visible = False
object Back: TPanel object Back: TPanel
Left = 0 Left = 0
Height = 121 Height = 121