window = view.window()
results = window.newFile()
results.isScratch(True)
Traceback (most recent call last):
File ".\sublimeplugin.py", line 118, in execTextCommand
File ".\Repl.py", line 35, in run
Boost.Python.ArgumentError: Python argument types in
View.isScratch(View, bool)
did not match C++ signature:
isScratch(class slate::SP<class TextBufferView>)
mikeb wrote:Thanks for the response and the scratch buffer is cool, but not quite what I had in mind for output. Really I am just looking for a way to display results just as it is in the console or output panel. Console is actually fine, it's just that there is quite a bit of other things being printed there and it would be nice to have a clean panel to send plugin output to.
I tried the scratch panel setting(with beta 20090923) but it didn't seem to work. Here is the python
- Code: Select all
window = view.window()
results = window.newFile()
results.isScratch(True)
and here is the error in the console
- Code: Select all
Traceback (most recent call last):
File ".\sublimeplugin.py", line 118, in execTextCommand
File ".\Repl.py", line 35, in run
Boost.Python.ArgumentError: Python argument types in
View.isScratch(View, bool)
did not match C++ signature:
isScratch(class slate::SP<class TextBufferView>)
results.setScratch(results.bufferId())But I agree we need a way to write to output panel!
something like sublime.outputGet() /sublime.outputWrite()
results.setScratch(True)In order to find the same panel on a second run of the plugin I had to set the name of the scratch buffer and then loop through the all the views and check the name of each one to find the same buffer on a second run of the plugin.
class MyCommand(sublimeplugin.TextCommand):
Results = ''
def run(self, view, args):
output = "blablabla"
if not self.Results:# or not self.Results in view.window().views():
# Need to create Results scratch buffer
self.Results = view.window().newFile()
self.Results.setScratch(True)
self.Results.setName("My output")
self.Results.insert(-1, output + "\n")
view.window().focusView(self.Results)
Users browsing this forum: No registered users and 8 guests