gnome-shell/js
Sebastian Keller 484a237002 keyboard: Fix deleting the previous word
Since mutter@33088d59 the cursor we receive from mutter already is a
character index while the code here still treated it like a byte offset.

Further the code to detect the previous word position was treating the
cursor parameter already like a character index, while passing the
cursor that was prior to that commit a byte offset.

The function also had some unreachable and redundant code paths. The
pos < 0 case can never be reached due to the max(). Also the regex
already ensures that all whitespace is considered, so the code to remove
spaces not actually do anything except when deleting the first word in
the text, in which it would cause the first character to not get
deleted.

Also it was not handling characters with more than 2 bytes correctly. In
the presence of these JS string functions, such as search(), can not be
considered to operate on character indices anymore but rather the number
of UTF-16 byte pairs. Issues with this can be avoided by using
iterators, which unlike anything else iterate on characters, not byte
pairs and by not using the results returned by JS string functions for
anything but JS strings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2746>
2024-02-29 14:56:16 +00:00
..
dbusServices FdoNotificationDaemon: Emit ActivationToken before ActionInvoked signal 2024-02-28 13:51:18 +00:00
extensions extensions: Fix ngettext convenience 2023-09-15 21:41:30 +00:00
gdm gdm/util: Reduce the fprintd proxy wait timeout 2024-02-28 22:12:03 +01:00
misc cleanup: Use spread properties instead of Object.assign() 2024-02-17 11:53:43 +01:00
portalHelper js: Port Config to ESM 2023-08-10 17:42:23 +00:00
ui keyboard: Fix deleting the previous word 2024-02-29 14:56:16 +00:00
js-resources.gresource.xml dbusErrors: Add utility module for handling remote errors 2024-01-31 20:58:31 +01:00
meson.build extensions-app: Move Extensions app to new subproject 2020-03-27 23:33:30 +00:00
portal-resources.gresource.xml js/portal-resources: Add missing fileUtils to js path 2022-11-03 18:02:27 +00:00