Version: 3.0.4 (using KDE KDE 3.2.3) Installed from: Debian testing/unstable Packages OS: Linux I am using KDevelop to code PHP projects. When I navigate through the code with the arrow keys, KDevelop has the following weird behaviors: 1. When I walk on the end of a word, it displays the Code Completion Window with symbols that begin with that word, as if I was typing that word. For example, if I walk to the end of an "if", it offers me ifx_connect(), ifx_close(), etc. 2. Whem I walk to the beginning of a line that begins with tabs or an empty line, it displays the same window, offering me class names, probably thinking I created that line, offering me classes to instantiate. In both cases, the code completion pop-up window grabs the keyboard focus, so when I press Up and Down, I move the selection of the listbox instead of moving the cursor of the text editor. In case "2", if I want to go down, walking through a lot of empty or indented lines, I must press an Esc for every Down Arrow. This kind of behavior gets in the way when you are waking through the code and is a real showstopper, at least for those developing PHP applications. Imagine a text editor that prevents you from using the arrow keys. :P My humble opinion is: The code completion window should not be triggered by cursor navigation. Instead, the window should be triggered only by typing text or by hitting Ctrl+Space.
CVS commit by dagerbo: Make PHP code completion react to textChanged() instead of cursorPositionChanged(), this to avoid trapping the cursor keys when simply navigating the code. Also added CTRL+SPACE shortcut to manually call up the completion dialog. BUG: 95696 M +4 -1 kdevphpsupport.rc 1.7 M +2 -2 phpcodecompletion.cpp 1.31 M +3 -1 phpcodecompletion.h 1.12 M +3 -0 phpsupportpart.cpp 1.63 --- kdevelop/languages/php/kdevphpsupport.rc #1.6:1.7 @@ -1,5 +1,8 @@ <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> -<kpartgui name="KPHPSupport" version="2"> +<kpartgui name="KPHPSupport" version="3"> <MenuBar> + <Menu name="edit"> + <Action name="edit_complete_text"/> + </Menu> <Menu name="build" > <Action name="build_execute" /> --- kdevelop/languages/php/phpcodecompletion.cpp #1.30:1.31 @@ -124,6 +124,6 @@ void PHPCodeCompletion::setActiveEditorP disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice - connect(part->widget(), SIGNAL(cursorPositionChanged()), - this, SLOT(cursorPositionChanged())); +// connect(part->widget(), SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged())); + connect( part, SIGNAL(textChanged()), this, SLOT(cursorPositionChanged()) ); connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHided())); connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxHided())); --- kdevelop/languages/php/phpcodecompletion.h #1.11:1.12 @@ -52,6 +52,8 @@ public: void setActiveEditorPart(KParts::Part *part); -protected slots: +public slots: void cursorPositionChanged(); + +protected slots: void argHintHided(); void completionBoxHided(); --- kdevelop/languages/php/phpsupportpart.cpp #1.62:1.63 @@ -116,4 +116,7 @@ PHPSupportPart::PHPSupportPart(QObject * m_codeCompletion = new PHPCodeCompletion(configData, core(),codeModel()); + new KAction(i18n("Complete Text"), CTRL+Key_Space, m_codeCompletion, SLOT(cursorPositionChanged()), + actionCollection(), "edit_complete_text"); + connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part *)));
Thank you very much for this quick fix. You rock, dude! Greetings from Brazil!