With the Electron upgrade, something changed in the way characters are
rendered/measured, and that was causing subpixel anti-aliasing to stop
working when cursors were at the end of the longest line.
Every cursor has a width that is calculated in the following way:
* If there's a character after the cursor, the width corresponds to
width of such character.
* Otherwise, the width equals to the "base character width" measured on
a dummy line.
In the latter case, even if we were setting the width of the content
container to account for the width of such cursor, some rounding problem
was causing the cursor to be able to escape the container and thus break
subpixel anti-aliasing.
With this commit, instead of rounding the value we assign to the
container width, we will always ceil it. This ensures that cursors are
always strictly contained within the parent element and resolves the
subpixel anti-aliasing issue.
This change fixes#13829 which reports that the `softWrapped` setting of
an untitled TextEditor is lost when the buffer is saved to a file. This
is caused by logic that updates TextEditor settings when the buffer's
language mode changes.
The fix is to preserve any TextEditor settings that would not change when
switching between the previous and current language mode of the buffer.
Previously, we would assign dock elements a minimum width/height of 2
pixels so that we could detect when the mouse approached the edge of a
hidden dock in order to show the chevron buttons. This, however, was
causing confusion for users, who expected that extra space to be
clickable in order to scroll editors located in the center dock.
With this commit we will instead register a global `mousemove` event on
the window right when attaching the workspace element to the DOM (the
event handler is debounced, so this shouldn't have any performance
consequence). Then, when mouse moves, we will programmatically detect
when it is approaching to the edge of a dock and show the chevron button
accordingly. This allows us to remove the `min-width` property from the
dock container element, which eliminates the confusing behavior
described above.