Browse Source

The completion parser expects to operate on a C (or Quill) file, so ignore Ctrl+Space/Ctrl+M for assembly files.

git-svn-id: file:///var/svn/tigccpp/trunk@842 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 years ago
parent
commit
c85f1c0b82
2 changed files with 17 additions and 8 deletions
  1. 10 4
      ktigcc/mainform.ui.h
  2. 7 4
      ktigcc/srcfilewin.ui.h

+ 10 - 4
ktigcc/mainform.ui.h

@@ -1307,10 +1307,16 @@ void MainForm::accel_activated(int index)
       case 10:
         if (IS_FILE(currentListItem)
             && CURRENT_VIEW==static_cast<ListViewFile *>(currentListItem)->kateView) {
-          // Disable newLineHook.
-          accel->setItemEnabled(6,FALSE);
-          accel->setItemEnabled(7,FALSE);
-          new CompletionPopup(CURRENT_VIEW,pathInProject(currentListItem),this,this);
+          QString fileText=CURRENT_VIEW->getDoc()->text();
+          CATEGORY_OF(category,currentListItem);
+          // Completion only operates on C files.
+          if (category==cFilesListItem
+              || (category==hFilesListItem && fileText[0]!='|' && fileText[0]!=';')) {
+            // Disable newLineHook.
+            accel->setItemEnabled(6,FALSE);
+            accel->setItemEnabled(7,FALSE);
+            new CompletionPopup(CURRENT_VIEW,pathInProject(currentListItem),this,this);
+          }
         }
         break;
       case 11: // next file

+ 7 - 4
ktigcc/srcfilewin.ui.h

@@ -363,10 +363,13 @@ void SourceFileWindow::accel_activated(int index)
         break;
       case 9:
       case 10:
-        // Disable newLineHook.
-        THIS->accel->setItemEnabled(6,FALSE);
-        THIS->accel->setItemEnabled(7,FALSE);
-        new CompletionPopup(CURRENT_VIEW,THIS->fileName,THIS->mainForm,this);
+        // Completion only operates on C files.
+        if (THIS->isCFile) {
+          // Disable newLineHook.
+          THIS->accel->setItemEnabled(6,FALSE);
+          THIS->accel->setItemEnabled(7,FALSE);
+          new CompletionPopup(CURRENT_VIEW,THIS->fileName,THIS->mainForm,this);
+        }
         break;
       default: break;
     }