Write a micro editor plugin that shows the text "Hello world" when editor starts.
- User
Write a micro editor plugin that shows the text "Hello world" when editor starts.
Assistant
Here is Python code for a basic micro editor plugin that displays "Hello world" when the editor starts:
import editor def on_start(): editor.show_message("Hello world") if __name__ == '__main__': editor.on_start(on_start)To break this down:
import editorimports the editor plugin moduledef on_start()defines the function that will run when the editor startseditor.show_message("Hello world")displays the "Hello world" message using the editor's message display functionif __name__ == '__main__':is boilerplate that makes this run as a plugin scripteditor.on_start(on_start)registers the on_start function to run when the editor launches
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.