diff --git a/NEWS b/NEWS index b94048ae..cfd52505 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ncmpcpp-0.6.5 (????-??-??) * Description of mouse wheel usage on volume is now correct. * Configure script now fails if either readline or pthread specific headers are not present. +* Searching in text fields now respects regular expression configuration. ncmpcpp-0.6.4 (2015-05-02) diff --git a/src/actions.cpp b/src/actions.cpp index 16a10448..34e7964f 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1932,8 +1932,8 @@ void Find::run() Statusbar::print("Searching..."); auto s = static_cast *>(myScreen); s->main().removeProperties(); - if (findme.empty() || s->main().setProperties(NC::Format::Reverse, findme, NC::Format::NoReverse)) - Statusbar::print("Done"); + if (findme.empty() || s->main().setProperties(NC::Format::Reverse, findme, NC::Format::NoReverse, Config.regex_type)) + Statusbar::print("Done"); else Statusbar::print("No matching patterns found"); s->main().flush(); diff --git a/src/scrollpad.cpp b/src/scrollpad.cpp index 064b03fa..3f25dba1 100644 --- a/src/scrollpad.cpp +++ b/src/scrollpad.cpp @@ -27,7 +27,7 @@ namespace {// template -bool regexSearch(NC::Buffer &buf, PropT begin, const std::string &ws, PropT end, size_t id, boost::regex::flag_type flags) +bool regexSearch(NC::Buffer &buf, PropT begin, const std::string &ws, PropT end, boost::regex::flag_type flags, size_t id) { try { boost::regex rx(ws, flags); @@ -274,14 +274,14 @@ void Scrollpad::reset() m_beginning = 0; } -bool Scrollpad::setProperties(Color begin, const std::string &s, Color end, size_t id, boost::regex::flag_type flags) +bool Scrollpad::setProperties(Color begin, const std::string &s, Color end, size_t flags, size_t id) { return regexSearch(m_buffer, begin, s, end, id, flags); } -bool Scrollpad::setProperties(Format begin, const std::string &s, Format end, size_t id, boost::regex::flag_type flags) +bool Scrollpad::setProperties(Format begin, const std::string &s, Format end, size_t flags, size_t id) { - return regexSearch(m_buffer, begin, s, end, id, flags); + return regexSearch(m_buffer, begin, s, end, flags, id); } void Scrollpad::removeProperties(size_t id) diff --git a/src/scrollpad.h b/src/scrollpad.h index c281dd2a..a9816d08 100644 --- a/src/scrollpad.h +++ b/src/scrollpad.h @@ -21,7 +21,6 @@ #ifndef NCMPCPP_SCROLLPAD_H #define NCMPCPP_SCROLLPAD_H -#include #include "window.h" #include "strbuffer.h" @@ -47,8 +46,8 @@ struct Scrollpad: public Window void flush(); void reset(); - bool setProperties(Color begin, const std::string &s, Color end, size_t id = -2, boost::regex::flag_type flags = boost::regex::icase); - bool setProperties(Format begin, const std::string &s, Format end, size_t id = -2, boost::regex::flag_type flags = boost::regex::icase); + bool setProperties(Color begin, const std::string &s, Color end, size_t flags, size_t id = -2); + bool setProperties(Format begin, const std::string &s, Format end, size_t flags, size_t id = -2); void removeProperties(size_t id = -2); template