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,9 +35,14 @@ impl Printer {
|
|||||||
Some((i,_)) => &text[..i],
|
Some((i,_)) => &text[..i],
|
||||||
_ => text,
|
_ => text,
|
||||||
};
|
};
|
||||||
|
|
||||||
let p = p + self.offset;
|
let p = p + self.offset;
|
||||||
|
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);
|
ncurses::mvprintw(p.y as i32, p.x as i32, text);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Prints a vertical line using the given character.
|
/// Prints a vertical line using the given character.
|
||||||
pub fn print_vline<T: ToVec2>(&self, start: T, len: usize, c: u64) {
|
pub fn print_vline<T: ToVec2>(&self, start: T, len: usize, c: u64) {
|
||||||
|
Loading…
Reference in New Issue
Block a user