Skip to content
Browse files

Better formatted line break handling

  • Loading branch information...
1 parent 59faf6b commit 1001fc8150e7530cf7fe525c4db83ae914c378d6 @sergeche committed Oct 12, 2012
View
3 Default (Linux).sublime-keymap
@@ -342,6 +342,9 @@
}, {
"key": "auto_complete_visible",
"operand": false
+ }, {
+ "key": "setting.disable_formatted_linebreak",
+ "operand": false
}
]
},
View
3 Default (OSX).sublime-keymap
@@ -342,6 +342,9 @@
}, {
"key": "auto_complete_visible",
"operand": false
+ }, {
+ "key": "setting.disable_formatted_linebreak",
+ "operand": false
}
]
},
View
3 Default (Windows).sublime-keymap
@@ -342,6 +342,9 @@
}, {
"key": "auto_complete_visible",
"operand": false
+ }, {
+ "key": "setting.disable_formatted_linebreak",
+ "operand": false
}
]
},
View
4 Emmet.sublime-settings
@@ -17,6 +17,10 @@
// Exit tabstop mode when enter key is pressed
"clear_fields_on_enter_key": true,
+ // List of HTML and XML scopes where Enter key should insert formatted
+ // (e.g. with indentation) line break
+ "formatted_linebreak_scopes": "meta.scope.between-tag-pair.html, meta.scope.between-tag-pair.xml, punctuation.definition.tag.end.html",
+
// Custom snippets definitions, as per https://github.com/sergeche/zen-coding/blob/v0.7.1/snippets.json
"snippets": {
// "html": {
View
4 Preferences.sublime-settings
@@ -14,6 +14,10 @@
// disable expanding abbreviation by Tab key
"disable_tab_abbreviations": false,
+ // disable insertion of formatted linebreak when
+ // Enter key is pressed between opening and closing HTML tags
+ "disable_formatted_linebreak": false,
+
// Enables default Emmet keymap. Many users complain that Emmet actions
// (especially ones that bound to Alt key) behave incorrectly in
// non-English keyboard layouts. Set this setting to `false` in
View
2 emmet-plugin.py
@@ -347,7 +347,7 @@ def run(self, edit, **kw):
# let's see if we have to insert formatted linebreak
scope = view.syntax_name(view.sel()[0].begin())
- if sublime.score_selector(scope, 'meta.scope.between-tag-pair.html, meta.scope.between-tag-pair.xml') > 0:
+ if sublime.score_selector(scope, settings.get('formatted_linebreak_scopes', '')) > 0:
view.run_command('insert_snippet', {'contents': '\n\t${0}\n'})
else:
view.run_command('insert_snippet', {'contents': '\n${0}'})

0 comments on commit 1001fc8

Please sign in to comment.
Something went wrong with that request. Please try again.