"Scroll" gutter by relatively positioning its line numbers

This matches how we scroll lines, and eliminates opportunities for the gutter to get out of sync with the lines. If that happened, it would probably be a bug, but this at least eliminates one source of confusion when debugging.
This commit is contained in:
Nathan Sobo
2012-07-03 11:09:34 -06:00
parent e21d0a5d2a
commit 3ee7c0dc0f
4 changed files with 9 additions and 5 deletions

View File

@@ -413,7 +413,7 @@ class Editor extends View
@updateRenderedLines() if @attached
@renderedLines.css('top', -scrollTop)
@gutter.scrollTop(scrollTop)
@gutter.lineNumbers.css('top', -scrollTop)
if options?.adjustVerticalScrollbar ? true
@verticalScrollbar.scrollTop(scrollTop)

View File

@@ -7,7 +7,7 @@ module.exports =
class Gutter extends View
@content: ->
@div class: 'gutter', =>
@div outlet: 'lineNumbers', class: 'wtf'
@div outlet: 'lineNumbers', class: 'line-numbers'
editor: ->
editor = @parentView