From 7025ca3b7dcb3a97b54f37108c2f8d46a9dfe5fd Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 29 Jan 2017 06:07:17 +0100 Subject: [PATCH] close #114, add symstring for the runnable binary file --- docs/features_symbolic_strings.md | 1 + src/ce_symstring.pas | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/features_symbolic_strings.md b/docs/features_symbolic_strings.md index fc084737..926844cb 100644 --- a/docs/features_symbolic_strings.md +++ b/docs/features_symbolic_strings.md @@ -29,6 +29,7 @@ Current file: - **``**: also _``_. Expanded to the current file filename. - **``**: also _``_. Expanded to the current file path. +- **``**: also _``_. Expanded to the runnable produced for the current file. The [OutputFolder](features_runnables) option is not handled. - **``**: also _``_. Expanded to the identifier located at the caret position. - **``**: also _``_. Expanded to the current line of code. - **``**: also _``_. Expanded to the current selection. diff --git a/src/ce_symstring.pas b/src/ce_symstring.pas index c2fd5ae4..f348194e 100644 --- a/src/ce_symstring.pas +++ b/src/ce_symstring.pas @@ -14,7 +14,7 @@ type * Enumerates the symbol kinds, used to index an associative array. *) TCESymbol = ( ENV_USER, ENV_HOME, ENV_TEMP, CAF, CAP, - CFF, CFP, CI, CL, CPF, CPP, CPO, CPOP, CPR, CPN, CPFS, CPCD, CS); + CFF, CFP, CFR, CI, CL, CPF, CPP, CPO, CPOP, CPR, CPN, CPFS, CPCD, CS); const FirstVariableSymbol = CFF; @@ -194,7 +194,8 @@ begin if not fDoc.fileName.fileExists then fDoc.saveTempFile; fSymbols[CFF] := fDoc.fileName; - fSymbols[CFP] := fDoc.fileName.extractFilePath; + fSymbols[CFR] := fSymbols[CFF].stripFileExt + exeExt; + fSymbols[CFP] := fSymbols[CFF].extractFilePath; if fDoc.Identifier.isNotEmpty then fSymbols[CI] := fDoc.Identifier; fSymbols[CL] := fDoc.LineText; @@ -283,6 +284,7 @@ begin 'CAP', 'CoeditApplicationPath': Result += fSymbols[CAP]; // 'CFF', 'CurrentFileFile' : Result += fSymbols[CFF]; + 'CFR', 'CurrentFileRunnable' : Result += fSymbols[CFR]; 'CFP', 'CurrentFilePath' : Result += fSymbols[CFP]; 'CI', 'CurrentIdentifier' : Result += fSymbols[CI]; 'CL', 'CurrentLine' : Result += fSymbols[CL];