mirror of
https://github.com/atom/atom.git
synced 2026-02-09 22:24:59 -05:00
Fix bug where you can't move rightward over fold placeholders
Fold placeholders needed to be real token objects so their screen / buffer deltas would be defined in ScreenLineFragment.proto.translateColumn
This commit is contained in:
@@ -57,7 +57,7 @@ class Point
|
||||
|
||||
isEqual: (other) ->
|
||||
other = Point.fromObject(other)
|
||||
@compare(other) == 0
|
||||
@row == other.row and @column == other.column
|
||||
|
||||
isLessThan: (other) ->
|
||||
@compare(other) < 0
|
||||
@@ -75,4 +75,4 @@ class Point
|
||||
"(#{@row}, #{@column})"
|
||||
|
||||
toString: ->
|
||||
"#{@row},#{@column}"
|
||||
"#{@row},#{@column}"
|
||||
|
||||
@@ -6,6 +6,7 @@ EventEmitter = require 'event-emitter'
|
||||
Range = require 'range'
|
||||
Fold = require 'fold'
|
||||
ScreenLineFragment = require 'screen-line-fragment'
|
||||
Token = require 'token'
|
||||
foldPlaceholderLength = 3
|
||||
|
||||
module.exports =
|
||||
@@ -193,7 +194,7 @@ class Renderer
|
||||
folds.sort (a, b) -> a.compare(b)
|
||||
|
||||
buildFoldPlaceholder: (fold) ->
|
||||
token = { value: '...', type: 'fold-placeholder', fold, isAtomic: true }
|
||||
token = new Token(value: '...', type: 'fold-placeholder', fold: fold, isAtomic: true)
|
||||
new ScreenLineFragment([token], token.value, [0, token.value.length], fold.getRange().toDelta())
|
||||
|
||||
screenLineRangeForBufferRange: (bufferRange) ->
|
||||
|
||||
@@ -4,7 +4,7 @@ class Token
|
||||
type: null
|
||||
isAtomic: null
|
||||
|
||||
constructor: ({@value, @type, @isAtomic, @bufferDelta}) ->
|
||||
constructor: ({@value, @type, @isAtomic, @bufferDelta, @fold}) ->
|
||||
@screenDelta = @value.length
|
||||
@bufferDelta ?= @screenDelta
|
||||
|
||||
|
||||
Reference in New Issue
Block a user