Summary: | autocompletion part has strange behavior | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Caleb Tennis <caleb> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kdebugs, kdevelop-devel |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Fix to katepart for unhelpful code completion / undo behaviour |
Description
Caleb Tennis
2003-02-27 15:22:41 UTC
This is related to 52746 a) Fixed b) Fixed c) Not fixed, but you can use backspace! AFAIK Roberto was the one that fixed it. After some arguing we reopen this bug... ... and reassign it to katepart. If Kate has a completion box open, and the user produces an undo event, should it not be up to Kate to do the correct thing here? (Which would be to close the completion box and execute one undo step.) *** Bug 52746 has been marked as a duplicate of this bug. *** >If Kate has a completion box open, and the user produces an undo event, should
>it not be up to Kate to do the correct thing here? (Which would be to close
>the completion box and execute one undo step.)
Actually IMHO this isn't even close to the right behaviour. An auto-complete box should not be being generated from an undo in the first place IMO, that will just result in a myrid of boxes appearing and disappearing all over the place while you hold down Ctrl+z to undo a bunch of stuff, thus slowing the UI down needlessly.
I don't know why an atuo-complete box should be created for any text that wasn't the result of the user typing.
I agree that KDevelop doesn't do this gracefully, but I still think the main part of the problem bleh. hit the wrong button.. :) I agree that KDevelop doesn't do this gracefully, but I still think the main part of the problem lies with Kate, as: 1. KDevelop doesn't immediately trigger the autocompletion box after an undo, it's only after the regular timeout it happens, and so it is quite possible to undo past a triggerpoint - you only need to be quick enough :) 2. It's very hard, if not impossible, for KDevelop to know that the textChanged() signal it receives is a result of an undo operation. 3. The "multiple undo" case isn't the only to hit upon this issue. It's quite possible to mistype and receive an autocomplete box as a result and then, again, you can't undo your way out of it (using ctrl+z or whatever the shortcut happens to be, it is possible with the toolbar button). So, IMHO and without knowing anything about the Kate code in question, if katepart simply closes the autocompletion box when the user hits the undo shortcut, the major part of this problem is solved. Subject: Re: autocompletion part has strange behavior
On November 14, 2003 12:37 am, Jens Dagerbo wrote:
> So, IMHO and without knowing anything about the Kate code in question, if
> katepart simply closes the autocompletion box when the user hits the undo
> shortcut, the major part of this problem is solved.
Yes... when the user hits undo, the autocompletion box should close and the last char
typed should be reverted. This would totally solve the bug.
Created attachment 3336 [details]
Fix to katepart for unhelpful code completion / undo behaviour
Not a particularly nice looking patch, but this does the job - can someone
review? Apply in kdelibs/kate/part. Thanks.
Subject: Re: autocompletion part has strange behavior > ------- Additional Comments From rodda@kde.org 2003-11-22 10:13 ------- > Created an attachment (id=3336) > --> (http://bugs.kde.org/attachment.cgi?id=3336&action=view) > Fix to katepart for unhelpful code completion / undo behaviour > > Not a particularly nice looking patch, but this does the job - can someone > review? Apply in kdelibs/kate/part. Thanks. solves the problem, at least for the moment ;) please commit Subject: kdelibs/kate/part CVS commit by rodda: Fix undo functionality with code completion active. Reviewed by Christoph Cullmann <cullmann@babylon2k.de> CCMAIL: 55276-done@bugs.kde.org M +10 -4 katecodecompletion.cpp 1.32 --- kdelibs/kate/part/katecodecompletion.cpp #1.31:1.32 @@ -203,7 +203,11 @@ bool KateCodeCompletion::eventFilter( QO } + int qtKeyCode = ke->key() | ((ke->state() & Qt::ShiftButton) ? Qt::SHIFT : 0) | ((ke->state() & Qt::ControlButton) ? Qt::CTRL : 0) | ((ke->state() & Qt::AltButton) ? Qt::ALT : 0) | ((ke->state() & Qt::MetaButton) ? Qt::META : 0); + // redirect the event to the editor if( ke->key() == Key_Backspace) { m_view->backspace(); + } else if (qtKeyCode == m_view->m_editUndo->shortcut().keyCodeQt()) { + m_view->m_editUndo->activate(); } else { QApplication::sendEvent( m_view->m_viewInternal, e ); It seems like this problem is back. With Kate 2.5.5 (KDE 3.5.5), when I hit Ctrl-Z to undo a word I just typed, the autocompletion box stays open. |