diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index 2914c5c..5454e06 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -367,6 +367,12 @@ void BufferPane::handle_key(uint32_t keyval) m_window->request_redraw(); } break; + case Window::KEYMOD_CTRL + 'w': + if (m_buffer->filename() != "") + { + m_buffer->write_to_file(m_buffer->filename().c_str()); + } + break; } } } diff --git a/src/gui/Window.h b/src/gui/Window.h index 417fe82..28a637f 100644 --- a/src/gui/Window.h +++ b/src/gui/Window.h @@ -14,13 +14,6 @@ class BufferStatusPane; class Window { public: - bool create(std::shared_ptr buffer); - void run_event_loop(); - void request_redraw() { m_redraw_requested = true; } - std::shared_ptr font() const { return m_font; } - std::shared_ptr gl() const { return m_gl; } - -protected: enum : uint32_t { KEYMOD_CTRL = 0x10000, @@ -29,6 +22,14 @@ protected: KEYMOD_GUI = 0x80000, }; + bool create(std::shared_ptr buffer); + void run_event_loop(); + void request_redraw() { m_redraw_requested = true; } + std::shared_ptr font() const { return m_font; } + std::shared_ptr gl() const { return m_gl; } + +protected: + void resize(); void redraw(); void handle_event(SDL_Event & event);