Change window_range to emit each element as a separate string
This commit is contained in:
parent
2261b48e35
commit
fc7be678ed
|
@ -5,6 +5,8 @@ released versions.
|
||||||
|
|
||||||
== Development version
|
== Development version
|
||||||
|
|
||||||
|
* `%val{window_range}` elements are now emitted as different strings
|
||||||
|
|
||||||
* `+` only duplicates identical selections a single time to avoid surprising
|
* `+` only duplicates identical selections a single time to avoid surprising
|
||||||
and slow exponential growth in the number of selections.
|
and slow exponential growth in the number of selections.
|
||||||
|
|
||||||
|
|
|
@ -1115,9 +1115,9 @@ private:
|
||||||
const String& line = m_line_editor.line();
|
const String& line = m_line_editor.line();
|
||||||
m_completions = completer(context(), flags, line,
|
m_completions = completer(context(), flags, line,
|
||||||
line.byte_count_to(m_line_editor.cursor_pos()));
|
line.byte_count_to(m_line_editor.cursor_pos()));
|
||||||
const bool menu = (bool)(m_completions.flags & Completions::Flags::Menu);
|
if (not context().has_client())
|
||||||
if (context().has_client())
|
return;
|
||||||
{
|
|
||||||
if (m_completions.candidates.empty())
|
if (m_completions.candidates.empty())
|
||||||
return context().client().menu_hide();
|
return context().client().menu_hide();
|
||||||
|
|
||||||
|
@ -1128,6 +1128,7 @@ private:
|
||||||
const auto menu_style = (m_flags & PromptFlags::Search) ? MenuStyle::Search : MenuStyle::Prompt;
|
const auto menu_style = (m_flags & PromptFlags::Search) ? MenuStyle::Search : MenuStyle::Prompt;
|
||||||
context().client().menu_show(items, {}, menu_style);
|
context().client().menu_show(items, {}, menu_style);
|
||||||
|
|
||||||
|
const bool menu = (bool)(m_completions.flags & Completions::Flags::Menu);
|
||||||
if (menu)
|
if (menu)
|
||||||
context().client().menu_select(0);
|
context().client().menu_select(0);
|
||||||
|
|
||||||
|
@ -1140,7 +1141,6 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_prefix_in_completions = false;
|
m_prefix_in_completions = false;
|
||||||
}
|
|
||||||
} catch (runtime_error&) {}
|
} catch (runtime_error&) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ struct {
|
||||||
StringView notes;
|
StringView notes;
|
||||||
} constexpr version_notes[] = { {
|
} constexpr version_notes[] = { {
|
||||||
0,
|
0,
|
||||||
|
"» {+b}%val{window_range}{} is now emitted as separate strings\n"
|
||||||
"» {+b}+{} only duplicates identical selections a single time\n"
|
"» {+b}+{} only duplicates identical selections a single time\n"
|
||||||
"» {+u}daemonize-session{} command\n"
|
"» {+u}daemonize-session{} command\n"
|
||||||
}, {
|
}, {
|
||||||
|
@ -387,8 +388,8 @@ static const EnvVarDesc builtin_env_vars[] = { {
|
||||||
[](StringView name, const Context& context) -> Vector<String>
|
[](StringView name, const Context& context) -> Vector<String>
|
||||||
{
|
{
|
||||||
const auto& setup = context.window().last_display_setup();
|
const auto& setup = context.window().last_display_setup();
|
||||||
return {format("{} {} {} {}", setup.first_line, setup.first_column,
|
return {to_string(setup.first_line), to_string(setup.first_column),
|
||||||
setup.line_count, 0)};
|
to_string(setup.line_count), to_string(0)};
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"history", false,
|
"history", false,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user