Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged master

  • Loading branch information...
commit ba205df88e9308d480cbc819e90076948a7b028f 2 parents ec3ca4b + ad42cd2
@mvoidex mvoidex authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 sublime_haskell_common.py
View
12 sublime_haskell_common.py
@@ -39,11 +39,14 @@ def preload_settings():
sublime_haskell_settings = {}
-def is_enabled_haskell_command(view = None, must_be_project=True, must_be_main=False):
+def is_enabled_haskell_command(view = None, must_be_project=True, must_be_main=False, must_be_file = False):
"""Returns True if command for .hs can be invoked"""
window, view, file_shown_in_view = get_haskell_command_window_view_file_project(view)
- if not window or not view or not file_shown_in_view:
+ if not window or not view:
+ return False
+
+ if must_be_file and not file_shown_in_view:
return False
syntax_file_for_view = view.settings().get('syntax').lower()
@@ -390,8 +393,5 @@ def show_status_message_process(msg, isok = None):
status_messager.start()
def is_haskell_source(view = None):
- if not view:
- view = sublime.active_window().active_view()
- syntax_file_for_view = view.settings().get('syntax').lower()
- return 'haskell' in syntax_file_for_view
+ return is_enabled_haskell_command(view, False)
Please sign in to comment.
Something went wrong with that request. Please try again.