mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
LibLine: Clear trailing trivia when cycling if the suggestion has any
This commit is contained in:
parent
b07bd1b95c
commit
c97ca2fecc
1 changed files with 2 additions and 1 deletions
|
@ -351,7 +351,7 @@ String Editor::get_line(const String& prompt)
|
|||
case 2:
|
||||
actual_offset = m_cursor - m_largest_common_suggestion_prefix_length + m_next_suggestion_invariant_offset;
|
||||
if (can_complete)
|
||||
shown_length = m_largest_common_suggestion_prefix_length;
|
||||
shown_length = m_largest_common_suggestion_prefix_length + m_last_shown_suggestion.trailing_trivia.length();
|
||||
break;
|
||||
default:
|
||||
if (m_last_shown_suggestion_display_length == 0)
|
||||
|
@ -391,6 +391,7 @@ String Editor::get_line(const String& prompt)
|
|||
insert(m_last_shown_suggestion.text.substring_view(m_next_suggestion_invariant_offset, m_last_shown_suggestion.text.length() - m_next_suggestion_invariant_offset));
|
||||
// add in the trivia of the last selected suggestion
|
||||
insert(m_last_shown_suggestion.trailing_trivia);
|
||||
m_last_shown_suggestion_display_length += m_last_shown_suggestion.trailing_trivia.length();
|
||||
if (m_tab_direction == TabDirection::Forward)
|
||||
increment_suggestion_index();
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue