Skip to content

Commit e3750a6

Browse files
committed
Release v1.4.2
- Fixed problem with navigating to the syntax error on double-click in output panel
1 parent 09898d2 commit e3750a6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cs-script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# https://www.sublimetext.com/docs/1/api-reference
1717

18-
version = '1.4.1' # build 0
18+
version = '1.4.2' # build 0
1919
os.environ["PACKAGE_VERSION"] = version
2020

2121
from .imports.utils import * # should be imported after environ["PACKAGE_VERSION"] is set
@@ -451,7 +451,7 @@ def on_hover(self, view, point, hover_zone):
451451
def on_post_text_command(self, view, command_name, args):
452452
if command_name == 'drag_select':
453453
if is_output_panel(view):
454-
if 'by' in args.keys() and args['by'] == 'words':
454+
if 'by' in args.keys() and args['by'] == 'words': # double-click
455455
try:
456456
point = view.sel()[0].begin()
457457
line_region = view.line(point)

imports/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,15 @@ def active_primary_view():
336336
return None
337337
# -----------------
338338
def is_output_panel(view):
339-
340339
# return view == sublime.active_window().active_panel() # not reliable
341-
if view == sublime.active_window().find_output_panel('exec'):
340+
if view == sublime.active_window().find_output_panel('CS-Script'):
342341
return True
343342

344-
return view.file_name() == None and view.name() == ''
343+
# CS-Script panel lookup, last defense
344+
name = view.name()
345+
file_name = view.file_name()
346+
347+
return file_name == None and (name == '' or name == None or name.startswith("Script: "))
345348

346349
# -----------------
347350
def get_saved_doc(view, location = -1):

0 commit comments

Comments
 (0)