Add toggle ignored files command

This commit is contained in:
Will Farrington
2012-11-09 12:05:14 -08:00
parent 1ea8df6e60
commit ee51e2ea0c
3 changed files with 11 additions and 3 deletions

View File

@@ -154,6 +154,7 @@ class Editor extends View
'editor:toggle-line-comments': @toggleLineCommentsInSelection
'editor:log-cursor-scope': @logCursorScope
'editor:checkout-head-revision': @checkoutHead
'editor:toggle-ignored-files': @toggleIgnoredFiles
documentation = {}
for name, method of editorBindings
@@ -953,6 +954,9 @@ class Editor extends View
toggleLineCommentsInSelection: ->
@activeEditSession.toggleLineCommentsInSelection()
toggleIgnoredFiles: ->
@rootView().toggleIgnoredFiles()
logRenderedLines: ->
@renderedLines.find('.line').each (n) ->
console.log n, $(this).text()

View File

@@ -15,7 +15,7 @@ class Project
autoIndent: true
softTabs: true
softWrap: false
hideIgnoredFiles: false
hideIgnoredFiles: true
rootDirectory: null
editSessions: null
ignoredPathRegexes: null
@@ -79,7 +79,7 @@ class Project
for regex in @ignoredPathRegexes
return true if path.match(regex)
return true if @repo.isPathIgnored(path)
return true if @hideIgnoredFiles and @repo.isPathIgnored(path)
return false
@@ -94,7 +94,7 @@ class Project
return true if name is ignored
for regex in @ignoredPathRegexes
return true if path.match(regex)
return true if @repo.isPathIgnored(path)
return true if @hideIgnoredFiles and @repo.isPathIgnored(path)
return false
@@ -117,6 +117,7 @@ class Project
getSoftWrap: -> @softWrap
setSoftWrap: (@softWrap) ->
toggleIgnoredFiles: -> @setHideIgnoredFiles(not @hideIgnoredFiles)
getHideIgnoredFiles: -> @hideIgnoredFiles
setHideIgnoredFiles: (@hideIgnoredFiles) ->

View File

@@ -182,6 +182,9 @@ class RootView extends View
@showInvisibles = showInvisibles
editor.setShowInvisibles(@showInvisibles) for editor in @getEditors()
toggleIgnoredFiles: ->
@project.toggleIgnoredFiles()
getEditors: ->
@panes.find('.pane > .editor').map(-> $(this).view()).toArray()