in browser_refresh(), for the ".." entry, display "(parent dir)" instead
of "(dir)", as Pico does git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3695 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
99c87ccb0c
Коммит
68e2c375e7
@ -17,6 +17,8 @@ CVS code -
|
|||||||
- Simplify. (DLR)
|
- Simplify. (DLR)
|
||||||
- Fix problems where translated versions of "(dir)" could be
|
- Fix problems where translated versions of "(dir)" could be
|
||||||
truncated, and where file sizes could be too long. (DLR)
|
truncated, and where file sizes could be too long. (DLR)
|
||||||
|
- For the ".." entry, display "(parent dir)" instead of "(dir)",
|
||||||
|
as Pico does. (DLR)
|
||||||
- doc/syntax/c.nanorc:
|
- doc/syntax/c.nanorc:
|
||||||
- Since .i and .ii are preprocessed C and C++ output, colorize
|
- Since .i and .ii are preprocessed C and C++ output, colorize
|
||||||
them here. (Mike Frysinger)
|
them here. (Mike Frysinger)
|
||||||
|
@ -418,7 +418,8 @@ char *do_browse_from(const char *inpath)
|
|||||||
/* Set filelist to the list of files contained in the directory path,
|
/* Set filelist to the list of files contained in the directory path,
|
||||||
* set filelist_len to the number of files in that list, and set longest
|
* set filelist_len to the number of files in that list, and set longest
|
||||||
* to the width in columns of the longest filename in that list, up to
|
* to the width in columns of the longest filename in that list, up to
|
||||||
* COLS - 1 (but at least 7). Assume path exists and is a directory. */
|
* COLS - 1 (but at least 15). Assume path exists and is a
|
||||||
|
* directory. */
|
||||||
void browser_init(const char *path, DIR *dir)
|
void browser_init(const char *path, DIR *dir)
|
||||||
{
|
{
|
||||||
const struct dirent *nextdir;
|
const struct dirent *nextdir;
|
||||||
@ -470,8 +471,8 @@ void browser_init(const char *path, DIR *dir)
|
|||||||
|
|
||||||
if (longest > COLS - 1)
|
if (longest > COLS - 1)
|
||||||
longest = COLS - 1;
|
longest = COLS - 1;
|
||||||
if (longest < 7)
|
if (longest < 15)
|
||||||
longest = 7;
|
longest = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine the shortcut key corresponding to the values of kbinput
|
/* Determine the shortcut key corresponding to the values of kbinput
|
||||||
@ -539,8 +540,9 @@ void browser_refresh(void)
|
|||||||
|
|
||||||
for (; i < filelist_len && line < editwinrows; i++) {
|
for (; i < filelist_len && line < editwinrows; i++) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *disp = display_string(tail(filelist[i]), 0, longest,
|
const char *filetail = tail(filelist[i]);
|
||||||
FALSE);
|
char *disp = display_string(filetail, 0, longest, FALSE);
|
||||||
|
size_t foo_col;
|
||||||
|
|
||||||
/* Highlight the currently selected file or directory. */
|
/* Highlight the currently selected file or directory. */
|
||||||
if (i == selected)
|
if (i == selected)
|
||||||
@ -567,7 +569,8 @@ void browser_refresh(void)
|
|||||||
foo = mallocstrcpy(NULL, _("(dir)"));
|
foo = mallocstrcpy(NULL, _("(dir)"));
|
||||||
} else if (S_ISDIR(st.st_mode))
|
} else if (S_ISDIR(st.st_mode))
|
||||||
/* If the file is a directory, display it as such. */
|
/* If the file is a directory, display it as such. */
|
||||||
foo = mallocstrcpy(NULL, _("(dir)"));
|
foo = mallocstrcpy(NULL, (strcmp(filetail, "..") == 0) ?
|
||||||
|
_("(parent dir)") : _("(dir)"));
|
||||||
else {
|
else {
|
||||||
foo = charalloc(uimax_digits + 4);
|
foo = charalloc(uimax_digits + 4);
|
||||||
|
|
||||||
@ -588,8 +591,10 @@ void browser_refresh(void)
|
|||||||
(unsigned int)(st.st_size >> 30));
|
(unsigned int)(st.st_size >> 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
mvwaddnstr(edit, line, col - strlenpt(foo), foo,
|
foo_col = col - strlenpt(foo);
|
||||||
actual_x(foo, 7));
|
|
||||||
|
mvwaddnstr(edit, line, foo_col, foo, actual_x(foo, longest -
|
||||||
|
foo_col));
|
||||||
|
|
||||||
if (i == selected)
|
if (i == selected)
|
||||||
wattroff(edit, reverse_attr);
|
wattroff(edit, reverse_attr);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user