mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:58:11 +00:00
LibGUI+HackStudio: Remove editing specific hacks from GUI::Command
Use is<T> to check for specific types of command in HackStudio instead of cluttering up GUI::Command with specialized getters.
This commit is contained in:
parent
f052a66c5d
commit
68a0e4f8d5
3 changed files with 4 additions and 9 deletions
|
@ -493,8 +493,8 @@ void Editor::on_edit_action(const GUI::Command& command)
|
|||
if (!m_language_client)
|
||||
return;
|
||||
|
||||
if (command.is_insert_text()) {
|
||||
const GUI::InsertTextCommand& insert_command = static_cast<const GUI::InsertTextCommand&>(command);
|
||||
if (is<GUI::InsertTextCommand>(command)) {
|
||||
auto const& insert_command = static_cast<GUI::InsertTextCommand const&>(command);
|
||||
m_language_client->insert_text(
|
||||
code_document().file_path(),
|
||||
insert_command.text(),
|
||||
|
@ -503,8 +503,8 @@ void Editor::on_edit_action(const GUI::Command& command)
|
|||
return;
|
||||
}
|
||||
|
||||
if (command.is_remove_text()) {
|
||||
const GUI::RemoveTextCommand& remove_command = static_cast<const GUI::RemoveTextCommand&>(command);
|
||||
if (is<GUI::RemoveTextCommand>(command)) {
|
||||
auto const& remove_command = static_cast<GUI::RemoveTextCommand const&>(command);
|
||||
m_language_client->remove_text(
|
||||
code_document().file_path(),
|
||||
remove_command.range().start().line(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue