MCPcopy
hub / github.com/catppuccin/catppuccin / diff_done

Method diff_done

samples/python1.py:372–391  ·  view source on GitHub ↗
(self, result)

Source from the content-addressed store, hash-verified

370
371class ShowDiffCommand(DiffCommand, sublime_plugin.TextCommand):
372 def diff_done(self, result):
373 self.log('on show_diff', result)
374
375 if not result.strip():
376 return
377
378 result = result.replace('\r\n', '\n')
379 file_name = re.findall(r'([^\\\/]+)$', self.view.file_name())
380 scratch = self.scratch(result, title="Diff - " + file_name[0])
381
382 # Select the line in the diff output where the cursor is located.
383 point = self.view.sel()[0].b
384 region = self.view.line(point)
385 line = self.view.substr(region)
386
387 region = scratch.find(line, 0, sublime.LITERAL)
388 scratch.show_at_center(region)
389 scratch.sel().clear()
390 # Place the cursor at the beginning of the line
391 scratch.sel().add(scratch.line(region).a)
392
393
394class DiffParser(object):

Callers

nothing calls this directly

Calls 2

logMethod · 0.80
scratchMethod · 0.80

Tested by

no test coverage detected