Make nanoget_repaint be much more eleet. Uses $ for indication of beyond COLS, prompt is always displayed

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-11-02 15:30:24 +00:00
parent 92d2bab3ef
commit 0d1e8d66e4
2 changed files with 36 additions and 27 deletions

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-11-02 09:51-0500\n"
"POT-Creation-Date: 2000-11-02 10:29-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -380,7 +380,7 @@ msgid "Case Sens"
msgstr ""
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
#: global.c:405 global.c:411 winio.c:983
#: global.c:405 global.c:411 winio.c:992
msgid "Cancel"
msgstr ""
@ -814,67 +814,67 @@ msgstr ""
msgid "actual_x_from_start for xplus=%d returned %d\n"
msgstr ""
#: winio.c:399
#: winio.c:408
#, c-format
msgid "input '%c' (%d)\n"
msgstr ""
#: winio.c:436
#: winio.c:445
msgid "New Buffer"
msgstr ""
#: winio.c:439
#: winio.c:448
msgid " File: ..."
msgstr ""
#: winio.c:447
#: winio.c:456
msgid "Modified"
msgstr ""
#: winio.c:899
#: winio.c:908
#, c-format
msgid "Moved to (%d, %d) in edit buffer\n"
msgstr ""
#: winio.c:910
#: winio.c:919
#, c-format
msgid "current->data = \"%s\"\n"
msgstr ""
#: winio.c:953
#: winio.c:962
#, c-format
msgid "I got \"%s\"\n"
msgstr ""
#: winio.c:978
#: winio.c:987
msgid "Yes"
msgstr ""
#: winio.c:980
#: winio.c:989
msgid "All"
msgstr ""
#: winio.c:982
#: winio.c:991
msgid "No"
msgstr ""
#: winio.c:1119
#: winio.c:1128
#, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr ""
#: winio.c:1123
#: winio.c:1132
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr ""
#: winio.c:1251
#: winio.c:1260
msgid "Dumping file buffer to stderr...\n"
msgstr ""
#: winio.c:1253
#: winio.c:1262
msgid "Dumping cutbuffer to stderr...\n"
msgstr ""
#: winio.c:1255
#: winio.c:1264
msgid "Dumping a buffer to stderr...\n"
msgstr ""

29
winio.c
View File

@ -221,19 +221,26 @@ void check_statblank(void)
/* Repaint the statusbar when getting a character in nanogetstr */
void nanoget_repaint(char *buf, char *inputbuf, int x)
{
int len = strlen(buf);
int wid = COLS - len;
blank_statusbar();
if (x <= COLS - 1) {
mvwaddstr(bottomwin, 0, 0, buf);
waddnstr(bottomwin, inputbuf, (COLS - 1) - strlen(buf));
if (x <= COLS - 1) {
/* Black magic */
buf[len - 1] = ' ';
} else if (x > COLS - 1 && x <= (COLS - 1) * 2)
mvwaddnstr(bottomwin, 0, 0, &inputbuf[(COLS - 1) - strlen(buf)], COLS);
else
mvwaddnstr(bottomwin, 0, 0, &inputbuf[COLS * (x / (COLS - 1)) -
strlen(buf)], COLS);
wmove(bottomwin, 0, (x % (COLS - 1)));
mvwaddstr(bottomwin, 0, 0, buf);
waddnstr(bottomwin, inputbuf, wid);
wmove(bottomwin, 0, (x % COLS));
}
else {
/* Black magic */
buf[len - 1] = '$';
mvwaddstr(bottomwin, 0, 0, buf);
waddnstr(bottomwin, &inputbuf[wid * ((x - len) / (wid))], wid);
wmove(bottomwin, 0, ((x - len) % wid) + len);
}
}
/* Get the input from the kb, this should only be called from statusq */
@ -314,7 +321,9 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
inputbuf[strlen(inputbuf) - 1] = 0;
}
}
x--;
nanoget_repaint(buf, inputbuf, x);
x++;
case KEY_LEFT:
if (x > strlen(buf))
x--;