Guest User

Untitled

a guest
Jul 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. # @title Diff
  2. # @matchuti public.diff-text
  3. # @matchext diff, patch
  4. # @matchfirstline (?x)^(=== modified file|====\s*//.+\s-\s.+\s+ ====|Index: |--- [^%]|\*\*\*.*\d{4}\s*$|\d+(,\d+)*(a|d|c)\d+(,\d+)*$|diff --git )
  5.  
  6. # language definition for files created with 'diff'
  7.  
  8. # diff created with -u option
  9. state oldfile = '(?=^[-]{3})' begin
  10. oldfile start '^[-]{3}'
  11. oldfile start '^[-]'
  12. newfile start '^[+]'
  13. difflines start '^@@'
  14. end
  15.  
  16. # diff created with -c option
  17. state oldfile = '(?=^[*]{3})' begin
  18. environment oldfile = '^[*]{3}[[:blank:]]+[[:digit:]]' begin
  19. normal start '^[[:space:]]'
  20. newfile = '(?=^[-]{3})' exit
  21. end
  22. oldfile start '^[*]{3}'
  23.  
  24. environment newfile = '^[-]{3}[[:blank:]]+[[:digit:]]' begin
  25. normal start '^[[:space:]]'
  26. newfile = '(?=^[*]{3})' exit
  27. normal start '^diff' exit
  28. end
  29. newfile start '^[-]{3}'
  30. end
  31.  
  32. # otherwise, created without options
  33. state difflines = '(?=^[[:digit:]])' begin
  34. difflines start '^[[:digit:]]'
  35. oldfile start '^[<]'
  36. newfile start '^[>]'
  37. end
Add Comment
Please, Sign In to add comment