aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme/text.c
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2017-05-11 08:04:35 +0200
committerPetter Rodhelind <petter.rodhelind@gmail.com>2017-05-11 08:04:35 +0200
commit31f188eef9af8a8ca3a7c493f18fcc74c00861a3 (patch)
tree93b23c6ff38198dc9431197b72e67160bc735292 /src/cmd/acme/text.c
parentbfd823b33025c7b5958a9d815f7762f83bc34a71 (diff)
downloadplan9port-31f188eef9af8a8ca3a7c493f18fcc74c00861a3.tar.gz
plan9port-31f188eef9af8a8ca3a7c493f18fcc74c00861a3.tar.bz2
plan9port-31f188eef9af8a8ca3a7c493f18fcc74c00861a3.zip
Add support for tab expansion (because everyone else is stupid and I am forced to follow along)
Tab expansion inserts spaces instead of TAB character. Number of spaces is dependent upon your current tab stop setting, which can be changed by running "Tab n". As of now, it's not possible to turn it on and off during runtime. You can however see whether it's compiled or not by executing the command "Tabexpand". The console will show either 1 or 0. This will be taken care of in a later commit.
Diffstat (limited to 'src/cmd/acme/text.c')
-rw-r--r--src/cmd/acme/text.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
index 0452c2b1..faa87d99 100644
--- a/src/cmd/acme/text.c
+++ b/src/cmd/acme/text.c
@@ -758,6 +758,14 @@ texttype(Text *t, Rune r)
} else
textshow(t, t->file->b.nc, t->file->b.nc, FALSE);
return;
+ case 0x09: /* ^I (TAB) */
+ if(t->w->tabexpand == TRUE){
+ for(i=0; i < t->w->body.tabstop; i++){
+ texttype(t, ' ');
+ }
+ return;
+ }else
+ break; /* fall through to normal code */
case 0x01: /* ^A: beginning of line */
typecommit(t);
/* go to where ^U would erase, if not already at BOL */