mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 23:24:24 +01:00
Check adjust mode argument
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
10641d688d
commit
bcdc7aba05
@ -100,8 +100,15 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
|
||||
zathura_t* zathura = session->global.data;
|
||||
g_return_val_if_fail(argument != NULL, false);
|
||||
|
||||
zathura_document_set_adjust_mode(zathura->document, argument->n);
|
||||
adjust_view(zathura);
|
||||
if (argument->n < ZATHURA_ADJUST_NONE || argument->n >= ZATHURA_ADJUST_MODE_NUMBER) {
|
||||
girara_error("Invalid adjust mode: %d", argument->n);
|
||||
girara_notify(session, GIRARA_ERROR, _("Invalid adjust mode: %d"), argument->n);
|
||||
} else {
|
||||
girara_debug("Setting adjust mode to: %d", argument->n);
|
||||
|
||||
zathura_document_set_adjust_mode(zathura->document, argument->n);
|
||||
adjust_view(zathura);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -101,7 +101,8 @@ typedef enum zathura_adjust_mode_e
|
||||
ZATHURA_ADJUST_NONE, /**< No adjustment */
|
||||
ZATHURA_ADJUST_BESTFIT, /**< Adjust to best-fit */
|
||||
ZATHURA_ADJUST_WIDTH, /**< Adjust to width */
|
||||
ZATHURA_ADJUST_INPUTBAR /**< Focusing the inputbar */
|
||||
ZATHURA_ADJUST_INPUTBAR, /**< Focusing the inputbar */
|
||||
ZATHURA_ADJUST_MODE_NUMBER /**< Number of adjust modes */
|
||||
} zathura_adjust_mode_t;
|
||||
|
||||
/**
|
||||
|
@ -121,7 +121,7 @@ error_out:
|
||||
static void
|
||||
create_directories(zathura_t* zathura)
|
||||
{
|
||||
static const unsigned int mode = 0711;
|
||||
static const unsigned int mode = 0700;
|
||||
|
||||
if (g_mkdir_with_parents(zathura->config.config_dir, mode) == -1) {
|
||||
girara_error("Could not create '%s': %s", zathura->config.config_dir,
|
||||
|
Loading…
Reference in New Issue
Block a user