mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Add toggle ignored files command
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user