on master help sign in
check selection's visible width when copying on mouse click (#2711)
d948aceMichael Davis
helix-term/src/ui/editor.rs+7−2
@@ -1127,9 +1127,14 @@ impl EditorView {
1127 }
1127 }
1128
1128
1129 let (view, doc) = current!(cxt.editor);
1129 let (view, doc) = current!(cxt.editor);
1130− let range = doc.selection(view.id).primary();
1131
1130
1132− if range.to() - range.from() <= 1 {
1131+ if doc
1132+ .selection(view.id)
1133+ .primary()
1134+ .fragment(doc.text().slice(..))
1135+ .width()
1136+ <= 1
1137+ {
1133 return EventResult::Ignored(None);
1138 return EventResult::Ignored(None);
1134 }
1139 }
1135
1140