From 4d314f99acc2fb848daa1ef78993a2317aac0a4e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 9 May 2013 17:14:21 -0600 Subject: [PATCH] Eliminate ScreenLine.bufferRows property Previously, we used bufferRows to determine how many buffer rows were spanned by the screen line in the event it was folded. Now that we have RowMap, screen lines don't need to serve this purpose. We still need to know if a screen line is wrapped, which we solve via setting the lineEnd property to null for a soft-wrapped screen line. --- src/app/screen-line.coffee | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/screen-line.coffee b/src/app/screen-line.coffee index 3bac61dcf..4899be30c 100644 --- a/src/app/screen-line.coffee +++ b/src/app/screen-line.coffee @@ -4,14 +4,13 @@ _ = require 'underscore' module.exports = class ScreenLine - constructor: ({tokens, @lineEnding, @ruleStack, @bufferRows, @startBufferColumn, @fold, tabLength}) -> + constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, tabLength}) -> @tokens = @breakOutAtomicTokens(tokens, tabLength) - @bufferRows ?= 1 @startBufferColumn ?= 0 @text = _.pluck(@tokens, 'value').join('') copy: -> - new ScreenLine({@tokens, @ruleStack, @bufferRows, @startBufferColumn, @fold}) + new ScreenLine({@tokens, @ruleStack, @startBufferColumn, @fold, @lineEnding}) clipScreenColumn: (column, options={}) -> return 0 if @tokens.length == 0 @@ -75,10 +74,9 @@ class ScreenLine leftFragment = new ScreenLine( tokens: leftTokens - bufferRows: 0 startBufferColumn: @startBufferColumn ruleStack: @ruleStack - lineEnding: @lineEnding + lineEnding: null ) rightFragment = new ScreenLine( tokens: rightTokens @@ -89,7 +87,7 @@ class ScreenLine [leftFragment, rightFragment] isSoftWrapped: -> - @bufferRows == 0 + @lineEnding is null tokenAtBufferColumn: (bufferColumn) -> delta = 0