n1k0 / SublimeHighlight

A humble SublimeText package for exporting highlighted code as RTF or HTML

Home Page:https://github.com/n1k0/SublimeHighlight

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows Copy to Clipboard RTF and HTML doesn't work

RafaAguilar opened this issue · comments

Hi there,

When highlight and Copy to clipboard RTF doesn't show anything at console, and the clipboard turns empty.

When highlight and Copy to clipboard HTML shows this error on console:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "C:\Users\raguilar\AppData\Roaming\Sublime Text 3\Packages\Highlight\SublimeHighlight.py", line 143, in run
    winclip.Paste(pygmented, output_type, plaintext)
  File "C:\Users\raguilar\AppData\Roaming\Sublime Text 3\Packages\Highlight\HighlightLib\winclip\__init__.py", line 46, in Paste
    data = EncodeHTML(data)
  File "C:\Users\raguilar\AppData\Roaming\Sublime Text 3\Packages\Highlight\HighlightLib\winclip\__init__.py", line 99, in EncodeHTML
    fragmentStart = html.index(fragment)
TypeError: Can't convert 'bytes' object to str implicitly

_The other options: View as *, works correctly.
*_Sublime Text 3: build 3047
SublimeHighlight-python3 branch

Same issue here, here's the console error for copying to RTF

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "C:\Users\Bob\AppData\Roaming\Sublime Text 3\Packages\Highlight\SublimeHighlight.py", line 143, in run
    winclip.Paste(pygmented, output_type, plaintext)
  File "C:\Users\Bob\AppData\Roaming\Sublime Text 3\Packages\Highlight\HighlightLib\winclip\__init__.py", line 57, in Paste
    Put(data, CF_RTF)
  File "C:\Users\Bob\AppData\Roaming\Sublime Text 3\Packages\Highlight\HighlightLib\winclip\__init__.py", line 79, in Put
    strcpy(c_char_p(pchData), bytes(data))

Edit: My issue seems to only be with ST3, ST2 copies fine.