From 5940c5ff8853e1920d89c7a59ada707c716c6f30 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 9 Nov 2007 17:06:01 +0000 Subject: [PATCH] Support tab. --- CHANGES | 3 ++- input.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 53df89e7..9aca03ed 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 09 November 2007 +* (nicm) Support tab (\011). * (nicm) Initial man page outline. * (nicm) -V to show version. * (nicm) rename-session command. @@ -196,4 +197,4 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.62 2007-11-09 15:23:28 nicm Exp $ +$Id: CHANGES,v 1.63 2007-11-09 17:06:01 nicm Exp $ diff --git a/input.c b/input.c index 8f12e4f4..35c8bb39 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.29 2007-10-26 17:15:50 nicm Exp $ */ +/* $Id: input.c,v 1.30 2007-11-09 17:06:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -405,6 +405,15 @@ input_handle_c0_control(u_char ch, struct input_ctx *ictx) if (s->cx > 0) s->cx--; break; + case '\011': /* TAB */ + s->cx = ((s->cx / 8) * 8) + 8; + if (s->cx > s->sx) { + s->cx = 0; + screen_cursor_down_scroll(s); + } + input_store_two( + ictx->b, CODE_CURSORMOVE, s->cy + 1, s->cx + 1); + return; default: log_debug("unknown c0: %hhu", ch); return;