add "q" command to quit

This commit is contained in:
josh committed 2017-01-27 21:00:52 -05:00
1 parent ee0d1e0d0e
commit fbc942c4f7
2 files changed
+10 -3

No files matched your search

+9 -3
View File
@@ -412,9 +412,6 @@ void Window::handle_keyval(uint32_t keyval)
case Keymod::CTRL + 'y':
m_focused_buffer_pane->scroll_window_up(ScrollMode::ONE_LINE);
break;
case Keymod::CTRL + 'q':
m_exit_requested = true;
break;
}
}
break;
@@ -576,6 +573,10 @@ void Window::handle_command(const EncodedString & command)
{
command_write_file(cp);
}
else if (cp[0] == "q")
{
command_quit(cp);
}
}
}
else
@@ -592,3 +593,8 @@ void Window::command_write_file(const CommandParser & cp)
buffer->write_to_file(buffer->filename()->c_str());
}
}
void Window::command_quit(const CommandParser & cp)
{
m_exit_requested = true;
}
+1
View File
@@ -79,6 +79,7 @@ protected:
void handle_command(const EncodedString & command);
void command_write_file(const CommandParser & cp);
void command_quit(const CommandParser & cp);
SDL_Window * m_window;
bool m_exit_requested;