diff --git src/option.c src/option.c
index b9b59ee..30f601a 100644
--- src/option.c
+++ src/option.c
@@ -4919,12 +4919,28 @@ do_set(
 			    {
 				/* Remove flags that appear twice. */
 				for (s = newval; *s; ++s)
-				    if ((!(flags & P_COMMA) || *s != ',')
-					    && vim_strchr(s + 1, *s) != NULL)
+				{
+				    /* if options have P_FLAGLIST and P_ONECOMMA such as 'whichwrap' */
+				    if (flags & P_ONECOMMA)
+				    {
+					if ( (*s != ',') && (*(s + 1) == ',')
+						&& vim_strchr(s + 2, *s) != NULL)
+					{
+					    /* Remove the duplicated value and the next comma. */
+					    STRMOVE(s, s + 2);
+					    s -= 2;
+					}
+				    }
+				    else
 				    {
-					STRMOVE(s, s + 1);
-					--s;
+					if ((!(flags & P_COMMA) || *s != ',')
+						&& vim_strchr(s + 1, *s) != NULL)
+					{
+					    STRMOVE(s, s + 1);
+					    --s;
+					}
 				    }
+				}
 			    }
 
 			    if (save_arg != NULL)   /* number for 'whichwrap' */
diff --git src/testdir/test_options.vim src/testdir/test_options.vim
new file mode 100644
index 0000000..3357f2d
--- /dev/null
+++ src/testdir/test_options.vim
@@ -0,0 +1,15 @@
+" Test for options
+
+function! Test_whichwrap()
+  set whichwrap=b,s
+  call assert_equal("b,s", &whichwrap)
+
+  set whichwrap+=h,l
+  call assert_equal("b,s,h,l", &whichwrap)
+
+  set whichwrap+=h,l
+  call assert_equal("b,s,h,l", &whichwrap)
+
+  set whichwrap+=h,l
+  call assert_equal("b,s,h,l", &whichwrap)
+endfunction
