mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Escapes % when printing strings.
This commit is contained in:
parent
6c6f929430
commit
8ee04c525f
@ -35,8 +35,13 @@ impl Printer {
|
||||
Some((i,_)) => &text[..i],
|
||||
_ => text,
|
||||
};
|
||||
|
||||
let p = p + self.offset;
|
||||
ncurses::mvprintw(p.y as i32, p.x as i32, text);
|
||||
if text.contains("%") {
|
||||
ncurses::mvprintw(p.y as i32, p.x as i32, &text.replace("%", "%%"));
|
||||
} else {
|
||||
ncurses::mvprintw(p.y as i32, p.x as i32, text);
|
||||
}
|
||||
}
|
||||
|
||||
/// Prints a vertical line using the given character.
|
||||
|
Loading…
Reference in New Issue
Block a user