Window: use AtomContent::length in scroll_to_keep_cursor_visible_ifn
This commit is contained in:
parent
76f55f5256
commit
5c2e3b25fa
|
@ -143,10 +143,7 @@ void Window::scroll_to_keep_cursor_visible_ifn()
|
||||||
if (atom.content.has_buffer_range() and
|
if (atom.content.has_buffer_range() and
|
||||||
atom.content.begin() <= last and atom.content.end() > last)
|
atom.content.begin() <= last and atom.content.end() > last)
|
||||||
{
|
{
|
||||||
if (atom.content.type() == AtomContent::BufferRange)
|
column += atom.content.length();
|
||||||
column += buffer().char_distance(atom.content.begin(), last);
|
|
||||||
else
|
|
||||||
column += atom.content.content().char_length();
|
|
||||||
|
|
||||||
CharCount first_col = first.line == last.line ?
|
CharCount first_col = first.line == last.line ?
|
||||||
buffer().char_distance(last.line, first) : 0_char;
|
buffer().char_distance(last.line, first) : 0_char;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user