Minor optimization of line number length logic (#26845)
In `layout_excerpt_gutter`, compute max line number length once instead of for every row In `max_line_number_width`, use ilog10 instead of converting to floats and back Release Notes: - N/A
This commit is contained in:
parent
c220fb387d
commit
ef91e7afae
2 changed files with 14 additions and 11 deletions
|
@ -4096,6 +4096,7 @@ impl MultiBufferSnapshot {
|
|||
}
|
||||
|
||||
pub fn widest_line_number(&self) -> u32 {
|
||||
// widest_line_number is 0-based, so 1 is added to get the displayed line number.
|
||||
self.excerpts.summary().widest_line_number + 1
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue