Skip to content

Commit 5f70b91

Browse files
committed
adjustments for ST2
1 parent 55e9d52 commit 5f70b91

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Diff for: CodeComplice.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ def get_trg(type, *args, **kwargs):
912912
codeintel_log.handlers = list(_hdlrs) + [hdlr]
913913
ctlr = LogEvalController(codeintel_log)
914914
try:
915-
global last_trigger_name, last_citdl_expr
915+
global last_trigger_name, last_citdl_expr, is_active_popup
916916
trigger_changed = False
917917

918918
current_trigger_name = trigger.name if trigger else None
@@ -925,7 +925,9 @@ def get_trg(type, *args, **kwargs):
925925
if current_trigger_name != last_trigger_name:
926926
log.debug("hiding automplete-panel, b/c trigger changed: FROM %r TO %r " % (last_trigger_name, (trigger.name if trigger else 'None') ))
927927
trigger_changed = True
928-
view.run_command('hide_auto_complete')
928+
if is_active_popup:
929+
is_active_popup = False
930+
view.run_command('hide_auto_complete')
929931

930932
last_trigger_name = current_trigger_name
931933

@@ -1039,7 +1041,7 @@ def generateEnvironment(mgr, lang, folders):
10391041
config["codeintel_scan_extra_dir"] = scan_extra_dir
10401042

10411043
for conf, p in config.items():
1042-
if isinstance(p, str) and p.startswith('~'):
1044+
if isinstance(p, unicode) and p.startswith('~'):
10431045
config[conf] = os.path.expanduser(p)
10441046

10451047
# Setup environment variables
@@ -1435,11 +1437,6 @@ def on_activated(self, view):
14351437
if codeintel_enabled():
14361438
sublime.set_timeout(settings_manager.checkProjectFileChanged, 100)
14371439

1438-
def on_text_command(self, window, command_name, args):
1439-
global is_active_popup, last_trigger_name
1440-
if command_name not in ["insert"]:
1441-
is_active_popup = False
1442-
14431440
#rescan a buffer on_pre_save, if it is dirty
14441441
def on_pre_save(self, view):
14451442
settings_manager.update()
@@ -1509,6 +1506,8 @@ def on_modified(self, view):
15091506
current_command = view.command_history(0)
15101507

15111508
if current_command[0] not in ['insert']:
1509+
global is_active_popup
1510+
is_active_popup = False
15121511
view.run_command('hide_auto_complete')
15131512
#show subsequent calltips instantly, if appropriate
15141513
if current_command[0] in ['commit_completion','insert_snippet']:

0 commit comments

Comments
 (0)