Hide the cursor when it is on a fold line

This commit is contained in:
Nathan Sobo
2012-05-25 12:35:32 -07:00
parent ce5a31b5a2
commit e2ca3814a9
3 changed files with 14 additions and 3 deletions

View File

@@ -177,4 +177,9 @@ class Cursor extends View
if this == _.last(@editor.getCursors())
@editor.scrollTo(pixelPosition)
if @editor.isFoldedAtScreenRow(screenPosition.row)
@hide()
else
@show()
@selection.updateAppearance()

View File

@@ -343,7 +343,6 @@ class Editor extends View
screenRow = @firstRenderedScreenRow + i
element = @lineElementForScreenRow(screenRow)
if @compositeSelection.intersectsBufferRange(fold.getBufferRange())
element.addClass('selected')
else
element.removeClass('selected')
@@ -363,6 +362,9 @@ class Editor extends View
getLastScreenRow: ->
@screenLineCount() - 1
isFoldedAtScreenRow: (screenRow) ->
@screenLineForRow(screenRow).fold?
destroyFoldsContainingBufferRow: (bufferRow) ->
@renderer.destroyFoldsContainingBufferRow(bufferRow)