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


Python ViewCollection.diff方法代码示例

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


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

示例1: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
 def run(self):
     self.view = self.window.active_view()
     self.clear_all()
     inserted, modified, deleted = ViewCollection.diff(self.view)
     self.lines_removed(deleted)
     self.lines_added(inserted)
     self.lines_modified(modified)
开发者ID:cromulus,项目名称:sublimesettings,代码行数:9,代码来源:git_gutter.py

示例2: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
    def run(self, force_refresh=False):
        self.view = self.window.active_view()
        if not self.view:
            # View is not ready yet, try again later.
            sublime.set_timeout(self.run, 1)
            return
        self.clear_all()
        if ViewCollection.untracked(self.view):
            self.bind_files('untracked')
        elif ViewCollection.ignored(self.view):
            self.bind_files('ignored')
        else:
            # If the file is untracked there is no need to execute the diff
            # update
            if force_refresh:
                ViewCollection.clear_git_time(self.view)
            inserted, modified, deleted = ViewCollection.diff(self.view)
            self.lines_removed(deleted)
            self.bind_icons('inserted', inserted)
            self.bind_icons('changed', modified)

            if(ViewCollection.show_status(self.view) != "none"):
                if(ViewCollection.show_status(self.view) == 'all'):
                    branch = ViewCollection.current_branch(
                        self.view).decode("utf-8").strip()
                else:
                    branch = ""

                self.update_status(len(inserted),
                                   len(modified),
                                   len(deleted),
                                   ViewCollection.get_compare(self.view), branch)
            else:
                self.update_status(0, 0, 0, "", "")
开发者ID:Itsme72002,项目名称:GitGutter,代码行数:36,代码来源:git_gutter.py

示例3: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
  def run(self, edit):
    self.clear_all()

    (inserted, modified, deleted) = ViewCollection.diff(self.view)

    self.lines_removed(deleted)
    self.lines_added(inserted)
    self.lines_modified(modified)
开发者ID:bencevans,项目名称:GitGutter,代码行数:10,代码来源:git_gutter.py

示例4: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
 def run(self):
     self.view = self.window.active_view()
     if not self.view:
         # View is not ready yet, try again later.
         sublime.set_timeout(self.run, 1)
         return
     self.clear_all()
     inserted, modified, deleted = ViewCollection.diff(self.view)
     self.lines_removed(deleted)
     self.bind_icons('inserted', inserted)
     self.bind_icons('changed', modified)
开发者ID:bmwang,项目名称:VcsGutter,代码行数:13,代码来源:vcs_gutter.py

示例5: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
    def run(self):
        view = self.window.active_view()

        inserted, modified, deleted = ViewCollection.diff(view)
        inserted = self.lines_to_blocks(inserted)
        modified = self.lines_to_blocks(modified)
        all_changes = sorted(inserted + modified + deleted)
        if all_changes:
            row, col = view.rowcol(view.sel()[0].begin())

            current_row = row + 1

            line = self.jump(all_changes, current_row)

            self.window.active_view().run_command("goto_line", {"line": line})
开发者ID:Bartuz,项目名称:GitGutter,代码行数:17,代码来源:git_gutter_change.py

示例6: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
 def run(self, force_refresh=False):
     self.view = self.window.active_view()
     if not self.view:
         # View is not ready yet, try again later.
         sublime.set_timeout(self.run, 1)
         return
     self.clear_all()
     if ViewCollection.untracked(self.view):
         self.bind_files('untracked')
     elif ViewCollection.ignored(self.view):
         self.bind_files('ignored')
     else:
         # If the file is untracked there is no need to execute the diff
         # update
         if force_refresh:
             ViewCollection.clear_git_time(self.view)
         inserted, modified, deleted = ViewCollection.diff(self.view)
         self.lines_removed(deleted)
         self.bind_icons('inserted', inserted)
         self.bind_icons('changed', modified)
开发者ID:ArtakManukyan,项目名称:config,代码行数:22,代码来源:git_gutter.py

示例7: run

# 需要导入模块: from view_collection import ViewCollection [as 别名]
# 或者: from view_collection.ViewCollection import diff [as 别名]
 def run(self):
     self.view = self.window.active_view()
     if not self.view:
         # Sometimes GitGutter tries to run when there is no active window
         # and it throws an error because self.view is None.
         # I have only been able to reproduce this in the following scenario:
         # you clicked on FileA in the sidebar (FileA is not previously open)
         # not to open it but to preview it. While previewing it you press
         # ctrl+` to open a console. With the console selected and the
         # unopened FileA preview showing in the window you click on another
         # unopened file, FileB to preview that file. There will be no active
         # window at this time and GitGutter will throw an error. So we can
         # just skip running this time because immediately after selecting
         # FileB, focus will shift from the console to its preview. This will
         # cause GitGutter to run again on the FileB preview.
         # Wow that was a really long explanation.
         return
     self.clear_all()
     inserted, modified, deleted = ViewCollection.diff(self.view)
     self.lines_removed(deleted)
     self.lines_added(inserted)
     self.lines_modified(modified)
开发者ID:jtwaleson,项目名称:GitGutter,代码行数:24,代码来源:git_gutter.py


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