diff --git a/src/nvim/option.c b/src/nvim/option.c index 1a7d161c62..33e3f5b459 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4347,7 +4347,7 @@ did_set_string_option ( } if (curwin->w_curswant != MAXCOL - && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0) + && (options[opt_idx].flags & (P_CURSWANT | P_RALL)) != 0) curwin->w_set_curswant = TRUE; check_redraw(options[opt_idx].flags); @@ -4988,7 +4988,7 @@ set_bool_option ( comp_col(); /* in case 'ruler' or 'showcmd' changed */ if (curwin->w_curswant != MAXCOL - && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0) + && (options[opt_idx].flags & (P_CURSWANT | P_RALL)) != 0) curwin->w_set_curswant = TRUE; check_redraw(options[opt_idx].flags); @@ -5360,7 +5360,7 @@ set_num_option ( comp_col(); /* in case 'columns' or 'ls' changed */ if (curwin->w_curswant != MAXCOL - && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0) + && (options[opt_idx].flags & (P_CURSWANT | P_RALL)) != 0) curwin->w_set_curswant = TRUE; check_redraw(options[opt_idx].flags); diff --git a/src/nvim/version.c b/src/nvim/version.c index 5758619b56..76460959ed 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -124,7 +124,7 @@ static int included_patches[] = { //662, //661, 660, - //659, + 659, //658, //657, //656, diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 7710918b94..d57c1773b1 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -159,8 +159,6 @@ describe('Screen', function() | ]]) end) - - end) end) @@ -245,6 +243,32 @@ describe('Screen', function() end) end) + describe('normal mode', function() + -- https://code.google.com/p/vim/issues/detail?id=339 + it("setting 'ruler' doesn't reset the preferred column", function() + execute('set virtualedit=') + feed('i0123456789kllj') + execute('set ruler') + feed('k') + screen:expect([[ + 0123^456 | + 789 | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + :set ruler 1,5 All | + ]]) + end) + end) + describe('command mode', function() it('typing commands', function() feed(':ls')