code: def show_diff(before_editing, after_editing):
      
      def listify(string):
          return [l+'\n' for l in string.rstrip('\n').split('\n')]
  
      unified_diff = difflib.unified_diff(listify(before_editing), listify(after_editing))
  
      if sys.stdout.isatty():
          buf = io.StringIO()
          for line in unified_diff:
              # Force cast to unicode as difflib on Python 2.7 returns a mix of unicode and str.
              buf.write(text_type(line))
          buf.seek(0)
  
          class opts:
              side_by_side = False
              width = 80
              tab_width = 8
          cdiff.markup_to_pager(cdiff.PatchStream(buf), opts)
      else:
          for line in unified_diff:
              click.echo(line.rstrip('\n'))
docs: Shows a diff between two strings.
  
      If the output is to a tty the diff will be colored. Inputs are expected to be unicode strings.