mirror of
https://github.com/atom/atom.git
synced 2026-02-08 21:55:05 -05:00
WIP: Testing changes that cause lines to wrap
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
_ = require 'underscore'
|
||||
Point = require 'point'
|
||||
EventEmitter = require 'event-emitter'
|
||||
Point = require 'point'
|
||||
Range = require 'range'
|
||||
|
||||
getWordRegex = -> /\b[^\s]+/g
|
||||
|
||||
@@ -11,7 +12,9 @@ class LineWrapper
|
||||
@buildWrappedLines()
|
||||
@highlighter.on 'change', (e) =>
|
||||
@wrappedLines[e.oldRange.start.row] = @buildWrappedLineForBufferRow(e.newRange.start.row)
|
||||
@trigger 'change', e
|
||||
oldRange = @screenRangeFromBufferRange(e.oldRange)
|
||||
newRange = @screenRangeFromBufferRange(e.newRange)
|
||||
@trigger 'change', { oldRange, newRange }
|
||||
|
||||
setMaxLength: (@maxLength) ->
|
||||
@buildWrappedLines()
|
||||
@@ -58,6 +61,12 @@ class LineWrapper
|
||||
|
||||
{ screenLines }
|
||||
|
||||
|
||||
screenRangeFromBufferRange: (bufferRange) ->
|
||||
start = @screenPositionFromBufferPosition(bufferRange.start)
|
||||
end = @screenPositionFromBufferPosition(bufferRange.end)
|
||||
new Range(start,end)
|
||||
|
||||
screenPositionFromBufferPosition: (bufferPosition) ->
|
||||
bufferPosition = Point.fromObject(bufferPosition)
|
||||
row = 0
|
||||
|
||||
Reference in New Issue
Block a user