Separate PieceTable::Cursor::go_*() into go_*() and check_go_*()
This commit is contained in:
1 parent
ef717faa16
commit
66105dc88f
3 files changed
+89
-47
No files matched your search
+9
-9
@@ -296,25 +296,25 @@ void Window::cursor_move(int which)
|
||||
switch (which)
|
||||
{
|
||||
case CURSOR_LEFT:
|
||||
moved = m_cursor->go_left(1);
|
||||
moved = m_cursor->check_go_left(1);
|
||||
m_target_column = m_cursor->column;
|
||||
break;
|
||||
case CURSOR_RIGHT:
|
||||
moved = m_cursor->go_right(1, false);
|
||||
moved = m_cursor->check_go_right(1, false);
|
||||
m_target_column = m_cursor->column;
|
||||
break;
|
||||
case CURSOR_UP:
|
||||
moved = m_cursor->go_up(1, m_target_column);
|
||||
moved = m_cursor->check_go_up(1, m_target_column);
|
||||
break;
|
||||
case CURSOR_DOWN:
|
||||
moved = m_cursor->go_down(1, m_target_column);
|
||||
moved = m_cursor->check_go_down(1, m_target_column);
|
||||
break;
|
||||
case CURSOR_SOL:
|
||||
moved = m_cursor->go_start_of_line();
|
||||
moved = m_cursor->check_go_start_of_line();
|
||||
m_target_column = 0u;
|
||||
break;
|
||||
case CURSOR_EOL:
|
||||
moved = m_cursor->go_end_of_line(false);
|
||||
moved = m_cursor->check_go_end_of_line(false);
|
||||
m_target_column = 0x7FFFFFFFu;
|
||||
break;
|
||||
}
|
||||
@@ -370,7 +370,7 @@ std::pair<int, PieceTable::Cursor> Window::calculate_start_position()
|
||||
cursor.go_start_of_line();
|
||||
while (row > 0)
|
||||
{
|
||||
if (cursor.go_up(1, 0u))
|
||||
if (cursor.check_go_up(1, 0u))
|
||||
{
|
||||
PieceTable::Cursor c = cursor;
|
||||
c.go_end_of_line(false);
|
||||
@@ -425,9 +425,9 @@ void Window::draw_buffer()
|
||||
(character != '\n'))
|
||||
draw_buffer_character(screen_column, screen_row, character);
|
||||
}
|
||||
if (!cursor.go_right(1, false))
|
||||
if (!cursor.check_go_right(1, false))
|
||||
{
|
||||
bool last_row = !cursor.go_down(1, 0);
|
||||
bool last_row = !cursor.check_go_down(1, 0);
|
||||
if (last_vertical_crosshair_row < row)
|
||||
{
|
||||
int crosshair_screen_row = row + crosshair_row_offset;
|
||||
|
||||
Reference in new issue
Block a user