1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 18:02:37 +01:00

Codechange: pass the characters to trim to StrTrimView

This commit is contained in:
Rubidium
2025-05-03 08:05:54 +02:00
committed by rubidium42
parent e2db8277b8
commit 1f39d469ff
8 changed files with 16 additions and 11 deletions

View File

@@ -8,6 +8,7 @@
/** @file console_gui.cpp Handling the GUI of the in-game console. */
#include "stdafx.h"
#include "core/string_consumer.hpp"
#include "textbuf_type.h"
#include "window_gui.h"
#include "autocompletion.h"
@@ -77,7 +78,7 @@ public:
private:
std::vector<std::string> GetSuggestions(std::string_view prefix, std::string_view query) override
{
prefix = StrTrimView(prefix);
prefix = StrTrimView(prefix, StringConsumer::WHITESPACE_NO_NEWLINE);
std::vector<std::string> suggestions;
/* We only suggest commands or aliases, so we only do it for the first token or an argument to help command. */