mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-24 23:23:58 +00:00
LibLine: Hide debug output behind SUGGESTIONS_DEBUG define
This commit is contained in:
parent
9241c3a957
commit
fbcfc8dcd0
Notes:
sideshowbarker
2024-07-19 06:16:21 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/fbcfc8dcd06 Pull-request: https://github.com/SerenityOS/serenity/pull/2324 Reviewed-by: https://github.com/Dexesttp
1 changed files with 6 additions and 0 deletions
|
@ -35,6 +35,8 @@
|
|||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// #define SUGGESTIONS_DEBUG
|
||||
|
||||
namespace Line {
|
||||
|
||||
Editor::Editor(Configuration configuration)
|
||||
|
@ -524,7 +526,9 @@ String Editor::get_line(const String& prompt)
|
|||
}
|
||||
m_last_shown_suggestion = m_suggestions[m_next_suggestion_index];
|
||||
m_last_shown_suggestion.token_start_index = token_start - m_next_suggestion_invariant_offset - m_next_suggestion_static_offset;
|
||||
#ifdef SUGGESTIONS_DEBUG
|
||||
dbg() << "Last shown suggestion token start index: " << m_last_shown_suggestion.token_start_index << " Token Start " << token_start << " invariant offset " << m_next_suggestion_invariant_offset;
|
||||
#endif
|
||||
m_last_shown_suggestion_display_length = m_last_shown_suggestion.text.length();
|
||||
m_last_shown_suggestion_was_complete = true;
|
||||
if (m_times_tab_pressed == 1) {
|
||||
|
@ -661,7 +665,9 @@ String Editor::get_line(const String& prompt)
|
|||
|
||||
if (m_times_tab_pressed) {
|
||||
// Apply the style of the last suggestion
|
||||
#ifdef SUGGESTIONS_DEBUG
|
||||
dbg() << "Last shown suggestion token start index: " << m_last_shown_suggestion.token_start_index << " invariant offset " << m_next_suggestion_invariant_offset << " static offset " << m_next_suggestion_static_offset;
|
||||
#endif
|
||||
readjust_anchored_styles(m_last_shown_suggestion.token_start_index, ModificationKind::ForcedOverlapRemoval);
|
||||
stylize({ m_last_shown_suggestion.token_start_index, m_cursor, Span::Mode::CodepointOriented }, m_last_shown_suggestion.style);
|
||||
// we probably have some suggestions drawn
|
||||
|
|
Loading…
Reference in a new issue