Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix regression where dynamic variables weren't set anymore

  • Loading branch information...
commit 6519dabd2b412b32b4f681817a545b3d7f8ebda4 1 parent d6baffa
@fmarcia authored
Showing with 19 additions and 19 deletions.
  1. +3 −3 zencoding/__init__.py
  2. +16 −16 zencoding/zen_editor.py
View
6 zencoding/__init__.py
@@ -134,9 +134,6 @@ def update_ui(self):
windowdata = self.window.get_data("ZenCodingPluginDataKey")
windowdata["action_group"].set_sensitive(bool(view and view.get_editable()))
- # the content changed
- self.editor.set_context(view)
-
# user settings
modified = os.path.getmtime(os.path.join(os.path.dirname(__file__), 'my_zen_settings.py'))
if modified != self.modified:
@@ -155,6 +152,9 @@ def update_ui(self):
globals()['zen_core'].zen_settings = globals()['stparser'].get_settings(my_zen_settings.my_zen_settings)
self.modified = modified
+ # the content changed
+ self.editor.set_context(view)
+
# Menu handlers
def expand_abbreviation(self, action):
View
32 zencoding/zen_editor.py
@@ -72,16 +72,6 @@ def __init__(self, window):
self.window = window
- default_locale = locale.getdefaultlocale()[0]
- if default_locale:
- lang = re.sub(r'_[^_]+$', '', default_locale)
- if lang != default_locale:
- zen_core.set_variable('lang', lang)
- zen_core.set_variable('locale', default_locale.replace('_', '-'))
- else:
- zen_core.set_variable('lang', default_locale)
- zen_core.set_variable('locale', default_locale)
-
self.last_wrap = ''
self.last_expand = ''
self.last_lorem_ipsum = 'list 5*5'
@@ -95,6 +85,16 @@ def __init__(self, window):
def set_context(self, view):
+ default_locale = locale.getdefaultlocale()[0]
+ if default_locale:
+ lang = re.sub(r'_[^_]+$', '', default_locale)
+ if lang != default_locale:
+ zen_core.set_variable('lang', lang)
+ zen_core.set_variable('locale', default_locale.replace('_', '-'))
+ else:
+ zen_core.set_variable('lang', default_locale)
+ zen_core.set_variable('locale', default_locale)
+
self.document = self.window.get_active_document()
if self.document:
zen_core.set_variable('charset', self.document.get_encoding().get_charset())
@@ -107,13 +107,13 @@ def set_context(self, view):
else:
zen_core.set_variable('indentation', "\t")
- #zen_core.set_newline(???)
+ #zen_core.set_newline(???)
- if USE_SNIPPETS and self.view:
- if not (self.view in self.snippet_document):
- self.snippet_document[self.view] = SnippetDocument(None, self.view)
- else:
- self.snippet_document[self.view] = None
+ if USE_SNIPPETS:
+ if not (self.view in self.snippet_document):
+ self.snippet_document[self.view] = SnippetDocument(None, self.view)
+ else:
+ self.snippet_document[self.view] = None
def get_selection_range(self):
Please sign in to comment.
Something went wrong with that request. Please try again.