diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-04 10:51:10 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-17 00:38:58 +0200 |
| commit | 01f3d7cbda4b9667fd2e65c6786a0e9140e2890b (patch) | |
| tree | 9e1cef9e2aff9603208eb70174f2b54aeb2dd657 /src/normal.cc | |
| parent | 31e9fc3cefcbea03d4eaad75ed0dab3da8f3dc6f (diff) | |
Rename key_to_str() to the more idiomatic to_string()
This makes the function easier to find for newcomers because
to_string() is the obvious name. It enables format() to do the
conversion automatically which seems like good idea (since there is
no other obvious representation).
Of course this change makes it a bit harder to grep but that's not
a problem with clang tooling.
We need to cast the function in one place when calling transform()
but that's acceptable.
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/normal.cc b/src/normal.cc index 68a5fd6f..3d5a5980 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -179,14 +179,14 @@ String build_autoinfo_for_mapping(const Context& context, KeymapMode mode, { String keys = join(built_in.keys | filter([&](Key k){ return not keymaps.is_mapped(k, mode); }) | - transform(key_to_str), + transform((String(*)(Key))to_string), ',', false); if (not keys.empty()) descs.emplace_back(std::move(keys), built_in.docstring); } for (auto& key : keymaps.get_mapped_keys(mode)) - descs.emplace_back(key_to_str(key), + descs.emplace_back(to_string(key), keymaps.get_mapping(key, mode).docstring); auto max_len = 0_col; |
