Skip to content

Commit

Permalink
Merge pull request #1931 from H3rnand3zzz/feature/redraw-command
Browse files Browse the repository at this point in the history
Introduce `/redraw` command
  • Loading branch information
jubalh authored Nov 14, 2023
2 parents 7718990 + a1ff88c commit 62e1de0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/command/cmd_defs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,18 @@ static const struct cmd_t command_defs[] = {
"/privacy logging off",
"/privacy os off")
},

{ CMD_PREAMBLE("/redraw",
parse_args, 0, 0, NULL)
CMD_MAINFUNC(cmd_redraw)
CMD_TAGS(
CMD_TAG_UI)
CMD_SYN(
"/redraw")
CMD_DESC(
"Redraw user interface. Can be used when some other program interrupted profanity or wrote to the same terminal and the interface looks \"broken\"." )
},

// NEXT-COMMAND (search helper)
};

Expand Down
8 changes: 8 additions & 0 deletions src/command/cmd_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9730,6 +9730,14 @@ cmd_correct_editor(ProfWin* window, const char* const command, gchar** args)
return TRUE;
}

gboolean
cmd_redraw(ProfWin* window, const char* const command, gchar** args)
{
ui_resize();

return TRUE;
}

gboolean
cmd_silence(ProfWin* window, const char* const command, gchar** args)
{
Expand Down
1 change: 1 addition & 0 deletions src/command/cmd_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ gboolean cmd_executable_vcard_photo(ProfWin* window, const char* const command,
gboolean cmd_mam(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_editor(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_correct_editor(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_redraw(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_silence(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_register(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_mood(ProfWin* window, const char* const command, gchar** args);
Expand Down

0 comments on commit 62e1de0

Please sign in to comment.