Make matching bracket dimmed, prevent out of bounds rendering
This commit is contained in:
parent
c978d811d9
commit
1bffb34350
1 changed files with 7 additions and 5 deletions
|
@ -334,11 +334,13 @@ impl EditorView {
|
||||||
if let Some(pos) = pos {
|
if let Some(pos) = pos {
|
||||||
let pos = view.screen_coords_at_pos(doc, text, pos);
|
let pos = view.screen_coords_at_pos(doc, text, pos);
|
||||||
if let Some(pos) = pos {
|
if let Some(pos) = pos {
|
||||||
// this only prevents panic due to painting selection too far
|
if (pos.col as u16) < viewport.width + view.first_col as u16
|
||||||
// TODO: prevent painting when scroll past x or in gutter
|
&& pos.col >= view.first_col
|
||||||
// TODO: use a more correct width check
|
{
|
||||||
if (pos.col as u16) < viewport.width {
|
let style = Style::default()
|
||||||
let style = Style::default().add_modifier(Modifier::REVERSED);
|
.add_modifier(Modifier::REVERSED)
|
||||||
|
.add_modifier(Modifier::DIM);
|
||||||
|
|
||||||
surface
|
surface
|
||||||
.get_mut(
|
.get_mut(
|
||||||
viewport.x + pos.col as u16,
|
viewport.x + pos.col as u16,
|
||||||
|
|
Loading…
Add table
Reference in a new issue