mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Enhancement
- Swapped std::string::find for find (from text.cpp) to allow configurable case sensitivity.
This commit is contained in:
parent
99bce308e6
commit
4f4a32b405
1 changed files with 23 additions and 18 deletions
|
@ -2036,6 +2036,8 @@ int handleDenotate (std::string &outs)
|
||||||
if (context.sequence.size () == 0)
|
if (context.sequence.size () == 0)
|
||||||
throw std::string ("A task ID is needed to delete an annotation.");
|
throw std::string ("A task ID is needed to delete an annotation.");
|
||||||
|
|
||||||
|
bool sensitive = context.config.getBoolean ("search.case.sensitive");
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
|
|
||||||
std::vector <Task> tasks;
|
std::vector <Task> tasks;
|
||||||
|
@ -2078,7 +2080,8 @@ int handleDenotate (std::string &outs)
|
||||||
for (i = annotations.begin (); i != annotations.end (); ++i)
|
for (i = annotations.begin (); i != annotations.end (); ++i)
|
||||||
{
|
{
|
||||||
anno = i->value ();
|
anno = i->value ();
|
||||||
std::string::size_type loc = anno.find (desc, 0);
|
std::string::size_type loc = find (anno, desc, sensitive);
|
||||||
|
|
||||||
if (loc != std::string::npos && loc == 0)
|
if (loc != std::string::npos && loc == 0)
|
||||||
{
|
{
|
||||||
match = true;
|
match = true;
|
||||||
|
@ -2088,6 +2091,7 @@ int handleDenotate (std::string &outs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskDiff (before, *task))
|
if (taskDiff (before, *task))
|
||||||
{
|
{
|
||||||
if (permission.confirmed (before, taskDifferences (before, *task) + "Proceed with change?"))
|
if (permission.confirmed (before, taskDifferences (before, *task) + "Proceed with change?"))
|
||||||
|
@ -2113,6 +2117,7 @@ int handleDenotate (std::string &outs)
|
||||||
outs = out.str ();
|
outs = out.str ();
|
||||||
context.hooks.trigger ("post-denotate-command");
|
context.hooks.trigger ("post-denotate-command");
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue