lucasmazza / copy-as-rtf

A package to export highlighted code as RTF
Other
19 stars 14 forks source link

Does not seem to work on OSX #2

Closed markoa closed 10 years ago

markoa commented 10 years ago

Hi, I was really happy when I found your package, as I was looking for an easy way to insert code in a Keynote presentation.

However when I select some code and hit the shortcut or click on the menu item, nothing new appears in the clipboard.

Maybe I'm doing something terribly wrong... is there anything I can do help you diagnose it?

lucasmazza commented 10 years ago

hey @markoa

I just retested the package with Atom 0.123.0 and a .gemspec file and it seems to be working correctly. Which kind of file (and Atom grammar) are you trying to use with it? Did any error surfaced in the Developer Tools panel of your editor?

markoa commented 10 years ago

Hey @lucasmazza, thanks for a quick response.

Yeah, it's about file type actually. I was trying to copy some Ruby embedded in a Markdown file. This results in Error callingpygmentize: Error: no lexer for alias 'github markdown' found but it works just fine I copy that snippet into a new .rb file and try there. So it's not really an issue as far as I am concerned. :)

lucasmazza commented 10 years ago

I've noticed this error before but haven't got around to patch/fix anything related to it :smile:

mechanoid commented 10 years ago

Experiencing a similar problem.

} // ⚠ no semicolon

Copied that from another document and tried to copy that via your plugin, but the ⚠ - symbol killed it :)

2 Error calling pygmentize: *\ Error while highlighting: TypeError: ord() expected a character, but string of length 3 found (file "/Users/falkh/.atom/packages/copy-as-rtf/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatters/rtf.py", line 77, in _escape_text)

lucasmazza commented 10 years ago

@markoa I've added a mapping between atom grammars -> pygments languages to deal with this - we just need to keep it updated :smile:.

lucasmazza commented 10 years ago

@mechanoid looks like this is a bug on the Pygments RTF formatter, which was already fixed (https://bitbucket.org/birkenfeld/pygments-main/pull-request/338/produce-only-unicode-escape-sequences-in/diff) but not released yet. Not much we can do about it.

mechanoid commented 10 years ago

ah i see, thanks! :)