MCPcopy Create free account
hub / github.com/crosire/reshade / move_top

Method move_top

source/imgui_code_editor.cpp:1611–1639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1609 _scroll_to_cursor = true;
1610}
1611void reshade::imgui::code_editor::move_top(bool selection)
1612{
1613 assert(!_lines.empty());
1614
1615 const text_pos prev_pos = _cursor_pos;
1616 _cursor_pos = text_pos(0, 0);
1617
1618 if (prev_pos == _cursor_pos)
1619 return;
1620
1621 if (selection)
1622 {
1623 // This logic ensures the selection is updated depending on which direction it was created in (mimics behavior of popular text editors)
1624 if (_interactive_beg > _interactive_end)
1625 std::swap(_interactive_beg, _interactive_end);
1626 if (prev_pos != _interactive_beg)
1627 _interactive_end = _interactive_beg;
1628
1629 _interactive_beg = _cursor_pos;
1630 }
1631 else
1632 {
1633 _interactive_beg = _cursor_pos;
1634 _interactive_end = _cursor_pos;
1635 }
1636
1637 select(_interactive_beg, _interactive_end);
1638 _scroll_to_cursor = true;
1639}
1640void reshade::imgui::code_editor::move_bottom(bool selection)
1641{
1642 assert(!_lines.empty());

Callers

nothing calls this directly

Calls 1

text_posClass · 0.85

Tested by

no test coverage detected