1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

LibLine+Shell: Remove unused split_mechanism

It was only read in should_break_token(), which had no callers.
should_break_token() also got `foo\\ bar` and `"foo bar"` wrong.
This commit is contained in:
Nico Weber 2020-08-06 14:29:18 -04:00 committed by Andreas Kling
parent 7f7dd3cf9c
commit 3cc9e8ba41
3 changed files with 2 additions and 23 deletions

View file

@ -919,7 +919,7 @@ void Editor::handle_read_event()
// Disable our own notifier so as to avoid interfering with the search editor.
m_notifier->set_enabled(false);
m_search_editor = Editor::construct(Configuration { Configuration::Eager, m_configuration.split_mechanism }); // Has anyone seen 'Inception'?
m_search_editor = Editor::construct(Configuration { Configuration::Eager }); // Has anyone seen 'Inception'?
add_child(*m_search_editor);
m_search_editor->on_display_refresh = [this](Editor& search_editor) {
@ -1638,19 +1638,6 @@ String Editor::line(size_t up_to_index) const
return builder.build();
}
bool Editor::should_break_token(Vector<u32, 1024>& buffer, size_t index)
{
switch (m_configuration.split_mechanism) {
case Configuration::TokenSplitMechanism::Spaces:
return buffer[index] == ' ';
case Configuration::TokenSplitMechanism::UnescapedSpaces:
return buffer[index] == ' ' && (index == 0 || buffer[index - 1] != '\\');
}
ASSERT_NOT_REACHED();
return true;
};
void Editor::remove_at_index(size_t index)
{
// See if we have any anchored styles, and reposition them if needed.