From 7a5fc7f970f5121a39bfef296e0242431d887015 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 8 Apr 2018 11:21:51 +0200 Subject: [PATCH] Add symstring for the mini-explorer current path, close #206 --- src/ce_miniexplorer.pas | 2 +- src/ce_symstring.pas | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ce_miniexplorer.pas b/src/ce_miniexplorer.pas index 936eb505..214e8906 100644 --- a/src/ce_miniexplorer.pas +++ b/src/ce_miniexplorer.pas @@ -760,7 +760,7 @@ end; function TCEMiniExplorerWidget.currentLocation: string; begin - result := treeFolders.path.extractFilePath; + result := treeFolders.Root; end; {$ENDREGION} diff --git a/src/ce_symstring.pas b/src/ce_symstring.pas index c91346f4..ea13d341 100644 --- a/src/ce_symstring.pas +++ b/src/ce_symstring.pas @@ -13,7 +13,7 @@ type (** * Enumerates the symbol kinds, used to index an associative array. *) - TCESymbol = ( ENV_USER, ENV_HOME, ENV_TEMP, CAF, CAP, + TCESymbol = ( ENV_USER, ENV_HOME, ENV_TEMP, CAF, CAP, MEP, CFF, CFP, CFR, CI, CL, CPF, CPP, CPO, CPOP, CPR, CPN, CPFS, CPCD, CPV, CS); const @@ -32,6 +32,7 @@ type fProjInterface: ICECommonProject; fDoc: TCESynMemo; fNeedUpdate: boolean; + fExp: ICEExplorer; fSymbols: array[TCESymbol] of string; procedure updateSymbols; // @@ -177,15 +178,22 @@ var const na = '``'; begin - if not fNeedUpdate then exit; + //if not fNeedUpdate then + // exit; fNeedUpdate := false; - // + hasNativeProj := fProj.isNotNil; hasProjItf := fProjInterface <> nil; hasDoc := fDoc.isNotNil; - // + if not assigned(fExp) then + fExp := getExplorer; + for e := FirstVariableSymbol to high(TCESymbol) do fSymbols[e] := na; + + if assigned(fExp) then + fSymbols[MEP] := fExp.currentLocation; + // document if hasDoc then begin @@ -282,6 +290,7 @@ begin // 'CAF', 'CoeditApplicationFile': Result += fSymbols[CAF]; 'CAP', 'CoeditApplicationPath': Result += fSymbols[CAP]; + 'MEP', 'MiniExplorerPath': Result += fSymbols[MEP]; // 'CFF', 'CurrentFileFile' : Result += fSymbols[CFF]; 'CFR', 'CurrentFileRunnable' : Result += fSymbols[CFR];