1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-11 04:46:05 +03:00

Update hard-coded links and contents

Matt Peterson 2018-05-21 13:56:05 -04:00
parent 54f8957cd8
commit b7e4e20aac

@ -2,7 +2,7 @@
By default it has the following value: `%val{bufname} %val{cursor_line}:%val{cursor_char_column} {{context_info}} {{mode_info}} - %val{client}@[%val{session}]`
The `{{context_info}}` placeholder displays [hard-coded info](https://github.com/mawww/kakoune/blob/master/src/client.cc#L122-L136):
The `{{context_info}}` placeholder displays [hard-coded info](https://github.com/mawww/kakoune/blob/master/src/client.cc#L124-L142):
```cpp
String generate_context_info(const Context& context)
@ -12,31 +12,42 @@ String generate_context_info(const Context& context)
s += "[+]";
if (context.client().input_handler().is_recording())
s += format("[recording ({})]", context.client().input_handler().recording_reg());
if (context.buffer().flags() & Buffer::Flags::New)
s += "[new file]";
if (context.hooks_disabled())
s += "[no-hooks]";
if (not(context.buffer().flags() & (Buffer::Flags::File | Buffer::Flags::Debug)))
s += "[scratch]";
if (context.buffer().flags() & Buffer::Flags::New)
s += "[new file]";
if (context.buffer().flags() & Buffer::Flags::Fifo)
s += "[fifo]";
if (context.buffer().flags() & Buffer::Flags::Debug)
s += "[debug]";
return s;
}
```
The `{{mode_info}}` placeholder also displays [hard-coded info](https://github.com/mawww/kakoune/blob/master/src/input_handler.cc#L291-L305), depending of the current mode:
The `{{mode_info}}` placeholder also displays [hard-coded info](https://github.com/mawww/kakoune/blob/master/src/input_handler.cc#L316-L337), depending of the current mode:
```cpp
DisplayLine mode_line() const override
{
AtomList atoms = { { to_string(context().selections().size()) + " sel", get_face("StatusLineInfo") } };
AtomList atoms;
auto num_sel = context().selections().size();
auto main_index = context().selections().main_index();
if (num_sel == 1)
atoms.emplace_back(format("{} sel", num_sel), context().faces()["StatusLineInfo"]);
else
atoms.emplace_back(format("{} sels ({})", num_sel, main_index + 1), context().faces()["StatusLineInfo"]);
if (m_params.count != 0)
{
atoms.emplace_back(" param=", get_face("StatusLineInfo"));
atoms.emplace_back(to_string(m_params.count), get_face("StatusLineValue"));
atoms.emplace_back(" param=", context().faces()["StatusLineInfo"]);
atoms.emplace_back(to_string(m_params.count), context().faces()["StatusLineValue"]);
}
if (m_params.reg)
{
atoms.emplace_back(" reg=", get_face("StatusLineInfo"));
atoms.emplace_back(StringView(m_params.reg).str(), get_face("StatusLineValue"));
atoms.emplace_back(" reg=", context().faces()["StatusLineInfo"]);
atoms.emplace_back(StringView(m_params.reg).str(), context().faces()["StatusLineValue"]);
}
return atoms;
}