To: vim_dev@googlegroups.com Subject: Patch 8.0.0968 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0968 Problem: Crash when switching terminal modes. (Nikolai Pavlov) Solution: Check that there are scrollback lines. Files: src/terminal.c *** ../vim-8.0.0967/src/terminal.c 2017-08-19 19:40:42.193061077 +0200 --- src/terminal.c 2017-08-19 21:19:38.096322883 +0200 *************** *** 1037,1050 **** /* Remove the terminal contents from the scrollback and the buffer. */ gap = &term->tl_scrollback; ! while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled) { ml_delete(curbuf->b_ml.ml_line_count, FALSE); line = (sb_line_T *)gap->ga_data + gap->ga_len - 1; vim_free(line->sb_cells); --gap->ga_len; - if (gap->ga_len == 0) - break; } check_cursor(); --- 1037,1049 ---- /* Remove the terminal contents from the scrollback and the buffer. */ gap = &term->tl_scrollback; ! while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled ! && gap->ga_len > 0) { ml_delete(curbuf->b_ml.ml_line_count, FALSE); line = (sb_line_T *)gap->ga_data + gap->ga_len - 1; vim_free(line->sb_cells); --gap->ga_len; } check_cursor(); *** ../vim-8.0.0967/src/version.c 2017-08-19 21:11:52.867147762 +0200 --- src/version.c 2017-08-19 21:22:12.263383261 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 968, /**/ -- Lower life forms have more fun! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///