From bff6a6e66a3e9e03b196ec7bafd3c49453145dba Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 16 Oct 2016 21:15:40 -0700 Subject: [PATCH] eliminate compile warnings and augment changelog Update the CHANGELOG to more accurately reflect what will be included in the 2.4.0 release vis-a-vis the `history` command behavior. I noticed that the compiler was emitting some harmless warnings related to the history changes so deal with those as well. --- CHANGELOG.md | 4 +++- src/history.cpp | 1 + src/history.h | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5d1997e1..1f7b0e16f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Significant changes - The clipboard integration has been revamped with explicit bindings. The killring commands no longer copy from, or paste to, the X11 clipboard - use the new copy (`C-x`) and paste (`C-v`) bindings instead. The clipboard is now available on OS X as well as systems using X11 (e.g. Linux). (#3061) -- `history` uses subcommands (`history delete`) rather than options (`history --delete`) for its actions (#3367). New options have been added, including `--max=n` to limit the number of history entries and `--show-time` option to show timestamps (#3175, #3244). +- `history` uses subcommands (`history delete`) rather than options (`history --delete`) for its actions (#3367). You can no longer specify multiple actions via flags (e.g., `history --delete --save something`). +- New `history` options have been added, including `--max=n` to limit the number of history entries and `--show-time` option to show timestamps (#3175, #3244). +- `history search` is now case-insensitive by default (which also affects `history delete`). - Vi-style bindings no longer include all of the default emacs-style bindings; instead, they share some definitions (#3068). - If there is no locale set in the environment, various known system configuration files will be checked for a default, otherwise forcing en_US-UTF.8 (#277). - A number followed by a caret (e.g. `5^`) is no longer treated as a redirection (#1873). diff --git a/src/history.cpp b/src/history.cpp index 77f4ac600..82f41b26b 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -1,4 +1,5 @@ // History functions, part of the user interface. +// #include "config.h" // IWYU pragma: keep #include diff --git a/src/history.h b/src/history.h index 58a0f30a5..bd990c196 100644 --- a/src/history.h +++ b/src/history.h @@ -265,7 +265,10 @@ class history_search_t { // The history in which we are searching. history_t *history; - // Our type. + // The search term. + wcstring term; + + // Our search type. enum history_search_type_t search_type; bool case_sensitive; @@ -276,9 +279,6 @@ class history_search_t { // Returns yes if a given term is in prev_matches. bool match_already_made(const wcstring &match) const; - // The search term. - wcstring term; - // Additional strings to skip (sorted). wcstring_list_t external_skips; @@ -326,7 +326,7 @@ class history_search_t { } // Default constructor. - history_search_t() : history(), term() {} + history_search_t() : history(), term(), search_type(HISTORY_SEARCH_TYPE_CONTAINS), case_sensitive(true) {} }; // Init history library. The history file won't actually be loaded until the first time a history