mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-09 00:50:04 +03:00
fdddbfc179
Currently in Zed, certain characters require pressing the key twice to move the caret through that character. For example: "❤️" and "y̆". The reason for this is as follows: Currently, Zed uses `chars` to distinguish different characters, and calling `chars` on `y̆` will yield two `char` values: `y` and `\u{306}`, and calling `chars` on `❤️` will yield two `char` values: `❤` and `\u{fe0f}`. Therefore, consider the following scenario (where ^ represents the caret): - what we see: ❤️ ^ - the actual buffer: ❤ \u{fe0f} ^ After pressing the left arrow key once: - what we see: ❤️ ^ - the actual buffer: ❤ ^ \u{fe0f} After pressing the left arrow key again: - what we see: ^ ❤️ - the actual buffer: ^ ❤ \u{fe0f} Thus, two left arrow key presses are needed to move the caret, and this PR fixes this bug (or this is actually a feature?). I have tried to keep the scope of code modifications as minimal as possible. In this PR, Zed handles such characters as follows: - what we see: ❤️ ^ - the actual buffer: ❤ \u{fe0f} ^ After pressing the left arrow key once: - what we see: ^ ❤️ - the actual buffer: ^ ❤ \u{fe0f} Or after pressing the delete key: - what we see: ^ - the actual buffer: ^ Please note that currently, different platforms and software handle these special characters differently, and even the same software may handle these characters differently in different situations. For example, in my testing on Chrome on macOS, GitHub treats `y̆` as a single character, just like in this PR; however, in Rust Playground, `y̆` is treated as two characters, and pressing the delete key does not delete the entire `y̆` character, but instead deletes `\u{306}` to yield the character `y`. And they both treat `❤️` as a single character, pressing the delete key will delete the entire `❤️` character. This PR is based on the principle of making changes with the smallest impact on the code, and I think that deleting the entire character with the delete key is more intuitive. Release Notes: - Fix caret movement issue for some special characters --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Thorsten <thorsten@zed.dev> Co-authored-by: Bennet <bennetbo@gmx.de>
136 lines
3.4 KiB
TOML
136 lines
3.4 KiB
TOML
[package]
|
|
name = "gpui"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
authors = ["Nathan Sobo <nathan@zed.dev>"]
|
|
description = "Zed's GPU-accelerated UI framework"
|
|
publish = false
|
|
license = "Apache-2.0"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
test-support = ["backtrace", "collections/test-support", "util/test-support"]
|
|
runtime_shaders = []
|
|
macos-blade = ["blade-graphics", "blade-macros", "blade-rwh", "bytemuck"]
|
|
|
|
[lib]
|
|
path = "src/gpui.rs"
|
|
doctest = false
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
async-task = "4.7"
|
|
backtrace = { version = "0.3", optional = true }
|
|
blade-graphics = { workspace = true, optional = true }
|
|
blade-macros = { workspace = true, optional = true }
|
|
blade-rwh = { workspace = true, optional = true }
|
|
bytemuck = { version = "1", optional = true }
|
|
collections.workspace = true
|
|
ctor.workspace = true
|
|
derive_more.workspace = true
|
|
env_logger.workspace = true
|
|
etagere = "0.2"
|
|
futures.workspace = true
|
|
font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5a5c4d4" }
|
|
gpui_macros.workspace = true
|
|
image = "0.23"
|
|
itertools.workspace = true
|
|
lazy_static.workspace = true
|
|
linkme = "0.3"
|
|
log.workspace = true
|
|
num_cpus = "1.13"
|
|
parking = "2.0.0"
|
|
parking_lot.workspace = true
|
|
pathfinder_geometry = "0.5"
|
|
postage.workspace = true
|
|
profiling.workspace = true
|
|
rand.workspace = true
|
|
raw-window-handle = "0.6"
|
|
refineable.workspace = true
|
|
resvg = "0.14"
|
|
tiny-skia = "0.5"
|
|
usvg = { version = "0.14", features = [] }
|
|
schemars.workspace = true
|
|
seahash = "4.1"
|
|
semantic_version.workspace = true
|
|
serde.workspace = true
|
|
serde_derive.workspace = true
|
|
serde_json.workspace = true
|
|
slotmap = "1.0.6"
|
|
smallvec.workspace = true
|
|
smol.workspace = true
|
|
sum_tree.workspace = true
|
|
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "1876f72bee5e376023eaa518aa7b8a34c769bd1b" }
|
|
thiserror.workspace = true
|
|
time.workspace = true
|
|
util.workspace = true
|
|
uuid = { version = "1.1.2", features = ["v4", "v5"] }
|
|
waker-fn = "1.1.0"
|
|
|
|
[dev-dependencies]
|
|
backtrace = "0.3"
|
|
collections = { workspace = true, features = ["test-support"] }
|
|
util = { workspace = true, features = ["test-support"] }
|
|
|
|
[target.'cfg(target_os = "macos")'.build-dependencies]
|
|
bindgen = "0.65.1"
|
|
cbindgen = "0.26.0"
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
block = "0.1"
|
|
cocoa = "0.25"
|
|
core-foundation.workspace = true
|
|
core-graphics = "0.23"
|
|
core-text = "20.1"
|
|
foreign-types = "0.5"
|
|
log.workspace = true
|
|
media.workspace = true
|
|
metal = "0.25"
|
|
objc = "0.2"
|
|
|
|
[target.'cfg(any(target_os = "linux", target_os = "windows"))'.dependencies]
|
|
flume = "0.11"
|
|
#TODO: use these on all platforms
|
|
blade-graphics.workspace = true
|
|
blade-macros.workspace = true
|
|
blade-rwh.workspace = true
|
|
bytemuck = "1"
|
|
cosmic-text = "0.11.2"
|
|
copypasta = "0.10.1"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
as-raw-xcb-connection = "1"
|
|
ashpd = "0.8.0"
|
|
calloop = "0.12.4"
|
|
calloop-wayland-source = "0.2.0"
|
|
wayland-backend = { version = "0.3.3", features = ["client_system"] }
|
|
wayland-client = { version = "0.31.2" }
|
|
wayland-cursor = "0.31.1"
|
|
wayland-protocols = { version = "0.31.2", features = [
|
|
"client",
|
|
"staging",
|
|
"unstable",
|
|
] }
|
|
oo7 = "0.3.0"
|
|
open = "5.1.2"
|
|
x11rb = { version = "0.13.0", features = ["allow-unsafe-code", "xkb", "randr"] }
|
|
xkbcommon = { version = "0.7", features = ["wayland", "x11"] }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
windows.workspace = true
|
|
|
|
[[example]]
|
|
name = "hello_world"
|
|
path = "examples/hello_world.rs"
|
|
|
|
[[example]]
|
|
name = "image"
|
|
path = "examples/image/image.rs"
|
|
|
|
[[example]]
|
|
name = "set_menus"
|
|
path = "examples/set_menus.rs"
|