Skip to content

Commit 6af3c89

Browse files
committed
Merge pull request #276 from zhengbli/msmaster_fixFormatOnkeyOnSublime2
Fix formatOnKey on Sublime2
2 parents cf6ec2f + 4fdbca5 commit 6af3c89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

typescript/listeners/format.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ def on_modified_with_info(self, view, info):
2727
redo_command = view.command_history(1)[0]
2828
log.debug("last_command:{0}, args:{1}".format(last_command, args))
2929
log.debug("redo_command:{0}".format(redo_command))
30-
if redo_command != "":
31-
# in an undo session, avoid running format_on_key
30+
if redo_command != "" and redo_command is not None:
31+
# in an undo session, avoid running format_on_key. For
32+
# a non-undo session in ST3, the redo_command is an empty
33+
# string; in ST2, the redo_command is None
3234
return
3335

3436
if last_command == "insert":

0 commit comments

Comments
 (0)