Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

pulsar-edit/line-length-index

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is archived under Pulsar due to no longer being in use. This module was remove from atom/text-buffer in atom/text-buffer#181.

line-length-index

This is a module used by Atom to keep track of the row with the longest line length.

Example

let lineLengthIndex = new LineLengthIndex()

// Splice at a start row with a replacement row count
// and an array of line lengths...
lineLengthIndex.splice(0, 0, [10, 40, 10, 50, 10])

// Now you can efficiently query the point at the end of the longest row
lineLengthIndex.getPointWithMaxLineLength() // => {row: 3, column: 50}

// As text changes, you can splice in new rows
lineLengthIndex.splice(2, 2, [30, 20])

// And the max row is available...
lineLengthIndex.getPointWithMaxLineLength() // => {row: 1, column: 40}

About

🔒

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Languages

  • JavaScript 100.0%