diff options
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | ci/common/build.sh | 6 | ||||
-rw-r--r-- | src/nvim/os/shell.c | 3 | ||||
-rw-r--r-- | src/nvim/screen.c | 5 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 8 | ||||
-rw-r--r-- | test/README.md | 11 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/syntax_conceal_spec.lua | 46 | ||||
-rw-r--r-- | test/unit/helpers.lua | 4 |
9 files changed, 70 insertions, 21 deletions
diff --git a/.travis.yml b/.travis.yml index 325b5e7b56..2882ba8935 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,10 +24,6 @@ env: -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr -DMIN_LOG_LEVEL=3" - DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF" - # Additional CMake flags for 32-bit builds. - - CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32 - -DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib - -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" # Environment variables for Clang sanitizers. - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan" - TSAN_OPTIONS="log_path=$LOG_DIR/tsan" @@ -136,6 +132,8 @@ jobs: compiler: gcc env: - BUILD_32BIT=ON + - CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" + - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" # Minimum required CMake. - CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh - *common-job-env diff --git a/ci/common/build.sh b/ci/common/build.sh index 8e9b2f8ebb..02e1110a15 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -18,9 +18,6 @@ build_make() { } build_deps() { - if test "${BUILD_32BIT}" = ON ; then - DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" - fi if test "${FUNCTIONALTEST}" = "functionaltest-lua" \ || test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" @@ -53,9 +50,6 @@ prepare_build() { if test -n "${CLANG_SANITIZER}" ; then CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" fi - if test "${BUILD_32BIT}" = ON ; then - CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" - fi mkdir -p "${BUILD_DIR}" cd "${BUILD_DIR}" diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 6956410401..f4377b1457 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -423,10 +423,11 @@ static bool out_data_decide_throttle(size_t size) pulse_msg[1] = (tick > 1) ? '.' : ' '; pulse_msg[2] = (tick > 2) ? '.' : ' '; if (visit == 1) { - msg_putchar('\n'); + msg_puts("[...]\n"); } msg_putchar('\r'); // put cursor at start of line msg_puts(pulse_msg); + msg_putchar('\r'); ui_flush(); return true; } diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 17a91f69d5..187c89b28c 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -578,10 +578,13 @@ void conceal_check_cursor_line(void) /// /// If true, both old and new cursorline will need /// need to be redrawn when moving cursor within windows. +/// TODO(bfredl): VIsual_active shouldn't be needed, but is used to fix a glitch +/// caused by scrolling. bool win_cursorline_standout(const win_T *wp) FUNC_ATTR_NONNULL_ALL { - return wp->w_p_cul || (wp->w_p_cole > 0 && !conceal_cursor_line(wp)); + return wp->w_p_cul + || (wp->w_p_cole > 0 && (VIsual_active || !conceal_cursor_line(wp))); } /* diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 4ca44b25f0..956d4eb9da 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -93,7 +93,7 @@ typedef struct { int out_fd; bool scroll_region_is_full_screen; bool can_change_scroll_region; - bool can_set_lr_margin; + bool can_set_lr_margin; // smglr bool can_set_left_right_margin; bool can_scroll; bool can_erase_chars; @@ -1603,6 +1603,12 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, unibi_set_if_empty(ut, unibi_set_lr_margin, "\x1b[%i%p1%d;%p2%ds"); unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds"); unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds"); + } else { + // Fix things advertised via TERM=xterm, for non-xterm. + if (unibi_get_str(ut, unibi_set_lr_margin)) { + ILOG("Disabling smglr with TERM=xterm for non-xterm."); + unibi_set_str(ut, unibi_set_lr_margin, NULL); + } } #ifdef WIN32 diff --git a/test/README.md b/test/README.md index 64892b5576..2b19740434 100644 --- a/test/README.md +++ b/test/README.md @@ -315,11 +315,12 @@ Number; !must be defined to function properly): - `NVIM_TEST_RUN_TESTTEST` (U) (1): allows running `test/unit/testtest_spec.lua` used to check how testing infrastructure works. -- `NVIM_TEST_TRACE_LEVEL` (U) (N): specifies unit tests tracing level: `0` - disables tracing (the fastest, but you get no data if tests crash and there - was no core dump generated), `1` or empty/undefined leaves only C function - cals and returns in the trace (faster then recording everything), `2` records - all function calls, returns and lua source lines exuecuted. +- `NVIM_TEST_TRACE_LEVEL` (U) (N): specifies unit tests tracing level: + - `0` disables tracing (the fastest, but you get no data if tests crash and + there no core dump was generated), + - `1` leaves only C function calls and returns in the trace (faster than + recording everything), + - `2` records all function calls, returns and executed Lua source lines. - `NVIM_TEST_TRACE_ON_ERROR` (U) (1): makes unit tests yield trace on error in addition to regular error message. diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index ed904f27ca..ada073c4e6 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -939,7 +939,7 @@ describe('TUI FocusGained/FocusLost', function() | gained | {3:-- TERMINAL --} | - ]], timeout=(3 * screen.timeout)} + ]], timeout=(4 * screen.timeout)} feed_data('\027[O') screen:expect([[ diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index 00e94ef94b..7079b43414 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -17,6 +17,7 @@ describe('Screen', function() [3] = {reverse = true}, [4] = {bold = true}, [5] = {background = Screen.colors.Yellow}, + [6] = {background = Screen.colors.LightGrey}, } ) end) @@ -823,5 +824,50 @@ describe('Screen', function() ]]) end) end) + + it('redraws properly with concealcursor in visual mode', function() + command('set concealcursor=v conceallevel=2') + + feed('10Ofoo barf bar barf eggs<esc>') + feed(':3<cr>o a<Esc>ggV') + screen:expect{grid=[[ + ^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + a | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + {4:-- VISUAL LINE --} | + ]]} + feed(string.rep('j', 15)) + screen:expect{grid=[[ + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + {6:foo }{1:b}{6: bar }{1:b}{6: eggs} | + ^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} | + {4:-- VISUAL LINE --} | + ]]} + feed(string.rep('k', 15)) + screen:expect{grid=[[ + ^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + a | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + foo {1:b} bar {1:b} eggs | + {4:-- VISUAL LINE --} | + ]]} + end) end) end) diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index 24dbc65bd0..bacdc54416 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -545,7 +545,7 @@ local tracehelp = dedent([[ local function child_sethook(wr) local trace_level = os.getenv('NVIM_TEST_TRACE_LEVEL') if not trace_level or trace_level == '' then - trace_level = 1 + trace_level = 0 else trace_level = tonumber(trace_level) end @@ -708,7 +708,7 @@ local function check_child_err(rd) local eres = sc.read(rd, 2) if eres ~= '$\n' then if #trace == 0 then - err = '\nTest crashed, no trace available\n' + err = '\nTest crashed, no trace available (check NVIM_TEST_TRACE_LEVEL)\n' else err = '\nTest crashed, trace:\n' .. tracehelp for i = 1, #trace do |