<table><tr><td style="">dhaumann created this revision.<br />dhaumann added a reviewer: cullmann.<br />Herald added projects: Kate, Frameworks.<br />Herald added subscribers: kde-frameworks-devel, kwrite-devel.<br />dhaumann requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D19795">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The Variable interface allows to register either exact matches<br />
of the form %{Document:Text} or prefix matches of the form<br />
%{Date:} where the text after the colon (separator) is passed<br />
to the evaluation of the variable.</p>

<p>This functionality is required for the External Tools plugin,<br />
that will use this interface to do its macro expansion.</p>

<p>A unit test demonstrates a bit how it works.</p>

<p>Some possible/fictive examples:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">%{CurrentDocument:Text} evaluates to documents contents</li>
<li class="remarkup-list-item">%{UUID} evaluates to a random uuid</li>
<li class="remarkup-list-item">%{Time:hh-mm} evaluates to 17-35</li>
</ul>

<p>Currently, none of these variables are added, it's just the<br />
interface.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>make && make test</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R39 KTextEditor</div></div></div><br /><div><strong>BRANCH</strong><div><div>variable-interface</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19795">https://phabricator.kde.org/D19795</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/CMakeLists.txt<br />
autotests/src/variable_test.cpp<br />
autotests/src/variable_test.h<br />
src/CMakeLists.txt<br />
src/include/CMakeLists.txt<br />
src/include/ktexteditor/editor.h<br />
src/include/ktexteditor/variable.h<br />
src/utils/kateglobal.h<br />
src/utils/katemacroexpander.cpp<br />
src/utils/katemacroexpander.h<br />
src/utils/ktexteditor.cpp</div></div></div><br /><div><strong>To: </strong>dhaumann, cullmann<br /><strong>Cc: </strong>kwrite-devel, kde-frameworks-devel, gennad, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann<br /></div>