From 70798cbfe0a5d0cab8c5f23534533d6c85af1a96 Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Sat, 24 Oct 2020 13:14:35 +0000 Subject: [PATCH] Some updates for TinyTextEditor git-svn-id: svn://kolibrios.org@8116 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/other/tte/tte.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/programs/other/tte/tte.c b/programs/other/tte/tte.c index 1f6c9f7bbb..f5dfdfceee 100644 --- a/programs/other/tte/tte.c +++ b/programs/other/tte/tte.c @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* Kolibri port by Siemargl 2018 +/* Kolibri port by Siemargl 2018 and update by maxcodehack 2020 * my fixes mostly commented with triple comment /// * */ @@ -1369,7 +1369,7 @@ void editorDrawWelcomeMessage(struct a_buf* ab) { // Using snprintf to truncate message in case the terminal // is too tiny to handle the entire string. int welcome_len = snprintf(welcome, sizeof(welcome), - "tte %s ", TTE_VERSION); + "TinyTextEditor %s", TTE_VERSION); if (welcome_len > ec.screen_cols) welcome_len = ec.screen_cols; // Centering the message. @@ -1764,15 +1764,18 @@ int handleArgs(int argc, char* argv[]) { int main(int argc, char* argv[]) { if (con_init_console_dll()) return 1; // init fail - + con_set_title("TinyTextEditor"); initEditor(); int arg_response = handleArgs(argc, argv); - if (arg_response == 1) - editorOpen(argv[1]); + if (arg_response == 1) { + editorOpen(argv[1]); + char* title = argv[1]; + strcat(title, " - TinyTextEditor"); + con_set_title(title); + } else if (arg_response == -1) return 0; enableRawMode(); - editorSetStatusMessage(" Ctrl-Q, ^Z to quit | Ctrl-S to save | (tte -h | --help for more info)"); while (1) {