mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 18:24:09 +03:00
Style color of folded line numbers
This commit is contained in:
parent
4db876aed1
commit
8dbcefa932
@ -1730,6 +1730,11 @@ describe "Editor", ->
|
||||
fold.destroy()
|
||||
expect(editor.gutter.find('.line-number').length).toBe 13
|
||||
|
||||
it "styles folded line numbers", ->
|
||||
editor.createFold(3, 5)
|
||||
expect(editor.gutter.find('.line-number.fold').length).toBe 1
|
||||
expect(editor.gutter.find('.line-number.fold:eq(0)').text()).toBe '4'
|
||||
|
||||
describe "when the scrollView is scrolled to the right", ->
|
||||
it "adds a drop shadow to the gutter", ->
|
||||
editor.attachToDom()
|
||||
|
@ -307,6 +307,10 @@ class EditSession
|
||||
fold.destroy()
|
||||
@setCursorBufferPosition([fold.startRow, 0])
|
||||
|
||||
isFoldedAtBufferRow: (bufferRow) ->
|
||||
screenRow = @screenPositionForBufferPosition([bufferRow]).row
|
||||
@isFoldedAtScreenRow(screenRow)
|
||||
|
||||
isFoldedAtScreenRow: (screenRow) ->
|
||||
@lineForScreenRow(screenRow)?.fold?
|
||||
|
||||
|
@ -276,6 +276,7 @@ class Editor extends View
|
||||
destroyFold: (foldId) -> @activeEditSession.destroyFold(foldId)
|
||||
destroyFoldsContainingBufferRow: (bufferRow) -> @activeEditSession.destroyFoldsContainingBufferRow(bufferRow)
|
||||
isFoldedAtScreenRow: (screenRow) -> @activeEditSession.isFoldedAtScreenRow(screenRow)
|
||||
isFoldedAtBufferRow: (bufferRow) -> @activeEditSession.isFoldedAtBufferRow(bufferRow)
|
||||
|
||||
lineForScreenRow: (screenRow) -> @activeEditSession.lineForScreenRow(screenRow)
|
||||
linesForScreenRows: (start, end) -> @activeEditSession.linesForScreenRows(start, end)
|
||||
|
@ -58,16 +58,19 @@ class Gutter extends View
|
||||
@renderLineNumbers(renderFrom, renderTo) if performUpdate
|
||||
|
||||
renderLineNumbers: (startScreenRow, endScreenRow) ->
|
||||
rows = @editor().bufferRowsForScreenRows(startScreenRow, endScreenRow)
|
||||
editor = @editor()
|
||||
rows = editor.bufferRowsForScreenRows(startScreenRow, endScreenRow)
|
||||
|
||||
cursorScreenRow = @editor().getCursorScreenPosition().row
|
||||
cursorScreenRow = editor.getCursorScreenPosition().row
|
||||
@lineNumbers[0].innerHTML = $$$ ->
|
||||
for row in rows
|
||||
if row == lastScreenRow
|
||||
rowValue = '•'
|
||||
else
|
||||
rowValue = row + 1
|
||||
@div {class: 'line-number'}, rowValue
|
||||
classes = ['line-number']
|
||||
classes.push('fold') if editor.isFoldedAtBufferRow(row)
|
||||
@div rowValue, class: classes.join(' ')
|
||||
lastScreenRow = row
|
||||
|
||||
@calculateWidth()
|
||||
|
@ -43,10 +43,19 @@
|
||||
-webkit-animation-iteration-count: 1;
|
||||
}
|
||||
|
||||
.editor .fold {
|
||||
.editor .line.fold {
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
.editor .gutter .line-number.fold {
|
||||
color: #FBA0E3;
|
||||
opacity: .75;
|
||||
}
|
||||
|
||||
.editor .gutter .line-number.fold.cursor-line {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.editor .fold.selected {
|
||||
background-color: #244;
|
||||
}
|
||||
|
@ -46,10 +46,19 @@
|
||||
-webkit-animation-iteration-count: 1;
|
||||
}
|
||||
|
||||
.editor .fold {
|
||||
.editor .line.fold {
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
.editor .gutter .line-number.fold {
|
||||
color: #FBA0E3;
|
||||
opacity: .75;
|
||||
}
|
||||
|
||||
.editor .gutter .line-number.fold.cursor-line {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.editor .fold.selected {
|
||||
background-color: #244;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user