mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-05-07 14:08:02 +03:00
remove scrollbar from disable_formatting mode
This commit is contained in:
parent
9e35bda45d
commit
e3f51cfacc
12
src/chat.rs
12
src/chat.rs
@ -96,8 +96,9 @@ pub fn print_console(ctx: Arc<Context>, messages: Vec<String>, input: &str) -> R
|
|||||||
let scroll = (1f64 - scroll as f64 / messages.len() as f64) * (height) as f64;
|
let scroll = (1f64 - scroll as f64 / messages.len() as f64) * (height) as f64;
|
||||||
let scroll = scroll as usize;
|
let scroll = scroll as usize;
|
||||||
|
|
||||||
let text = format!(
|
let formatted_messages = if ctx.disable_formatting {
|
||||||
"{}\r\n> {}",
|
messages
|
||||||
|
} else {
|
||||||
messages[messages.len()-height-1..].into_iter()
|
messages[messages.len()-height-1..].into_iter()
|
||||||
.flat_map(|o| string_chunks(&o, width as usize - 1))
|
.flat_map(|o| string_chunks(&o, width as usize - 1))
|
||||||
.enumerate()
|
.enumerate()
|
||||||
@ -111,7 +112,12 @@ pub fn print_console(ctx: Arc<Context>, messages: Vec<String>, input: &str) -> R
|
|||||||
"|"
|
"|"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}).collect::<Vec<String>>().join("\r\n"),
|
}).collect::<Vec<String>>()
|
||||||
|
};
|
||||||
|
|
||||||
|
let text = format!(
|
||||||
|
"{}\r\n> {}",
|
||||||
|
formatted_messages.join("\r\n"),
|
||||||
input
|
input
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user