diff options
Diffstat (limited to 'plugins/code.py')
-rw-r--r-- | plugins/code.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/code.py b/plugins/code.py index 1c6dfab0..8d9c57a3 100644 --- a/plugins/code.py +++ b/plugins/code.py @@ -41,7 +41,11 @@ class Plugin(BasePlugin): help='Sends syntax-highlighted code in the current tab') def command_code(self, args): - language, code = args.split(None, 1) + split = args.split(None, 1) + if len(split) != 2: + self.api.information('Usage: /code <language> <code>', 'Error') + return None + language, code = split lexer = get_lexer_by_name(language) tab = self.api.current_tab() code = highlight(code, lexer, FORMATTER) |