D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
loh.tar added a comment. > Will wait for further advice Still waiting if I have to undo these reference stuff. (Yes your are busy. Just only wanted it to emphasize) Besides, I like to add some more chars to this special handling: _ : # @ ~ * ! $ % / \ Some of these may handy when write Markdown, some perhaps elsewhere REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 To: loh.tar, #ktexteditor Cc: cullmann, sars, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, dhaumann
D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
loh.tar added a comment. > Btw., have you perhaps played a bit with the https://phabricator.kde.org/D12295 patch? No, but noticed it sometime in the past > If you use it, could you try that patch, too? Will try it REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 To: loh.tar, #ktexteditor Cc: cullmann, sars, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, dhaumann
D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
cullmann added a comment. Btw., have you perhaps played a bit with the https://phabricator.kde.org/D12295 patch? I tried it once and it did behave ok, but I don'T use that feature that often. If you use it, could you try that patch, too? REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 To: loh.tar, #ktexteditor Cc: cullmann, sars, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, dhaumann
D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
loh.tar added a comment. > the change from QChar to const QChar & does not improve the amount of copied data. Argh! OK. Was just an impulse to do it as usual and to follow isStartBracket(..) and isBracket(..) Will wait for further advice REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 To: loh.tar, #ktexteditor Cc: sars, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, cullmann, dhaumann
D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
sars added inline comments. INLINE COMMENTS > katedocument.cpp:117 > > -static inline QChar matchingStartBracket(QChar c, bool withQuotes) > +static inline QChar matchingStartBracket(const QChar ) > { I'm not familiar with the auto-bracket code, but the change from QChar to const QChar & does not improve the amount of copied data. Qt documentation: "Most compilers treat it like an unsigned short." This means that in stead of adding unsigned short to the stack you add the 64bit reference and add the tiny overhead that the reference brings with it. It probably has no practical difference tho REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 To: loh.tar, #ktexteditor Cc: sars, kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, cullmann, dhaumann
D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
loh.tar added a comment. Should you dislike the auto bracket code changes can I remove them from this patch. They are not needed for this one and only be the byproduct of my code studying. As always, poor tested :-) REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 To: loh.tar, #ktexteditor Cc: kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
D17693: DocumentPrivate: Treat angle bracket < and backtick ` also as "auto bracket" when we have a selection
loh.tar created this revision. loh.tar added a reviewer: KTextEditor. Herald added projects: Kate, Frameworks. Herald added subscribers: kde-frameworks-devel, kwrite-devel. loh.tar requested review of this revision. REVISION SUMMARY The first attempt was to add these chars to the auto bracket code but that caused surprising odd behavour in the normal edit flow, so it's done in a special way which hopefully caused no trouble. - Improve readability of auto bracket code - Change arguments as reference - Remove unneeded code REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D17693 AFFECTED FILES src/document/katedocument.cpp To: loh.tar, #ktexteditor Cc: kwrite-devel, kde-frameworks-devel, #ktexteditor, hase, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann