From 0ffb0fb78642bd24c53c3642e3450ec2bed57f92 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 14 Sep 2022 13:32:13 +0200 Subject: [PATCH] reader: move function definition out-of-line Happily, clangd provides a code action to do this. No functional change. --- src/reader.cpp | 7 +++++++ src/reader.h | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index 06d349e26..87c6ebd3e 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -264,6 +264,13 @@ bool editable_line_t::undo() { return did_undo; } +void editable_line_t::clear() { + undo_history.clear(); + if (empty()) return; + set_text_bypassing_undo_history(L""); + set_position(0); +} + void editable_line_t::push_edit(edit_t &&edit) { // Assign a new group id or propagate the old one if we're in a logical grouping of edits if (edit_group_level_ != -1) { diff --git a/src/reader.h b/src/reader.h index f22e9a378..10d49073b 100644 --- a/src/reader.h +++ b/src/reader.h @@ -107,12 +107,7 @@ class editable_line_t { wchar_t at(size_t idx) const { return text().at(idx); } - void clear() { - undo_history.clear(); - if (empty()) return; - set_text_bypassing_undo_history(L""); - set_position(0); - } + void clear(); /// Modify the commandline according to @edit. Most modifications to the /// text should pass through this function.