From be64c5388860492ca328285aeb5afc26122c834f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 14 Sep 2022 19:13:54 +0200 Subject: [PATCH] reader: inline dangerous function The idea for this function was that it stands as the one place that modifies the text without push_edit. In practice I don't think it helps. No functional change. --- src/reader.cpp | 2 +- src/reader.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index 8d62dd57a..2f300be05 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -250,7 +250,7 @@ bool editable_line_t::undo() { void editable_line_t::clear() { undo_history_.clear(); if (empty()) return; - set_text_bypassing_undo_history(L""); + text_ = L""; set_position(0); } diff --git a/src/reader.h b/src/reader.h index 989fff6a2..79a8154f0 100644 --- a/src/reader.h +++ b/src/reader.h @@ -81,8 +81,6 @@ struct undo_history_t { class editable_line_t { public: const wcstring &text() const { return text_; } - /// Set the text directly without maintaining undo invariants. Use with caution. - void set_text_bypassing_undo_history(wcstring &&text) { text_ = text; } size_t position() const { return position_; } void set_position(size_t position) { position_ = position; }