mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-16 05:02:46 +08:00
Fix typos in comments
This commit is contained in:
parent
88c8992cc3
commit
b6a1bedab9
|
@ -26,7 +26,7 @@ set(rust_profile $<IF:$<CONFIG:Debug>,debug,$<IF:$<CONFIG:RelWithDebInfo>,releas
|
|||
set(rust_debugflags "$<$<CONFIG:Debug>:-g>$<$<CONFIG:RelWithDebInfo>:-g>")
|
||||
|
||||
|
||||
# Temporary hack to propogate CMake flags/options to build.rs. We need to get CMake to evaluate the
|
||||
# Temporary hack to propagate CMake flags/options to build.rs. We need to get CMake to evaluate the
|
||||
# truthiness of the strings if they are set.
|
||||
set(CMAKE_WITH_GETTEXT "1")
|
||||
if(DEFINED WITH_GETTEXT AND NOT "${WITH_GETTEXT}")
|
||||
|
@ -47,7 +47,7 @@ get_property(
|
|||
set(VARS_FOR_CARGO
|
||||
"FISH_BUILD_DIR=${CMAKE_BINARY_DIR}"
|
||||
"PREFIX=${CMAKE_INSTALL_PREFIX}"
|
||||
# Temporary hack to propogate CMake flags/options to build.rs.
|
||||
# Temporary hack to propagate CMake flags/options to build.rs.
|
||||
"CMAKE_WITH_GETTEXT=${CMAKE_WITH_GETTEXT}"
|
||||
# Cheesy so we can tell cmake was used to build
|
||||
"CMAKE=1"
|
||||
|
|
|
@ -48,7 +48,7 @@ add_custom_target(fish_run_tests
|
|||
)
|
||||
|
||||
# If CMP0037 is available, also make an alias "test" target.
|
||||
# Note that this policy may not be available, in which case definining such a target silently fails.
|
||||
# Note that this policy may not be available, in which case defining such a target silently fails.
|
||||
cmake_policy(PUSH)
|
||||
if(POLICY CMP0037)
|
||||
cmake_policy(SET CMP0037 OLD)
|
||||
|
|
|
@ -221,7 +221,7 @@ impl Decimal {
|
|||
// Round up if necessary.
|
||||
if self.should_round_up(last_digit_idx, remainder_to_round, mod_base) {
|
||||
self[last_digit_idx] += mod_base;
|
||||
// Propogate carry.
|
||||
// Propagate carry.
|
||||
while self[last_digit_idx] >= DIGIT_BASE {
|
||||
self[last_digit_idx] = 0;
|
||||
last_digit_idx -= 1;
|
||||
|
|
|
@ -232,7 +232,7 @@ end
|
|||
|
||||
if command -q kill
|
||||
# Only define this if something to wrap exists
|
||||
# this allows a nice "commad not found" error to be triggered.
|
||||
# this allows a nice "command not found" error to be triggered.
|
||||
function kill
|
||||
set -l args (__fish_expand_pid_args $argv)
|
||||
and command kill $args
|
||||
|
|
|
@ -177,7 +177,7 @@ pub struct AbbreviationSet {
|
|||
/// List of abbreviations, in definition order.
|
||||
abbrs: Vec<Abbreviation>,
|
||||
|
||||
/// Set of used abbrevation names.
|
||||
/// Set of used abbreviation names.
|
||||
/// This is to avoid a linear scan when adding new abbreviations.
|
||||
used_names: HashSet<WString>,
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ pub fn complete(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) ->
|
|||
let mut result_mode = CompletionMode::default();
|
||||
let mut remove = false;
|
||||
let mut short_opt = WString::new();
|
||||
// todo!("these whould be Vec<&wstr>");
|
||||
// todo!("these would be Vec<&wstr>");
|
||||
let mut gnu_opt = vec![];
|
||||
let mut old_opt = vec![];
|
||||
let mut subcommand = vec![];
|
||||
|
|
|
@ -50,7 +50,7 @@ pub fn fg(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) -> Optio
|
|||
} else if optind + 1 < argv.len() {
|
||||
// Specifying more than one job to put to the foreground is a syntax error, we still
|
||||
// try to locate the job $argv[1], since we need to determine which error message to
|
||||
// emit (ambigous job specification vs malformed job id).
|
||||
// emit (ambiguous job specification vs malformed job id).
|
||||
let mut found_job = false;
|
||||
if let Ok(Some(pid)) = fish_wcstoi(argv[optind]).map(Pid::new) {
|
||||
found_job = parser.job_get_from_pid(pid).is_some();
|
||||
|
|
|
@ -583,7 +583,7 @@ pub fn status(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
|||
}
|
||||
if path.is_absolute() {
|
||||
let path = str2wcstring(path.as_os_str().as_bytes());
|
||||
// This is an absoulte path, we can canonicalize it
|
||||
// This is an absolute path, we can canonicalize it
|
||||
let real = match wrealpath(&path) {
|
||||
Some(p) if waccess(&p, F_OK) == 0 => p,
|
||||
// realpath did not work, just append the path
|
||||
|
|
|
@ -48,7 +48,7 @@ impl StringSubCommand<'_> for Collect {
|
|||
}
|
||||
|
||||
// If we haven't printed anything and "no_empty" is set,
|
||||
// print something empty. Helps with empty ellision:
|
||||
// print something empty. Helps with empty elision:
|
||||
// echo (true | string collect --allow-empty)"bar"
|
||||
// prints "bar".
|
||||
if self.allow_empty && appended == 0 {
|
||||
|
|
|
@ -1807,7 +1807,7 @@ impl<'ctx> Completer<'ctx> {
|
|||
// The getpwent() function does not exist on Android. A Linux user on Android isn't
|
||||
// really a user - each installed app gets an UID assigned. Listing all UID:s is not
|
||||
// possible without root access, and doing a ~USER type expansion does not make sense
|
||||
// since every app is sandboxed and can't access eachother.
|
||||
// since every app is sandboxed and can't access each other.
|
||||
return false;
|
||||
}
|
||||
#[cfg(not(target_os = "android"))]
|
||||
|
|
|
@ -359,7 +359,7 @@ pub fn env_dispatch_init(vars: &EnvStack) {
|
|||
use once_cell::sync::Lazy;
|
||||
|
||||
run_inits(vars);
|
||||
// env_dispatch_var_change() purposely supresses change notifications until the dispatch table
|
||||
// env_dispatch_var_change() purposely suppresses change notifications until the dispatch table
|
||||
// was initialized elsewhere (either explicitly as below or via deref of VAR_DISPATCH_TABLE).
|
||||
Lazy::force(&VAR_DISPATCH_TABLE);
|
||||
}
|
||||
|
|
|
@ -1349,7 +1349,7 @@ fn get_deferred_process(j: &Job) -> Option<usize> {
|
|||
return None;
|
||||
}
|
||||
|
||||
// Find the last non-external process, and return it if it pipes into an extenal process.
|
||||
// Find the last non-external process, and return it if it pipes into an external process.
|
||||
for (i, p) in j.processes().iter().enumerate().rev() {
|
||||
if p.typ != ProcessType::external {
|
||||
return if p.is_last_in_job { None } else { Some(i) };
|
||||
|
|
|
@ -28,7 +28,7 @@ pub enum FeatureFlag {
|
|||
/// Remove `test`'s one and zero arg mode (make `test -n` return false etc)
|
||||
test_require_arg,
|
||||
|
||||
/// Buffered enter (typed wile running a command) does not execute.
|
||||
/// Buffered enter (typed while running a command) does not execute.
|
||||
buffered_enter_noexec,
|
||||
}
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ struct HistoryImpl {
|
|||
/// The file ID of the history file.
|
||||
history_file_id: FileId, // INVALID_FILE_ID
|
||||
/// The boundary timestamp distinguishes old items from new items. Items whose timestamps are <=
|
||||
/// the boundary are considered "old". Items whose timestemps are > the boundary are new, and are
|
||||
/// the boundary are considered "old". Items whose timestamps are > the boundary are new, and are
|
||||
/// ignored by this instance (unless they came from this instance). The timestamp may be adjusted
|
||||
/// by incorporate_external_changes().
|
||||
boundary_timestamp: SystemTime,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! Implemention of history files.
|
||||
//! Implementation of history files.
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
|
|
|
@ -472,7 +472,7 @@ pub fn char_to_symbol(c: char) -> WString {
|
|||
} else if fish_wcwidth(c) > 0 {
|
||||
sprintf!(=> buf, "%lc", c);
|
||||
} else if c <= '\u{FFFF}' {
|
||||
// BMP Unicode chararacter
|
||||
// BMP Unicode character
|
||||
sprintf!(=> buf, "\\u%04X", u32::from(c));
|
||||
} else {
|
||||
sprintf!(=> buf, "\\U%06X", u32::from(c));
|
||||
|
|
|
@ -62,7 +62,7 @@ use std::sync::{atomic::Ordering, Arc};
|
|||
/// cancellation. Note it does not track the exit status of commands.
|
||||
#[derive(Eq, PartialEq)]
|
||||
pub enum EndExecutionReason {
|
||||
/// Evaluation was successfull.
|
||||
/// Evaluation was successful.
|
||||
ok,
|
||||
|
||||
/// Evaluation was skipped due to control flow (break or return).
|
||||
|
|
|
@ -377,7 +377,7 @@ impl TtyTransfer {
|
|||
// 1. There is no tty at all (tcgetpgrp() returns -1). For example running from a pure script.
|
||||
// Of course do not transfer it in that case.
|
||||
// 2. The tty is owned by the process. This comes about often, as the process will call
|
||||
// tcsetpgrp() on itself between fork ane exec. This is the essential race inherent in
|
||||
// tcsetpgrp() on itself between fork and exec. This is the essential race inherent in
|
||||
// tcsetpgrp(). In this case we want to reclaim the tty, but do not need to transfer it
|
||||
// ourselves since the child won the race.
|
||||
// 3. The tty is owned by a different process. This may come about if fish is running in the
|
||||
|
|
|
@ -3899,7 +3899,7 @@ impl<'a> Reader<'a> {
|
|||
// Return true on success, false if we got an error, in which case the caller should fire the
|
||||
// error event.
|
||||
fn handle_execute(&mut self) -> bool {
|
||||
// Evaluate. If the current command is unfinished, or if the charater is escaped
|
||||
// Evaluate. If the current command is unfinished, or if the character is escaped
|
||||
// using a backslash, insert a newline.
|
||||
// If the user hits return while navigating the pager, it only clears the pager.
|
||||
if self.is_navigating_pager_contents() {
|
||||
|
@ -4287,7 +4287,7 @@ fn acquire_tty_or_exit(shell_pgid: libc::pid_t) {
|
|||
// Bummer, we are not in control of the terminal. Stop until parent has given us control of
|
||||
// it.
|
||||
//
|
||||
// In theory, reseting signal handlers could cause us to miss signal deliveries. In
|
||||
// In theory, resetting signal handlers could cause us to miss signal deliveries. In
|
||||
// practice, this code should only be run during startup, when we're not waiting for any
|
||||
// signals.
|
||||
signal_reset_handlers();
|
||||
|
|
|
@ -825,7 +825,7 @@ impl Screen {
|
|||
if self.mtime_stdout_stderr != mtime_stdout_stderr() {
|
||||
// Ok, someone has been messing with our screen. We will want to repaint. However, we do not
|
||||
// know where the cursor is. It is our best bet that we are still on the same line, so we
|
||||
// move to the beginning of the line, reset the modelled screen contents, and then set the
|
||||
// move to the beginning of the line, reset the modeled screen contents, and then set the
|
||||
// modeled cursor y-pos to its earlier value.
|
||||
let prev_line = self.actual.cursor.y;
|
||||
self.reset_line(true /* repaint prompt */);
|
||||
|
@ -1465,7 +1465,7 @@ impl LayoutCache {
|
|||
if endc != '\0' {
|
||||
if endc == '\n' || endc == '\x0C' {
|
||||
layout.line_breaks.push(trunc_prompt.len());
|
||||
// If the prompt ends in a new line, that's one empy last line.
|
||||
// If the prompt ends in a new line, that's one empty last line.
|
||||
if run_end == prompt_str.len() - 1 {
|
||||
layout.last_line_width = 0;
|
||||
}
|
||||
|
|
|
@ -533,7 +533,7 @@ pub(crate) fn iothread_drain_all(ctx: &mut Reader) {
|
|||
}
|
||||
}
|
||||
|
||||
/// `Debounce` is a simple class which executes one function on a background thread while enqueing
|
||||
/// `Debounce` is a simple class which executes one function on a background thread while enqueuing
|
||||
/// at most one more. Subsequent execution requests overwrite the enqueued one. It takes an optional
|
||||
/// timeout; if a handler does not finish within the timeout then a new thread is spawned to service
|
||||
/// the remaining request.
|
||||
|
@ -677,7 +677,7 @@ impl Debounce {
|
|||
}
|
||||
|
||||
#[test]
|
||||
/// Verify that spawing a thread normally via [`std::thread::spawn()`] causes the calling thread's
|
||||
/// Verify that spawning a thread normally via [`std::thread::spawn()`] causes the calling thread's
|
||||
/// sigmask to be inherited by the newly spawned thread.
|
||||
fn std_thread_inherits_sigmask() {
|
||||
// First change our own thread mask
|
||||
|
|
|
@ -330,7 +330,7 @@ pub struct TopicMonitor {
|
|||
status_: AtomicU8,
|
||||
|
||||
/// Binary semaphore used to communicate changes.
|
||||
/// If status_ is STATUS_NEEDS_WAKEUP, then a thread has commited to call wait() on our sema and
|
||||
/// If status_ is STATUS_NEEDS_WAKEUP, then a thread has committed to call wait() on our sema and
|
||||
/// this must be balanced by the next call to post(). Note only one thread may wait at a time.
|
||||
sema_: BinarySemaphore,
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ pub struct DevInode {
|
|||
}
|
||||
|
||||
/// While an inode / dev pair is sufficient to distinguish co-existing files, Linux
|
||||
/// seems to aggressively re-use inodes, so it cannot determine if a file has been deleted
|
||||
/// seems to aggressively reuse inodes, so it cannot determine if a file has been deleted
|
||||
/// (ABA problem). Therefore we include richer information to detect file changes.
|
||||
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct FileId {
|
||||
|
|
|
@ -32,7 +32,7 @@ functions d
|
|||
# CHECK: '/mnt/c/Program Files (x86)/devenv.exe' /Edit $argv
|
||||
# CHECK: end
|
||||
|
||||
# Use "command" to prevent recusion, and don't add --wraps to avoid accidental recursion in completion.
|
||||
# Use "command" to prevent recursion, and don't add --wraps to avoid accidental recursion in completion.
|
||||
alias e 'e --option=value'
|
||||
functions e
|
||||
# CHECK: # Defined via `source`
|
||||
|
|
|
@ -12,7 +12,7 @@ rm $filename
|
|||
set -l filename (echo foo | psub --testing --fifo)
|
||||
test -p $filename
|
||||
or echo 'psub is not a fifo' >&2
|
||||
# hack: the background write that psub peforms may block
|
||||
# hack: the background write that psub performs may block
|
||||
# until someone opens the fifo for reading. So make sure we
|
||||
# actually read it.
|
||||
cat $filename >/dev/null
|
||||
|
|
|
@ -87,7 +87,7 @@ string pad -c_ --width 5 longer-than-width-param x
|
|||
# CHECK: ______________________x
|
||||
|
||||
# Current behavior is that only a single padding character is supported.
|
||||
# We can support longer strings in future without breaking compatibilty.
|
||||
# We can support longer strings in future without breaking compatibility.
|
||||
string pad -c ab -w4 .
|
||||
# CHECKERR: string pad: Padding should be a character 'ab'
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ isolated-tmux send-keys abbr-test C-Space arg3 Enter
|
|||
tmux-sleep
|
||||
# CHECK: prompt {{\d+}}> abbr-test arg3
|
||||
|
||||
# Do not expand abbrevation if the cursor is not at the command, even if it's just white space.
|
||||
# Do not expand abbreviation if the cursor is not at the command, even if it's just white space.
|
||||
# This makes the behavior more consistent with the above two scenarios.
|
||||
isolated-tmux send-keys abbr-test C-Space Enter
|
||||
tmux-sleep
|
||||
|
|
|
@ -39,7 +39,7 @@ sleep .1
|
|||
kill -USR2 $fish_pid
|
||||
sleep .1
|
||||
|
||||
# Send the signal and immediately define the function; it should not excute.
|
||||
# Send the signal and immediately define the function; it should not execute.
|
||||
kill -USR1 $fish_pid
|
||||
function handle1 --on-signal SIGUSR1
|
||||
gotsigusr1
|
||||
|
|
|
@ -4,7 +4,7 @@ from pexpect_helper import SpawnedProc
|
|||
sp = SpawnedProc(args=["-d", "reader"])
|
||||
sp.expect_prompt()
|
||||
|
||||
# Verify we correctly diable mouse tracking.
|
||||
# Verify we correctly disable mouse tracking.
|
||||
|
||||
# Five char sequence.
|
||||
sp.send("\x1b[tDE")
|
||||
|
|
|
@ -49,7 +49,7 @@ if fish_pid == tty_owner:
|
|||
# It must not hang. But it might hang when trying to restore the tty.
|
||||
os.kill(fish_pid, signal.SIGTERM)
|
||||
|
||||
# Loop a bit until the process exits (correct) or stops (incorrrect).
|
||||
# Loop a bit until the process exits (correct) or stops (incorrect).
|
||||
# When it exits it should be due to the SIGTERM that we sent it.
|
||||
for i in range(50):
|
||||
pid, status = os.waitpid(fish_pid, os.WUNTRACED | os.WNOHANG)
|
||||
|
|
Loading…
Reference in New Issue
Block a user