mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-29 10:02:57 +03:00
Fix window position computation that could get negative with big scroll offsets
This commit is contained in:
parent
72b7a8910b
commit
1cbaac5323
@ -132,8 +132,8 @@ static LineCount adapt_view_pos(LineCount line, LineCount offset,
|
||||
if (line - offset < view_pos)
|
||||
return std::max(0_line, line - offset);
|
||||
else if (line + offset >= view_pos + view_size)
|
||||
return std::min(buffer_size - view_size,
|
||||
line + offset - (view_size - 1));
|
||||
return std::max(0_line, std::min(buffer_size - view_size,
|
||||
line + offset - (view_size - 1)));
|
||||
return view_pos;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user