| To: vim-dev@vim.org |
| Subject: Patch 7.0.154 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.0.154 |
| Problem: When 'foldnextmax' is negative Vim can hang. (James Vega) |
| Solution: Avoid the fold level becoming negative. |
| Files: src/fold.c, src/syntax.c |
| |
| |
| |
| |
| |
| *** 2971,2977 **** |
| --- 2971,2981 ---- |
| else |
| flp->lvl = get_indent_buf(buf, lnum) / buf->b_p_sw; |
| if (flp->lvl > flp->wp->w_p_fdn) |
| + { |
| flp->lvl = flp->wp->w_p_fdn; |
| + if (flp->lvl < 0) |
| + flp->lvl = 0; |
| + } |
| } |
| |
| /* foldlevelDiff() {{{2 */ |
| |
| |
| |
| *** 6072,6078 **** |
| --- 6072,6082 ---- |
| ++level; |
| } |
| if (level > wp->w_p_fdn) |
| + { |
| level = wp->w_p_fdn; |
| + if (level < 0) |
| + level = 0; |
| + } |
| return level; |
| } |
| #endif |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 154, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 134. You consider bandwidth to be more important than carats. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |