当前位置: 首页>>代码示例>>Python>>正文


Python View.settings方法代码示例

本文整理汇总了Python中sublime.View.settings方法的典型用法代码示例。如果您正苦于以下问题:Python View.settings方法的具体用法?Python View.settings怎么用?Python View.settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sublime.View的用法示例。


在下文中一共展示了View.settings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: show_enable_config

# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import settings [as 别名]
def show_enable_config(view: sublime.View, config: ClientConfig):
    syntax = str(view.settings().get("syntax", ""))
    message = "SublimeCodeIntel has found a language server for {}. Run \"Setup Language Server\" to start using it".format(
        extract_syntax_name(syntax)
    )
    window = view.window()
    if window:
        window.status_message(message)
开发者ID:Kronuz,项目名称:SublimeCodeIntel,代码行数:10,代码来源:configuration.py

示例2: on_load

# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import settings [as 别名]
    def on_load(self, view: sublime.View) -> None:
        """Called after load a file
        """

        if (check_linting(view, ONLY_CODE, code=self.lang.lower()) and
                check_linting_behaviour(view, ['always', 'load-save'])):
            if self.lang in view.settings().get('syntax'):
                self.run_linter(view)
        else:
            self._erase_marks_if_no_linting(view)
开发者ID:DamnWidget,项目名称:anaconda,代码行数:12,代码来源:linting.py

示例3: on_activated

# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import settings [as 别名]
    def on_activated(self, view: sublime.View) -> None:
        """Called when a view gain the focus
        """

        if (check_linting(
                view, ONLY_CODE | LINTING_ENABLED, code=self.lang.lower()) and
                check_linting_behaviour(view, ['always'])):
            if self.lang in view.settings().get('syntax'):
                self.run_linter(view)
        else:
            self._erase_marks_if_no_linting(view)
开发者ID:DamnWidget,项目名称:anaconda,代码行数:13,代码来源:linting.py

示例4: notify_did_open

# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import settings [as 别名]
def notify_did_open(view: sublime.View):
    config = config_for_scope(view)
    client = client_for_view(view)
    if client and config:
        view.settings().set("show_definitions", False)
        window = view.window()
        view_file = view.file_name()
        if window and view_file:
            if not has_document_state(window, view_file):
                ds = get_document_state(window, view_file)
                ds.languageId = config.get_language_id(view)
                if settings.show_view_status:
                    view.set_status("code_intel_clients", config.name)
                params = {
                    "textDocument": {
                        "uri": filename_to_uri(view_file),
                        "languageId": ds.languageId,
                        "text": view.substr(sublime.Region(0, view.size())),
                        "version": ds.version
                    }
                }
                client.send_notification(Notification.didOpen(params))
开发者ID:Kronuz,项目名称:SublimeCodeIntel,代码行数:24,代码来源:documents.py

示例5: on_post_save

# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import settings [as 别名]
    def on_post_save(self, view: sublime.View) -> None:
        """Called post file save event
        """

        if check_linting(
                view, NOT_SCRATCH | LINTING_ENABLED, code=self.lang.lower()):
            if self.lang in view.settings().get('syntax'):
                if get_settings(
                        view, "anaconda_linter_show_errors_on_save", False):
                    self.run_linter(view, self._show_errors_list)
                else:
                    self.run_linter(view)
        else:
            self._erase_marks_if_no_linting(view)
开发者ID:DamnWidget,项目名称:anaconda,代码行数:16,代码来源:linting.py

示例6: on_selection_modified

# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import settings [as 别名]
    def on_selection_modified(self, view: sublime.View) -> None:
        """Called on selection modified
        """

        constraints = ONLY_CODE | NOT_SCRATCH | LINTING_ENABLED
        if (not check_linting(view, constraints, code=self.lang.lower()) or
                self.lang not in view.settings().get('syntax')):
            return

        last_selected_line = last_selected_lineno(view)

        if last_selected_line != self.last_selected_line:
            self.last_selected_line = last_selected_line
            update_statusbar(view)
开发者ID:DamnWidget,项目名称:anaconda,代码行数:16,代码来源:linting.py


注:本文中的sublime.View.settings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。