Skip to content

Commit

Permalink
Fix bug that added a semi colon when adding a new line even if there …
Browse files Browse the repository at this point in the history
…was already one
  • Loading branch information
Maurice Zhang authored and Maurice Zhang committed Jul 4, 2015
1 parent 75717ae commit f6209e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
5 changes: 4 additions & 1 deletion AppendSemiColon.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sublime_plugin

class AppendSemiColonCommand(sublime_plugin.TextCommand):
def run(self, edit):
def run(self, edit, **args):

def insert_semicolon(point):
self.view.insert(edit, point, ';')
Expand Down Expand Up @@ -34,3 +34,6 @@ def is_semicolon(point):

elif not is_semicolon(line_end - 1):
insert_semicolon(line_end)

if ('enter_new_line' in args and args['enter_new_line'] == 'true'):
self.view.run_command("run_macro_file", {"file": "Packages/Default/Add Line.sublime-macro"}) # enter new line
23 changes: 0 additions & 23 deletions AppendSemiColon.sublime-macro

This file was deleted.

2 changes: 1 addition & 1 deletion Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
{ "keys": ["super+;"], "command": "append_semi_colon" },
{ "keys": ["super+shift+;"], "command": "run_macro_file", "args": {"file": "Packages/AppendSemiColon/AppendSemiColon.sublime-macro"} }
{ "keys": ["super+shift+;"], "command": "append_semi_colon", "args": {"enter_new_line": "true"} }
]
2 changes: 1 addition & 1 deletion Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
{ "keys": ["ctrl+;"], "command": "append_semi_colon" },
{ "keys": ["ctrl+shift+;"], "command": "run_macro_file", "args": {"file": "Packages/AppendSemiColon/AppendSemiColon.sublime-macro"} }
{ "keys": ["ctrl+shift+;"], "command": "append_semi_colon", "args": {"enter_new_line": "true"} }
]

0 comments on commit f6209e9

Please sign in to comment.