mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 14:36:42 +02:00
Fix more width issues
This commit is contained in:
parent
a74d101b39
commit
e20ec465c6
3 changed files with 14 additions and 15 deletions
|
@ -17,6 +17,7 @@ use rustyline_derive::Helper;
|
|||
|
||||
use unicode_segmentation::Graphemes;
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
pub fn get_start_word_under_cursor(line: &str, cursor_pos: usize) -> usize {
|
||||
let mut chars = line[..cursor_pos].chars();
|
||||
|
@ -143,10 +144,7 @@ impl CompletionList {
|
|||
}
|
||||
|
||||
pub fn max_width(&self) -> Option<usize> {
|
||||
self.candidates()
|
||||
.iter()
|
||||
.map(|p| p.display.graphemes(true).count() + 4)
|
||||
.max()
|
||||
self.candidates().iter().map(|p| p.display.width() + 4).max()
|
||||
}
|
||||
|
||||
pub fn get(&self, i: usize) -> Option<String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue