diff --git a/src/main.cc b/src/main.cc index e846dfbc..1640c504 100644 --- a/src/main.cc +++ b/src/main.cc @@ -178,10 +178,14 @@ void register_registers() register_manager.add_register('_', make_unique()); } -static void check_positive(const int& val) +static void check_tabstop(const int& val) { - if (val < 1) - throw runtime_error{"value should be strictly positive"}; + if (val < 1) throw runtime_error{"tabstop should be strictly positive"}; +} + +static void check_indentwidth(const int& val) +{ + if (val < 0) throw runtime_error{"indentwidth should be positive or zero"}; } static void check_scrolloff(const CharCoord& so) @@ -194,8 +198,8 @@ void register_options() { OptionsRegistry& reg = GlobalScope::instance().option_registry(); - reg.declare_option("tabstop", "size of a tab character", 8); - reg.declare_option("indentwidth", "indentation width", 4); + reg.declare_option("tabstop", "size of a tab character", 8); + reg.declare_option("indentwidth", "indentation width", 4); reg.declare_option( "scrolloff", "number of lines and columns to keep visible main cursor when scrolling", {0,0});