aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Reed <m.reed@mykolab.com>2015-04-27 22:08:14 -0400
committerMichael Reed <m.reed@mykolab.com>2015-05-01 16:45:02 -0400
commit98b3dc0571603f07f3e81babe402bb0837fc619b (patch)
treeb7600282fff70c2d8165209c4ba7f0a6342567c1
parent28e60462c8668e59c9de5890852e3c28de94f255 (diff)
downloadrneovim-98b3dc0571603f07f3e81babe402bb0837fc619b.tar.gz
rneovim-98b3dc0571603f07f3e81babe402bb0837fc619b.tar.bz2
rneovim-98b3dc0571603f07f3e81babe402bb0837fc619b.zip
vim-patch:7.4.659 + test
Problem: When 'ruler' is set the preferred column is reset. (Issue 339) Solution: Don't set curswant when redrawing the status lines. https://code.google.com/p/vim/source/detail?r=v7-4-659 Helped-by: David Bürgin <676c7473@gmail.com> Based on #2347 by @pvinis
-rw-r--r--src/nvim/option.c6
-rw-r--r--src/nvim/version.c2
-rw-r--r--test/functional/ui/screen_basic_spec.lua28
3 files changed, 30 insertions, 6 deletions
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('i0123456<cr>789<esc>kllj')
+ 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')