mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Add support for highligting qutes in a special color - defaults to blue
darcs-hash:20060527123516-ac50b-d6e0cf08bd9dfe8514e64004d93dc4035e73fad8.gz
This commit is contained in:
parent
42a260f1e6
commit
6bdb0cde8b
4 changed files with 12 additions and 5 deletions
|
@ -752,7 +752,7 @@ certain environment variables.
|
|||
|
||||
- \c BROWSER, which is the users preferred web browser. If this variable is set, fish will use the specified browser instead of the system default browser to display the fish documentation.
|
||||
- \c CDPATH, which is an array of directories in which to search for the new directory for the \c cd builtin.
|
||||
- \c fish_color_normal, \c fish_color_command, \c fish_color_redirection, \c fish_color_end, \c fish_color_error, \c fish_color_param, \c fish_color_comment, \c fish_color_match, \c fish_color_search_match, \c fish_color_operator, \c fish_color_escape, \c fish_color_cwd, \c fish_pager_color_prefix, \c fish_pager_color_completion, \c fish_pager_color_description and \c fish_pager_color_progress are used to change the color of various elements in \c fish. These variables are universal, i.e. when changing them, their new value will be used by all running fish sessions. The new value will also be retained when restarting fish.
|
||||
- \c fish_color_normal, \c fish_color_command, \c fish_color_quote, \c fish_color_redirection, \c fish_color_end, \c fish_color_error, \c fish_color_param, \c fish_color_comment, \c fish_color_match, \c fish_color_search_match, \c fish_color_operator, \c fish_color_escape, \c fish_color_cwd, \c fish_pager_color_prefix, \c fish_pager_color_completion, \c fish_pager_color_description and \c fish_pager_color_progress are used to change the color of various elements in \c fish. These variables are universal, i.e. when changing them, their new value will be used by all running fish sessions. The new value will also be retained when restarting fish.
|
||||
- \c PATH, which is an array of directories in which to search for commands
|
||||
- \c umask, which is the current file creation mask. The preferred way to change the umask variable is through the <a href="commands.html#umask">umask shellscript function</a>. An attempt to set umask to an invalid value will always fail.
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ set_default fish_color_comment brown
|
|||
set_default fish_color_error red
|
||||
set_default fish_color_escape cyan
|
||||
set_default fish_color_operator cyan
|
||||
set_default fish_color_quote blue
|
||||
|
||||
set_default fish_color_cwd green
|
||||
|
||||
|
|
13
highlight.c
13
highlight.c
|
@ -52,7 +52,8 @@ static wchar_t *highlight_var[] =
|
|||
L"fish_color_match",
|
||||
L"fish_color_search_match",
|
||||
L"fish_color_operator",
|
||||
L"fish_color_escape"
|
||||
L"fish_color_escape",
|
||||
L"fish_color_quote"
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -262,12 +263,14 @@ static void highlight_param( const wchar_t * buff,
|
|||
|
||||
case L'\'':
|
||||
{
|
||||
color[in_pos] = HIGHLIGHT_QUOTE;
|
||||
mode = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case L'\"':
|
||||
{
|
||||
color[in_pos] = HIGHLIGHT_QUOTE;
|
||||
mode = 2;
|
||||
break;
|
||||
}
|
||||
|
@ -291,7 +294,7 @@ static void highlight_param( const wchar_t * buff,
|
|||
case L'\'':
|
||||
{
|
||||
color[start_pos] = HIGHLIGHT_ESCAPE;
|
||||
color[in_pos+1] = HIGHLIGHT_NORMAL;
|
||||
color[in_pos+1] = HIGHLIGHT_QUOTE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -306,6 +309,7 @@ static void highlight_param( const wchar_t * buff,
|
|||
if( c == L'\'' )
|
||||
{
|
||||
mode = 0;
|
||||
color[in_pos+1] = HIGHLIGHT_NORMAL;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -321,6 +325,7 @@ static void highlight_param( const wchar_t * buff,
|
|||
case '"':
|
||||
{
|
||||
mode = 0;
|
||||
color[in_pos+1] = HIGHLIGHT_NORMAL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -339,7 +344,7 @@ static void highlight_param( const wchar_t * buff,
|
|||
case '"':
|
||||
{
|
||||
color[start_pos] = HIGHLIGHT_ESCAPE;
|
||||
color[in_pos+1] = HIGHLIGHT_NORMAL;
|
||||
color[in_pos+1] = HIGHLIGHT_QUOTE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -349,7 +354,7 @@ static void highlight_param( const wchar_t * buff,
|
|||
case '$':
|
||||
{
|
||||
color[in_pos] = HIGHLIGHT_OPERATOR;
|
||||
color[in_pos+1] = HIGHLIGHT_NORMAL;
|
||||
color[in_pos+1] = HIGHLIGHT_QUOTE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
1
output.h
1
output.h
|
@ -23,6 +23,7 @@ enum
|
|||
HIGHLIGHT_SEARCH_MATCH,
|
||||
HIGHLIGHT_OPERATOR,
|
||||
HIGHLIGHT_ESCAPE,
|
||||
HIGHLIGHT_QUOTE,
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in a new issue