mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 22:14:53 +00:00
Reformat all files
This commit is contained in:
parent
6e6fcda8e2
commit
daf520db0a
3 changed files with 13 additions and 27 deletions
|
@ -46,8 +46,8 @@
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "wildcard.h"
|
|
||||||
#include "wcstringutil.h"
|
#include "wcstringutil.h"
|
||||||
|
#include "wildcard.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
#ifdef KERN_PROCARGS2
|
#ifdef KERN_PROCARGS2
|
||||||
#else
|
#else
|
||||||
|
@ -468,7 +468,7 @@ static bool expand_variables(const wcstring &instr, std::vector<completion_t> *o
|
||||||
|
|
||||||
/// Perform brace expansion.
|
/// Perform brace expansion.
|
||||||
static expand_error_t expand_braces(const wcstring &instr, expand_flags_t flags,
|
static expand_error_t expand_braces(const wcstring &instr, expand_flags_t flags,
|
||||||
std::vector<completion_t> *out, parse_error_list_t *errors) {
|
std::vector<completion_t> *out, parse_error_list_t *errors) {
|
||||||
bool syntax_error = false;
|
bool syntax_error = false;
|
||||||
int brace_count = 0;
|
int brace_count = 0;
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ static expand_error_t expand_braces(const wcstring &instr, expand_flags_t flags,
|
||||||
assert(pos >= item_begin);
|
assert(pos >= item_begin);
|
||||||
size_t item_len = pos - item_begin;
|
size_t item_len = pos - item_begin;
|
||||||
wcstring item = wcstring(item_begin, item_len);
|
wcstring item = wcstring(item_begin, item_len);
|
||||||
item = trim(item, (const wchar_t[]) { BRACE_SPACE, L'\0' });
|
item = trim(item, (const wchar_t[]){BRACE_SPACE, L'\0'});
|
||||||
for (auto &c : item) {
|
for (auto &c : item) {
|
||||||
if (c == BRACE_SPACE) {
|
if (c == BRACE_SPACE) {
|
||||||
c = ' ';
|
c = ' ';
|
||||||
|
@ -746,8 +746,7 @@ static void expand_home_directory(wcstring &input) {
|
||||||
}
|
}
|
||||||
|
|
||||||
maybe_t<wcstring> realhome;
|
maybe_t<wcstring> realhome;
|
||||||
if (home)
|
if (home) realhome = wrealpath(home->as_string());
|
||||||
realhome = wrealpath(home->as_string());
|
|
||||||
|
|
||||||
if (realhome) {
|
if (realhome) {
|
||||||
input.replace(input.begin(), input.begin() + tail_idx, *realhome);
|
input.replace(input.begin(), input.begin() + tail_idx, *realhome);
|
||||||
|
@ -902,13 +901,12 @@ static expand_error_t expand_stage_variables(const wcstring &input, std::vector<
|
||||||
}
|
}
|
||||||
|
|
||||||
static expand_error_t expand_stage_braces(const wcstring &input, std::vector<completion_t> *out,
|
static expand_error_t expand_stage_braces(const wcstring &input, std::vector<completion_t> *out,
|
||||||
expand_flags_t flags, parse_error_list_t *errors) {
|
expand_flags_t flags, parse_error_list_t *errors) {
|
||||||
return expand_braces(input, flags, out, errors);
|
return expand_braces(input, flags, out, errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static expand_error_t expand_stage_home(const wcstring &input,
|
static expand_error_t expand_stage_home(const wcstring &input, std::vector<completion_t> *out,
|
||||||
std::vector<completion_t> *out,
|
expand_flags_t flags, parse_error_list_t *errors) {
|
||||||
expand_flags_t flags, parse_error_list_t *errors) {
|
|
||||||
(void)errors;
|
(void)errors;
|
||||||
wcstring next = input;
|
wcstring next = input;
|
||||||
|
|
||||||
|
|
|
@ -2294,9 +2294,7 @@ static bool selection_is_at_top() {
|
||||||
static uint32_t run_count = 0;
|
static uint32_t run_count = 0;
|
||||||
|
|
||||||
/// Returns the current interactive loop count
|
/// Returns the current interactive loop count
|
||||||
uint32_t reader_run_count() {
|
uint32_t reader_run_count() { return run_count; }
|
||||||
return run_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Read interactively. Read input from stdin while providing editing facilities.
|
/// Read interactively. Read input from stdin while providing editing facilities.
|
||||||
static int read_i() {
|
static int read_i() {
|
||||||
|
@ -3243,12 +3241,8 @@ const wchar_t *reader_readline(int nchars) {
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
if (data->last_jump_target) {
|
if (data->last_jump_target) {
|
||||||
success = jump(
|
success = jump(data->last_jump_direction, data->last_jump_precision, el,
|
||||||
data->last_jump_direction,
|
data->last_jump_target);
|
||||||
data->last_jump_precision,
|
|
||||||
el,
|
|
||||||
data->last_jump_target
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input_function_set_status(success);
|
input_function_set_status(success);
|
||||||
|
@ -3268,12 +3262,7 @@ const wchar_t *reader_readline(int nchars) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->last_jump_target) {
|
if (data->last_jump_target) {
|
||||||
success = jump(
|
success = jump(dir, data->last_jump_precision, el, data->last_jump_target);
|
||||||
dir,
|
|
||||||
data->last_jump_precision,
|
|
||||||
el,
|
|
||||||
data->last_jump_target
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data->last_jump_direction = original_dir;
|
data->last_jump_direction = original_dir;
|
||||||
|
@ -3351,7 +3340,7 @@ bool jump(jump_direction_t dir, jump_precision_t precision, editable_line_t *el,
|
||||||
while (tmp_pos--) {
|
while (tmp_pos--) {
|
||||||
if (el->at(tmp_pos) == target) {
|
if (el->at(tmp_pos) == target) {
|
||||||
if (precision == jump_precision_t::till) {
|
if (precision == jump_precision_t::till) {
|
||||||
tmp_pos = std::min(el->size()-1, tmp_pos+1);
|
tmp_pos = std::min(el->size() - 1, tmp_pos + 1);
|
||||||
}
|
}
|
||||||
update_buff_pos(el, tmp_pos);
|
update_buff_pos(el, tmp_pos);
|
||||||
success = true;
|
success = true;
|
||||||
|
@ -3361,7 +3350,7 @@ bool jump(jump_direction_t dir, jump_precision_t precision, editable_line_t *el,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case jump_direction_t::forward: {
|
case jump_direction_t::forward: {
|
||||||
for (size_t tmp_pos=el->position+1; tmp_pos < el->size(); tmp_pos++) {
|
for (size_t tmp_pos = el->position + 1; tmp_pos < el->size(); tmp_pos++) {
|
||||||
if (el->at(tmp_pos) == target) {
|
if (el->at(tmp_pos) == target) {
|
||||||
if (precision == jump_precision_t::till && tmp_pos) {
|
if (precision == jump_precision_t::till && tmp_pos) {
|
||||||
tmp_pos--;
|
tmp_pos--;
|
||||||
|
|
|
@ -230,7 +230,6 @@ wcstring completion_apply_to_command_line(const wcstring &val_str, complete_flag
|
||||||
/// Terminate all background jobs
|
/// Terminate all background jobs
|
||||||
void kill_background_jobs();
|
void kill_background_jobs();
|
||||||
|
|
||||||
|
|
||||||
/// Print warning with list of backgrounded jobs
|
/// Print warning with list of backgrounded jobs
|
||||||
void reader_bg_job_warning();
|
void reader_bg_job_warning();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue