[all-commits] [llvm/llvm-project] 0e9b0b: [EditLine] Fix RecallHistory to make it go in the ...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Tue Dec 3 08:12:45 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e9b0b6d11e882efec8505d97c4b65e1562e6715
      https://github.com/llvm/llvm-project/commit/0e9b0b6d11e882efec8505d97c4b65e1562e6715
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2019-12-03 (Tue, 03 Dec 2019)

  Changed paths:
    M lldb/include/lldb/Host/Editline.h
    M lldb/source/Host/common/Editline.cpp

  Log Message:
  -----------
  [EditLine] Fix RecallHistory to make it go in the right direction.

The naming used by editline for the history operations is counter
intuitive to how it's used in lldb for the REPL.

 - The H_PREV operation returns the previous element in the history,
   which is newer than the current one.
 - The H_NEXT operation returns the next element in the history, which
   is older than the current one.

This exposed itself as a bug in the REPL where the behavior of up- and
down-arrow was inverted. This wasn't immediately obvious because of how
we save the current "live" entry.

This patch fixes the bug and introduces and enum to wrap the editline
operations that match the semantics of lldb.

Differential revision: https://reviews.llvm.org/D70932




More information about the All-commits mailing list