@ -62,7 +62,7 @@ impl StatusLine {
context . theme . get ( "ui.statusline.inactive" )
context . theme . get ( "ui.statusline.inactive" )
} ;
} ;
surface . set_style ( viewport .with_height ( 1 ) , base_style ) ;
surface . set_style ( viewport , base_style ) ;
let write_left = | context : & mut RenderContext , text , style | {
let write_left = | context : & mut RenderContext , text , style | {
Self ::append ( & mut context . parts . left , text , & base_style , style )
Self ::append ( & mut context . parts . left , text , & base_style , style )
@ -76,7 +76,7 @@ impl StatusLine {
// Left side of the status line.
// Left side of the status line.
let element_ids = & editor . config ( ) . status _ line. left ;
let element_ids = & editor . config ( ) . status line. left ;
element_ids
element_ids
. iter ( )
. iter ( )
. map ( | element_id | Self ::get_render_function ( * element_id ) )
. map ( | element_id | Self ::get_render_function ( * element_id ) )
@ -91,7 +91,7 @@ impl StatusLine {
// Right side of the status line.
// Right side of the status line.
let element_ids = & editor . config ( ) . status _ line. right ;
let element_ids = & editor . config ( ) . status line. right ;
element_ids
element_ids
. iter ( )
. iter ( )
. map ( | element_id | Self ::get_render_function ( * element_id ) )
. map ( | element_id | Self ::get_render_function ( * element_id ) )
@ -109,7 +109,7 @@ impl StatusLine {
// Center of the status line.
// Center of the status line.
let element_ids = & editor . config ( ) . status _ line. center ;
let element_ids = & editor . config ( ) . status line. center ;
element_ids
element_ids
. iter ( )
. iter ( )
. map ( | element_id | Self ::get_render_function ( * element_id ) )
. map ( | element_id | Self ::get_render_function ( * element_id ) )
@ -220,47 +220,16 @@ impl StatusLine {
} ) ;
} ) ;
if warnings > 0 {
if warnings > 0 {
Self ::render_diagnostics_warning_state ( context , write ) ;
write ( context , "●" . to_string ( ) , Some ( context . theme . get ( "warning" ) ) ) ;
Self ::render_diagnostics_warning_count ( context , warnings , writ e) ;
write ( context , format! ( " {} " , warnings ) , Non e) ;
}
}
if errors > 0 {
if errors > 0 {
Self ::render_diagnostics_error_state ( context , write ) ;
write ( context , "●" . to_string ( ) , Some ( context . theme . get ( "error" ) ) ) ;
Self ::render_diagnostics_error_count ( context , errors , writ e) ;
write ( context , format! ( " {} " , errors ) , Non e) ;
}
}
}
}
fn render_diagnostics_warning_state < F > ( context : & mut RenderContext , write : F )
where
F : Fn ( & mut RenderContext , String , Option < Style > ) + Copy ,
{
write ( context , "●" . to_string ( ) , Some ( context . theme . get ( "warning" ) ) ) ;
}
fn render_diagnostics_warning_count < F > (
context : & mut RenderContext ,
warning_count : usize ,
write : F ,
) where
F : Fn ( & mut RenderContext , String , Option < Style > ) + Copy ,
{
write ( context , format! ( " {} " , warning_count ) , None ) ;
}
fn render_diagnostics_error_state < F > ( context : & mut RenderContext , write : F )
where
F : Fn ( & mut RenderContext , String , Option < Style > ) + Copy ,
{
write ( context , "●" . to_string ( ) , Some ( context . theme . get ( "error" ) ) ) ;
}
fn render_diagnostics_error_count < F > ( context : & mut RenderContext , error_count : usize , write : F )
where
F : Fn ( & mut RenderContext , String , Option < Style > ) + Copy ,
{
write ( context , format! ( " {} " , error_count ) , None ) ;
}
fn render_selections < F > ( context : & mut RenderContext , write : F )
fn render_selections < F > ( context : & mut RenderContext , write : F )
where
where
F : Fn ( & mut RenderContext , String , Option < Style > ) + Copy ,
F : Fn ( & mut RenderContext , String , Option < Style > ) + Copy ,