Allow the screen row count of N-screen:1-buffer mappings to be updated

This commit is contained in:
Nathan Sobo
2013-05-07 17:56:09 -06:00
parent 5c74a02688
commit 1895e8143d
2 changed files with 24 additions and 1 deletions

View File

@@ -21,7 +21,13 @@ class RowMap
mapBufferRowRange: (startBufferRow, endBufferRow, screenRows) ->
{ mapping, index, bufferRow } = @traverseToBufferRow(startBufferRow)
throw new Error("Invalid mapping insertion") if mapping and mapping.bufferRows != mapping.screenRows
if mapping and mapping.bufferRows != mapping.screenRows
if bufferRow == startBufferRow and bufferRow + mapping.bufferRows == endBufferRow
mapping.screenRows = screenRows
return
else
throw new Error("Invalid mapping insertion")
padBefore = startBufferRow - bufferRow
padAfter = (bufferRow + mapping?.bufferRows) - endBufferRow