Add Variable interface to KTextEditor::Editor

Authored by dhaumann on Mar 18 2019, 8:52 PM.

Description

Add Variable interface to KTextEditor::Editor

Summary:
The Variable interface allows to register either exact matches
of the form %{Document:Text} or prefix matches of the form
%{Date:} where the text after the colon (separator) is passed
to the evaluation of the variable.

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

A unit test demonstrates a bit how it works.

Some possible/fictive examples:

  • %{CurrentDocument:Text} evaluates to documents contents
  • %{UUID} evaluates to a random uuid
  • %{Time:hh-mm} evaluates to 17-35

Currently, none of these variables are added, it's just the
interface.

Test Plan: make && make test

Reviewers: cullmann

Reviewed By: cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D19795

Details

Committed
dhaumannMar 18 2019, 8:57 PM
Reviewer
cullmann
Differential Revision
D19795: Add Variable interface to KTextEditor::Editor
Parents
R39:1072aa3e0dba: relax code to only assert in debug build, work in release build
Branches
Unknown
Tags
Unknown