diff --git a/src/autoload.cpp b/src/autoload.cpp index fcfee4298..55d49724e 100644 --- a/src/autoload.cpp +++ b/src/autoload.cpp @@ -189,7 +189,8 @@ maybe_t autoload_t::resolve_command(const wcstring &cmd, const environ } } -maybe_t autoload_t::resolve_command(const wcstring &cmd, const std::vector &paths) { +maybe_t autoload_t::resolve_command(const wcstring &cmd, + const std::vector &paths) { // Are we currently in the process of autoloading this? if (current_autoloading_.count(cmd) > 0) return none(); diff --git a/src/builtin.cpp b/src/builtin.cpp index 7e5690153..9378e75ef 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -433,7 +433,8 @@ static const wchar_t *const help_builtins[] = {L"for", L"while", L"function", L static bool cmd_needs_help(const wcstring &cmd) { return contains(help_builtins, cmd); } /// Execute a builtin command -proc_status_t builtin_run(parser_t &parser, const std::vector &argv, io_streams_t &streams) { +proc_status_t builtin_run(parser_t &parser, const std::vector &argv, + io_streams_t &streams) { if (argv.empty()) return proc_status_t::from_exit_code(STATUS_INVALID_ARGS); const wcstring &cmdname = argv.front(); diff --git a/src/builtin.h b/src/builtin.h index 055b8c284..fb482ce94 100644 --- a/src/builtin.h +++ b/src/builtin.h @@ -80,7 +80,8 @@ struct builtin_data_t { bool builtin_exists(const wcstring &cmd); -proc_status_t builtin_run(parser_t &parser, const std::vector &argv, io_streams_t &streams); +proc_status_t builtin_run(parser_t &parser, const std::vector &argv, + io_streams_t &streams); std::vector builtin_get_names(); wcstring_list_ffi_t builtin_get_names_ffi(); diff --git a/src/common.cpp b/src/common.cpp index 144db0b99..54ca4b9c4 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -172,7 +172,8 @@ bool is_windows_subsystem_for_linux() { #ifdef HAVE_BACKTRACE_SYMBOLS // This function produces a stack backtrace with demangled function & method names. It is based on // https://gist.github.com/fmela/591333 but adapted to the style of the fish project. -[[gnu::noinline]] static std::vector demangled_backtrace(int max_frames, int skip_levels) { +[[gnu::noinline]] static std::vector demangled_backtrace(int max_frames, + int skip_levels) { void *callstack[128]; const int n_max_frames = sizeof(callstack) / sizeof(callstack[0]); int n_frames = backtrace(callstack, n_max_frames); diff --git a/src/complete.cpp b/src/complete.cpp index 1d7476bc9..ec0f8d734 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -380,7 +380,9 @@ class completer_t { // Bag of data to support expanding a command's arguments using custom completions, including // the wrap chain. struct custom_arg_data_t { - explicit custom_arg_data_t(std::vector *vars) : var_assignments(vars) { assert(vars); } + explicit custom_arg_data_t(std::vector *vars) : var_assignments(vars) { + assert(vars); + } // The unescaped argument before the argument which is being completed, or empty if none. wcstring previous_argument{}; diff --git a/src/env.cpp b/src/env.cpp index 37860bd6a..c3d75e6af 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -1018,7 +1018,8 @@ class env_stack_impl_t final : public env_scoped_impl_t { /// Try setting\p key as an electric or readonly variable. /// \return an error code, or none() if not an electric or readonly variable. /// \p val will not be modified upon a none() return. - maybe_t try_set_electric(const wcstring &key, const query_t &query, std::vector &val); + maybe_t try_set_electric(const wcstring &key, const query_t &query, + std::vector &val); /// Set a universal value. void set_universal(const wcstring &key, std::vector val, const query_t &query); diff --git a/src/function.cpp b/src/function.cpp index f240b3aa3..dc8140222 100644 --- a/src/function.cpp +++ b/src/function.cpp @@ -172,9 +172,7 @@ wcstring function_get_definition_file(const function_properties_t &props) { wcstring function_get_copy_definition_file(const function_properties_t &props) { return props.copy_definition_file ? *props.copy_definition_file : L""; } -bool function_is_copy(const function_properties_t &props) { - return props.is_copy; -} +bool function_is_copy(const function_properties_t &props) { return props.is_copy; } int function_get_definition_lineno(const function_properties_t &props) { return props.definition_lineno(); } @@ -182,7 +180,8 @@ int function_get_copy_definition_lineno(const function_properties_t &props) { return props.copy_definition_lineno; } -wcstring function_get_annotated_definition(const function_properties_t &props, const wcstring &name) { +wcstring function_get_annotated_definition(const function_properties_t &props, + const wcstring &name) { return props.annotated_definition(name); } diff --git a/src/function.h b/src/function.h index b21958597..bce3a15b5 100644 --- a/src/function.h +++ b/src/function.h @@ -86,7 +86,8 @@ wcstring function_get_copy_definition_file(const function_properties_t &props); bool function_is_copy(const function_properties_t &props); int function_get_definition_lineno(const function_properties_t &props); int function_get_copy_definition_lineno(const function_properties_t &props); -wcstring function_get_annotated_definition(const function_properties_t &props, const wcstring &name); +wcstring function_get_annotated_definition(const function_properties_t &props, + const wcstring &name); /// \return the properties for a function, or nullptr if none, perhaps triggering autoloading. function_properties_ref_t function_get_props_autoload(const wcstring &name, parser_t &parser); diff --git a/src/highlight.h b/src/highlight.h index 3454fb2b7..452a2ccd6 100644 --- a/src/highlight.h +++ b/src/highlight.h @@ -115,7 +115,6 @@ void highlight_shell(const wcstring &buffstr, std::vector &col const operation_context_t &ctx, bool io_ok = false, maybe_t cursor = {}); - class parser_t; /// Wrapper around colorize(highlight_shell) wcstring colorize_shell(const wcstring &text, parser_t &parser); diff --git a/src/input.cpp b/src/input.cpp index 8b66708eb..d610d0dd8 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -825,7 +825,8 @@ bool input_mapping_set_t::erase(const wcstring &sequence, const wcstring &mode, } bool input_mapping_set_t::get(const wcstring &sequence, const wcstring &mode, - std::vector *out_cmds, bool user, wcstring *out_sets_mode) const { + std::vector *out_cmds, bool user, + wcstring *out_sets_mode) const { bool result = false; const auto &ml = user ? mapping_list_ : preset_mapping_list_; for (const input_mapping_t &m : ml) { diff --git a/src/input.h b/src/input.h index 04e210272..2ca5013fc 100644 --- a/src/input.h +++ b/src/input.h @@ -114,8 +114,8 @@ class input_mapping_set_t { /// Gets the command bound to the specified key sequence in the specified mode. Returns true if /// it exists, false if not. - bool get(const wcstring &sequence, const wcstring &mode, std::vector *out_cmds, bool user, - wcstring *out_sets_mode) const; + bool get(const wcstring &sequence, const wcstring &mode, std::vector *out_cmds, + bool user, wcstring *out_sets_mode) const; /// Returns all mapping names and modes. std::vector get_names(bool user = true) const; diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index bb5ed73a3..1268d0738 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -465,7 +465,8 @@ end_execution_reason_t parse_execution_context_t::run_for_statement( auto &vars = parser->vars(); int retval; - retval = vars.set(for_var_name, ENV_LOCAL | ENV_USER, var ? var->as_list() : std::vector{}); + retval = vars.set(for_var_name, ENV_LOCAL | ENV_USER, + var ? var->as_list() : std::vector{}); assert(retval == ENV_OK); trace_if_enabled(*parser, L"for", arguments); diff --git a/src/parser.cpp b/src/parser.cpp index f83dfde45..121cba8e0 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -70,7 +70,8 @@ rust::Box &parser_t::get_wait_handles_ffi() { return wait_ha const rust::Box &parser_t::get_wait_handles_ffi() const { return wait_handles; } -int parser_t::set_var_and_fire(const wcstring &key, env_mode_flags_t mode, std::vector vals) { +int parser_t::set_var_and_fire(const wcstring &key, env_mode_flags_t mode, + std::vector vals) { int res = vars().set(key, mode, std::move(vals)); if (res == ENV_OK) { event_fire(*this, *new_event_variable_set(key)); diff --git a/src/path.cpp b/src/path.cpp index 6a8643aba..55417f2ec 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -28,7 +28,8 @@ // PREFIX is defined at build time. static const std::vector kDefaultPath({L"/bin", L"/usr/bin", PREFIX L"/bin"}); -static get_path_result_t path_get_path_core(const wcstring &cmd, const std::vector &pathsv) { +static get_path_result_t path_get_path_core(const wcstring &cmd, + const std::vector &pathsv) { const get_path_result_t noent_res{ENOENT, wcstring{}}; get_path_result_t result{}; @@ -173,7 +174,7 @@ wcstring_list_ffi_t path_get_paths_ffi(const wcstring &cmd, const parser_t &pars } std::vector path_apply_cdpath(const wcstring &dir, const wcstring &wd, - const environment_t &env_vars) { + const environment_t &env_vars) { std::vector paths; if (dir.at(0) == L'/') { // Absolute path. diff --git a/src/path.h b/src/path.h index 997b3ecf2..0e9fa04f1 100644 --- a/src/path.h +++ b/src/path.h @@ -85,7 +85,7 @@ maybe_t path_get_cdpath(const wcstring &dir, const wcstring &wd, /// Returns the given directory with all CDPATH components applied. std::vector path_apply_cdpath(const wcstring &dir, const wcstring &wd, - const environment_t &env_vars); + const environment_t &env_vars); /// Returns the path resolved as an implicit cd command, or none() if none. This requires it to /// start with one of the allowed prefixes (., .., ~) and resolve to a directory. diff --git a/src/reader.cpp b/src/reader.cpp index e0659d79f..8939018f8 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1214,7 +1214,8 @@ void reader_data_t::paint_layout(const wchar_t *reason) { // Apply any selection. if (data.selection.has_value()) { - highlight_spec_t selection_color = {highlight_role_t::selection, highlight_role_t::selection}; + highlight_spec_t selection_color = {highlight_role_t::selection, + highlight_role_t::selection}; auto end = std::min(selection->stop, colors.size()); for (size_t i = data.selection->start; i < end; i++) { colors.at(i) = selection_color; diff --git a/src/wcstringutil.cpp b/src/wcstringutil.cpp index 4c8519d5c..9a8318f03 100644 --- a/src/wcstringutil.cpp +++ b/src/wcstringutil.cpp @@ -259,7 +259,8 @@ std::vector split_string(const wcstring &val, wchar_t sep) { return out; } -std::vector split_string_tok(const wcstring &val, const wcstring &seps, size_t max_results) { +std::vector split_string_tok(const wcstring &val, const wcstring &seps, + size_t max_results) { std::vector out; size_t end = val.size(); size_t pos = 0; @@ -286,7 +287,8 @@ std::vector split_string_tok(const wcstring &val, const wcstring &seps return out; } -static wcstring join_strings_impl(const std::vector &vals, const wchar_t *sep, size_t seplen) { +static wcstring join_strings_impl(const std::vector &vals, const wchar_t *sep, + size_t seplen) { if (vals.empty()) return wcstring{}; // Reserve the size we will need. diff --git a/src/wcstringutil.h b/src/wcstringutil.h index 39d33c0cf..789d83660 100644 --- a/src/wcstringutil.h +++ b/src/wcstringutil.h @@ -138,7 +138,7 @@ std::vector split_string(const wcstring &val, wchar_t sep); /// except for the first. This is historical behavior. /// Example: split_string_tok(" a b c ", " ", 3) -> {"a", "b", " c "} std::vector split_string_tok(const wcstring &val, const wcstring &seps, - size_t max_results = std::numeric_limits::max()); + size_t max_results = std::numeric_limits::max()); /// Join a list of strings by a separator character or string. wcstring join_strings(const std::vector &vals, wchar_t sep);