Previously, when `setModel` was called, we forgot to update the pointer
to the component in the newly supplied editor. This was causing the
element to not update in response to model updates but only as a result
of focus or visibility changes. We suspect this regressed during the
rewrite of the editor rendering layer.
With this commit we will now correctly swap the element's underlying
editor by updating the component pointer on the newly supplied editor.
Also, if the element was already attached to another editor, we will
null out the component reference on it, because one instance of
`TextEditorElement` can only represent one instance of `TextEditor`.
These events will only be fired a single time at most, so we should clean up the listeners after that.
This should help minimize accidental memory leaks.
This commit uses a new private API on Workspace that emits an event
every time the window title gets updated (e.g. as a result of an active
pane item changing, the project paths changing, etc.).
This fixes a bug that left the custom title bar with a stale
document.title under some circumstances.
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Previously, we were mistakenly not clearing out some styling properties
like `marginTop`, thus causing e.g. line numbers to be misaligned. This
was caused by manual updates to an element's style object, without a
consequent update to the NodePool.
With this commit we will now rely on `element.styleMap` (a DOM
primitive) to detect which styles have been set on a element that is
about to be recycled and, if the object being created doesn't use them,
simply clear them out.
Before rendering block decorations, we read their heights by putting
them into a special div called `blockDecorationMeasurementsArea`.
Previously, this div was not explicitly sized, which was causing
decorations to wrap while being measured but not when actually rendering
them.
This commit fixes this inconsistency by explicitly styling the
measurement area so that it has the same width as the component scroll
width.
Changed "Close" to "Force Close" because "Close" might imply closing the Alert/Dialog instead of the editor, whereas "Force Close" better describes the action that button will take.
By the time that the animation frame is delivered, the requested
autoscroll
position could not exist anymore. This could cause the editor component
to measure a non-existent line and, as a result, throw an exception.
With this commit we will always ignore measurements for screen lines
that do not exist.