@@ -7,9 +7,12 @@
 import subprocess
 import tempfile
 
-from .HighlightLib import desktop
-from .HighlightLib import pygments
+import sys
+sys.path.append(os.path.dirname(__file__)+"/HighlightLib")
 
+import desktop
+import pygments.lexers
+import pygments.formatters
 
 if desktop.get_desktop() == 'Windows':
     from .HighlightLib import winclip
@@ -20,6 +23,10 @@
 
 settings = sublime.load_settings('%s.sublime-settings' % __name__)
 
+class OpenHighlightCommand(sublime_plugin.TextCommand):
+    def run(self, edit, content):
+        print('Hello World!')
+        self.view.insert(edit, 0, content)
 
 class SublimeHighlightCommand(sublime_plugin.TextCommand):
     """Code highlighter command."""
@@ -139,9 +146,10 @@ def run(self, edit, target='external', output_type='html'):
             new_view = self.view.window().new_file()
             if output_type == 'html':
                 new_view.set_syntax_file('Packages/HTML/HTML.tmLanguage')
-            new_edit = new_view.begin_edit()
-            new_view.insert(new_edit, 0, pygmented)
-            new_view.end_edit(new_edit)
+            new_view.run_command("open_highlight", {'content': pygmented})
+            #new_edit = new_view.begin_edit()
+            #new_view.insert(new_edit, 0, pygmented)
+            #new_view.end_edit(new_edit)
         else:
             sublime.error_message('Unsupported target "%s"' % target)
 