Merge pull request #537 from jonathandturner/tabs_in_textview
Add tab support to textview
This commit is contained in:
commit
3fba30f2dc
|
@ -54,13 +54,25 @@ fn paint_textview(
|
||||||
match command {
|
match command {
|
||||||
DrawCommand::DrawString(style, string) => {
|
DrawCommand::DrawString(style, string) => {
|
||||||
for chr in string.chars() {
|
for chr in string.chars() {
|
||||||
frame_buffer.push((
|
if chr == '\t' {
|
||||||
chr,
|
for _ in 0..8 {
|
||||||
style.foreground.r,
|
frame_buffer.push((
|
||||||
style.foreground.g,
|
' ',
|
||||||
style.foreground.b,
|
style.foreground.r,
|
||||||
));
|
style.foreground.g,
|
||||||
pos += 1;
|
style.foreground.b,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
pos += 8;
|
||||||
|
} else {
|
||||||
|
frame_buffer.push((
|
||||||
|
chr,
|
||||||
|
style.foreground.r,
|
||||||
|
style.foreground.g,
|
||||||
|
style.foreground.b,
|
||||||
|
));
|
||||||
|
pos += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DrawCommand::NextLine => {
|
DrawCommand::NextLine => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user