aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Bürgin <676c7473@gmail.com>2015-05-13 21:35:29 +0200
committerJustin M. Keyes <justinkz@gmail.com>2015-05-21 01:31:30 -0400
commit32837cc7df5da97b367da61fdb6e5da47f55e590 (patch)
tree1778b756fb8fc94c6e243563807f3f3827d2811c /src
parenteca51bbfa033f4956f5430fa15fa18c91a5fffef (diff)
downloadrneovim-32837cc7df5da97b367da61fdb6e5da47f55e590.tar.gz
rneovim-32837cc7df5da97b367da61fdb6e5da47f55e590.tar.bz2
rneovim-32837cc7df5da97b367da61fdb6e5da47f55e590.zip
'cpoptions': Remove "-" flag #2655
Diffstat (limited to 'src')
-rw-r--r--src/nvim/edit.c16
-rw-r--r--src/nvim/ex_docmd.c7
-rw-r--r--src/nvim/option_defs.h5
3 files changed, 11 insertions, 17 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 682a9146f3..ffbe0e0348 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -5966,10 +5966,11 @@ cursor_up (
if (n > 0) {
lnum = curwin->w_cursor.lnum;
- /* This fails if the cursor is already in the first line or the count
- * is larger than the line number and '-' is in 'cpoptions' */
- if (lnum <= 1 || (n >= lnum && vim_strchr(p_cpo, CPO_MINUS) != NULL))
+
+ // This fails if the cursor is already in the first line.
+ if (lnum <= 1) {
return FAIL;
+ }
if (n >= lnum)
lnum = 1;
else if (hasAnyFolding(curwin)) {
@@ -6021,12 +6022,11 @@ cursor_down (
lnum = curwin->w_cursor.lnum;
/* Move to last line of fold, will fail if it's the end-of-file. */
(void)hasFolding(lnum, NULL, &lnum);
- /* This fails if the cursor is already in the last line or would move
- * beyond the last line and '-' is in 'cpoptions' */
- if (lnum >= curbuf->b_ml.ml_line_count
- || (lnum + n > curbuf->b_ml.ml_line_count
- && vim_strchr(p_cpo, CPO_MINUS) != NULL))
+
+ // This fails if the cursor is already in the last line.
+ if (lnum >= curbuf->b_ml.ml_line_count) {
return FAIL;
+ }
if (lnum + n >= curbuf->b_ml.ml_line_count)
lnum = curbuf->b_ml.ml_line_count;
else if (hasAnyFolding(curwin)) {
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index ee935773b4..b55b59453f 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1684,12 +1684,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
}
} else if (ea.addr_count != 0) {
if (ea.line2 > curbuf->b_ml.ml_line_count) {
- /* With '-' in 'cpoptions' a line number past the file is an
- * error, otherwise put it at the end of the file. */
- if (vim_strchr(p_cpo, CPO_MINUS) != NULL)
- ea.line2 = -1;
- else
- ea.line2 = curbuf->b_ml.ml_line_count;
+ ea.line2 = curbuf->b_ml.ml_line_count;
}
if (ea.line2 < 0)
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 5e85b4bbea..de8816af0a 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -127,7 +127,6 @@
#define CPO_FILTER '!'
#define CPO_MATCH '%'
#define CPO_PLUS '+' /* ":write file" resets 'modified' */
-#define CPO_MINUS '-' /* "9-" fails at and before line 9 */
#define CPO_SPECI '<' /* don't recognize <> in mappings */
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
/* POSIX flags */
@@ -142,9 +141,9 @@
* cursor would not move */
/* default values for Vim, Vi and POSIX */
#define CPO_VIM "aABceFs"
-#define CPO_VI "aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%-+<>;"
+#define CPO_VI "aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
#define CPO_ALL \
- "aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%-+<>#{|&/\\.;"
+ "aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>#{|&/\\.;"
/* characters for p_ww option: */
#define WW_ALL "bshl<>[],~"