mirror of
https://github.com/atom/atom.git
synced 2026-02-06 20:55:33 -05:00
23 lines
656 B
CoffeeScript
23 lines
656 B
CoffeeScript
{View, $$$} = require 'space-pen'
|
|
|
|
$ = require 'jquery'
|
|
_ = require 'underscore'
|
|
|
|
module.exports =
|
|
class Gutter extends View
|
|
@content: ->
|
|
@div class: 'gutter', =>
|
|
@div outlet: 'lineNumbers', class: 'wtf'
|
|
|
|
renderLineNumbers: (startScreenRow, endScreenRow) ->
|
|
editor = @parentView
|
|
lastScreenRow = -1
|
|
rows = editor.bufferRowsForScreenRows(startScreenRow, endScreenRow)
|
|
|
|
@lineNumbers[0].innerHTML = $$$ ->
|
|
for row in rows
|
|
@div {class: 'line-number'}, if row == lastScreenRow then '•' else row + 1
|
|
lastScreenRow = row
|
|
|
|
@lineNumbers.width(editor.buffer.getLastRow().toString().length * editor.charWidth)
|