From 11c8d204c1a49cd54446107bb0d61f8686872152 Mon Sep 17 00:00:00 2001 From: Thomas Lent Date: Tue, 30 Jun 2015 10:26:29 -0400 Subject: [PATCH] add language scopes to atom language config gets --- src/languages/css.coffee | 5 +++-- src/languages/html.coffee | 5 +++-- src/languages/javascript.coffee | 7 ++++--- src/languages/python.coffee | 5 +++-- src/languages/ruby.coffee | 5 +++-- src/languages/sql.coffee | 5 +++-- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/languages/css.coffee b/src/languages/css.coffee index ff75dcf..6560be5 100644 --- a/src/languages/css.coffee +++ b/src/languages/css.coffee @@ -1,6 +1,7 @@ # Get Atom defaults -tabLength = atom?.config.get('editor.tabLength') ? 4 -softTabs = atom?.config.get('editor.softTabs') ? true +scope = ['source.css'] +tabLength = atom?.config.get('editor.tabLength', scope: scope) ? 4 +softTabs = atom?.config.get('editor.softTabs', scope: scope) ? true defaultIndentSize = (if softTabs then tabLength else 1) defaultIndentChar = (if softTabs then " " else "\t") defaultIndentWithTabs = not softTabs diff --git a/src/languages/html.coffee b/src/languages/html.coffee index c6f117e..fb93332 100644 --- a/src/languages/html.coffee +++ b/src/languages/html.coffee @@ -1,6 +1,7 @@ # Get Atom defaults -tabLength = atom?.config.get('editor.tabLength') ? 4 -softTabs = atom?.config.get('editor.softTabs') ? true +scope = ['text.html'] +tabLength = atom?.config.get('editor.tabLength', scope: scope) ? 4 +softTabs = atom?.config.get('editor.softTabs', scope: scope) ? true defaultIndentSize = (if softTabs then tabLength else 1) defaultIndentChar = (if softTabs then " " else "\t") defaultIndentWithTabs = not softTabs diff --git a/src/languages/javascript.coffee b/src/languages/javascript.coffee index cb947ae..4634765 100644 --- a/src/languages/javascript.coffee +++ b/src/languages/javascript.coffee @@ -1,6 +1,7 @@ # Get Atom defaults -tabLength = atom?.config.get('editor.tabLength') ? 4 -softTabs = atom?.config.get('editor.softTabs') ? true +scope = ['source.js'] +tabLength = atom?.config.get('editor.tabLength', scope: scope) ? 4 +softTabs = atom?.config.get('editor.softTabs', scope: scope) ? true defaultIndentSize = (if softTabs then tabLength else 1) defaultIndentChar = (if softTabs then " " else "\t") defaultIndentWithTabs = not softTabs @@ -27,7 +28,7 @@ module.exports = { defaultBeautifier: "JS Beautify" ### - + ### options: # JavaScript diff --git a/src/languages/python.coffee b/src/languages/python.coffee index 5825ae7..d1cc1da 100644 --- a/src/languages/python.coffee +++ b/src/languages/python.coffee @@ -1,6 +1,7 @@ # Get Atom defaults -tabLength = atom?.config.get('editor.tabLength') ? 4 -softTabs = atom?.config.get('editor.softTabs') ? true +scope = ['source.python'] +tabLength = atom?.config.get('editor.tabLength', scope: scope) ? 4 +softTabs = atom?.config.get('editor.softTabs', scope: scope) ? true defaultIndentSize = (if softTabs then tabLength else 1) defaultIndentChar = (if softTabs then " " else "\t") defaultIndentWithTabs = not softTabs diff --git a/src/languages/ruby.coffee b/src/languages/ruby.coffee index e409dfd..9eb866c 100644 --- a/src/languages/ruby.coffee +++ b/src/languages/ruby.coffee @@ -1,6 +1,7 @@ # Get Atom defaults -tabLength = atom?.config.get('editor.tabLength') ? 4 -softTabs = atom?.config.get('editor.softTabs') ? true +scope = ['source.ruby'] +tabLength = atom?.config.get('editor.tabLength', scope: scope) ? 4 +softTabs = atom?.config.get('editor.softTabs', scope: scope) ? true defaultIndentSize = (if softTabs then tabLength else 1) defaultIndentChar = (if softTabs then " " else "\t") defaultIndentWithTabs = not softTabs diff --git a/src/languages/sql.coffee b/src/languages/sql.coffee index c674c1e..92434be 100644 --- a/src/languages/sql.coffee +++ b/src/languages/sql.coffee @@ -1,6 +1,7 @@ # Get Atom defaults -tabLength = atom?.config.get('editor.tabLength') ? 4 -softTabs = atom?.config.get('editor.softTabs') ? true +scope = ['source.sql'] +tabLength = atom?.config.get('editor.tabLength', scope: scope) ? 4 +softTabs = atom?.config.get('editor.softTabs', scope: scope) ? true defaultIndentSize = (if softTabs then tabLength else 1) defaultIndentChar = (if softTabs then " " else "\t") defaultIndentWithTabs = not softTabs