aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Aaron Gyes <me@aaron.gy>2016-06-23 22:44:58 -0700
committerGravatar Aaron Gyes <me@aaron.gy>2016-06-23 22:48:45 -0700
commit0d6bdb38e62ec434cf9ee861e66428370c96bd5a (patch)
tree150c932ecfcc83a06765df3d45bc391a5cafc351
parent02cef2da23b022cf2703fdf856fdf00b452d67fb (diff)
Style fixes.
-rw-r--r--src/complete.cpp1
-rw-r--r--src/fish_key_reader.cpp21
-rw-r--r--src/fish_tests.cpp3
-rw-r--r--src/input.cpp2
-rw-r--r--src/pager.cpp4
-rw-r--r--src/parse_tree.cpp4
-rw-r--r--src/reader.cpp2
-rw-r--r--src/screen.cpp2
8 files changed, 20 insertions, 19 deletions
diff --git a/src/complete.cpp b/src/complete.cpp
index 43d36290..b9cc83da 100644
--- a/src/complete.cpp
+++ b/src/complete.cpp
@@ -19,7 +19,6 @@
#include <string>
#include <utility>
-
#include "autoload.h"
#include "builtin.h"
#include "common.h"
diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp
index 8df01394..afe02f35 100644
--- a/src/fish_key_reader.cpp
+++ b/src/fish_key_reader.cpp
@@ -13,11 +13,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <wctype.h>
#include <sys/signal.h>
-#include <iosfwd>
-#include <limits>
+#include <wctype.h>
#include <cmath>
+#include <iosfwd>
+#include <limits>
#include "common.h"
#include "env.h"
@@ -31,10 +31,11 @@ struct config_paths_t determine_config_directory_paths(const char *argv0);
double prev_tstamp = std::numeric_limits<double>::quiet_NaN();
-static const char *ctrl_equivalents[] = {"\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a",
- "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\014", "\\015",
- "\\016", "\\017", "\\018", "\\019", "\\020", "\\021", "\\022", "\\023",
- "\\024", "\\025", "", "\\e", "\\028", "\\029", "\\030", "\\031"};
+static const char *ctrl_equivalents[] = {
+ "\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a",
+ "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\014", "\\015",
+ "\\016", "\\017", "\\018", "\\019", "\\020", "\\021", "\\022", "\\023",
+ "\\024", "\\025", "", "\\e", "\\028", "\\029", "\\030", "\\031"};
/// Return true if the recent sequence of characters indicates the user wants to exit the program.
bool should_exit(unsigned char c) {
@@ -98,8 +99,8 @@ void process_input(bool continuous_mode) {
if (c < 32) {
// Control characters.
if (ctrl_equivalents[c]) {
- printf("dec: %3u hex: %2x char: %s (aka \\c%c)", c, c,
- ctrl_equivalents[c], c + 64);
+ printf("dec: %3u hex: %2x char: %s (aka \\c%c)", c, c, ctrl_equivalents[c],
+ c + 64);
} else {
printf("dec: %3u hex: %2x char: \\c%c\t", c, c, c + 64);
}
@@ -164,7 +165,7 @@ void setup_and_process_keys(bool continuous_mode) {
}
if (continuous_mode) {
- printf("<ctrl-C> ('\\Cc') or type 'exit' or 'quit' followed by enter to terminate this program.\n");
+ printf("ctrl-C or type 'exit' or 'quit' to terminate this program.\n");
} else {
set_wait_on_escape_ms(500);
}
diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp
index 4c15f498..681428a7 100644
--- a/src/fish_tests.cpp
+++ b/src/fish_tests.cpp
@@ -2255,7 +2255,8 @@ static int test_universal_helper(int *x) {
static void test_universal() {
say(L"Testing universal variables");
- if (system("mkdir -p " "/tmp/fish_uvars_test/")) err(L"mkdir failed");
+ if (system("mkdir -p /tmp/fish_uvars_test/"))
+ err(L"mkdir failed");
const int threads = 16;
static int ctx[threads];
diff --git a/src/input.cpp b/src/input.cpp
index 71690217..145e10e8 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -350,7 +350,7 @@ int input_init() {
debug(0, _(L"Your TERM value of '%ls' is not valid"), term.c_str());
debug(0, _(L"Check that your terminal type is supported on this system"));
}
-
+
env_set(L"TERM", DEFAULT_TERM, ENV_GLOBAL | ENV_EXPORT);
if (setupterm(NULL, STDOUT_FILENO, &err_ret) == ERR) {
debug(0, _(L"Unable to setup terminal using your TERM or the '%ls' fallback"),
diff --git a/src/pager.cpp b/src/pager.cpp
index 8867c5e3..def797a9 100644
--- a/src/pager.cpp
+++ b/src/pager.cpp
@@ -10,7 +10,7 @@
#include "common.h"
#include "complete.h"
-#include "fallback.h"
+#include "fallback.h"
#include "highlight.h"
#include "pager.h"
#include "reader.h"
@@ -506,7 +506,7 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co
int search_field_written = print_max(SEARCH_FIELD_PROMPT, highlight_spec_normal,
term_width - 1, false, search_field);
print_max(search_field_text, highlight_modifier_force_underline,
- term_width - search_field_written - 1, false, search_field);
+ term_width - search_field_written - 1, false, search_field);
}
}
return print;
diff --git a/src/parse_tree.cpp b/src/parse_tree.cpp
index 9939d81b..8b5e0b8d 100644
--- a/src/parse_tree.cpp
+++ b/src/parse_tree.cpp
@@ -12,13 +12,13 @@
#include <vector>
#include "common.h"
-#include "fallback.h"
+#include "fallback.h"
#include "parse_constants.h"
#include "parse_productions.h"
#include "parse_tree.h"
#include "proc.h"
#include "tokenizer.h"
-#include "wutil.h" // IWYU pragma: keep
+#include "wutil.h" // IWYU pragma: keep
// This array provides strings for each symbol in enum parse_token_type_t in parse_constants.h.
const wchar_t *const token_type_map[] = {
diff --git a/src/reader.cpp b/src/reader.cpp
index 3306255e..43f942f7 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -2176,7 +2176,7 @@ static int threaded_highlight(background_highlight_context_t *ctx) {
/// an asynchronous highlight in the background, which may perform disk I/O.
static void reader_super_highlight_me_plenty(int match_highlight_pos_adjust, bool no_io) {
const editable_line_t *el = &data->command_line;
- assert (el != NULL);
+ assert(el != NULL);
long match_highlight_pos = (long)el->position + match_highlight_pos_adjust;
assert(match_highlight_pos >= 0);
diff --git a/src/screen.cpp b/src/screen.cpp
index a9d9ddcf..a34d7c98 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -247,7 +247,7 @@ size_t escape_code_length(const wchar_t *code) {
}
}
}
-
+
if (!found) found = is_screen_name_escape_seq(code, &resulting_length);
if (!found) found = is_iterm2_escape_seq(code, &resulting_length);
if (!found) found = is_single_byte_escape_seq(code, &resulting_length);