This prevents the parent tile from disabling sub-pixel anti-aliasing.
For some reason, adding `overflow: hidden` to the cursor container
element doesn't solve the issue, so we're adding this workaround
instead.
When using DPI scaling the scroll position could be set to a position
that
was not possible causing a scroll event to scroll back. This was causing
the editor to shake when editing. This PR fixes
this by rounding scrollTop and scrollLeft to a physical pixel instead of
rounding using Math.round
Co-authored-by: Antonio Scandurra <as-cii@github.com>
This change fixes an issue where users on Linux are able to paste into
read only TextEditors by clicking the middle mouse button. The fix is
to check for whether the TextEditorComponent's isInputEnabled method
returns true before pasting with middle click on Linux.
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 fixes a bug most likely introduced with #16511 by ensuring that UI
elements (such as selections) never cover up the text.
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit reverts a portion of the changes introduced in
9eac520e6a. Prior to that commit, we were
setting the tabIndex to -1 on the atom-text-editor element. This commit
restores that behavior.
Instead of setting a custom tab index directly on the atom-text-editor
element, we instead set the tabIndex on the input element *inside* the
atom-text-editor element.
With these changes in place, you can successfully use the tabIndex to
define the tab order for atom-text-editor elements. 😅
This commit uses `content` containment (i.e. `layout paint style`) as
opposed to `strict` containment (i.e. `layout paint style size`) for
dummy scrollbar elements.
By removing `size` containment we are fixing a rendering bug that was
preventing the scrollbar from being sized correctly. This problem was
caught by a TextEditorComponent test
(https://circleci.com/gh/atom/atom/6393).
In Atom 1.19 we changed the scroll handler to use deltaX and deltaY
instead of wheelDeltaX/wheelDeltaY. wheelDelta is larger so this caused
the scrolling speed to slow down. This change in speed was especially
noticable on Linux
Previously, we used to prevent the user from dragging the selection
further when the buffer was about to change. This was problematic
because any change in the buffer, even one that was performed
"automatically" by a package, would cancel the dragging action and
result in a confusing experience for the user.
On the other hand, we want to prevent users from accidentally selecting
text when they perform an edit (see #15217, #15405).
This commit addresses both concerns by canceling the dragging as soon as
the user interacts with the keyboard, instead of canceling the dragging
when the buffer is about to change.
One downside of this approach is that it changes the behavior of
pressing a keystroke that does not result in a buffer change, e.g.
Shift, Arrow Keys, etc.
Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
Previously, if the user opened the IME menu while input was disabled, we
would create a composition checkpoint without reverting to it after the
composition ended. When enabling input again, the first keystroke would
cause any buffer change that occurred between the IME composition and
the keystroke to be reverted.
With this commit we will always revert and delete the composition
checkpoint as soon as the composition ends, regardless of whether the
input is enabled or not.