Skip to content

Commit ce6d73a

Browse files
committed
fix ths issue that multiple file close slowly
1 parent a962ae2 commit ce6d73a

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

libs/viewhelpers.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def __init__(self, filename, cc):
3232

3333

3434
_file_map = dict()
35-
most_recent_used_file_list = []
3635

3736

3837
def get_info(view):
@@ -58,9 +57,9 @@ def get_info(view):
5857
reload_buffer(view, info.client_info)
5958
else:
6059
info.client_info.pending_changes = True
61-
if info in most_recent_used_file_list:
62-
most_recent_used_file_list.remove(info)
63-
most_recent_used_file_list.append(info)
60+
# if info in most_recent_used_file_list:
61+
# most_recent_used_file_list.remove(info)
62+
# most_recent_used_file_list.append(info)
6463
return info
6564

6665

@@ -305,9 +304,4 @@ def change_count(view):
305304
if IS_ST2:
306305
return info.modify_count
307306
else:
308-
return view.change_count()
309-
310-
311-
# def get_delete_indent_space_number(view, pos):
312-
# line, offset =
313-
# tab_size = view.settings().get("tab_size", 1)
307+
return view.change_count()

listeners/listeners.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ def on_close(self, view):
220220
if view.is_scratch() and view.name() == "Find References":
221221
cli.dispose_ref_info()
222222
else:
223-
info = get_info(view)
224-
if info:
225-
if info in most_recent_used_file_list:
226-
most_recent_used_file_list.remove(info)
227-
# notify the server that the file is closed
228-
cli.service.close(file_name)
223+
# info = get_info(view)
224+
# if info:
225+
# if info in most_recent_used_file_list:
226+
# most_recent_used_file_list.remove(info)
227+
# notify the server that the file is closed
228+
cli.service.close(file_name)
229229

230230
def on_pre_save(self, view):
231231
log.debug("on_pre_save")

0 commit comments

Comments
 (0)