parent
ca105f8cc6
commit
ae69759a53
|
@ -759,6 +759,7 @@ int run_server(StringView session, StringView server_init,
|
||||||
client_manager.clear_client_trash();
|
client_manager.clear_client_trash();
|
||||||
client_manager.clear_window_trash();
|
client_manager.clear_window_trash();
|
||||||
buffer_manager.clear_buffer_trash();
|
buffer_manager.clear_buffer_trash();
|
||||||
|
global_scope.option_registry().clear_option_trash();
|
||||||
|
|
||||||
if (local_client and not contains(client_manager, local_client))
|
if (local_client and not contains(client_manager, local_client))
|
||||||
local_client = nullptr;
|
local_client = nullptr;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "assert.hh"
|
#include "assert.hh"
|
||||||
#include "flags.hh"
|
#include "flags.hh"
|
||||||
|
#include "scope.hh"
|
||||||
|
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
@ -85,6 +86,7 @@ void OptionManager::unset_option(StringView name)
|
||||||
{
|
{
|
||||||
auto& parent_option = (*m_parent)[name];
|
auto& parent_option = (*m_parent)[name];
|
||||||
const bool changed = not parent_option.has_same_value(*it->value);
|
const bool changed = not parent_option.has_same_value(*it->value);
|
||||||
|
GlobalScope::instance().option_registry().move_to_trash(std::move(it->value));
|
||||||
m_options.erase(name);
|
m_options.erase(name);
|
||||||
if (changed)
|
if (changed)
|
||||||
on_option_changed(parent_option);
|
on_option_changed(parent_option);
|
||||||
|
|
|
@ -263,9 +263,13 @@ public:
|
||||||
bool option_exists(StringView name) const { return option_desc(name) != nullptr; }
|
bool option_exists(StringView name) const { return option_desc(name) != nullptr; }
|
||||||
|
|
||||||
CandidateList complete_option_name(StringView prefix, ByteCount cursor_pos) const;
|
CandidateList complete_option_name(StringView prefix, ByteCount cursor_pos) const;
|
||||||
|
|
||||||
|
void clear_option_trash() { m_option_trash.clear(); }
|
||||||
|
void move_to_trash(std::unique_ptr<Option>&& option) { m_option_trash.push_back(std::move(option)); }
|
||||||
private:
|
private:
|
||||||
OptionManager& m_global_manager;
|
OptionManager& m_global_manager;
|
||||||
Vector<std::unique_ptr<const OptionDesc>, MemoryDomain::Options> m_descs;
|
Vector<std::unique_ptr<const OptionDesc>, MemoryDomain::Options> m_descs;
|
||||||
|
Vector<std::unique_ptr<Option>> m_option_trash;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user