[all-commits] [llvm/llvm-project] 6ebbb1: [lldb] Simplify color logic in (IOHandler)Editline...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Sep 13 22:28:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ebbb1f53689f11303ae2ef69b7d593a52b40fde
      https://github.com/llvm/llvm-project/commit/6ebbb1f53689f11303ae2ef69b7d593a52b40fde
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-09-13 (Wed, 13 Sep 2023)

  Changed paths:
    M lldb/include/lldb/Core/IOHandler.h
    M lldb/include/lldb/Host/Editline.h
    M lldb/source/Core/IOHandler.cpp
    M lldb/source/Host/common/Editline.cpp
    M lldb/unittests/Editline/EditlineTest.cpp

  Log Message:
  -----------
  [lldb] Simplify color logic in (IOHandler)Editline (NFC)

This patch simplifies the color handling logic in Editline and
IOHandlerEditline:

 - Remove the m_color_prompts property from Editline and use the prompt
   ANSI prefix and suffix as the single source of truth. This avoids
   having to redraw the prompt unnecessarily, for example when colors
   are enabled but the prompt prefix and suffix are empty.

 - Rename m_color_prompts to just m_color in IOHandlerEditline and use
   it to ensure consistency between colored prompts and colored
   auto-suggestions. Some IOHandler explicitly turn off colors (such as
   IOHandlerConfirm) and it doesn't really make sense to have one or the
   other.




More information about the All-commits mailing list