Make popup smaller on char deletion
This commit is contained in:
parent
fc7016caa9
commit
4eb025ba91
@ -26,8 +26,6 @@ pub struct Level {
|
|||||||
impl Level {
|
impl Level {
|
||||||
//TODO: double width chars render, also note in text wrapping
|
//TODO: double width chars render, also note in text wrapping
|
||||||
//TODO: im
|
//TODO: im
|
||||||
//TODO: cursor
|
|
||||||
//TODO: delete
|
|
||||||
|
|
||||||
pub fn replace_from_ctx(&mut self, ctx: &CmdLineContext, render_state: &shell::RenderState) {
|
pub fn replace_from_ctx(&mut self, ctx: &CmdLineContext, render_state: &shell::RenderState) {
|
||||||
let content = ctx.get_lines();
|
let content = ctx.get_lines();
|
||||||
|
@ -95,7 +95,11 @@ impl ModelLayout {
|
|||||||
row_idx += 1;
|
row_idx += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.cols_filled = max(self.cols_filled, max_col_idx + 1);
|
if self.rows_filled == 1 {
|
||||||
|
self.cols_filled = max_col_idx + 1;
|
||||||
|
} else {
|
||||||
|
self.cols_filled = max(self.cols_filled, max_col_idx + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn count_lines(lines: &Vec<Vec<(Option<Attrs>, Vec<char>)>>, max_columns: usize) -> usize {
|
fn count_lines(lines: &Vec<Vec<(Option<Attrs>, Vec<char>)>>, max_columns: usize) -> usize {
|
||||||
|
Loading…
Reference in New Issue
Block a user