diff options
| author | Jason Felice <jason.m.felice@gmail.com> | 2019-11-02 16:49:26 -0400 |
|---|---|---|
| committer | Jason Felice <jason.m.felice@gmail.com> | 2019-11-09 12:53:45 -0500 |
| commit | d26bb0ce2bd7bffd87b38b466f1e9642b85d0715 (patch) | |
| tree | 7d03051b0b2c104bf809c9d91fead12903cdc561 /src/normal.cc | |
| parent | 49ca5127336d1bac7b3e64e3efa7b20060a9f96a (diff) | |
Add static or const where useful
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc index 3a7565e2..66957a2e 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -166,7 +166,7 @@ void repeat_last_select(Context& context, NormalParams) context.repeat_last_select(); } -String build_autoinfo_for_mapping(Context& context, KeymapMode mode, +String build_autoinfo_for_mapping(const Context& context, KeymapMode mode, ConstArrayView<KeyInfo> built_ins) { auto& keymaps = context.keymaps(); @@ -445,7 +445,7 @@ void for_each_codepoint(Context& context, NormalParams) selections.insert(strings, InsertMode::Replace); } -void command(Context& context, EnvVarMap env_vars) +void command(const Context& context, EnvVarMap env_vars) { if (not CommandManager::has_instance()) throw runtime_error{"commands are not supported"}; @@ -1190,7 +1190,7 @@ void deindent(Context& context, NormalParams params) indent_width = tabstop; indent_width = indent_width * count; - auto& buffer = context.buffer(); + const auto& buffer = context.buffer(); Vector<Selection> sels; LineCount last_line = 0; for (auto& sel : context.selections()) @@ -1378,7 +1378,7 @@ enum Direction { Backward = -1, Forward = 1 }; template<Direction direction, bool half = false> void scroll(Context& context, NormalParams params) { - Window& window = context.window(); + const Window& window = context.window(); const int count = params.count ? params.count : 1; const LineCount offset = (window.dimensions().line - 2) / (half ? 2 : 1) * count; |
