-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor align_selection using kakoune logic #1675
Conversation
helix-term/src/commands.rs
Outdated
column_widths.push(vec![(l1, cursor)]); | ||
} | ||
} | ||
let mut max_curs = vec![]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut max_curs = vec![]; | |
let mut max_curs = Vec::with_capacity(column_widths.len()) |
helix-term/src/commands.rs
Outdated
for item in column_widths[i].iter_mut() { | ||
pads.insert(item.0, max_cur - item.1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for item in column_widths[i].iter_mut() { | |
pads.insert(item.0, max_cur - item.1); | |
} | |
for (line_start, cursor) in &column_widths[i] { | |
pads.insert(line_start, max_cur - cursor); | |
} |
helix-term/src/commands.rs
Outdated
.fold(0, |max, &(_, cur)| max.max(cur)); | ||
max_curs.push(max_cur); | ||
|
||
let mut pads = std::collections::HashMap::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut pads = std::collections::HashMap::new(); | |
let mut pads = std::collections::HashMap::with_capacity(column_widths[i].len()); |
helix-term/src/commands.rs
Outdated
let max_cur = column_widths[i] | ||
.iter() | ||
.fold(0, |max, &(_, cur)| max.max(cur)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.iter().map(|(_, cur)| cur).max()
?
Thanks! 🎉 |
#1670