mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
mcviewer: clarify support of UTF-8 codeset.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
8f8c5217ee
commit
60e1a06c06
@ -135,7 +135,9 @@ struct mcview_struct
|
||||
gboolean hexedit_lownibble; /* Are we editing the last significant nibble? */
|
||||
gboolean locked; /* We hold lock on current file */
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
gboolean utf8; /* It's multibyte file codeset */
|
||||
#endif
|
||||
|
||||
coord_cache_t *coord_cache; /* Cache for mapping offsets to cursor positions */
|
||||
|
||||
|
@ -376,16 +376,15 @@ mcview_moveto_eol (mcview_t * view)
|
||||
else
|
||||
{
|
||||
off_t eol;
|
||||
|
||||
bol = mcview_bol (view, view->dpy_start, 0);
|
||||
eol = mcview_eol (view, view->dpy_start, mcview_get_filesize (view));
|
||||
if (!view->utf8)
|
||||
{
|
||||
if (eol > bol)
|
||||
view->dpy_text_column = eol - bol;
|
||||
}
|
||||
else
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
if (view->utf8)
|
||||
{
|
||||
char *str = NULL;
|
||||
|
||||
switch (view->datasource)
|
||||
{
|
||||
case DS_STDIO_PIPE:
|
||||
@ -406,6 +405,10 @@ mcview_moveto_eol (mcview_t * view)
|
||||
else
|
||||
view->dpy_text_column = eol - bol;
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_CHARSET */
|
||||
if (eol > bol)
|
||||
view->dpy_text_column = eol - bol;
|
||||
|
||||
if (view->dpy_text_column < (off_t) view->data_area.width)
|
||||
view->dpy_text_column = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user