From 59c4c15afdb3004312634b9d6af331c45476bc6f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 17 Jan 2014 12:57:06 -0800 Subject: [PATCH] Add command to open ~/.atom/user.less in an editor --- src/theme-manager.coffee | 2 +- src/workspace-view.coffee | 2 ++ src/workspace.coffee | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index 0c38c1d12..b073a9b45 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -104,7 +104,7 @@ class ThemeManager if fs.isFileSync(stylesheetPath) stylesheetPath else - null + path.join(@configDirPath, 'user.less') #Private: unwatchUserStylesheet: -> diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index d29cdab0c..66e096e10 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -123,6 +123,8 @@ class WorkspaceView extends View @command 'core:save', => @saveActivePaneItem() @command 'core:save-as', => @saveActivePaneItemAs() + @command 'open-your-stylesheet', => @model.openUserStylesheet() + # Private: handleFocus: (e) -> if @getActivePane() diff --git a/src/workspace.coffee b/src/workspace.coffee index 34cc77dd2..37a2a6584 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -38,6 +38,10 @@ class Workspace extends Model paneContainer: @paneContainer.serialize() fullScreen: atom.isFullScreen() + # Private: Open ~/.atom/user.less or ~/.atom.user.css + openUserStylesheet: -> + @open(atom.themes.getUserStylesheetPath()) + # Public: Asynchronously opens a given a filepath in Atom. # # * filePath: A file path