diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-01-20 20:03:58 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-01-20 20:03:58 -0600 |
commit | 79b9a868c2e195afb30e234c8eb779a0b85150ce (patch) | |
tree | 9cc721d37d80ef550af9baf2f6b3dab34e1c86b8 /apps/system | |
parent | 41a06a7941a5d49f064f42f198351d90d0aceb4d (diff) | |
download | nuttx-79b9a868c2e195afb30e234c8eb779a0b85150ce.tar.gz nuttx-79b9a868c2e195afb30e234c8eb779a0b85150ce.tar.bz2 nuttx-79b9a868c2e195afb30e234c8eb779a0b85150ce.zip |
VI: Send the BEL character on errors to make a noise on errors
Diffstat (limited to 'apps/system')
-rw-r--r-- | apps/system/vi/vi.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/apps/system/vi/vi.c b/apps/system/vi/vi.c index 83dbbb3b6..c36067455 100644 --- a/apps/system/vi/vi.c +++ b/apps/system/vi/vi.c @@ -66,6 +66,8 @@ #undef CTRL #define CTRL(a) ((a) & 0x1f) +#define VI_BEL(vi) vi_putch(vi,CTRL('G')) + /* Sizes of things */ #define MAX_STRING 64 /* The maximum size of a filename or search string */ @@ -707,6 +709,7 @@ static void vi_error(FAR struct vi_s *vi, FAR const char *fmt, ...) */ vi->error = TRUE; + VI_BEL(vi); } /**************************************************************************** @@ -2171,6 +2174,9 @@ static void vi_cmd_mode(FAR struct vi_s *vi) break; default: + { + VI_BEL(vi); + } break; } @@ -2518,6 +2524,10 @@ static void vi_cmd_submode(FAR struct vi_s *vi) vi_cmdch(vi, ch); } + else + { + VI_BEL(vi); + } } break; } @@ -2709,6 +2719,10 @@ static void vi_find_submode(FAR struct vi_s *vi) vi_cmdch(vi, ch); } + else + { + VI_BEL(vi); + } } break; } @@ -2843,7 +2857,14 @@ static void vi_replacech_submode(FAR struct vi_s *vi) { /* Ignore all but printable characters and tab */ - found = (isprint(ch) || ch == '\t'); + if (isprint(ch) || ch == '\t') + { + found = true; + } + else + { + VI_BEL(vi); + } } break; } @@ -2995,6 +3016,10 @@ static void vi_insert_mode(FAR struct vi_s *vi) vi_insertch(vi, ch); } + else + { + VI_BEL(vi); + } } break; } @@ -3101,6 +3126,10 @@ static void vi_replace_mode(FAR struct vi_s *vi) vi_replacech(vi, '\n'); } + else + { + VI_BEL(vi); + } } break; } |