D17693: DocumentPrivate: Treat some chars also as "auto bracket" only when we have a selection

Milian Wolff noreply at phabricator.kde.org
Thu Jan 24 15:34:40 GMT 2019


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  Ok, that behavior you describe is bad. I would get annoyed by that, esp. since the list of chars that you use are totally language specific.
  
  If you want to get this behavior for Markdown, then we need to store that data in the syntax file and make it accessible at this position. in the `<general>` section we already define how single/multiline comments are handled. We would need something similar for this feature, e.g. add something like the following and make it accessible through the syntax-highlighting API:
  
    <general>
      <brackets>
        <bracket open="(" close=")" />
        <bracket open="[" close="]" />
        <bracket open="{" close="}" />
        <bracket open="<" close=">" />
        <bracket open=""" close=""" />
        <bracket open="'" close="'" />
        <bracket open="´" close="´" />
        <bracket open="`" close="`" />
        <bracket open="_" close="_" />
        <bracket open="." close="." />
        <bracket open="," close="," />
        <bracket open=";" close=";" />
        <bracket open=":" close=":" />
        <bracket open="|" close="|" />
        <bracket open="-" close="-" />
        <bracket open="+" close="+" />
        <bracket open="^" close="^" />
        <bracket open="°" close="°" />
        <bracket open="&" close="&" />
        <bracket open="#" close="#" />
        <bracket open="@" close="@" />
        <bracket open="~" close="~" />
        <bracket open="*" close="*" />
        <bracket open="!" close="!" />
        <bracket open="?" close="?" />
        <bracket open="$" close="$" />
        <bracket open="§" close="§" />
        <bracket open="%" close="%" />
        <bracket open="/" close="/" />
        <bracket open="\" close="\" />
        <bracket open="=" close="=" />
      </brackets>
    </general>
  
  Of course the initial, common, brackets should be the implicit default when no `<brackets>` group is specified in a language file. And then we probably need more meta data that specified that some of the brackets above only should be added when we have a selection. Just add a `requiresSelection` or similar attribute?

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17693

To: loh.tar, #ktexteditor, cullmann, mwolff
Cc: mwolff, cullmann, sars, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190124/111f52e2/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list