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

[ST3] Works not well ...

liuhewei opened this issue · comments

My environment is win7-32, st 3 build3047. I cloned the branch "python3" into the package directory, but seems can't work well:

  1. Settings seems useless. I tried to put the global settings to local:
    settings = sublime.load_settings('SublimeHighlight.sublime-settings')
    into get_formatter() in SublimeHighlight.py, then the setting options can be obtained.
  2. tmp_file.write(contents.encode(...)) in function write_file() should be changed to tmp_file.write(contents).

After the 2 steps above, the "view as HTML" command works. But, "view as RTF" still can't work, seems the settings is ineffectual. And, "Copy to clipboard" can't work. The error exists in winclip library according to my python console:

Traceback (most recent call last):
  File "D:\Tools\Sublime Text 3\sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "D:\Tools\Sublime Text 3\Data\Packages\SublimeHighlight\SublimeHighlight.py", line 143, in run
    winclip.Paste(pygmented, output_type, plaintext)
  File "D:\Tools\Sublime Text 3\Data\Packages\SublimeHighlight\HighlightLib\winclip\__init__.py", line 60, in Paste
    Put(data, CF_HTML)
  File "D:\Tools\Sublime Text 3\Data\Packages\SublimeHighlight\HighlightLib\winclip\__init__.py", line 83, in Put
    scd(c_int(format), hCd, 0, False)
ValueError: Procedure probably called with too many arguments (8 bytes in excess)

Seems the winclip doesn't support win7 well? I don't know...

I'm in Mac OSX 10.7.5 Lion and also encountered the problem mentioned above.

After changing tmp_file.write(contents.encode(...)) to tmp_file.write(contents) the TypeError is resolved, and "Copy as RTF" works well.

For some reason ST3 is unable to store user settings in the appropriate folder. Still investigating this one.

None of the commands are working for me, either. This is the output from the console:

Traceback (most recent call last):
  File "/Applications/Sublime Text 3.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/SublimeHighlight.py", line 118, in run
    pygmented = self.highlight(output_type, full)
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/SublimeHighlight.py", line 107, in highlight
    self.get_formatter(output_type, full))
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/SublimeHighlight.py", line 75, in get_formatter
    fontface=settings.get('fontface', ''))
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/HighlightLib/pygments/formatters/__init__.py", line 51, in get_formatter_by_name
    return cls(**options)
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/HighlightLib/pygments/formatters/html.py", line 372, in __init__
    Formatter.__init__(self, **options)
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/HighlightLib/pygments/formatter.py", line 68, in __init__
    self.full  = get_bool_opt(options, 'full', False)
  File "/Users/zenojevski/Library/Application Support/Sublime Text 3/Packages/SublimeHighlight/HighlightLib/pygments/util.py", line 58, in get_bool_opt
    string, optname))
pygments.util.OptionError: Invalid type None for option full; use 1/0, yes/no, true/false, on/off

I have transitioned my folder to ST3 some time ago, so I'm guessing I may have stale configuration values from before, but I'm can't seem to find anything relevant.

SHould be fixed by #37 - Please reopen if that's not true.

I'm with the same error but I'm using ST2. Please help me.