Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Optimize DisplayLayer's memory usage by storing transformations in a Patch #185

Merged
merged 160 commits into from
Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
c45598b
Start on a new DisplayLayer implement in terms of Patch to save memory
Nov 4, 2016
d0ee67f
Implement getText for hard tabs
Nov 4, 2016
25b5f31
Start work on soft wraps
maxbrunsfeld Nov 7, 2016
a2dd130
Handle soft wraps in getScreenLines
maxbrunsfeld Nov 7, 2016
1decd90
Add skipSoftWrapIndentation option that overrides backward clipDirection
Nov 7, 2016
07e1fec
Assign characterWidth to 0 at end of buffer line
Nov 7, 2016
ec69919
Disallow non-positive soft wrap column parameters
Nov 7, 2016
6215c6e
Cover edge cases of soft wrapping
Nov 7, 2016
f79ecbd
Support creating and destroying individual folds
Nov 17, 2016
5cb2779
Handle folds containing / contained by other folds
Nov 17, 2016
fbcdbbe
Allow adjacent folds
Nov 18, 2016
5c5614b
Update full screen lines and buffer lines in spatial index
Nov 18, 2016
d248917
Implement DisplayLayer.destroyFoldsIntersectingBufferRange
Nov 18, 2016
35c867d
Implement DisplayLayer.copy
Nov 18, 2016
bdf0dd5
Add DisplayLayer.destroyAllFolds
Nov 18, 2016
e74e54e
Temporarily use JS patch implementation in History and TextBuffer
Nov 18, 2016
d549eaa
Don’t consult buffer when finding following boundaries
Nov 18, 2016
c53aad0
Add DisplayLayer.foldsIntersectingBufferRange
Nov 18, 2016
f3c6da5
Start handling changes to the buffer in new DisplayLayer implementation
Nov 18, 2016
79ac94a
Push open/close tags for hard tabs, leading whitespace
Nov 18, 2016
149afa8
WIP: Push close/open tags when flags for current token change
Nov 19, 2016
49aec84
Improve failure message
Nov 19, 2016
13c9bff
Remove incorrect assertions from DisplayLayer tests
Nov 19, 2016
5e0cd66
Handle leading/trailing whitespace and all types of invisibles
Nov 19, 2016
6d8b21d
Get folds + invisibles test passing
maxbrunsfeld Nov 21, 2016
38f33d1
Clip to the start or end of atomic soft tabs
Nov 28, 2016
397efe3
Render indent guides on non-empty lines
Nov 28, 2016
b334020
Render indent guides for blank lines
Nov 29, 2016
2c501fe
Push to tagCodes array if needed when soft wrapping
Nov 29, 2016
f197a05
Render indent guides inside soft wrap indentation whitespace
Nov 29, 2016
2d65c81
Resume trailing whitespace decorations on soft-wrapped line segments
Nov 29, 2016
f3167b7
Remove tests of soft wrap descriptor API
Nov 29, 2016
43d9261
Don't clip atomic tabs if `fold` is false in translateBufferPosition
Nov 29, 2016
3a9786d
Clip atomic soft tabs in translateScreenPosition
Nov 29, 2016
8ca717a
Simplify getAtomicSoftTabColumnDelta
Nov 29, 2016
39f6979
Handle paired characters
Nov 29, 2016
56abd8d
Handle folds when translating buffer positions
maxbrunsfeld Nov 29, 2016
ee02eee
Constrain end row argument to getScreenLines
maxbrunsfeld Nov 29, 2016
d341097
Emit change events from DisplayLayer
maxbrunsfeld Nov 29, 2016
0e77550
Add DisplayMarkerLayer APIs to new DisplayLayer
Nov 29, 2016
2b9a873
Use exclusive end row when updating spatial index after destroying folds
Nov 30, 2016
fc9359d
Integrate empty line handling into main loop
Nov 30, 2016
5edf45d
Only call isCharacterPair with non-null values
Nov 30, 2016
6894d4e
WIP: Add method stubs for integration into Atom
Nov 30, 2016
d6a668f
Account for tabs when incrementing screenLineWidth
Nov 30, 2016
1d26950
Deal with patch hunks before any further processing of a character
Nov 30, 2016
3b12dff
Terminate pending tab sequences at soft wrap boundaries
Nov 30, 2016
645d148
Extract translation methods for internal use that don't clip via buffer
Nov 30, 2016
5797f86
Dissallow non-positive soft wrap columns
Nov 30, 2016
da0249c
Remove stray debugger
maxbrunsfeld Nov 30, 2016
08e54f2
Account for folds at screen column 0 in findBoundaryPrecedingBufferRow
maxbrunsfeld Nov 30, 2016
ca81453
Don't assert that lineLengthForScreenRow includes EOL invisibles
maxbrunsfeld Nov 30, 2016
ddb7594
Expand change events to include empty lines (for indent guides)
maxbrunsfeld Nov 30, 2016
48db8da
Remove coffee-script artifact
maxbrunsfeld Nov 30, 2016
538d4c6
Extract ScreenLineBuilder object from DisplayLayer
maxbrunsfeld Nov 30, 2016
1653537
Convert tagCodes and currentTokenLength to instance variables
Dec 1, 2016
a47bcc5
Emit pending token boundaries when emitting open/close tags
Dec 1, 2016
6e45b45
Don't open/close blank tags, but still push a token boundary
Dec 1, 2016
e1df2f6
Clean up tag emitting
Dec 1, 2016
98ae6cd
Extract emitText method
Dec 1, 2016
2a34c00
Extract emitNewline method
Dec 1, 2016
08263a7
Extract emitEOLInvisible
Dec 1, 2016
f27101c
Extract emitIndentWhitespace
Dec 1, 2016
687727b
Cleanup
Dec 1, 2016
aca9b44
Extract emitHardTab method
Dec 1, 2016
c75c118
Cleanup
Dec 1, 2016
2893371
Extract updateCurrentTokenFlags
Dec 1, 2016
6fce55c
Extract emitSoftWrap and emitFold
Dec 1, 2016
b053411
Cleanup
Dec 1, 2016
ccf5129
Extract emitLineEnding
Dec 1, 2016
b159123
Cleanup
Dec 1, 2016
4106549
Cleanup
Dec 1, 2016
3202e7e
Keep one ScreenLineBuilder instance per DisplayLayer
Dec 1, 2016
81375bc
Improve flag variable names
Dec 1, 2016
7e85d6b
Add caching of screen lines and rightmost screen position
maxbrunsfeld Dec 2, 2016
292f936
Rebalance Patch after DisplayLayer reset
maxbrunsfeld Dec 2, 2016
a208083
Start adding support for text decoration layers
maxbrunsfeld Dec 3, 2016
670113c
Fix lint errors
Dec 3, 2016
56707a4
Handle async range invalidations from TextDecorationLayers
Dec 3, 2016
d0797a8
Fix more lint errors
Dec 3, 2016
3246389
Fix lint error
Dec 5, 2016
3630b74
Install yargs dev dependency
Dec 5, 2016
9393041
Make test script independent of path variable
Dec 5, 2016
76bd88d
Make onDidInvalidateRange optional on text decoration layers
Dec 5, 2016
58aeac1
WIP get invalidated ranges
Dec 5, 2016
838f194
Emit empty tokens when necessary
Dec 5, 2016
9f43172
Don't reopen tags prior to EOL invisibles
Dec 5, 2016
fb09bcb
Handle close tags immediately following open tags by pushing a 0
Dec 5, 2016
41f98d3
Fix reversed comparison
Dec 5, 2016
3bbaf75
Clean up invalidation composition range adjustment
Dec 5, 2016
3aeb5d6
Avoid reopening containing tags when emitting indent whitespace
maxbrunsfeld Dec 6, 2016
4b84517
Expand decoration layers' invalidated ranges to screen line boundaries
maxbrunsfeld Dec 6, 2016
ee793d6
Fix random tests
Dec 6, 2016
d68f3f2
Assign tagsToReopen when seeking decoration iterator
Dec 6, 2016
2659e55
Catch up the decoration iterator at the start of screen lines
Dec 6, 2016
bab90af
Use spliceArray
Dec 6, 2016
d1a640c
Use for loops to prevent deoptimization in hot code path
Dec 6, 2016
df4fdc1
Rename translation methods WithoutBufferClipping -> WithoutReadingBuffer
maxbrunsfeld Dec 6, 2016
c72906b
Populate the spatial index in idle callbacks
maxbrunsfeld Dec 7, 2016
ce3e86b
Rebalance DisplayLayer's spatial index after indexing the entire buffer
maxbrunsfeld Dec 7, 2016
159441d
Avoid unnecessary work in populateSpatialIndexIfNeeded
maxbrunsfeld Dec 7, 2016
31b472f
Fix invalidation event
Dec 7, 2016
5b108c2
Don't store tab sequences in the spatial index
Dec 7, 2016
9e56a1b
Adjust test for decoration boundaries beyond the end of lines
Dec 7, 2016
f1278ec
:art:
Dec 7, 2016
339b9ee
Return empty array of screen lines when passing a screen row off the end
Dec 7, 2016
c8d542c
Use new native Patch implementation everywhere
Dec 9, 2016
9b8cca7
Allow soft wraps immediately following folds
Dec 12, 2016
d896d48
Fix edge case with soft wraps between adjacent folds at column 1
Dec 12, 2016
5c19306
Remove logging
Dec 12, 2016
be0e8a7
:arrow_up: atom-patch
maxbrunsfeld Dec 12, 2016
d78440f
Pass clipDirection and skipSoftWrapIndentation to recursive call
Dec 12, 2016
aaeb1c0
Always clip forward when finding following boundary
Dec 12, 2016
db4678c
Run randomized tests within a single it to save memory
Dec 12, 2016
3f0d0c3
Fix path to jasmine
Dec 12, 2016
a82c060
Fix interactions between hard tabs, soft wraps, and folds
maxbrunsfeld Dec 12, 2016
cced7e9
Remove stray debugger
maxbrunsfeld Dec 12, 2016
df0dd25
Add randomized test of position translations and fix failures
Dec 12, 2016
3e3bfb0
Fix lint errors
Dec 12, 2016
45a00a6
Constrain to EOF when row is beyond end
Dec 12, 2016
4659f37
Don't clip when between atomic soft tabs
Dec 13, 2016
0a3efc3
Bump serialization version
Dec 13, 2016
6183339
Clear all computed DisplayLayer state in reset
maxbrunsfeld Dec 13, 2016
fcb7dc8
Create fold markers with {invalidate: 'overlap', exclusive: true}
Dec 13, 2016
0969f41
Add DisplayLayer.bufferRangeForFold
Dec 13, 2016
e1ea80c
Track tab counts correctly for soft wrapped lines
Dec 13, 2016
06b4b76
Update expanded/unexpanded columns separately when wrapping
Dec 13, 2016
6081ecb
Improve failure message
Dec 13, 2016
fc2cbd7
Fix getComputedScreenLineCount to not force all lines to be scanned
Dec 13, 2016
f356656
Test display layer's partially-indexed state in randomized tests
maxbrunsfeld Dec 13, 2016
b9f3821
Remove extra spatial indexing in buildScreenLines
maxbrunsfeld Dec 13, 2016
d644a61
Fix retrieval of partially-cached runs of soft-wrapped screen lines
maxbrunsfeld Dec 13, 2016
150f583
Validate getScreenLines with random row ranges
maxbrunsfeld Dec 13, 2016
641e5f0
Always cache all screen lines for a given buffer line
maxbrunsfeld Dec 13, 2016
ddfaae5
Remove logic for handling partially cached buffer lines
maxbrunsfeld Dec 13, 2016
f53d3b4
Avoid infinite loop in findBoundaryFollowingScreenRow
maxbrunsfeld Dec 13, 2016
67cf382
In buildScreenLines, always start at a boundary screen row
maxbrunsfeld Dec 13, 2016
e1e3755
Fix off-by-one error when handling decoration invalidation events
maxbrunsfeld Dec 13, 2016
15ccd70
Surround EOLs and indent guides with containing decoration tags
maxbrunsfeld Dec 14, 2016
4b0003d
Fix off-by-one error in getClipColumnDelta
maxbrunsfeld Dec 14, 2016
e639721
Merge remote-tracking branch 'origin/master' into mb-use-less-memory-…
maxbrunsfeld Dec 14, 2016
1acc409
Prevent error if reset is called on a destroyed DisplayLayer
maxbrunsfeld Dec 14, 2016
fb96877
Fix lint error
maxbrunsfeld Dec 14, 2016
48d2321
9.4.4-0
maxbrunsfeld Dec 14, 2016
19c370c
Copy js sources to lib in compile step
maxbrunsfeld Dec 14, 2016
a28d71f
10.0.0-0
maxbrunsfeld Dec 14, 2016
c9a4ed3
Remove old DisplayLayer implementation
maxbrunsfeld Dec 14, 2016
fef3e0a
Check for invalid points in translateScreenPosition
maxbrunsfeld Dec 14, 2016
95e81ea
10.0.0-1
maxbrunsfeld Dec 14, 2016
514b0af
Optimize DisplayLayer.copy by copying the patch
maxbrunsfeld Dec 15, 2016
0b94342
Avoid unnecessarily re-populating spatial index in DisplayLayer.reset
maxbrunsfeld Dec 15, 2016
22c3b99
:arrow_up: atom-patch
maxbrunsfeld Dec 15, 2016
1e1da5a
10.0.0-2
maxbrunsfeld Dec 15, 2016
199e82b
Fix lint errors
maxbrunsfeld Dec 15, 2016
bcecbd1
10.0.0-3
maxbrunsfeld Dec 15, 2016
8d1dc8e
Add missing change check when setting showIndentGuides
maxbrunsfeld Dec 15, 2016
345d7eb
10.0.0-4
maxbrunsfeld Dec 15, 2016
6bd5ce6
Remove old Patch implementation
maxbrunsfeld Dec 15, 2016
1f4c959
10.0.0-5
maxbrunsfeld Dec 15, 2016
13aea79
10.0.0
maxbrunsfeld Dec 15, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "text-buffer",
"version": "9.4.3",
"version": "10.0.0",
"description": "A container for large mutable strings with annotated regions",
"main": "./lib/text-buffer",
"scripts": {
"prepublish": "npm run clean && npm run compile && npm run lint && npm run atomdoc",
"atomdoc": "grunt shell:update-atomdoc atomdoc",
"clean": "grunt clean",
"compile": "coffee --no-header --output lib --compile src",
"compile": "coffee --no-header --output lib --compile src && cp src/*.js lib/",
"lint": "coffeelint -r src spec && eslint src spec",
"test": "node script/test",
"ci": "npm run compile && npm run lint && npm run test && npm run bench",
Expand Down Expand Up @@ -43,10 +43,10 @@
"random-seed": "^0.2.0",
"rimraf": "~2.2.2",
"temp": "^0.8.3",
"yargs": "^6.3.0"
"yargs": "^6.5.0"
},
"dependencies": {
"atom-patch": "0.3.0",
"atom-patch": "1.0.3",
"buffer-offset-index": "0.0.1",
"delegato": "^1.0.0",
"diff": "^2.2.1",
Expand Down
5 changes: 3 additions & 2 deletions script/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

const childProcess = require('child_process')
const path = require('path')

const argv =
require('yargs')
Expand Down Expand Up @@ -33,7 +34,7 @@ if (argv.rebuild) {

// Run tests
if (argv.interactive) {
childProcess.spawnSync('electron', ['spec/support/runner', 'spec/**/*-spec.*'], {stdio: 'inherit'})
childProcess.spawnSync('./node_modules/.bin/electron', ['spec/support/runner', 'spec/**/*-spec.*'], {stdio: 'inherit', cwd: path.join(__dirname, '..')})
} else {
childProcess.spawnSync('jasmine', ['--captureExceptions', '--forceexit'], {stdio: 'inherit'})
childProcess.spawnSync('./node_modules/.bin/jasmine', ['--captureExceptions', '--forceexit', '--stop-on-failure=true'], {stdio: 'inherit'})
}
Loading