shithub: riscv

Download patch

ref: 3e7d181191769eebb8f5bd64ce2bc8f9a7ef2a56
parent: d9c4637a5f65da6cc6972765c0be9a05c8483ef5
parent: 84f45a4491b5abb1d7dd54490d240a30712cb2b8
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Dec 18 18:55:00 EST 2014

merge

--- a/sys/src/cmd/acme/text.c
+++ b/sys/src/cmd/acme/text.c
@@ -643,8 +643,6 @@
 	Rune *rp;
 	Text *u;
 
-	if(t->what!=Body && r=='\n')
-		return;
 	nr = 1;
 	rp = &r;
 	switch(r){
@@ -670,7 +668,8 @@
 		n = 2*t->maxlines/3;
 	case_Down:
 		q0 = t->org+frcharofpt(t, Pt(t->r.min.x, t->r.min.y+n*t->font->height));
-		textsetorigin(t, q0, TRUE);
+		if(t->what == Body)
+			textsetorigin(t, q0, TRUE);
 		return;
 	case Kup:
 		n = t->maxlines/3;
@@ -682,7 +681,8 @@
 		n = 2*t->maxlines/3;
 	case_Up:
 		q0 = textbacknl(t, t->org, n);
-		textsetorigin(t, q0, TRUE);
+		if(t->what == Body)
+			textsetorigin(t, q0, TRUE);
 		return;
 	case Khome:
 		typecommit(t);
@@ -776,7 +776,7 @@
 			textfill(t->file->text[i]);
 		return;
 	case '\n':
-		if(t->w->autoindent){
+		if(t->what == Body && t->w->autoindent){
 			/* find beginning of previous line using backspace code */
 			nnb = textbswidth(t, 0x15); /* ^U case */
 			rp = runemalloc(nnb + 1);