summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-12-15 10:45:28 +1100
committerMaxime Coste <mawww@kakoune.org>2019-12-15 10:47:20 +1100
commitdfc67dd5826a24d13dca25426dee4bdfaceadc3e (patch)
treeaca64ca7db2ddaa61490aa083c4fa86d09666494 /src
parent660378ee3a275c034fa520f1aad714d50597efd5 (diff)
Code style tweak
Diffstat (limited to 'src')
-rw-r--r--src/highlighters.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/highlighters.cc b/src/highlighters.cc
index a8f4c433..fceb1e68 100644
--- a/src/highlighters.cc
+++ b/src/highlighters.cc
@@ -920,10 +920,8 @@ struct WrapHighlighter : Highlighter
ParameterDesc::Flags::None, 0, 0
};
ParametersParser parser(params, param_desc);
-
- ColumnCount max_width{std::numeric_limits<int>::max()};
- if (auto width = parser.get_switch("width"))
- max_width = str_to_int(*width);
+ ColumnCount max_width = parser.get_switch("width").map(str_to_int)
+ .value_or(std::numeric_limits<int>::max());
return std::make_unique<WrapHighlighter>(max_width, (bool)parser.get_switch("word"),
(bool)parser.get_switch("indent"),
@@ -1162,9 +1160,9 @@ private:
return digit_count;
}
- const bool m_relative;
- const bool m_hl_cursor_line;
- const String m_separator;
+ const bool m_relative;
+ const bool m_hl_cursor_line;
+ const String m_separator;
};
constexpr StringView LineNumbersHighlighter::ms_id;