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.
This commit is contained in:
Johannes Altmanninger 2022-09-14 19:13:54 +02:00
parent 8b4b24428c
commit be64c53888
2 changed files with 1 additions and 3 deletions

View file

@ -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);
}

View file

@ -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; }