add "q" command to quit
This commit is contained in:
parent
ee0d1e0d0e
commit
fbc942c4f7
@ -412,9 +412,6 @@ void Window::handle_keyval(uint32_t keyval)
|
|||||||
case Keymod::CTRL + 'y':
|
case Keymod::CTRL + 'y':
|
||||||
m_focused_buffer_pane->scroll_window_up(ScrollMode::ONE_LINE);
|
m_focused_buffer_pane->scroll_window_up(ScrollMode::ONE_LINE);
|
||||||
break;
|
break;
|
||||||
case Keymod::CTRL + 'q':
|
|
||||||
m_exit_requested = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -576,6 +573,10 @@ void Window::handle_command(const EncodedString & command)
|
|||||||
{
|
{
|
||||||
command_write_file(cp);
|
command_write_file(cp);
|
||||||
}
|
}
|
||||||
|
else if (cp[0] == "q")
|
||||||
|
{
|
||||||
|
command_quit(cp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -592,3 +593,8 @@ void Window::command_write_file(const CommandParser & cp)
|
|||||||
buffer->write_to_file(buffer->filename()->c_str());
|
buffer->write_to_file(buffer->filename()->c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::command_quit(const CommandParser & cp)
|
||||||
|
{
|
||||||
|
m_exit_requested = true;
|
||||||
|
}
|
||||||
|
@ -79,6 +79,7 @@ protected:
|
|||||||
void handle_command(const EncodedString & command);
|
void handle_command(const EncodedString & command);
|
||||||
|
|
||||||
void command_write_file(const CommandParser & cp);
|
void command_write_file(const CommandParser & cp);
|
||||||
|
void command_quit(const CommandParser & cp);
|
||||||
|
|
||||||
SDL_Window * m_window;
|
SDL_Window * m_window;
|
||||||
bool m_exit_requested;
|
bool m_exit_requested;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user