mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 17:53:13 +02:00
core: fix bug with new line inserted at end of each line displayed (set eat_newline_glitch to 0 if available)
This commit is contained in:
+3
-2
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ gui_main_init ()
|
||||
|
||||
initscr ();
|
||||
|
||||
gui_term_set_eat_newline_glitch (0);
|
||||
|
||||
curs_set (1);
|
||||
noecho ();
|
||||
nodelay (stdscr, TRUE);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user