mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
Spelling fixes
Found with scspell
This commit is contained in:
parent
2c0bbb0f82
commit
daf5e11179
27 changed files with 36 additions and 36 deletions
|
@ -138,7 +138,7 @@ class token_stream_t {
|
|||
return result;
|
||||
}
|
||||
|
||||
/// Provide the orignal source code.
|
||||
/// Provide the original source code.
|
||||
const wcstring &source() const { return src_; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -75,7 +75,7 @@ const wchar_t *ast_type_to_string(type_t type);
|
|||
* void will_visit_fields_of(job_t &job);
|
||||
*
|
||||
* /// The visitor needs to be prepared for the following four field types.
|
||||
* /// Naturally the vistor may overload visit_field to carve this
|
||||
* /// Naturally the visitor may overload visit_field to carve this
|
||||
* /// arbitrarily finely.
|
||||
*
|
||||
* /// A field may be a "direct embedding" of a node.
|
||||
|
@ -246,7 +246,7 @@ struct node_t : noncopyable_t {
|
|||
}
|
||||
|
||||
/// Try casting to a concrete node type, except returns nullptr on failure.
|
||||
/// Example ussage:
|
||||
/// Example usage:
|
||||
/// if (const auto *job_list = node->try_as<job_list_t>()) job_list->...
|
||||
template <typename To>
|
||||
To *try_as() {
|
||||
|
|
|
@ -58,7 +58,7 @@ class autoload_file_cache_t {
|
|||
/// \return whether a timestamp is fresh enough to use.
|
||||
static bool is_fresh(timestamp_t then, timestamp_t now);
|
||||
|
||||
/// Attempt to find an autoloadable file by searching our path list for a given comand.
|
||||
/// Attempt to find an autoloadable file by searching our path list for a given command.
|
||||
/// \return the file, or none() if none.
|
||||
maybe_t<autoloadable_file_t> locate_file(const wcstring &cmd) const;
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ void builtin_print_error_trailer(parser_t &parser, output_stream_t &b, const wch
|
|||
b.append_format(_(L"(Type 'help %ls' for related documentation)\n"), cmd);
|
||||
}
|
||||
|
||||
/// A generic bultin that only supports showing a help message. This is only a placeholder that
|
||||
/// A generic builtin that only supports showing a help message. This is only a placeholder that
|
||||
/// prints the help message. Useful for commands that live in the parser.
|
||||
static maybe_t<int> builtin_generic(parser_t &parser, io_streams_t &streams, const wchar_t **argv) {
|
||||
const wchar_t *cmd = argv[0];
|
||||
|
|
|
@ -239,7 +239,7 @@ static inline const char *align_start(const char *start, size_t len) {
|
|||
// How much do we have to add to start to make it 0 mod Align?
|
||||
// To compute 17 up-aligned by 8, compute its skew 17 % 8, yielding 1,
|
||||
// and then we will add 8 - 1. Of course if we align 16 with the same idea, we will
|
||||
// add 8 instead of 0, so then mod the summand by Align again.
|
||||
// add 8 instead of 0, so then mod the sum by Align again.
|
||||
// Note all of these mods are optimized to masks.
|
||||
uintptr_t add_which_aligns = Align - (startu % Align);
|
||||
add_which_aligns %= Align;
|
||||
|
@ -1820,7 +1820,7 @@ void assert_is_locked(std::mutex &mutex, const char *who, const char *caller) {
|
|||
}
|
||||
}
|
||||
|
||||
/// Test if the specified character is in a range that fish uses interally to store special tokens.
|
||||
/// Test if the specified character is in a range that fish uses internally to store special tokens.
|
||||
///
|
||||
/// NOTE: This is used when tokenizing the input. It is also used when reading input, before
|
||||
/// tokenization, to replace such chars with REPLACEMENT_WCHAR if they're not part of a quoted
|
||||
|
|
14
src/common.h
14
src/common.h
|
@ -73,18 +73,18 @@ struct termsize_t;
|
|||
// Unicode BOM value.
|
||||
#define UTF8_BOM_WCHAR 0xFEFFu
|
||||
|
||||
// Use Unicode "noncharacters" for internal characters as much as we can. This
|
||||
// Use Unicode "non-characters" for internal characters as much as we can. This
|
||||
// gives us 32 "characters" for internal use that we can guarantee should not
|
||||
// appear in our input stream. See http://www.unicode.org/faq/private_use.html.
|
||||
#define RESERVED_CHAR_BASE static_cast<wchar_t>(0xFDD0)
|
||||
#define RESERVED_CHAR_END static_cast<wchar_t>(0xFDF0)
|
||||
// Split the available noncharacter values into two ranges to ensure there are
|
||||
// Split the available non-character values into two ranges to ensure there are
|
||||
// no conflicts among the places we use these special characters.
|
||||
#define EXPAND_RESERVED_BASE RESERVED_CHAR_BASE
|
||||
#define EXPAND_RESERVED_END (EXPAND_RESERVED_BASE + 16)
|
||||
#define WILDCARD_RESERVED_BASE EXPAND_RESERVED_END
|
||||
#define WILDCARD_RESERVED_END (WILDCARD_RESERVED_BASE + 16)
|
||||
// Make sure the ranges defined above don't exceed the range for noncharacters.
|
||||
// Make sure the ranges defined above don't exceed the range for non-characters.
|
||||
// This is to make sure we didn't do something stupid in subdividing the
|
||||
// Unicode range for our needs.
|
||||
//#if WILDCARD_RESERVED_END > RESERVED_CHAR_END
|
||||
|
@ -146,7 +146,7 @@ typedef unsigned int unescape_flags_t;
|
|||
// Flags for the escape_string() function. These are only applicable when the escape style is
|
||||
// "script" (i.e., STRING_STYLE_SCRIPT).
|
||||
enum {
|
||||
/// Do not escape special fish syntax characters like the semicolon. Only escape nonprintable
|
||||
/// Do not escape special fish syntax characters like the semicolon. Only escape non-printable
|
||||
/// characters and backslashes.
|
||||
ESCAPE_NO_PRINTABLES = 1 << 0,
|
||||
/// Do not try to use 'simplified' quoted escapes, and do not use empty quotes as the empty
|
||||
|
@ -154,7 +154,7 @@ enum {
|
|||
ESCAPE_NO_QUOTED = 1 << 1,
|
||||
/// Do not escape tildes.
|
||||
ESCAPE_NO_TILDE = 1 << 2,
|
||||
/// Replace nonprintable control characters with Unicode symbols.
|
||||
/// Replace non-printable control characters with Unicode symbols.
|
||||
ESCAPE_SYMBOLIC = 1 << 3
|
||||
};
|
||||
typedef unsigned int escape_flags_t;
|
||||
|
@ -338,7 +338,7 @@ void format_long_safe(wchar_t buff[64], long val);
|
|||
void format_llong_safe(wchar_t buff[64], long long val);
|
||||
void format_ullong_safe(wchar_t buff[64], unsigned long long val);
|
||||
|
||||
/// "Narrows" a wide character string. This just grabs any ASCII characters and trunactes.
|
||||
/// "Narrows" a wide character string. This just grabs any ASCII characters and truncates.
|
||||
void narrow_string_safe(char buff[64], const wchar_t *s);
|
||||
|
||||
/// Stored in blocks to reference the file which created the block.
|
||||
|
@ -561,7 +561,7 @@ void assert_is_not_forked_child(const char *who);
|
|||
/// See https://github.com/Microsoft/WSL/issues/423 and Microsoft/WSL#2997
|
||||
bool is_windows_subsystem_for_linux();
|
||||
|
||||
/// Detect if we are running under Cygwin or Cgywin64
|
||||
/// Detect if we are running under Cygwin or Cygwin64
|
||||
constexpr bool is_cygwin() {
|
||||
#ifdef __CYGWIN__
|
||||
return true;
|
||||
|
|
|
@ -1338,7 +1338,7 @@ void completer_t::complete_custom(const wcstring &cmd, const wcstring &cmdline,
|
|||
|
||||
bool is_autosuggest = this->flags.autosuggestion;
|
||||
// Perhaps set a transient commandline so that custom completions
|
||||
// buitin_commandline will refer to the wrapped command. But not if
|
||||
// builtin_commandline will refer to the wrapped command. But not if
|
||||
// we're doing autosuggestions.
|
||||
maybe_t<cleanup_t> remove_transient{};
|
||||
bool wants_transient = (ad->wrap_depth > 0 || ad->var_assignments) && !is_autosuggest;
|
||||
|
|
|
@ -1294,7 +1294,7 @@ class universal_notifier_named_pipe_t final : public universal_notifier_t {
|
|||
char c[1] = {'\0'};
|
||||
ssize_t amt_written = write(pipe_fd.fd(), c, sizeof c);
|
||||
if (amt_written < 0 && (errno == EWOULDBLOCK || errno == EAGAIN)) {
|
||||
// Very unsual: the pipe is full! Try to read some and repeat once.
|
||||
// Very unusual: the pipe is full! Try to read some and repeat once.
|
||||
drain_excess();
|
||||
amt_written = write(pipe_fd.fd(), c, sizeof c);
|
||||
if (amt_written < 0) {
|
||||
|
|
|
@ -276,7 +276,7 @@ static size_t parse_slice(const wchar_t *const in, wchar_t **const end_ptr, std:
|
|||
///
|
||||
/// This function operates on strings backwards, starting at last_idx.
|
||||
///
|
||||
/// Note: last_idx is considered to be where it previously finished procesisng. This means it
|
||||
/// Note: last_idx is considered to be where it previously finished processing. This means it
|
||||
/// actually starts operating on last_idx-1. As such, to process a string fully, pass string.size()
|
||||
/// as last_idx instead of string.size()-1.
|
||||
///
|
||||
|
|
|
@ -19,7 +19,7 @@ static constexpr uint64_t kUsecPerMsec = 1000;
|
|||
fd_monitor_t::fd_monitor_t() = default;
|
||||
|
||||
fd_monitor_t::~fd_monitor_t() {
|
||||
// In orindary usage, we never invoke the dtor.
|
||||
// In ordinary usage, we never invoke the dtor.
|
||||
// This is used in the tests to not leave stale fds around.
|
||||
// That is why this is very hacky!
|
||||
data_.acquire()->terminate = true;
|
||||
|
|
|
@ -109,7 +109,7 @@ bool function_load(const wcstring &name, parser_t &parser) {
|
|||
static void autoload_names(std::unordered_set<wcstring> &names, bool get_hidden) {
|
||||
size_t i;
|
||||
|
||||
// TODO: justfy this.
|
||||
// TODO: justify this.
|
||||
auto &vars = env_stack_t::principal();
|
||||
const auto path_var = vars.get(L"fish_function_path");
|
||||
if (path_var.missing_or_empty()) return;
|
||||
|
|
|
@ -777,7 +777,7 @@ static void color_string_internal(const wcstring &buffstr, highlight_spec_t base
|
|||
namespace {
|
||||
/// Syntax highlighter helper.
|
||||
class highlighter_t {
|
||||
// The string we're highlighting. Note this is a reference memmber variable (to avoid copying)!
|
||||
// The string we're highlighting. Note this is a reference member variable (to avoid copying)!
|
||||
// We must not outlive this!
|
||||
const wcstring &buff;
|
||||
// The position of the cursor within the string.
|
||||
|
|
|
@ -84,7 +84,7 @@ class history_item_t {
|
|||
/// \return whether the text is empty.
|
||||
bool empty() const { return contents.empty(); }
|
||||
|
||||
/// \return wehther our contents matches a search term.
|
||||
/// \return whether our contents matches a search term.
|
||||
bool matches_search(const wcstring &term, enum history_search_type_t type,
|
||||
bool case_sensitive) const;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class inputter_t final : private input_event_queue_t {
|
|||
/// but do not permanently block the escape character.
|
||||
///
|
||||
/// This is performed in the same way vim does it, i.e. if an escape character is read, wait for
|
||||
/// more input for a short time (a few milliseconds). If more input is avaialable, it is assumed
|
||||
/// more input for a short time (a few milliseconds). If more input is available, it is assumed
|
||||
/// to be an escape sequence for a special character (such as an arrow key), and readch attempts
|
||||
/// to parse it. If no more input follows after the escape key, it is assumed to be an actual
|
||||
/// escape key press, and is returned as such.
|
||||
|
|
|
@ -61,7 +61,7 @@ job_group_ref_t job_group_t::create_with_job_control(wcstring command, bool want
|
|||
void job_group_t::set_pgid(pid_t pgid) {
|
||||
// Note we need not be concerned about thread safety. job_groups are intended to be shared
|
||||
// across threads, but any pgid should always have been set beforehand, since it's set
|
||||
// immediately after thfe first process launches.
|
||||
// immediately after the first process launches.
|
||||
assert(pgid >= 0 && "invalid pgid");
|
||||
assert(wants_job_control() && "should not set a pgid for this group");
|
||||
assert(!pgid_.has_value() && "pgid already set");
|
||||
|
|
|
@ -40,7 +40,7 @@ class operation_context_t {
|
|||
|
||||
/// The job group of the parental job.
|
||||
/// This is used only when expanding command substitutions. If this is set, any jobs created by
|
||||
/// the command substitions should use this tree.
|
||||
/// the command substitutions should use this tree.
|
||||
std::shared_ptr<job_group_t> job_group{};
|
||||
|
||||
// A function which may be used to poll for cancellation.
|
||||
|
|
|
@ -161,7 +161,7 @@ void outputter_t::set_color(rgb_color_t fg, rgb_color_t bg) {
|
|||
if (fg.is_reset() || bg.is_reset()) {
|
||||
fg = bg = normal;
|
||||
reset_modes();
|
||||
// If we exit attibute mode, we must first set a color, or previously colored text might
|
||||
// If we exit attribute mode, we must first set a color, or previously colored text might
|
||||
// lose it's color. Terminals are weird...
|
||||
write_foreground_color(*this, 0);
|
||||
writembs(*this, exit_attribute_mode);
|
||||
|
|
|
@ -1531,7 +1531,7 @@ end_execution_reason_t parse_execution_context_t::eval_node(const ast::job_list_
|
|||
INFINITE_FUNC_RECURSION_ERR_MSG, func_name.c_str());
|
||||
}
|
||||
|
||||
// Check for stack overflow in case of funtion calls (regular stack overflow) or string
|
||||
// Check for stack overflow in case of function calls (regular stack overflow) or string
|
||||
// substitution blocks, which can be recursively called with eval (issue #9302).
|
||||
if ((associated_block->type() == block_type_t::top &&
|
||||
parser->function_stack_is_overflowing()) ||
|
||||
|
|
|
@ -113,7 +113,7 @@ static int parse_util_locate_cmdsub(const wchar_t *in, const wchar_t **begin, co
|
|||
last_dollar = q_end;
|
||||
quoted_cmdsubs.push_back(paran_count);
|
||||
}
|
||||
// We want to report whether the outermost comand substitution between
|
||||
// We want to report whether the outermost command substitution between
|
||||
// paran_begin..paran_end is quoted.
|
||||
if (paran_count == 0 && inout_is_quoted) {
|
||||
*inout_is_quoted = *q_end == L'$';
|
||||
|
|
|
@ -92,7 +92,7 @@ int parse_util_get_line_from_offset(const wcstring &str, size_t pos);
|
|||
/// Get the offset of the first character on the specified line.
|
||||
size_t parse_util_get_offset_from_line(const wcstring &str, int line);
|
||||
|
||||
/// Return the total offset of the buffer for the cursor position nearest to the specified poition.
|
||||
/// Return the total offset of the buffer for the cursor position nearest to the specified position.
|
||||
size_t parse_util_get_offset(const wcstring &str, int line, long line_offset);
|
||||
|
||||
/// Return the given string, unescaping wildcard characters but not performing any other character
|
||||
|
|
|
@ -580,7 +580,7 @@ eval_res_t parser_t::eval_node(const parsed_source_ref_t &ps, const T &node,
|
|||
operation_context_t op_ctx = this->context();
|
||||
block_t *scope_block = this->push_block(block_t::scope_block(block_type));
|
||||
|
||||
// Propogate our job group.
|
||||
// Propagate our job group.
|
||||
op_ctx.job_group = job_group;
|
||||
|
||||
// Replace the context's cancel checker with one that checks the job group's signal.
|
||||
|
|
|
@ -449,7 +449,7 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
|
|||
|
||||
/// Returns the file currently evaluated by the parser. This can be different than
|
||||
/// reader_current_filename, e.g. if we are evaluating a function defined in a different file
|
||||
/// than the one curently read.
|
||||
/// than the one currently read.
|
||||
filename_ref_t current_filename() const;
|
||||
|
||||
/// Return if we are interactive, which means we are executing a command that the user typed in
|
||||
|
|
|
@ -339,7 +339,7 @@ maybe_t<pid_t> posix_spawner_t::spawn(const char *cmd, char *const argv[], char
|
|||
pid_t pid = -1;
|
||||
if (check_fail(posix_spawn(&pid, cmd, &*actions_, &*attr_, argv, envp))) {
|
||||
// The shebang wasn't introduced until UNIX Seventh Edition, so if
|
||||
// the kernel won't run the binary we hand it off to the intpreter
|
||||
// the kernel won't run the binary we hand it off to the interpreter
|
||||
// after performing a binary safety check, recommended by POSIX: a
|
||||
// line needs to exist before the first \0 with a lowercase letter
|
||||
if (error_ == ENOEXEC && is_thompson_shell_script(cmd)) {
|
||||
|
|
|
@ -1259,7 +1259,7 @@ void screen_t::reset_abandoning_line(int screen_width) {
|
|||
std::string dim = fish_tparm(const_cast<char *>(enter_dim_mode));
|
||||
if (!dim.empty()) {
|
||||
// Use dim if they have it, so the color will be based on their actual normal
|
||||
// color and the background of the termianl.
|
||||
// color and the background of the terminal.
|
||||
abandon_line_string.append(str2wcstring(dim));
|
||||
justgrey = false;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ class screen_t {
|
|||
/// \param right_prompt the right prompt, or NULL if none
|
||||
/// \param commandline the command line
|
||||
/// \param explicit_len the number of characters of the "explicit" (non-autosuggestion) portion
|
||||
/// of the command line \param colors the colors to use for the comand line \param indent the
|
||||
/// of the command line \param colors the colors to use for the commanad line \param indent the
|
||||
/// indent to use for the command line \param cursor_pos where the cursor is \param pager the
|
||||
/// pager to render below the command line \param page_rendering to cache the current pager view
|
||||
/// \param cursor_is_within_pager whether the position is within the pager line (first line)
|
||||
|
@ -157,7 +157,7 @@ class screen_t {
|
|||
/// This function assumes that the current line is still valid.
|
||||
void reset_line(bool repaint_prompt = false);
|
||||
|
||||
/// Resets the screen buffer's internal knowldge about the contents of the screen,
|
||||
/// Resets the screen buffer's internal knowledge about the contents of the screen,
|
||||
/// abandoning the current line and going to the next line.
|
||||
/// If clear_to_eos is set,
|
||||
/// The screen width must be provided for the PROMPT_SP hack.
|
||||
|
|
|
@ -40,7 +40,7 @@ void get_signals_with_handlers(sigset_t *set);
|
|||
int signal_check_cancel();
|
||||
|
||||
/// Set the cancellation signal to zero.
|
||||
/// In generaly this should only be done in interactive sessions.
|
||||
/// In generally this should only be done in interactive sessions.
|
||||
void signal_clear_cancel();
|
||||
|
||||
enum class topic_t : uint8_t;
|
||||
|
|
|
@ -151,7 +151,7 @@ class binary_semaphore_t {
|
|||
// Whether our semaphore was successfully initialized.
|
||||
bool sem_ok_{};
|
||||
|
||||
// The semaphore, if initalized.
|
||||
// The semaphore, if initialized.
|
||||
sem_t sem_{};
|
||||
|
||||
// Pipes used to emulate a semaphore, if not initialized.
|
||||
|
|
Loading…
Reference in a new issue