Skip to content

Commit

Permalink
Merge pull request #78 from huntout/master
Browse files Browse the repository at this point in the history
Do not replace edit region when text not changed
  • Loading branch information
victorporof committed Jan 17, 2014
2 parents 891b4b1 + f4469de commit 51203be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion HTMLPrettify.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def run(self, edit):
if self.view.settings().get("ensure_newline_at_eof_on_save") and not text.endswith("\n"):
text += "\n"

self.view.replace(edit, region, text)
if text != bufferText:
self.view.replace(edit, region, text)

self.view.set_viewport_position((0, 0,), False)
self.view.set_viewport_position(previous_position, False)
Expand Down

0 comments on commit 51203be

Please sign in to comment.