File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ use tui::{
24
24
} ;
25
25
use utils:: { ItemBatch , LogEntry } ;
26
26
27
- static SLICE_SIZE : usize = 1200 ;
27
+ const SLICE_SIZE : usize = 1200 ;
28
+ const ELEMENTS_PER_LINE : usize = 10 ;
29
+
28
30
///
29
31
pub struct Revlog {
30
32
selection : usize ,
@@ -174,8 +176,6 @@ impl Revlog {
174
176
tags : Option < String > ,
175
177
theme : & Theme ,
176
178
) {
177
- const ELEMENTS_PER_LINE : usize = 10 ;
178
-
179
179
txt. reserve ( ELEMENTS_PER_LINE ) ;
180
180
181
181
let splitter_txt = Cow :: from ( " " ) ;
@@ -229,7 +229,7 @@ impl Revlog {
229
229
fn get_text ( & self , height : usize ) -> Vec < Text > {
230
230
let selection = self . relative_selection ( ) ;
231
231
232
- let mut txt = Vec :: with_capacity ( height) ;
232
+ let mut txt = Vec :: with_capacity ( height * ELEMENTS_PER_LINE ) ;
233
233
234
234
for ( idx, e) in self
235
235
. items
You can’t perform that action at this time.
0 commit comments