Fix clang compilation

This commit is contained in:
Maxime Coste 2014-04-02 22:33:52 +01:00
parent 84c30c4b8a
commit e1a9d5f71e
6 changed files with 9 additions and 8 deletions

View File

@ -711,7 +711,7 @@ void Buffer::on_option_changed(const Option& option)
void Buffer::run_hook_in_own_context(const String& hook_name, const String& param) void Buffer::run_hook_in_own_context(const String& hook_name, const String& param)
{ {
InputHandler hook_handler(*this, SelectionList{ {} }); InputHandler hook_handler(*this, { Selection{} });
m_hooks.run_hook(hook_name, param, hook_handler.context()); m_hooks.run_hook(hook_name, param, hook_handler.context());
} }

View File

@ -125,7 +125,7 @@ void Client::check_buffer_fs_timestamp()
"press r or y to reload, k or n to keep", "press r or y to reload, k or n to keep",
pos, get_color("Information"), MenuStyle::Prompt); pos, get_color("Information"), MenuStyle::Prompt);
m_input_handler.on_next_key([=, this](Key key, Context& context) { m_input_handler.on_next_key([this, filename, ts](Key key, Context& context) {
Buffer* buf = BufferManager::instance().get_buffer_ifp(filename); Buffer* buf = BufferManager::instance().get_buffer_ifp(filename);
m_ui->info_hide(); m_ui->info_hide();
// buffer got deleted while waiting for the key, do nothing // buffer got deleted while waiting for the key, do nothing

View File

@ -918,7 +918,7 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func)
for (auto& name : names) for (auto& name : names)
{ {
Buffer& buffer = BufferManager::instance().get_buffer(name); Buffer& buffer = BufferManager::instance().get_buffer(name);
InputHandler input_handler(buffer, SelectionList{ {} }); InputHandler input_handler{buffer, ( Selection{} )};
func(parser, input_handler.context()); func(parser, input_handler.context());
} }
return; return;

View File

@ -66,7 +66,7 @@ void register_env_vars()
{ return context.buffer().display_name(); } { return context.buffer().display_name(); }
}, { }, {
"buffile", "buffile",
[](const String& name, const Context& context) [](const String& name, const Context& context) -> String
{ return context.buffer().name(); } { return context.buffer().name(); }
}, { }, {
"timestamp", "timestamp",

View File

@ -11,6 +11,7 @@ using CaptureList = std::vector<String>;
// A selection is a Selection, associated with a CaptureList // A selection is a Selection, associated with a CaptureList
struct Selection struct Selection
{ {
Selection() = default;
explicit Selection(BufferCoord pos) : Selection(pos,pos) {} explicit Selection(BufferCoord pos) : Selection(pos,pos) {}
Selection(BufferCoord anchor, BufferCoord cursor, Selection(BufferCoord anchor, BufferCoord cursor,
CaptureList captures = {}) CaptureList captures = {})

View File

@ -23,7 +23,7 @@ Window::Window(Buffer& buffer)
m_options(buffer.options()), m_options(buffer.options()),
m_keymaps(buffer.keymaps()) m_keymaps(buffer.keymaps())
{ {
InputHandler hook_handler{*m_buffer, SelectionList{ {} } }; InputHandler hook_handler{*m_buffer, { Selection{} } };
hook_handler.context().set_window(*this); hook_handler.context().set_window(*this);
m_hooks.run_hook("WinCreate", buffer.name(), hook_handler.context()); m_hooks.run_hook("WinCreate", buffer.name(), hook_handler.context());
m_options.register_watcher(*this); m_options.register_watcher(*this);
@ -38,7 +38,7 @@ Window::Window(Buffer& buffer)
Window::~Window() Window::~Window()
{ {
InputHandler hook_handler{*m_buffer, SelectionList{ {} } }; InputHandler hook_handler{*m_buffer, { Selection{} } };
hook_handler.context().set_window(*this); hook_handler.context().set_window(*this);
m_hooks.run_hook("WinClose", buffer().name(), hook_handler.context()); m_hooks.run_hook("WinClose", buffer().name(), hook_handler.context());
m_options.unregister_watcher(*this); m_options.unregister_watcher(*this);
@ -262,7 +262,7 @@ BufferCoord Window::offset_coord(BufferCoord coord, LineCount offset)
lines.emplace_back(AtomList{ {buffer(), line, line+1} }); lines.emplace_back(AtomList{ {buffer(), line, line+1} });
display_buffer.compute_range(); display_buffer.compute_range();
InputHandler hook_handler{*m_buffer, SelectionList{ {} } }; InputHandler hook_handler{*m_buffer, { Selection{} } };
hook_handler.context().set_window(*this); hook_handler.context().set_window(*this);
m_highlighters(hook_handler.context(), HighlightFlags::MoveOnly, display_buffer); m_highlighters(hook_handler.context(), HighlightFlags::MoveOnly, display_buffer);
m_builtin_highlighters(hook_handler.context(), HighlightFlags::MoveOnly, display_buffer); m_builtin_highlighters(hook_handler.context(), HighlightFlags::MoveOnly, display_buffer);
@ -274,7 +274,7 @@ BufferCoord Window::offset_coord(BufferCoord coord, LineCount offset)
void Window::on_option_changed(const Option& option) void Window::on_option_changed(const Option& option)
{ {
String desc = option.name() + "=" + option.get_as_string(); String desc = option.name() + "=" + option.get_as_string();
InputHandler hook_handler{*m_buffer, SelectionList{ {} } }; InputHandler hook_handler{*m_buffer, { Selection{} } };
hook_handler.context().set_window(*this); hook_handler.context().set_window(*this);
m_hooks.run_hook("WinSetOption", desc, hook_handler.context()); m_hooks.run_hook("WinSetOption", desc, hook_handler.context());