Skip to content

Commit

Permalink
Finish v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Sep 15, 2015
2 parents cc522ca + 6d85912 commit 186cc1a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 8 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
InsertDate Changelog
====================

v2.0.2 (2015-09-15)
-------------------

- Improved usability with `save_on_focus_lost` and
`trim_trailing_white_space_on_save` settings (#26)


v2.0.1 (2015-08-21)
-------------------

- Fixed plugin for usage with ST2 (#)
- Fixed plugin for usage with ST2 (#24)
- Fixed longstanding issue (that nobody encountered?) where specifying a
timezone via settings didn't work in ST2

Expand Down
25 changes: 20 additions & 5 deletions insert_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,23 @@ def run(self, edit, format=None, tz_in=None, tz_out=None):
self.tz_in = tz_in
self.tz_out = tz_out

# Unset save_on_focus_lost so that ST doesn't save and remove trailing
# whitespace when the input/quick panel is opened, if that option is
# also enabled. (#26)
self.view.settings().set('save_on_focus_lost', False)

# Ask for the format string
i_panel = self.view.window().show_input_panel(
# Caption
# caption
"Date format string:",
# Default text
# initial_text
format or fdate.default['format'],
# on_done callback
# on_done
self.on_format,
# Unnecessary callbacks
None, None
# on_change (unused)
None,
# on_cancel
lambda: self.view.settings().erase('save_on_focus_lost')
)

# Select the default text
Expand All @@ -247,6 +255,7 @@ def on_tz_out(self, index):
self.run_for_real()

def run_for_real(self):
self.view.settings().erase('save_on_focus_lost')
self.view.run_command(
'insert_date',
{'format': self.format, 'tz_in': self.tz_in, 'tz_out': self.tz_out}
Expand Down Expand Up @@ -302,9 +311,15 @@ def run(self, edit, tz_in=None, tz_out=None):
self.panel_cache.append([conf['name'], text])
self.config_map[conf['name']] = c

# Unset save_on_focus_lost so that ST doesn't save and remove trailing
# whitespace when the quick panel is opened, if that option is also
# enabled. (#26)
self.view.settings().set('save_on_focus_lost', False)
self.view.window().show_quick_panel(self.panel_cache, self.on_done)

def on_done(self, index):
# Erase our settings override
self.view.settings().erase('save_on_focus_lost')
if index == -1:
return

Expand Down
4 changes: 3 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"install": "messages/install.md",
"1.0.0": "messages/1.0.0.md",
"1.0.1": "messages/1.0.1.md",
"2.0.0": "messages/2.0.0.md"
"2.0.0": "messages/2.0.0.md",
"2.0.1": "messages/2.0.1.md",
"2.0.2": "messages/2.0.2.md"
}
2 changes: 1 addition & 1 deletion messages/2.0.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
v2.0.1 (2015-08-21)
-------------------

- Fixed plugin for usage with ST2 (#)
- Fixed plugin for usage with ST2 (#24)
- Fixed longstanding issue (that nobody encountered?) where specifying a
timezone via settings didn't work in ST2
15 changes: 15 additions & 0 deletions messages/2.0.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
v2.0.2 (2015-09-15)
-------------------

- Improved usability with `save_on_focus_lost` and
`trim_trailing_white_space_on_save` settings (#26)

Important notice for Windows users:

A bug in InsertDate together with a bug in Package Control prevented
InsertDate 1.0.1 from being removed or updated conventionally. If
InsertDate stopped working for you or you received an update message every
time you restarted Sublime Text, make sure you update Package Control to
3.1 and restart Sublime Text when asked to.

More details at https://github.com/FichteFoll/InsertDate/issues/25.

0 comments on commit 186cc1a

Please sign in to comment.