mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Restyle touched .cpp files
This commit is contained in:
parent
0310d3bd8c
commit
1499ade89c
@ -267,7 +267,7 @@ template <>
|
|||||||
long double raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
|
long double raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
|
||||||
// Forcing the locale to C is questionable but it's what the old C_STRTOD() that I inlined here
|
// Forcing the locale to C is questionable but it's what the old C_STRTOD() that I inlined here
|
||||||
// as part of changing how locale management is done by fish.
|
// as part of changing how locale management is done by fish.
|
||||||
char * old_locale = setlocale(LC_NUMERIC, "C");
|
char *old_locale = setlocale(LC_NUMERIC, "C");
|
||||||
double val = wcstod(s, end);
|
double val = wcstod(s, end);
|
||||||
setlocale(LC_NUMERIC, old_locale);
|
setlocale(LC_NUMERIC, old_locale);
|
||||||
return val;
|
return val;
|
||||||
|
@ -144,8 +144,6 @@ void complete_add(const wchar_t *cmd, bool cmd_is_path, const wcstring &option,
|
|||||||
complete_option_type_t option_type, int result_mode, const wchar_t *condition,
|
complete_option_type_t option_type, int result_mode, const wchar_t *condition,
|
||||||
const wchar_t *comp, const wchar_t *desc, int flags);
|
const wchar_t *comp, const wchar_t *desc, int flags);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Sets whether the completion list for this command is complete. If true, any options not matching
|
/// Sets whether the completion list for this command is complete. If true, any options not matching
|
||||||
/// one of the provided options will be flagged as an error by syntax highlighting.
|
/// one of the provided options will be flagged as an error by syntax highlighting.
|
||||||
void complete_set_authoritative(const wchar_t *cmd, bool cmd_type, bool authoritative);
|
void complete_set_authoritative(const wchar_t *cmd, bool cmd_type, bool authoritative);
|
||||||
|
@ -45,9 +45,7 @@ void output_set_writer(int (*writer)(char)) {
|
|||||||
int (*output_get_writer())(char) { return out; }
|
int (*output_get_writer())(char) { return out; }
|
||||||
|
|
||||||
// Returns true if we think the term256 support is "native" as opposed to forced.
|
// Returns true if we think the term256 support is "native" as opposed to forced.
|
||||||
static bool term256_support_is_native(void) {
|
static bool term256_support_is_native(void) { return max_colors >= 256; }
|
||||||
return max_colors >= 256;
|
|
||||||
}
|
|
||||||
|
|
||||||
color_support_t output_get_color_support(void) { return color_support; }
|
color_support_t output_get_color_support(void) { return color_support; }
|
||||||
|
|
||||||
|
@ -209,7 +209,9 @@ void parse_error_offset_source_start(parse_error_list_t *errors, size_t amt);
|
|||||||
#define ILLEGAL_FD_ERR_MSG _(L"Illegal file descriptor in redirection '%ls'")
|
#define ILLEGAL_FD_ERR_MSG _(L"Illegal file descriptor in redirection '%ls'")
|
||||||
|
|
||||||
/// Error message for wildcards with no matches.
|
/// Error message for wildcards with no matches.
|
||||||
#define WILDCARD_ERR_MSG _(L"No matches for wildcard '%ls'. (Tip: empty matches are allowed in 'set', 'count', 'for'.)")
|
#define WILDCARD_ERR_MSG \
|
||||||
|
_(L"No matches for wildcard '%ls'. (Tip: empty matches are allowed in 'set', 'count', " \
|
||||||
|
L"'for'.)")
|
||||||
|
|
||||||
/// Error when using break outside of loop.
|
/// Error when using break outside of loop.
|
||||||
#define INVALID_BREAK_ERR_MSG _(L"'break' while not inside of loop")
|
#define INVALID_BREAK_ERR_MSG _(L"'break' while not inside of loop")
|
||||||
|
@ -1827,7 +1827,6 @@ static void handle_token_history(int forward, int reset) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum move_word_dir_t { MOVE_DIR_LEFT, MOVE_DIR_RIGHT };
|
enum move_word_dir_t { MOVE_DIR_LEFT, MOVE_DIR_RIGHT };
|
||||||
|
|
||||||
/// Move buffer position one word or erase one word. This function updates both the internal buffer
|
/// Move buffer position one word or erase one word. This function updates both the internal buffer
|
||||||
|
@ -383,7 +383,7 @@ static size_t read_redirection_or_fd_pipe(const wchar_t *buff,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either way we should have ended on the redirection character itself like '>'.
|
// Either way we should have ended on the redirection character itself like '>'.
|
||||||
// Don't allow an fd with a caret redirection - see #1873
|
// Don't allow an fd with a caret redirection - see #1873
|
||||||
wchar_t redirect_char = buff[idx++]; // note increment of idx
|
wchar_t redirect_char = buff[idx++]; // note increment of idx
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
// 4. #include wgetopt.h in your program
|
// 4. #include wgetopt.h in your program
|
||||||
// 5. Make use of all the regular getopt functions, prefixing every function, global variable
|
// 5. Make use of all the regular getopt functions, prefixing every function, global variable
|
||||||
// and d structure with a 'w', and use only wide character strings.
|
// and d structure with a 'w', and use only wide character strings.
|
||||||
// There are no other functional changes in this version of getopt besides using wide character strings.
|
// There are no other functional changes in this version of getopt besides using wide character
|
||||||
|
// strings.
|
||||||
//
|
//
|
||||||
// For examples of how to use wgetopt, see the fish builtin functions, which are defined in
|
// For examples of how to use wgetopt, see the fish builtin functions, which are defined in
|
||||||
// src/builtin_*.cpp
|
// src/builtin_*.cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user