From 38e98ade1103c3fcd7c375d43335fc4c6f73a8ae Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 24 Aug 2006 17:52:46 +0000
Subject: [PATCH] goto position 1,1 before returning from edit() to prevent hit
 any key prompt when exiting from last edit line.

---
 exec/fseditor.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/exec/fseditor.js b/exec/fseditor.js
index de8762bc6e..da7e0931c5 100644
--- a/exec/fseditor.js
+++ b/exec/fseditor.js
@@ -1366,8 +1366,10 @@ function edit(quote_first)
 
 	redraw_screen();
 	if(quote_first) {
-		if(quote_mode())
+		if(quote_mode()) {
+			console.gotoxy(1,1);
 			return;
+		}
 	}
 	while(1) {
 		set_cursor();
@@ -1646,6 +1648,7 @@ function edit(quote_first)
 					xpos=line[ypos].text.length;
 				break;
 			case '\x11':	/* CTRL-Q (XOff) (Quick Abort in SyncEdit) */
+				console.gotoxy(1,1);
 				return;
 			case '\x12':	/* CTRL-R (Quick Redraw in SyncEdit) */
 				redraw_screen();
@@ -1663,8 +1666,10 @@ function edit(quote_first)
 				break;
 			case '\x15':	/* CTRL-U (Quick Quote in SyncEdit) */
 				if(quote_line.length>0) {
-					if(quote_mode())
+					if(quote_mode()) {
+						console.gotoxy(1,1);
 						return;
+					}
 				}
 				else
 					console.beep();
@@ -1747,6 +1752,7 @@ function edit(quote_first)
 				var s=make_strings(true,true);
 				f.write(s[0]);
 				f.close();
+				console.gotoxy(1,1);
 				return;
 			case '\x1b':	/* ESC (This should parse extra ANSI sequences) */
 				break;
@@ -1766,6 +1772,7 @@ function edit(quote_first)
 				try_prev_line();
 				break;
 			case '\x1f':	/* CTRL-_ Safe quick-abort*/
+				console.gotoxy(1,1);
 				return;
 			case '\x7f':	/* DELETE */
 				last_xpos=-1;
-- 
GitLab