Skip to content

Commit

Permalink
Highlight eol to buffer end
Browse files Browse the repository at this point in the history
This commit it intented to showcase how #1909 would work, to get
a better idea of the visual effect of that proposal.

Fixes #1909
  • Loading branch information
mawww committed Mar 24, 2018
1 parent 81f6057 commit 98b6ead
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/highlighters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,15 @@ void highlight_selections(HighlightContext context, DisplayBuffer& display_buffe
const bool eol = buffer[coord.line].length() - 1 == coord.column;
highlight_range(display_buffer, coord, buffer.char_next(coord), false,
apply_face(faces[2 + (eol ? 2 : 0) + (primary ? 0 : 1)]));
if (eol)
{
auto it = find_if(display_buffer.lines(), [&](auto& l) { return l.range().begin.line == coord.line; });
if (it != display_buffer.lines().end())
{
it->push_back(DisplayAtom{String{' ', context.context.window().dimensions().column - it->length()},
faces[2 + (eol ? 2 : 0) + (primary ? 0 : 1)]});
}
}
}
}

Expand Down

0 comments on commit 98b6ead

Please sign in to comment.