Show ignored icon in status bar

This commit is contained in:
Kevin Sawicki
2013-03-25 11:52:16 -04:00
parent 9604d81ec8
commit 7756f8e86d
6 changed files with 26 additions and 2 deletions

View File

@@ -1 +0,0 @@
i am ignored

View File

@@ -114,6 +114,9 @@ class StatusBarView extends View
else if git.isStatusNew(status)
@gitStatusIcon.addClass('new-status-icon')
@gitStatusIcon.text("+#{@buffer.getLineCount()}")
else if git.isPathIgnored(path)
@gitStatusIcon.addClass('ignored-status-icon')
@gitStatusIcon.text('')
updatePathText: ->
if path = @editor.getPath()

View File

@@ -124,12 +124,14 @@ describe "StatusBar", ->
expect(statusBar.branchLabel.text()).toBe ''
describe "git status label", ->
[repo, path, originalPathText, newPath] = []
[repo, path, originalPathText, newPath, ignoredPath] = []
beforeEach ->
path = require.resolve('fixtures/git/working-dir/file.txt')
newPath = fs.join(fs.resolveOnLoadPath('fixtures/git/working-dir'), 'new.txt')
fs.write(newPath, "I'm new here")
ignoredPath = fs.join(fs.resolveOnLoadPath('fixtures/git/working-dir'), 'ignored.txt')
fs.write(ignoredPath, 'ignored.txt')
git.getPathStatus(path)
git.getPathStatus(newPath)
originalPathText = fs.read(path)
@@ -138,6 +140,7 @@ describe "StatusBar", ->
afterEach ->
fs.write(path, originalPathText)
fs.remove(newPath) if fs.exists(newPath)
fs.remove(ignoredPath) if fs.exists(ignoredPath)
it "displays the modified icon for a changed file", ->
fs.write(path, "i've changed for the worse")
@@ -153,6 +156,10 @@ describe "StatusBar", ->
rootView.open(newPath)
expect(statusBar.gitStatusIcon).toHaveClass('new-status-icon')
it "displays the ignored icon for an ignored file", ->
rootView.open(ignoredPath)
expect(statusBar.gitStatusIcon).toHaveClass('ignored-status-icon')
it "updates when a status-changed event occurs", ->
fs.write(path, "i've changed for the worse")
git.getPathStatus(path)

View File

@@ -57,6 +57,11 @@
content: "\f26b";
}
.status-bar .ignored-status-icon:before {
content: "\f099";
margin-right: 0px;
}
.status-bar .commits-behind-label:before {
margin-top: -3px;
margin-left: 3px;

View File

@@ -20,3 +20,8 @@
color: #5293d8;
display: inline-block;
}
.status-bar .git-status.octicons.ignored-status-icon {
color: #969696;
display: inline-block;
}

View File

@@ -14,6 +14,11 @@
display: inline-block;
}
.status-bar .git-status.octicons.ignored-status-icon {
color: #333;
display: inline-block;
}
.status-bar .grammar-name:hover {
color: #000;
border: 1px solid rgba(50, 50, 50, 0.2);