Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix block cursor using placeholder text even when it's not displayed (#32766)

Michael Sloanc0717bc61345
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index 40ce3fd05bf..44f3728c9b6 100644
--- a/crates/editor/src/element.rs
+++ b/crates/editor/src/element.rs
@@ -1559,7 +1559,7 @@ impl EditorElement {
snapshot
.grapheme_at(cursor_position)
.or_else(|| {
- if cursor_column == 0 {
+ if snapshot.is_empty() {
snapshot.placeholder_text().and_then(|s| {
s.graphemes(true).next().map(|s| s.to_string().into())
})