mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
Enable maxLineNumberDigits
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
TiledComponent = require './tiled-component'
|
||||
LineNumbersTileComponent = require './line-numbers-tile-component'
|
||||
WrapperDiv = document.createElement('div')
|
||||
DummyLineNumberComponent = new LineNumbersTileComponent(id: -1)
|
||||
DummyLineNumberComponent = LineNumbersTileComponent.createDummy()
|
||||
|
||||
module.exports =
|
||||
class LineNumberGutterComponent extends TiledComponent
|
||||
|
||||
@@ -3,6 +3,9 @@ WrapperDiv = document.createElement('div')
|
||||
|
||||
module.exports =
|
||||
class LineNumbersTileComponent
|
||||
@createDummy: ->
|
||||
new LineNumbersTileComponent({id: -1})
|
||||
|
||||
constructor: ({@id}) ->
|
||||
@lineNumberNodesById = {}
|
||||
@domNode = document.createElement("div")
|
||||
@@ -36,11 +39,11 @@ class LineNumbersTileComponent
|
||||
@oldTileState.top = @newTileState.top
|
||||
@oldTileState.left = @newTileState.left
|
||||
|
||||
# if @newState.maxLineNumberDigits isnt @oldState.maxLineNumberDigits
|
||||
# node.remove() for id, node of @lineNumberNodesById
|
||||
# @oldState.tiles[@id] = {lineNumbers: {}}
|
||||
# @oldTileState = @oldState.tiles[@id]
|
||||
# @lineNumberNodesById = {}
|
||||
if @newState.maxLineNumberDigits isnt @oldState.maxLineNumberDigits
|
||||
node.remove() for id, node of @lineNumberNodesById
|
||||
@oldState.tiles[@id] = {lineNumbers: {}}
|
||||
@oldTileState = @oldState.tiles[@id]
|
||||
@lineNumberNodesById = {}
|
||||
|
||||
if @newState.scrollWidth isnt @oldState.scrollWidth
|
||||
@domNode.style.width = @newState.scrollWidth + 'px'
|
||||
|
||||
Reference in New Issue
Block a user