mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 15:01:16 -03:00
Fix formatting
This commit is contained in:
20
reader.cpp
20
reader.cpp
@@ -984,9 +984,9 @@ void reader_init()
|
||||
// PCA disable VDSUSP (typically control-Y), which is a funny job control
|
||||
// function available only on OS X and BSD systems
|
||||
// This lets us use control-Y for yank instead
|
||||
#ifdef VDSUSP
|
||||
#ifdef VDSUSP
|
||||
shell_modes.c_cc[VDSUSP] = _POSIX_VDISABLE;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1723,7 +1723,7 @@ static const completion_t *cycle_competions(const std::vector<completion_t> &com
|
||||
// note start_idx will be set to -1 initially, so that when it gets incremented we start at 0
|
||||
const size_t start_idx = *inout_idx;
|
||||
size_t idx = start_idx;
|
||||
|
||||
|
||||
const completion_t *result = NULL;
|
||||
size_t remaining = comp.size();
|
||||
while (remaining--)
|
||||
@@ -2340,7 +2340,7 @@ static void handle_token_history(int forward, int reset)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -3814,34 +3814,34 @@ const wchar_t *reader_readline(void)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case R_UPCASE_WORD:
|
||||
case R_DOWNCASE_WORD:
|
||||
case R_CAPITALIZE_WORD:
|
||||
{
|
||||
// For capitalize_word, whether we've capitalized a character so far
|
||||
bool capitalized_first = false;
|
||||
|
||||
|
||||
// We apply the operation from the current location to the end of the word
|
||||
size_t pos = data->buff_pos;
|
||||
move_word(MOVE_DIR_RIGHT, false, move_word_style_punctuation, false);
|
||||
for (; pos < data->buff_pos; pos++)
|
||||
{
|
||||
wchar_t chr = data->command_line.at(pos);
|
||||
|
||||
|
||||
// We always change the case; this decides whether we go uppercase (true) or lowercase (false)
|
||||
bool make_uppercase;
|
||||
if (c == R_CAPITALIZE_WORD)
|
||||
make_uppercase = ! capitalized_first && iswalnum(chr);
|
||||
else
|
||||
make_uppercase = (c == R_UPCASE_WORD);
|
||||
|
||||
|
||||
// Apply the operation and then record what we did
|
||||
if (make_uppercase)
|
||||
chr = towupper(chr);
|
||||
else
|
||||
chr = towlower(chr);
|
||||
|
||||
|
||||
data->command_line.at(pos) = chr;
|
||||
capitalized_first = capitalized_first || make_uppercase;
|
||||
}
|
||||
@@ -3850,7 +3850,7 @@ const wchar_t *reader_readline(void)
|
||||
reader_repaint();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Other, if a normal character, we add it to the command */
|
||||
default:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user