core: fix bug with new line inserted at end of each line displayed (set eat_newline_glitch to 0 if available)

v2.8-utf8proc
Sebastien Helleu 2011-06-01 12:10:03 +02:00
parent 35120b633c
commit 4126187574
9 changed files with 127 additions and 47 deletions

View File

@ -7,6 +7,8 @@ v0.3.6-dev, 2011-06-01
Version 0.3.6 (under dev!)
--------------------------
* core: fix bug with new line inserted at end of each line displayed (set
eat_newline_glitch to 0 if available)
* core: add option "infolists" for command /debug
* core: add horizontal scrolling for buffers with free content (command
/window scroll_horiz) (task #11112)

View File

@ -22,6 +22,7 @@
#cmakedefine ICONV_2ARG_IS_CONST 1
#cmakedefine HAVE_TCL_CREATE_NS
#cmakedefine HAVE_MALLINFO
#cmakedefine HAVE_EAT_NEWLINE_GLITCH
#define PACKAGE_VERSION "@VERSION@"
#define PACKAGE "@PROJECT_NAME@"
#define PACKAGE_NAME "@PROJECT_NAME@"

View File

@ -100,28 +100,29 @@ AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa mem
# Variables in config.h
AH_VERBATIM([PREFIX], [#undef PREFIX])
AH_VERBATIM([WEECHAT_LIBDIR], [#undef WEECHAT_LIBDIR])
AH_VERBATIM([WEECHAT_SHAREDIR], [#undef WEECHAT_SHAREDIR])
AH_VERBATIM([HAVE_GCRYPT], [#undef HAVE_GCRYPT])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS])
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
AH_VERBATIM([PLUGIN_DEMO], [#undef PLUGIN_DEMO])
AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO])
AH_VERBATIM([PLUGIN_IRC], [#undef PLUGIN_IRC])
AH_VERBATIM([PLUGIN_LOGGER], [#undef PLUGIN_LOGGER])
AH_VERBATIM([PLUGIN_RELAY], [#undef PLUGIN_RELAY])
AH_VERBATIM([PLUGIN_RMODIFIER], [#undef PLUGIN_RMODIFIER])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
AH_VERBATIM([PLUGIN_TCL], [#undef PLUGIN_TCL])
AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER])
AH_VERBATIM([DOC], [#undef DOC])
AH_VERBATIM([PREFIX], [#undef PREFIX])
AH_VERBATIM([WEECHAT_LIBDIR], [#undef WEECHAT_LIBDIR])
AH_VERBATIM([WEECHAT_SHAREDIR], [#undef WEECHAT_SHAREDIR])
AH_VERBATIM([HAVE_GCRYPT], [#undef HAVE_GCRYPT])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
AH_VERBATIM([HAVE_EAT_NEWLINE_GLITCH], [#undef HAVE_EAT_NEWLINE_GLITCH])
AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS])
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
AH_VERBATIM([PLUGIN_DEMO], [#undef PLUGIN_DEMO])
AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO])
AH_VERBATIM([PLUGIN_IRC], [#undef PLUGIN_IRC])
AH_VERBATIM([PLUGIN_LOGGER], [#undef PLUGIN_LOGGER])
AH_VERBATIM([PLUGIN_RELAY], [#undef PLUGIN_RELAY])
AH_VERBATIM([PLUGIN_RMODIFIER], [#undef PLUGIN_RMODIFIER])
AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL])
AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON])
AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY])
AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA])
AH_VERBATIM([PLUGIN_TCL], [#undef PLUGIN_TCL])
AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER])
AH_VERBATIM([DOC], [#undef DOC])
# Arguments for ./configure
@ -864,6 +865,25 @@ if test "x$debug" != "x0" ; then
fi
fi
# ------------------------------------------------------------------------------
# eat_newline_glitch
# ------------------------------------------------------------------------------
enable_eatnewlineglitch="no"
AC_CACHE_CHECK([for eat_newline_glitch support], ac_have_eatnewlineglitch, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[ #include <term.h> ]],
[[ eat_newline_glitch = 0; ]])],
[ ac_have_eatnewlineglitch="yes" ],
[ ac_have_eatnewlineglitch="no" ])])
if test "x$ac_have_eatnewlineglitch" = "xyes"; then
enable_eatnewlineglitch="yes"
AC_DEFINE(HAVE_EAT_NEWLINE_GLITCH)
else
not_found="$not_found eat_newline_glitch"
fi
# ------------------------------------------------------------------------------
# documentation
# ------------------------------------------------------------------------------
@ -981,29 +1001,30 @@ CFLAGS="$CFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENS
# output Makefiles
# ------------------------------------------------------------------------------
AM_CONDITIONAL(HAVE_GCRYPT, test "$enable_gcrypt" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_ALIAS, test "$enable_alias" = "yes")
AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes")
AM_CONDITIONAL(PLUGIN_DEMO, test "$enable_demo" = "yes")
AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes")
AM_CONDITIONAL(PLUGIN_IRC, test "$enable_irc" = "yes")
AM_CONDITIONAL(PLUGIN_LOGGER, test "$enable_logger" = "yes")
AM_CONDITIONAL(PLUGIN_RELAY, test "$enable_relay" = "yes")
AM_CONDITIONAL(PLUGIN_RMODIFIER, test "$enable_rmodifier" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
AM_CONDITIONAL(PLUGIN_TCL, test "$enable_tcl" = "yes")
AM_CONDITIONAL(PLUGIN_XFER, test "$enable_xfer" = "yes")
AM_CONDITIONAL(DOC, test "$enable_doc" = "yes")
AM_CONDITIONAL(HAVE_GCRYPT, test "$enable_gcrypt" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
AM_CONDITIONAL(HAVE_EAT_NEWLINE_GLITCH, test "$enable_eatnewlineglitch" = "yes")
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_ALIAS, test "$enable_alias" = "yes")
AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes")
AM_CONDITIONAL(PLUGIN_DEMO, test "$enable_demo" = "yes")
AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes")
AM_CONDITIONAL(PLUGIN_IRC, test "$enable_irc" = "yes")
AM_CONDITIONAL(PLUGIN_LOGGER, test "$enable_logger" = "yes")
AM_CONDITIONAL(PLUGIN_RELAY, test "$enable_relay" = "yes")
AM_CONDITIONAL(PLUGIN_RMODIFIER, test "$enable_rmodifier" = "yes")
AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes")
AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes")
AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes")
AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes")
AM_CONDITIONAL(PLUGIN_TCL, test "$enable_tcl" = "yes")
AM_CONDITIONAL(PLUGIN_XFER, test "$enable_xfer" = "yes")
AM_CONDITIONAL(DOC, test "$enable_doc" = "yes")
AC_OUTPUT([Makefile
doc/Makefile

View File

@ -23,6 +23,7 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckSymbolExists)
CHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES("limits.h" HAVE_LIMITS_H)
@ -66,9 +67,9 @@ CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO)
CHECK_INCLUDE_FILES("regex.h" HAVE_REGEX_H)
CHECK_FUNCTION_EXISTS(regexec HAVE_REGEXEC)
CHECK_SYMBOL_EXISTS("eat_newline_glitch" "term.h" HAVE_EAT_NEWLINE_GLITCH)
#needs to be splitted in subdirectories
# FIXME: weechat_gui_common MUST be the first lib in the list
# weechat_gui_common MUST be the first lib in the list
SET(STATIC_LIBS weechat_gui_common)
# Check for Large File Support

View File

@ -30,6 +30,7 @@ gui-curses-chat.c
gui-curses-color.c
gui-curses-keyboard.c
gui-curses-main.c
gui-curses-term.c
gui-curses-window.c)
SET(EXECUTABLE weechat-curses)

View File

@ -37,6 +37,7 @@ weechat_curses_SOURCES = gui-curses-bar-window.c \
gui-curses-color.c \
gui-curses-keyboard.c \
gui-curses-main.c \
gui-curses-term.c \
gui-curses-window.c \
gui-curses.h

View File

@ -92,6 +92,8 @@ gui_main_init ()
initscr ();
gui_term_set_eat_newline_glitch (0);
curs_set (1);
noecho ();
nodelay (stdscr, TRUE);

View File

@ -0,0 +1,48 @@
/*
* Copyright (C) 2011 Sebastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* gui-curses-term.c: terminal functions for Curses GUI
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <term.h>
/*
* gui_term_set_eat_newline_glitch: set "eat_newline_glitch" variable
* With value 0, this is used to not auto
* insert newline char at end of lines
* displayed, so that long words like URLs are
* not cut when they are selected with mouse
*/
void
gui_term_set_eat_newline_glitch (int value)
{
#ifdef HAVE_EAT_NEWLINE_GLITCH
eat_newline_glitch = value;
#else
/* make C compiler happy */
(void) value;
#endif
}

View File

@ -82,6 +82,9 @@ extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
extern void gui_keyboard_default_bindings ();
extern int gui_keyboard_read_cb (void *data, int fd);
/* terminal functions */
extern void gui_term_set_eat_newline_glitch (int value);
/* window functions */
extern void gui_window_read_terminal_size ();
extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer);