window: add ScopedStringHelper and use it where appropriate

This commit is contained in:
Andrzej Rybczak
2014-10-31 15:30:54 +01:00
parent fa1cd965fa
commit b265d56cdf
3 changed files with 31 additions and 9 deletions

View File

@@ -842,10 +842,11 @@ void ExecuteCommand::run()
std::string cmd_name;
{
Statusbar::ScopedLock lock;
NC::Window::ScopedStringHelper helper(*wFooter,
Statusbar::Helpers::TryExecuteImmediateCommand()
);
Statusbar::put() << NC::Format::Bold << ":" << NC::Format::NoBold;
wFooter->setGetStringHelper(Statusbar::Helpers::TryExecuteImmediateCommand());
cmd_name = wFooter->getString();
wFooter->setGetStringHelper(Statusbar::Helpers::getString);
}
auto cmd = Bindings.findCommand(cmd_name);
@@ -1882,10 +1883,11 @@ void ApplyFilter::run()
try
{
Statusbar::ScopedLock lock;
NC::Window::ScopedStringHelper helper(*wFooter,
Statusbar::Helpers::ApplyFilterImmediately(f, filter)
);
Statusbar::put() << NC::Format::Bold << "Apply filter: " << NC::Format::NoBold;
wFooter->setGetStringHelper(Statusbar::Helpers::ApplyFilterImmediately(f, filter));
wFooter->getString(filter);
wFooter->setGetStringHelper(Statusbar::Helpers::getString);
}
catch (NC::PromptAborted &)
{