mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug Fix
- Conditional compilation (via FEATURE_NCURSES_COLS) to either use ncurses COLS and LINES global variables, or determine these from the WINDOW structure.
This commit is contained in:
parent
9fb5b34759
commit
ab3de212bf
2 changed files with 15 additions and 12 deletions
|
@ -58,14 +58,15 @@ int Context::interactive ()
|
|||
// throw std::string ("unimplemented Context::interactive");
|
||||
|
||||
// Fake interactive teaser...
|
||||
/*
|
||||
WINDOW* w = initscr ();
|
||||
int width = w->_maxx + 1;
|
||||
int height = w->_maxy + 1;
|
||||
*/
|
||||
#ifdef FEATURE_NCURSES_COLS
|
||||
initscr ();
|
||||
int width = COLS;
|
||||
int height = LINES;
|
||||
#else
|
||||
WINDOW* w = initscr ();
|
||||
int width = w->_maxx + 1;
|
||||
int height = w->_maxy + 1;
|
||||
#endif
|
||||
|
||||
(void) nonl ();
|
||||
(void) cbreak ();
|
||||
|
@ -141,12 +142,13 @@ int Context::getWidth ()
|
|||
#ifdef HAVE_LIBNCURSES
|
||||
if (config.get ("curses", true))
|
||||
{
|
||||
/*
|
||||
WINDOW* w = initscr ();
|
||||
width = w->_maxx + 1;
|
||||
*/
|
||||
#ifdef FEATURE_NCURSES_COLS
|
||||
initscr ();
|
||||
width = COLS;
|
||||
#else
|
||||
WINDOW* w = initscr ();
|
||||
width = w->_maxx + 1;
|
||||
#endif
|
||||
endwin ();
|
||||
|
||||
std::stringstream out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue