mirror of https://github.com/helix-editor/helix
simplified code for 'nullspace' calculation in EditorView render
parent
6ffd2f8cbe
commit
fb6d0d8f7b
|
@ -94,22 +94,8 @@ impl EditorView {
|
||||||
let config = editor.config();
|
let config = editor.config();
|
||||||
|
|
||||||
if config.nullspace.enable {
|
if config.nullspace.enable {
|
||||||
let gutter_width = view.gutter_offset(doc);
|
if inner.width < view.area.width {
|
||||||
let text_width = config.text_width as u16;
|
let (null_l, _, null_r) = area.clip_bottom(1).split_centre_vertical(inner.width);
|
||||||
|
|
||||||
let view_width = text_width + gutter_width;
|
|
||||||
|
|
||||||
if view_width < view.area.width {
|
|
||||||
let null_width = (area.width - view_width) / 2;
|
|
||||||
|
|
||||||
let null_l = area.with_width(null_width).clip_bottom(1);
|
|
||||||
let null_r = Rect::new(
|
|
||||||
area.x + view_width + null_width,
|
|
||||||
area.y,
|
|
||||||
area.width - view_width - null_width,
|
|
||||||
area.height,
|
|
||||||
)
|
|
||||||
.clip_bottom(1);
|
|
||||||
|
|
||||||
let null_style = theme
|
let null_style = theme
|
||||||
.try_get("ui.nullspace")
|
.try_get("ui.nullspace")
|
||||||
|
|
Loading…
Reference in New Issue