Register an overflowchanged event listener on the editor's scroll view
and update the width in chars when this event fires.
Closes#928Closes#961Closes#993
This version of telepath adds an `undo: 'combine'` option which becomes
the default for marker changes. With an undo strategy of 'combine', the
operation is only undone when combined in a transaction with other
operations that are undone. This prevents simple marker updates from
getting pushed to the undo stack.
This fixes a regression where multiple end of line invisibles were
displayed on empty lines when the indent guide was also enabled.
The invisibles array used to be shifted and not it isn't but the
entire array was still being iterated over causing extra invisibles
to be added to the line.
The test calls hiddenInput.focus(), but in reality, nothing external to
the editor can trigger this. I'd rather just have
bringHiddenInputIntoView() called in one place, but this is insurance.
This is slower than the position cache in the best case, but faster
in the worst and average case. With this, you can search for a space
in find and replace, and still scroll the buffer.
In editor.coffee, there are 10,500 spaces. To highlight all of them,
the previous cache method took 7 seconds, this takes 2 when the cache
is empty, and about 10ms when the entire file is cached.
We know it's visible if it is on the dom and doesn't have
display == none set. This is an order of magnitude faster than the
default implementation which calls getComputedStyle()
This is is faster and simpler than the old method. Running each function
20,000 times yielded these results:
Old: 3750ms
This method: 1523ms
By looking up each char's width in a dict: 29ms