diff --git a/ChangeLog b/ChangeLog index 654ab6f66..a8aa1ceda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ - TW-1603 Priority color precedence changed since it is a UDA, should be lowered again (thanks to Jens Erat). - TW-1605 Japanese translation for Taskwarrior (thanks to Oota Toshiya). +- TW-1606 scheduled.any filter (thanks to Peter Rochen). - The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'. ------ current release --------------------------- diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 0a9da3003..41fb6ef9f 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -754,14 +754,16 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type) } } - if (_eos - _cursor > 1 && + if (_eos - _cursor >= 1 && _text[_cursor] == ':') { _cursor++; if (isString (ignoredToken, ignoredType, '\'') || isString (ignoredToken, ignoredType, '"') || - isWord (ignoredToken, ignoredType)) + isWord (ignoredToken, ignoredType) || + _eos == _cursor || + _text[_cursor] == ' ') { token = _text.substr (marker, _cursor - marker); type = Lexer::Type::pair; diff --git a/test/lexer.t.cpp b/test/lexer.t.cpp index 9ea0531b3..d29b82997 100644 --- a/test/lexer.t.cpp +++ b/test/lexer.t.cpp @@ -36,7 +36,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (765); + UnitTest t (771); std::vector > tokens; std::string token; @@ -278,6 +278,7 @@ int main (int argc, char** argv) // Pair { "name:value", { { "name:value", Lexer::Type::pair }, NO, NO, NO, NO }, }, { "desc.cont:pattern", { { "desc.cont:pattern", Lexer::Type::pair }, NO, NO, NO, NO }, }, + { "desc.any:", { { "desc.any:", Lexer::Type::pair }, NO, NO, NO, NO }, }, { "pro:'P 1'", { { "pro:'P 1'", Lexer::Type::pair }, NO, NO, NO, NO }, }, { "pro:PROJECT", { { "pro:PROJECT", Lexer::Type::pair }, NO, NO, NO, NO }, }, { "due:'eow - 2d'", { { "due:'eow - 2d'", Lexer::Type::pair }, NO, NO, NO, NO }, },