[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdevelop/parts/phpsupport
From:       Sebastian Gutweiler <sebastian () gutweiler ! net>
Date:       2003-09-15 15:27:33
[Download RAW message or body]

CVS commit by barcley: 

Don't display a code completion box ar an argument hint when text is selected
(e.g. for copy/paste).


  M +11 -0     phpcodecompletion.cpp   1.25
  M +2 -0      phpcodecompletion.h   1.11


--- kdevelop/parts/phpsupport/phpcodecompletion.cpp  #1.24:1.25
@@ -116,4 +116,11 @@ void PHPCodeCompletion::setActiveEditorP
   }
 
+  m_selectionInterface = dynamic_cast<KTextEditor::SelectionInterface*>(part);
+  if(!m_selectionInterface) {
+        kdDebug(9018) << "editor doesn't support the SelectionInterface" << endl;
+        return;
+  }
+
+
   disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice
   connect(part->widget(), SIGNAL(cursorPositionChanged()),
@@ -138,4 +145,8 @@ void PHPCodeCompletion::cursorPositionCh
   //  kdDebug(9018) << "ZEILEohneTAB:" << lineStr <<":" << endl;
 
+  if(m_selectionInterface->hasSelection()){
+        kdDebug(9018) << "No CodeCompletion/ArgHinting at the moment, because text is selected" << endl;
+        return;
+  }
 
   if(m_config->getCodeHinting()){

--- kdevelop/parts/phpsupport/phpcodecompletion.h  #1.10:1.11
@@ -28,4 +28,5 @@
 #include <ktexteditor/viewcursorinterface.h>
 #include <ktexteditor/codecompletioninterface.h>
+#include <ktexteditor/selectioninterface.h>
 
 
@@ -82,4 +83,5 @@ protected slots:
   KTextEditor::CodeCompletionInterface *m_codeInterface;
   KTextEditor::ViewCursorInterface *m_cursorInterface;
+  KTextEditor::SelectionInterface *m_selectionInterface;
   PHPConfigData* m_config;
 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic