mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-18 08:51:46 +03:00
Fixed all reorder warnings
This commit is contained in:
parent
29342836a6
commit
8178400f8d
@ -85,7 +85,7 @@ else
|
||||
LDFLAGS += -rdynamic
|
||||
endif
|
||||
|
||||
CXXFLAGS += -pedantic -std=c++17 -g -Wall -Wextra -Wno-unused-parameter -Wno-reorder -Wno-sign-compare -Wno-address
|
||||
CXXFLAGS += -pedantic -std=c++17 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address
|
||||
|
||||
all : kak
|
||||
|
||||
|
@ -32,9 +32,9 @@ Client::Client(std::unique_ptr<UserInterface>&& ui,
|
||||
: m_ui{std::move(ui)}, m_window{std::move(window)},
|
||||
m_pid{pid},
|
||||
m_on_exit{std::move(on_exit)},
|
||||
m_env_vars(std::move(env_vars)),
|
||||
m_input_handler{std::move(selections), Context::Flags::None,
|
||||
std::move(name)},
|
||||
m_env_vars(std::move(env_vars))
|
||||
std::move(name)}
|
||||
{
|
||||
m_window->set_client(this);
|
||||
|
||||
|
@ -13,9 +13,9 @@ Context::~Context() = default;
|
||||
|
||||
Context::Context(InputHandler& input_handler, SelectionList selections,
|
||||
Flags flags, String name)
|
||||
: m_input_handler{&input_handler},
|
||||
: m_flags(flags),
|
||||
m_input_handler{&input_handler},
|
||||
m_selections{std::move(selections)},
|
||||
m_flags(flags),
|
||||
m_name(std::move(name))
|
||||
{}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
: m_type(Range), m_buffer(&buffer), m_range{begin, end} {}
|
||||
|
||||
DisplayAtom(String str, Face face)
|
||||
: m_type(Text), m_text(std::move(str)), face(face) {}
|
||||
: face(face), m_type(Text), m_text(std::move(str)) {}
|
||||
|
||||
StringView content() const;
|
||||
ColumnCount length() const;
|
||||
|
@ -34,7 +34,7 @@ void FDWatcher::close_fd()
|
||||
}
|
||||
|
||||
Timer::Timer(TimePoint date, Callback callback, EventMode mode)
|
||||
: m_date{date}, m_callback{std::move(callback)}, m_mode(mode)
|
||||
: m_date{date}, m_mode(mode), m_callback{std::move(callback)}
|
||||
{
|
||||
if (m_callback and EventManager::has_instance())
|
||||
EventManager::instance().m_timers.push_back(this);
|
||||
|
@ -633,8 +633,8 @@ std::unique_ptr<Highlighter> create_column_highlighter(HighlighterParameters par
|
||||
struct WrapHighlighter : Highlighter
|
||||
{
|
||||
WrapHighlighter(ColumnCount max_width, bool word_wrap, bool preserve_indent, String marker)
|
||||
: Highlighter{HighlightPass::Wrap}, m_max_width{max_width},
|
||||
m_word_wrap{word_wrap}, m_preserve_indent{preserve_indent},
|
||||
: Highlighter{HighlightPass::Wrap}, m_word_wrap{word_wrap},
|
||||
m_preserve_indent{preserve_indent}, m_max_width{max_width},
|
||||
m_marker{std::move(marker)} {}
|
||||
|
||||
static constexpr StringView ms_id = "wrap";
|
||||
|
@ -752,9 +752,10 @@ public:
|
||||
Prompt(InputHandler& input_handler, StringView prompt,
|
||||
String initstr, String emptystr, Face face, PromptFlags flags,
|
||||
PromptCompleter completer, PromptCallback callback)
|
||||
: InputMode(input_handler), m_prompt(prompt.str()), m_prompt_face(face),
|
||||
: InputMode(input_handler), m_callback(std::move(callback)), m_completer(std::move(completer)),
|
||||
m_prompt(prompt.str()), m_prompt_face(face),
|
||||
m_empty_text{std::move(emptystr)},
|
||||
m_flags(flags), m_completer(std::move(completer)), m_callback(std::move(callback)),
|
||||
m_line_editor{context().faces()}, m_flags(flags),
|
||||
m_auto_complete{context().options()["autocomplete"].get<AutoComplete>() & AutoComplete::Prompt},
|
||||
m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Draft ?
|
||||
Timer::Callback{} : [this](Timer&) {
|
||||
@ -766,8 +767,7 @@ public:
|
||||
m_line_changed = false;
|
||||
}
|
||||
context().hooks().run_hook(Hook::PromptIdle, "", context());
|
||||
}},
|
||||
m_line_editor{context().faces()}
|
||||
}}
|
||||
{
|
||||
m_history_it = ms_history[m_prompt].end();
|
||||
m_line_editor.reset(std::move(initstr), m_empty_text);
|
||||
@ -1102,7 +1102,7 @@ class NextKey : public InputMode
|
||||
{
|
||||
public:
|
||||
NextKey(InputHandler& input_handler, KeymapMode keymap_mode, KeyCallback callback)
|
||||
: InputMode(input_handler), m_keymap_mode(keymap_mode), m_callback(std::move(callback)) {}
|
||||
: InputMode(input_handler), m_callback(std::move(callback)), m_keymap_mode(keymap_mode) {}
|
||||
|
||||
void on_key(Key key) override
|
||||
{
|
||||
@ -1132,16 +1132,16 @@ class Insert : public InputMode
|
||||
public:
|
||||
Insert(InputHandler& input_handler, InsertMode mode, int count)
|
||||
: InputMode(input_handler),
|
||||
m_restore_cursor(mode == InsertMode::Append),
|
||||
m_edition(context()),
|
||||
m_completer(context()),
|
||||
m_restore_cursor(mode == InsertMode::Append),
|
||||
m_auto_complete{context().options()["autocomplete"].get<AutoComplete>() & AutoComplete::Insert},
|
||||
m_disable_hooks{context().hooks_disabled(), context().hooks_disabled()},
|
||||
m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Draft ?
|
||||
Timer::Callback{} : [this](Timer&) {
|
||||
m_completer.update(m_auto_complete);
|
||||
context().hooks().run_hook(Hook::InsertIdle, "", context());
|
||||
}}
|
||||
}},
|
||||
m_disable_hooks{context().hooks_disabled(), context().hooks_disabled()}
|
||||
{
|
||||
context().buffer().throw_if_read_only();
|
||||
|
||||
|
@ -250,7 +250,9 @@ default_colors = {
|
||||
};
|
||||
|
||||
NCursesUI::NCursesUI()
|
||||
: m_stdin_watcher{0, FdEvents::Read,
|
||||
: m_colors{default_colors},
|
||||
m_cursor{CursorMode::Buffer, {}},
|
||||
m_stdin_watcher{0, FdEvents::Read,
|
||||
[this](FDWatcher&, FdEvents, EventMode) {
|
||||
if (not m_on_key)
|
||||
return;
|
||||
@ -258,9 +260,7 @@ NCursesUI::NCursesUI()
|
||||
while (auto key = get_next_key())
|
||||
m_on_key(*key);
|
||||
}},
|
||||
m_assistant(assistant_clippy),
|
||||
m_colors{default_colors},
|
||||
m_cursor{CursorMode::Buffer, {}}
|
||||
m_assistant(assistant_clippy)
|
||||
{
|
||||
initscr();
|
||||
raw();
|
||||
|
@ -672,7 +672,7 @@ constexpr RegexParser::ControlEscape RegexParser::control_escapes[];
|
||||
struct RegexCompiler
|
||||
{
|
||||
RegexCompiler(ParsedRegex&& parsed_regex, RegexCompileFlags flags)
|
||||
: m_parsed_regex{parsed_regex}, m_flags(flags)
|
||||
: m_flags(flags), m_parsed_regex{parsed_regex}
|
||||
{
|
||||
kak_assert(not (flags & RegexCompileFlags::NoForward) or flags & RegexCompileFlags::Backward);
|
||||
// Approximation of the number of instructions generated
|
||||
|
@ -8,7 +8,7 @@ namespace Kakoune
|
||||
{
|
||||
|
||||
SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp)
|
||||
: m_buffer(&buffer), m_selections({ std::move(s) }), m_timestamp(timestamp)
|
||||
: m_selections({ std::move(s) }), m_buffer(&buffer), m_timestamp(timestamp)
|
||||
{
|
||||
check_invariant();
|
||||
}
|
||||
@ -17,7 +17,7 @@ SelectionList::SelectionList(Buffer& buffer, Selection s)
|
||||
: SelectionList(buffer, std::move(s), buffer.timestamp()) {}
|
||||
|
||||
SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list, size_t timestamp)
|
||||
: m_buffer(&buffer), m_selections(std::move(list)), m_timestamp(timestamp)
|
||||
: m_selections(std::move(list)), m_buffer(&buffer), m_timestamp(timestamp)
|
||||
{
|
||||
kak_assert(size() > 0);
|
||||
m_main = size() - 1;
|
||||
@ -28,7 +28,7 @@ SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list)
|
||||
: SelectionList(buffer, std::move(list), buffer.timestamp()) {}
|
||||
|
||||
SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector<Selection> list, size_t timestamp, size_t main)
|
||||
: m_buffer(&buffer), m_selections(std::move(list)), m_timestamp(timestamp)
|
||||
: m_selections(std::move(list)), m_buffer(&buffer), m_timestamp(timestamp)
|
||||
{
|
||||
sort_and_merge_overlapping();
|
||||
check_invariant();
|
||||
|
@ -65,11 +65,11 @@ class OnScopeEnd
|
||||
{
|
||||
public:
|
||||
[[gnu::always_inline]]
|
||||
OnScopeEnd(T func) : m_func{std::move(func)}, m_valid{true} {}
|
||||
OnScopeEnd(T func) : m_valid{true}, m_func{std::move(func)} {}
|
||||
|
||||
[[gnu::always_inline]]
|
||||
OnScopeEnd(OnScopeEnd&& other)
|
||||
: m_func{std::move(other.m_func)}, m_valid{other.m_valid}
|
||||
: m_valid{other.m_valid}, m_func{std::move(other.m_func)}
|
||||
{ other.m_valid = false; }
|
||||
|
||||
[[gnu::always_inline]]
|
||||
|
Loading…
Reference in New Issue
Block a user