summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-04 05:12:19 +0000
committerBlaž Hrastnik2021-03-04 05:12:19 +0000
commit565fb94afe817eb698f219d1fed76fe5ff7e27cd (patch)
treed973ffeb3ea0cc7b73e78cc5de004f5cf900fac5
parent7e4830215e22eb2fef15c1689b1dd9660aa74981 (diff)
commands: Correct another case that always used primary().
-rw-r--r--helix-term/src/commands.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 4004e18a..60359ef0 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -125,6 +125,10 @@ pub fn move_line_start(cx: &mut Context) {
doc.set_selection(selection);
}
+// TODO: move vs extend could take an extra type Extend/Move that would
+// Range::new(if Move { pos } if Extend { range.anchor }, pos)
+// since these all really do the same thing
+
pub fn move_next_word_start(cx: &mut Context) {
let count = cx.count;
let doc = cx.doc();
@@ -958,9 +962,7 @@ pub fn format_selections(cx: &mut Context) {
.selection()
.ranges()
.iter()
- .map(|range| {
- helix_lsp::util::range_to_lsp_range(doc.text().slice(..), doc.selection().primary())
- })
+ .map(|range| helix_lsp::util::range_to_lsp_range(doc.text().slice(..), *range))
.collect();
for range in ranges {