Summary: | Code completion erases following word | ||
---|---|---|---|
Product: | [Developer tools] kdev-python | Reporter: | Todd <toddrme2178> |
Component: | Code completion | Assignee: | Sven Brauch <mail> |
Status: | CONFIRMED --- | ||
Severity: | wishlist | CC: | antonis+kdebugs, aspotashev |
Priority: | NOR | ||
Version: | 1.4.0 / 1.4.1 (stable) | ||
Target Milestone: | 1.4.0 | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Todd
2013-03-17 10:21:33 UTC
This is a difficult one, since how it currently is is not good, but if you change it to always insert text it won't be good either... For example, assume it always inserted the text, and you wanted to * change the object a method is called on * change the method that is being called * change the key of a named argument then it will go wrong too. Thus, I will not simply change it from "replace" to "insert" since it's just a personal preference which one is more annoying. What C++ does, and what I will now do too, is making it so that the text is inserted and deleted in two steps, so you can press Ctrl+Z once after you triggered the completion to get the deleted text back. That's not a clean solution of course. In general I'd be for having another shortcut for using autocompletion, e.g. Shift+Enter, which inserts the text, and have Enter always replace it. As another workaround you can insert a space character behind the text you're typing to prevent text replacenemnt. It is already pretty easy to replace. Just double-click on the text before you start type, or you can hit ctrl+delete or ctrl+backspace. In pretty much every context, adding text adds text, rather than overwriting. We have an insert key to switch between insert/overwrite mode, but it always defaults to insert. I think that is because destructive actions are inherently dangerous, so it is safer to default to a non-destructive behavior. This is the only case I can think of where the default behavior is destructive, and you have to take extra steps to make it non-destructive. All the other cases I can think of it is the other way around. And there isn't any warning that it is destructive, either. There have been a number of cases personally where I have forgotten that it works like this, tried to run my code and realized that parts were missing because they had been deleted without me realizing it. Git commit f3d15c67c26fbabae40e2feeaf1b7069d866f03f by Sven Brauch. Committed on 17/03/2013 at 17:34. Pushed by brauch into branch 'master'. Fix a performance issue with multiple calls in a chain see unit test from previous commit for an example. The cause for the issue was calling the parent visitor in the Expression Visitor *plus* creating an extra expression visitor. Creating the extra visitor is bad enough (n**2 compexity) but additionally calling AstDefaultVisitor::visit... will blow it up to exp(n). M +1 -3 duchain/expressionvisitor.cpp http://commits.kde.org/kdev-python/f3d15c67c26fbabae40e2feeaf1b7069d866f03f Huh. Wrong bug ID. Sorry. I'm really unsure about this. I'll look into whether we can add an extra shortcut to let the user decide what to do, but that'll require modifying the kate api, which will take time. Try Text Editor Settings > Editing > Auto Completion > Remove tail on complete. |