Skip to content

Commit

Permalink
Prioritize closer nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraTenshi committed Mar 3, 2023
1 parent d95b738 commit acbc1a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ impl EditorView {
// we render from top most (last in the list)
context = context
.into_iter()
.rev()
// only take the nodes until 1 / 3 of the viewport is reached or the maximum amount of sticky nodes .take(viewport.height as usize / 3)
.take(max_nodes_amount)
.rev()
.enumerate()
.take_while(|(i, _)| *i + 1 != visual_cursor_pos as usize) // also only nodes that don't overlap with the visual cursor position
.map(|(i, node)| {
Expand Down

0 comments on commit acbc1a0

Please sign in to comment.