Browse Source

wxGUI/prompt: fix 'ctrl+space' (cont'ed)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40138 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 years ago
parent
commit
50da78b39e
1 changed files with 8 additions and 7 deletions
  1. 8 7
      gui/wxpython/gui_modules/prompt.py

+ 8 - 7
gui/wxpython/gui_modules/prompt.py

@@ -796,14 +796,15 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
             elif event.GetKeyCode() == wx.WXK_SPACE and event.ControlDown():
                 # manual autocompletion
                 # map entries without arguments (as in r.info [mapname]) use ctrl-shift
-                cmdtype = self.GetTextLeft().split('.')[0]
-                if cmdtype=='r' or cmdtype=='i':
-                    self.promptType = 'raster'
-                elif cmdtype=='v':
-                    self.promptType = 'vector'
-                elif cmdtype=='r3':
-                    self.promptType = 'raster3d'
+                if not self.cmdDesc:
+                    return
                 
+                try:
+                    param = self.cmdDesc.get_list_params()[0]
+                    self.promptType = self.cmdDesc.get_param(param)['prompt']
+                except IndexError:
+                    return
+            
             if self.promptType and self.promptType in ('raster', 'raster3d', 'vector'):
                 self.autoCompList = self.mapList[self.promptType]
                 self.AutoCompShow(lenEntered = 0, itemList = ' '.join(self.autoCompList))