Import installed robotframeworklexer.
Try to fix Ctrl-Space in Grid Editor.
@@ -41,9 +41,12 @@ if wx.VERSION >= (3, 0, 3, ''): # DEBUG wxPhoenix
else:
from wx import HyperlinkCtrl, EVT_HYPERLINK
-try:
- from . import robotframeworklexer
+try: # import installed version first
+ import robotframeworklexer
except ImportError:
+ try: # then import local version
+ from . import robotframeworklexer
+ except ImportError: # Pygments is not installed
robotframeworklexer = None
@@ -428,8 +431,10 @@ class SourceEditor(wx.Panel):
self._search_field_notification.SetLabel('No matches found.')
def OnContentAssist(self, event):
- # print("DEBUG: Content assist called")
- if wx.Window.FindFocus() is self._editor:
+ # print("DEBUG: Content assist called Focused: %s" % self.is_focused())
+ if not self.is_focused():
+ return
+ # if wx.Window.FindFocus() is self._editor:
selected = self._editor.get_selected_or_near_text()
sugs = [s.name for s in self._suggestions.get_suggestions(
selected or '')]
