[kdevplatform/frameworks] language: make compile with new ktexteditor: remove start/endEditing

Sven Brauch svenbrauch at googlemail.com
Tue Apr 1 20:33:23 UTC 2014


Picking this topic up again:

On Monday 31 March 2014 22:13:40 Dominik Haumann wrote:
> > make compile with new ktexteditor: remove start/endEditing
> [...]
> KDevelop should seriously try to fix such things through proper interfaces
> in KTextEditor. The not above says "this is ugly" and this is so true...

I think the problem is that the "replace tabs" stuff (and similar things) are 
handled in insertText, and thus insertText does not actually guarantee to 
insert the text the calling application tells it to insert.
I consider "replace tabs" and "remove trailing spaces while editing" to be 
part of input handling: they are only there to make it easier for the user to 
type the stuff he wants to type. Thus, I would propose to move this logic from 
insertText into KTextEditor::DocumentPrivate::typeChars. Then it only gets 
called when the user actually types, and not when text gets inserted in other 

One noticeable implication this would have is that you could paste text with 
tabs into a document which has replace tabs set to on. I consider this a good 
thing, given that it's very easy to get rid of the tabs, but if you think it's 
undesirable it could easily be changed.

If you agree, I will propose a patch to change this in KF5. We can get rid of 
the hack in KDevelop, and I can remove a related hack or two from the 
collaborative plugin too.


More information about the KDevelop-devel mailing list