mirror of
https://github.com/atom/atom.git
synced 2026-02-06 12:44:59 -05:00
Add octicon to branch label
This commit is contained in:
committed by
Corey Johnson
parent
88cdff9d26
commit
e4fb12a398
@@ -22,7 +22,11 @@ class StatusBar extends View
|
||||
@div class: 'file-info', =>
|
||||
@div class: 'current-path', outlet: 'currentPath'
|
||||
@div class: 'buffer-modified', outlet: 'bufferModified'
|
||||
@div class: 'cursor-position', outlet: 'cursorPosition'
|
||||
@div class: 'cursor-position', =>
|
||||
@span outlet: 'branchArea', =>
|
||||
@span '\uf020', class: 'octicons'
|
||||
@span class: 'branch-label', outlet: 'branchLabel'
|
||||
@span outlet: 'cursorPosition'
|
||||
|
||||
initialize: (@rootView, @editor) ->
|
||||
@updatePathText()
|
||||
@@ -58,6 +62,9 @@ class StatusBar extends View
|
||||
|
||||
updateCursorPositionText: ->
|
||||
{ row, column } = @editor.getCursorBufferPosition()
|
||||
cursorText = "#{row + 1},#{column + 1}"
|
||||
cursorText = "(#{@head}) #{cursorText}" if @head
|
||||
@cursorPosition.text(cursorText)
|
||||
if @head
|
||||
@branchArea.show()
|
||||
@branchLabel.text(@head)
|
||||
else
|
||||
@branchArea.hide()
|
||||
@cursorPosition.text("#{row + 1},#{column + 1}")
|
||||
|
||||
Reference in New Issue
Block a user