Permalink
Browse files

Fix indentation of switch statements

  • Loading branch information...
1 parent 7d63900 commit 26678682ca90b68f19b993e259bf43384c0a18ec @ridiculousfish ridiculousfish committed Nov 19, 2012
Showing with 6,517 additions and 6,516 deletions.
  1. +808 −808 builtin.cpp
  2. +136 −136 builtin_commandline.cpp
  3. +72 −72 builtin_complete.cpp
  4. +84 −84 builtin_jobs.cpp
  5. +49 −49 builtin_set.cpp
  6. +99 −99 builtin_test.cpp
  7. +109 −109 builtin_ulimit.cpp
  8. +55 −55 color.cpp
  9. +539 −539 common.cpp
  10. +63 −63 complete.cpp
  11. +13 −13 env.cpp
  12. +94 −94 env_universal_common.cpp
  13. +47 −47 event.cpp
  14. +470 −470 exec.cpp
  15. +154 −154 expand.cpp
  16. +264 −264 fallback.cpp
  17. +62 −62 fish.cpp
  18. +147 −147 fish_indent.cpp
  19. +133 −133 fish_pager.cpp
  20. +42 −42 fishd.cpp
  21. +602 −602 highlight.cpp
  22. +41 −41 history.cpp
  23. +8 −8 input.cpp
  24. +41 −41 input_common.cpp
  25. +15 −15 io.cpp
  26. +233 −233 mimedb.cpp
  27. +4 −4 output.cpp
  28. +63 −63 parse_util.cpp
  29. +1,044 −1,044 parser.cpp
  30. +12 −12 path.cpp
  31. +166 −166 postfork.cpp
  32. +39 −39 proc.cpp
  33. +486 −485 reader.cpp
  34. +51 −51 screen.cpp
  35. +32 −32 set_color.cpp
  36. +184 −184 tokenizer.cpp
  37. +8 −8 wildcard.cpp
  38. +15 −15 wutil.cpp
  39. +9 −9 xdgmimeglob.cpp
  40. +24 −24 xdgmimemagic.cpp
View
1,616 builtin.cpp

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -102,29 +102,29 @@ static void replace_part(const wchar_t *begin,
switch (append_mode)
{
- case REPLACE_MODE:
- {
+ case REPLACE_MODE:
+ {
- out.append(insert);
- out_pos = wcslen(insert) + (begin-buff);
- break;
+ out.append(insert);
+ out_pos = wcslen(insert) + (begin-buff);
+ break;
- }
- case APPEND_MODE:
- {
- out.append(begin, end-begin);
- out.append(insert);
- break;
- }
- case INSERT_MODE:
- {
- long cursor = get_cursor_pos() -(begin-buff);
- out.append(begin, cursor);
- out.append(insert);
- out.append(begin+cursor, end-begin-cursor);
- out_pos += wcslen(insert);
- break;
- }
+ }
+ case APPEND_MODE:
+ {
+ out.append(begin, end-begin);
+ out.append(insert);
+ break;
+ }
+ case INSERT_MODE:
+ {
+ long cursor = get_cursor_pos() -(begin-buff);
+ out.append(begin, cursor);
+ out.append(insert);
+ out.append(begin+cursor, end-begin-cursor);
+ out_pos += wcslen(insert);
+ break;
+ }
}
out.append(end);
reader_set_buffer(out, out_pos);
@@ -166,12 +166,12 @@ static void write_part(const wchar_t *begin,
switch (tok_last_type(&tok))
{
- case TOK_STRING:
- {
- out.append(escape_string(tok_last(&tok), UNESCAPE_INCOMPLETE));
- out.push_back(L'\n');
- break;
- }
+ case TOK_STRING:
+ {
+ out.append(escape_string(tok_last(&tok), UNESCAPE_INCOMPLETE));
+ out.push_back(L'\n');
+ break;
+ }
}
}
@@ -333,82 +333,82 @@ static int builtin_commandline(parser_t &parser, wchar_t **argv)
switch (opt)
{
- case 0:
- if (long_options[opt_index].flag != 0)
- break;
- append_format(stderr_buffer,
- BUILTIN_ERR_UNKNOWN,
- argv[0],
- long_options[opt_index].name);
- builtin_print_help(parser, argv[0], stderr_buffer);
+ case 0:
+ if (long_options[opt_index].flag != 0)
+ break;
+ append_format(stderr_buffer,
+ BUILTIN_ERR_UNKNOWN,
+ argv[0],
+ long_options[opt_index].name);
+ builtin_print_help(parser, argv[0], stderr_buffer);
- return 1;
+ return 1;
- case L'a':
- append_mode = APPEND_MODE;
- break;
+ case L'a':
+ append_mode = APPEND_MODE;
+ break;
- case L'b':
- buffer_part = STRING_MODE;
- break;
+ case L'b':
+ buffer_part = STRING_MODE;
+ break;
- case L'i':
- append_mode = INSERT_MODE;
- break;
+ case L'i':
+ append_mode = INSERT_MODE;
+ break;
- case L'r':
- append_mode = REPLACE_MODE;
- break;
+ case L'r':
+ append_mode = REPLACE_MODE;
+ break;
- case 'c':
- cut_at_cursor=1;
- break;
+ case 'c':
+ cut_at_cursor=1;
+ break;
- case 't':
- buffer_part = TOKEN_MODE;
- break;
+ case 't':
+ buffer_part = TOKEN_MODE;
+ break;
- case 'j':
- buffer_part = JOB_MODE;
- break;
+ case 'j':
+ buffer_part = JOB_MODE;
+ break;
- case 'p':
- buffer_part = PROCESS_MODE;
- break;
+ case 'p':
+ buffer_part = PROCESS_MODE;
+ break;
- case 'f':
- function_mode=1;
- break;
+ case 'f':
+ function_mode=1;
+ break;
- case 'o':
- tokenize=1;
- break;
+ case 'o':
+ tokenize=1;
+ break;
- case 'I':
- current_buffer = woptarg;
- current_cursor_pos = wcslen(woptarg);
- break;
+ case 'I':
+ current_buffer = woptarg;
+ current_cursor_pos = wcslen(woptarg);
+ break;
- case 'C':
- cursor_mode = 1;
- break;
+ case 'C':
+ cursor_mode = 1;
+ break;
- case 'L':
- line_mode = 1;
- break;
+ case 'L':
+ line_mode = 1;
+ break;
- case 'S':
- search_mode = 1;
- break;
+ case 'S':
+ search_mode = 1;
+ break;
- case 'h':
- builtin_print_help(parser, argv[0], stdout_buffer);
- return 0;
+ case 'h':
+ builtin_print_help(parser, argv[0], stdout_buffer);
+ return 0;
- case L'?':
- builtin_unknown_option(parser, argv[0], argv[woptind-1]);
- return 1;
+ case L'?':
+ builtin_unknown_option(parser, argv[0], argv[woptind-1]);
+ return 1;
}
}
@@ -574,72 +574,72 @@ static int builtin_commandline(parser_t &parser, wchar_t **argv)
switch (buffer_part)
{
- case STRING_MODE:
- {
- begin = get_buffer();
- end = begin+wcslen(begin);
- break;
- }
+ case STRING_MODE:
+ {
+ begin = get_buffer();
+ end = begin+wcslen(begin);
+ break;
+ }
- case PROCESS_MODE:
- {
- parse_util_process_extent(get_buffer(),
+ case PROCESS_MODE:
+ {
+ parse_util_process_extent(get_buffer(),
+ get_cursor_pos(),
+ &begin,
+ &end);
+ break;
+ }
+
+ case JOB_MODE:
+ {
+ parse_util_job_extent(get_buffer(),
get_cursor_pos(),
&begin,
&end);
- break;
- }
-
- case JOB_MODE:
- {
- parse_util_job_extent(get_buffer(),
- get_cursor_pos(),
- &begin,
- &end);
- break;
- }
+ break;
+ }
- case TOKEN_MODE:
- {
- parse_util_token_extent(get_buffer(),
- get_cursor_pos(),
- &begin,
- &end,
- 0, 0);
- break;
- }
+ case TOKEN_MODE:
+ {
+ parse_util_token_extent(get_buffer(),
+ get_cursor_pos(),
+ &begin,
+ &end,
+ 0, 0);
+ break;
+ }
}
switch (argc-woptind)
{
- case 0:
- {
- write_part(begin, end, cut_at_cursor, tokenize);
- break;
- }
-
- case 1:
- {
- replace_part(begin, end, argv[woptind], append_mode);
- break;
- }
-
- default:
- {
- wcstring sb = argv[woptind];
- int i;
+ case 0:
+ {
+ write_part(begin, end, cut_at_cursor, tokenize);
+ break;
+ }
- for (i=woptind+1; i<argc; i++)
+ case 1:
{
- sb.push_back(L'\n');
- sb.append(argv[i]);
+ replace_part(begin, end, argv[woptind], append_mode);
+ break;
}
- replace_part(begin, end, sb.c_str(), append_mode);
+ default:
+ {
+ wcstring sb = argv[woptind];
+ int i;
- break;
- }
+ for (i=woptind+1; i<argc; i++)
+ {
+ sb.push_back(L'\n');
+ sb.append(argv[i]);
+ }
+
+ replace_part(begin, end, sb.c_str(), append_mode);
+
+ break;
+ }
}
return 0;
Oops, something went wrong.

0 comments on commit 2667868

Please sign in to comment.