mirror of
https://github.com/atom/atom.git
synced 2026-01-14 17:38:03 -05:00
Show ignored icon in status bar
This commit is contained in:
1
spec/fixtures/git/working-dir/ignored.txt
vendored
1
spec/fixtures/git/working-dir/ignored.txt
vendored
@@ -1 +0,0 @@
|
||||
i am ignored
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -20,3 +20,8 @@
|
||||
color: #5293d8;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.status-bar .git-status.octicons.ignored-status-icon {
|
||||
color: #969696;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user