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 @@ -355,13 +355,13 @@ impl<T: AsRef<str>> fmt::Display for Grid<T> {
355
355
// * cursor = 0, \t moves to column 8;
356
356
// * cursor = 5, \t moves to column 8 (3 spaces);
357
357
// * cursor = 9, \t moves to column 16 (7 spaces).
358
- // Calculate first \t size .
359
- let first_tab = tab_size - ( cursor % tab_size) ;
358
+ // Calculate the nearest \t position in relation to cursor .
359
+ let closest_tab = tab_size - ( cursor % tab_size) ;
360
360
361
- if first_tab > total_spaces {
361
+ if closest_tab > total_spaces {
362
362
f. write_str ( & padding[ ..total_spaces] ) ?;
363
363
} else {
364
- let rest_spaces = total_spaces - first_tab ;
364
+ let rest_spaces = total_spaces - closest_tab ;
365
365
let tabs = 1 + ( rest_spaces / tab_size) ;
366
366
let spaces = rest_spaces % tab_size;
367
367
f. write_str ( & "\t " . repeat ( tabs) ) ?;
You can’t perform that action at this time.
0 commit comments