Commit Graph

26 Commits

Author SHA1 Message Date
Aaron Gyes
f464704884 escape_code_length: test all setaf parameters
Taking a different approach here. I can't see why we'd only want to
recognize certain colors. Now, we'll just try all the colors fish might
use.

This could probably be optimized now that there are more
than 8 (or 16) colors fish can do.
2016-10-10 11:56:25 -07:00
Aaron Gyes
14efcb7cc5 escape_code_length: cast to size_t, not int 2016-10-09 21:58:14 -07:00
Kurtis Rader
c07c98ac05 eliminate many "unused parameter" warnings
Partially addresses issue #3430.
2016-10-09 14:38:26 -07:00
Kurtis Rader
851e449347 eliminate signed/unsigned comparison warnings
This partially addresses #3430.
2016-10-09 14:36:08 -07:00
Aaron Gyes
30e56c0237 Make calc_prompt_layout detect bright escapes 2016-10-09 07:37:39 -07:00
Kurtis Rader
d389b22afc make style-all C++ style cleanup
It's time once again to run `make style-all` to fix some style bogosities
that have crept in.
2016-10-04 20:06:14 -07:00
Aaron Gyes
ce6e9b52ce screen.cpp: fix omitted newline char color on VCs
It's the ninth color - on virtual consoles this was likely to
try a color that doesn't work because we checked if max_colors >= 8.

Add another way to reach that color on terminals with only 8 colors
by using bold mode to get a bright.

This has potential to fail by simply rendering as black which can cause
it to be invisible on a white-on-black terminal. Not bad as it's just
making this bell/whistle invisible:

We *really* want to set the omitted newline character apart by having
it appear grey. On (FreeBSD consoles, at least) VCs it's not uncommon
for it to render as a "?". It's particularly confusing if it doesn't
render in a darker color as it cannot be discerned from actual program
output.
2016-10-03 12:51:21 -07:00
Aaron Gyes
0c23b5652a color 8 wasn't white, it's brblack
Fixes wrong comment.

Pick a better grey shade.
2016-10-03 08:48:09 -07:00
Aaron Gyes
40a83e4018 screen.cpp: try grey for the newline character.
what we really were using before was color 8 (white).
2016-10-03 05:57:49 -07:00
Aaron Gyes
90e535f66f Update pager colors, tweak pager.cpp
Adds a color reset thing, to ensure fish tries to use hard colors during
testing.

Also, work on a discrepancy (not introduced by my changes, afaik) when
with some combinations of color settings, and usage of --bold, caused super
flakey color paninting in the pager. Downwards movements that trigger
scrolling vs. upwards movement in the pager would only apply bold to
selections when moving upwards. The bold state of the command completions in
the pager was flipping flops on and off, depending on if there is a description
on the preceding line.

Implement a lame fix by reseting the color to normal and applying a
different style on the rightmost ')' which seems to be what was influencing it.

Makes fish use terminfo for coloring the newline glich char.
2016-09-11 03:04:53 -07:00
Aaron Gyes
9daffc7080 HeaderDoc code documentation improvements
Some cleanup too, move things to builtin.h from builtin.cpp that seem
to belong there.
2016-08-16 18:00:07 -07:00
Kurtis Rader
8140f74d75 simplify oclint error suppression for scoped_buffer_t 2016-07-20 22:43:48 -07:00
Aaron Gyes
0d6bdb38e6 Style fixes. 2016-06-23 22:48:45 -07:00
Kurtis Rader
8e21d5de92 deal with broken ttys on MS Windows
The tty device timestamps on MS Windows aren't usable because they're always
the current time. So fish can't use them to decide if the entire prompt needs
to be repainted.

Fixes #2859
2016-06-18 19:33:54 -07:00
Aaron Gyes
9f0c31611c Lint Cleanup
This remove some stores that clang assures me are very dead.

And an assert() for an unlikely NULL pointer dereference I can't quite
figure out.
2016-06-14 19:27:00 -07:00
Kurtis Rader
d70be18c42 use fish_wcwidth rather than wcwidth
Minor cleanup related to issue #2199.
2016-06-14 17:17:31 -07:00
Kurtis Rader
9ad3488b5d fix some style bogosities that crept in 2016-05-27 14:44:30 -07:00
Kurtis Rader
1cdf386822 lint: screen.cpp low hanging fruit
The remaining lint work to be done on screen.cpp will require refactoring
several functions that are way too large and complex.
2016-05-04 18:14:04 -07:00
Kurtis Rader
42068931c7 eliminate "useless parentheses" lint errors
Some `oclint` errors regarding "useless parentheses" are meaningfull. But
the vast majority are bogus in as much as removing the parentheses reduces
readability. So fix a few of the egregious uses and otherwise suppress
that error.
2016-05-03 21:31:32 -07:00
Kurtis Rader
fa53563733 restyle sanity & screen module to match project style
Reduces lint errors from 163 to 112 (-31%). Line count from 1866 to 1493 (-20%).

Another step in resolving issue #2902.
2016-05-03 12:53:54 -07:00
Kurtis Rader
1f06e5f0b9 add better support for IWYU and fix things
Remove the "make iwyu" build target. Move the functionality into the
recently introduced lint.fish script. Fix a lot, but not all, of the
include-what-you-use errors. Specifically, it fixes all of the IWYU errors
on my OS X server but only removes some of them on my Ubuntu 14.04 server.

Fixes #2957
2016-04-26 15:02:22 -07:00
ridiculousfish
10f3ea0008 Mark a bunch of constructors as explicit
This prevents undesired implicit conversions
2016-02-27 19:38:15 -08:00
Tom Smeding
4417a6ee34 Prevent line-full-of-spaces in s_reset
If you have a prompt preceded by a new line, you'll get a line full of spaces instead of an empty line above your prompt. This doesn't make a difference in normal usage, but copying and pasting your terminal log becomes a pain. This commit clears that line, making it an actual empty line.
2016-01-08 23:38:31 +01:00
David Adam
e56f0628d5 common.cpp: check wcwidth for supported characters
Rather than trying to detect Unicode support from the environment, check
the printable width of characters in the current locale before deciding
on whether to use them.

Closes #1927.
2015-08-03 14:18:06 +08:00
David Adam
3929e9de0e Merge branch 'master' into iwyu 2015-07-26 10:20:13 +08:00
ridiculousfish
b4f53143b0 Migrate source files into src/ directory
This change moves source files into a src/ directory,
and puts object files into an obj/ directory. The Makefile
and xcode project are updated accordingly.

Fixes #1866
2015-07-24 00:59:27 -07:00