From 70610017284af7effd675bd927ae25b084b3e4b9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Feb 2022 20:14:47 +1100 Subject: Add a complete-command command to configure command completion This makes it possible to change command completion in hooks and paves the way to more flexibility in how custom commands can be completed --- src/string_utils.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/string_utils.cc') diff --git a/src/string_utils.cc b/src/string_utils.cc index a1c1c38d..37ca6716 100644 --- a/src/string_utils.cc +++ b/src/string_utils.cc @@ -396,6 +396,16 @@ UnitTest test_string{[]() { kak_assert(String("youpi ") + "matin" == "youpi matin"); + kak_assert(StringView{"youpi"}.starts_with("")); + kak_assert(StringView{"youpi"}.starts_with("you")); + kak_assert(StringView{"youpi"}.starts_with("youpi")); + kak_assert(not StringView{"youpi"}.starts_with("youpi!")); + + kak_assert(StringView{"youpi"}.ends_with("")); + kak_assert(StringView{"youpi"}.ends_with("pi")); + kak_assert(StringView{"youpi"}.ends_with("youpi")); + kak_assert(not StringView{"youpi"}.ends_with("oup")); + auto wrapped = "wrap this paragraph\n respecting whitespaces and much_too_long_words" | wrap_at(16) | gather(); kak_assert(wrapped.size() == 6); kak_assert(wrapped[0] == "wrap this"); -- cgit v1.2.3