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-d3aeb78583b8master
parent
92d2bab3ef
commit
0d1e8d66e4
34
po/nano.pot
34
po/nano.pot
|
@ -6,7 +6,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"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"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -380,7 +380,7 @@ msgid "Case Sens"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
|
#: 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"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -814,67 +814,67 @@ msgstr ""
|
||||||
msgid "actual_x_from_start for xplus=%d returned %d\n"
|
msgid "actual_x_from_start for xplus=%d returned %d\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:399
|
#: winio.c:408
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "input '%c' (%d)\n"
|
msgid "input '%c' (%d)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:436
|
#: winio.c:445
|
||||||
msgid "New Buffer"
|
msgid "New Buffer"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:439
|
#: winio.c:448
|
||||||
msgid " File: ..."
|
msgid " File: ..."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:447
|
#: winio.c:456
|
||||||
msgid "Modified"
|
msgid "Modified"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:899
|
#: winio.c:908
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Moved to (%d, %d) in edit buffer\n"
|
msgid "Moved to (%d, %d) in edit buffer\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:910
|
#: winio.c:919
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "current->data = \"%s\"\n"
|
msgid "current->data = \"%s\"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:953
|
#: winio.c:962
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "I got \"%s\"\n"
|
msgid "I got \"%s\"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:978
|
#: winio.c:987
|
||||||
msgid "Yes"
|
msgid "Yes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:980
|
#: winio.c:989
|
||||||
msgid "All"
|
msgid "All"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:982
|
#: winio.c:991
|
||||||
msgid "No"
|
msgid "No"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:1119
|
#: winio.c:1128
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
|
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:1123
|
#: winio.c:1132
|
||||||
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
|
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:1251
|
#: winio.c:1260
|
||||||
msgid "Dumping file buffer to stderr...\n"
|
msgid "Dumping file buffer to stderr...\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:1253
|
#: winio.c:1262
|
||||||
msgid "Dumping cutbuffer to stderr...\n"
|
msgid "Dumping cutbuffer to stderr...\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: winio.c:1255
|
#: winio.c:1264
|
||||||
msgid "Dumping a buffer to stderr...\n"
|
msgid "Dumping a buffer to stderr...\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
29
winio.c
29
winio.c
|
@ -221,19 +221,26 @@ void check_statblank(void)
|
||||||
/* Repaint the statusbar when getting a character in nanogetstr */
|
/* Repaint the statusbar when getting a character in nanogetstr */
|
||||||
void nanoget_repaint(char *buf, char *inputbuf, int x)
|
void nanoget_repaint(char *buf, char *inputbuf, int x)
|
||||||
{
|
{
|
||||||
|
int len = strlen(buf);
|
||||||
|
int wid = COLS - len;
|
||||||
|
|
||||||
blank_statusbar();
|
blank_statusbar();
|
||||||
if (x <= COLS - 1) {
|
if (x <= COLS - 1) {
|
||||||
mvwaddstr(bottomwin, 0, 0, buf);
|
/* Black magic */
|
||||||
waddnstr(bottomwin, inputbuf, (COLS - 1) - strlen(buf));
|
buf[len - 1] = ' ';
|
||||||
|
|
||||||
} else if (x > COLS - 1 && x <= (COLS - 1) * 2)
|
mvwaddstr(bottomwin, 0, 0, buf);
|
||||||
mvwaddnstr(bottomwin, 0, 0, &inputbuf[(COLS - 1) - strlen(buf)], COLS);
|
waddnstr(bottomwin, inputbuf, wid);
|
||||||
else
|
wmove(bottomwin, 0, (x % COLS));
|
||||||
mvwaddnstr(bottomwin, 0, 0, &inputbuf[COLS * (x / (COLS - 1)) -
|
}
|
||||||
strlen(buf)], COLS);
|
else {
|
||||||
|
/* Black magic */
|
||||||
wmove(bottomwin, 0, (x % (COLS - 1)));
|
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 */
|
/* 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;
|
inputbuf[strlen(inputbuf) - 1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
x--;
|
||||||
nanoget_repaint(buf, inputbuf, x);
|
nanoget_repaint(buf, inputbuf, x);
|
||||||
|
x++;
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
if (x > strlen(buf))
|
if (x > strlen(buf))
|
||||||
x--;
|
x--;
|
||||||
|
|
Loading…
Reference in New Issue