Observe the config from tree view to show/hide git-ignored files

This commit is contained in:
Kevin Sawicki & Nathan Sobo
2012-12-12 18:19:21 -08:00
parent 0a1b389994
commit 49d817a9c4
6 changed files with 26 additions and 35 deletions

View File

@@ -15,7 +15,6 @@ class Project
autoIndent: true
softTabs: true
softWrap: false
hideIgnoredFiles: false
rootDirectory: null
editSessions: null
ignoredPathRegexes: null
@@ -71,7 +70,7 @@ class Project
@ignoreRepositoryPath(path)
ignoreRepositoryPath: (path) ->
@hideIgnoredFiles and @repo.isPathIgnored(fs.join(@getPath(), path))
config.core.hideGitIgnoredFiles and @repo.isPathIgnored(fs.join(@getPath(), path))
resolve: (filePath) ->
filePath = fs.join(@getPath(), filePath) unless filePath[0] == '/'
@@ -89,10 +88,6 @@ class Project
getSoftWrap: -> @softWrap
setSoftWrap: (@softWrap) ->
toggleIgnoredFiles: -> @setHideIgnoredFiles(not @hideIgnoredFiles)
getHideIgnoredFiles: -> @hideIgnoredFiles
setHideIgnoredFiles: (@hideIgnoredFiles) ->
buildEditSessionForPath: (filePath, editSessionOptions={}) ->
@buildEditSession(@bufferForPath(filePath), editSessionOptions)

View File

@@ -90,7 +90,9 @@ class RootView extends View
@command 'window:toggle-invisibles', =>
config.editor.showInvisibles = not config.editor.showInvisibles
config.update()
@command 'window:toggle-ignored-files', => @toggleIgnoredFiles()
@command 'window:toggle-ignored-files', =>
config.core.hideGitIgnoredFiles = not config.core.hideGitIgnoredFiles
config.update()
afterAttach: (onDom) ->
@focus() if onDom
@@ -198,9 +200,6 @@ class RootView extends View
updateWindowTitle: ->
document.title = @title
toggleIgnoredFiles: ->
@project.toggleIgnoredFiles()
getEditors: ->
@panes.find('.pane > .editor').map(-> $(this).view()).toArray()