| 826 | set_text(std::string_view()); |
| 827 | } |
| 828 | void reshade::imgui::code_editor::append_text(const std::string_view text) |
| 829 | { |
| 830 | text_pos cursor_pos = _cursor_pos; |
| 831 | const bool reset_cursor_pos = cursor_pos != get_text_end(); |
| 832 | _cursor_pos = get_text_end(); |
| 833 | insert_text(text); |
| 834 | // Keep the cursor position at the new end when the cursor was at the end before |
| 835 | // This way the editor scrolls with text being appended when the cursor is at the end, but does not scroll when the cursor is somewhere else |
| 836 | if (reset_cursor_pos) |
| 837 | _cursor_pos = cursor_pos; |
| 838 | } |
| 839 | void reshade::imgui::code_editor::insert_text(const std::string_view text) |
| 840 | { |
| 841 | undo_record u; |