summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/commands.doc3
-rw-r--r--src/docparser.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/commands.doc b/doc/commands.doc
index 73eb842..1b3f2bd 100644
--- a/doc/commands.doc
+++ b/doc/commands.doc
@@ -2147,7 +2147,8 @@ Commands for displaying examples
\addindex \\snippet
Where the \ref cmdinclude "\\include" command can be used to include
a complete file as source code, this command can be used to quote only
- a fragment of a source file.
+ a fragment of a source file. In case `this` is used as <file-name> the
+ current file is taken as file to take the snippet from.
For example, the putting the following command in the documentation,
references a snippet in file \c example.cpp residing in a subdirectory
diff --git a/src/docparser.cpp b/src/docparser.cpp
index bab0c75..b8aa9a6 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -5218,6 +5218,7 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
QCString blockId;
if (t==DocInclude::Snippet)
{
+ if (fileName == "this") fileName=g_fileName;
doctokenizerYYsetStateSnippet();
tok=doctokenizerYYlex();
doctokenizerYYsetStatePara();