mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
'cpoptions': Remove "-" flag #2655
This commit is contained in:
parent
eca51bbfa0
commit
32837cc7df
@ -354,10 +354,6 @@ or the last line. The first two commands put the cursor in the same column
|
|||||||
except after the "$" command, then the cursor will be put on the last
|
except after the "$" command, then the cursor will be put on the last
|
||||||
character of the line.
|
character of the line.
|
||||||
|
|
||||||
If "k", "-" or CTRL-P is used with a [count] and there are less than [count]
|
|
||||||
lines above the cursor and the 'cpo' option includes the "-" flag it is an
|
|
||||||
error. |cpo--|.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. Word motions *word-motions*
|
4. Word motions *word-motions*
|
||||||
|
|
||||||
|
@ -1925,13 +1925,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
there is one). This works very well for C programs.
|
there is one). This works very well for C programs.
|
||||||
This flag is also used for other features, such as
|
This flag is also used for other features, such as
|
||||||
C-indenting.
|
C-indenting.
|
||||||
*cpo--*
|
|
||||||
- When included, a vertical movement command fails when
|
|
||||||
it would go above the first line or below the last
|
|
||||||
line. Without it the cursor moves to the first or
|
|
||||||
last line, unless it already was in that line.
|
|
||||||
Applies to the commands "-", "k", CTRL-P, "+", "j",
|
|
||||||
CTRL-N, CTRL-J and ":1234".
|
|
||||||
*cpo-+*
|
*cpo-+*
|
||||||
+ When included, a ":write file" command will reset the
|
+ When included, a ":write file" command will reset the
|
||||||
'modified' flag of the buffer, even though the buffer
|
'modified' flag of the buffer, even though the buffer
|
||||||
|
@ -5966,10 +5966,11 @@ cursor_up (
|
|||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
lnum = curwin->w_cursor.lnum;
|
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' */
|
// This fails if the cursor is already in the first line.
|
||||||
if (lnum <= 1 || (n >= lnum && vim_strchr(p_cpo, CPO_MINUS) != NULL))
|
if (lnum <= 1) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
if (n >= lnum)
|
if (n >= lnum)
|
||||||
lnum = 1;
|
lnum = 1;
|
||||||
else if (hasAnyFolding(curwin)) {
|
else if (hasAnyFolding(curwin)) {
|
||||||
@ -6021,12 +6022,11 @@ cursor_down (
|
|||||||
lnum = curwin->w_cursor.lnum;
|
lnum = curwin->w_cursor.lnum;
|
||||||
/* Move to last line of fold, will fail if it's the end-of-file. */
|
/* Move to last line of fold, will fail if it's the end-of-file. */
|
||||||
(void)hasFolding(lnum, NULL, &lnum);
|
(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' */
|
// This fails if the cursor is already in the last line.
|
||||||
if (lnum >= curbuf->b_ml.ml_line_count
|
if (lnum >= curbuf->b_ml.ml_line_count) {
|
||||||
|| (lnum + n > curbuf->b_ml.ml_line_count
|
|
||||||
&& vim_strchr(p_cpo, CPO_MINUS) != NULL))
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
if (lnum + n >= curbuf->b_ml.ml_line_count)
|
if (lnum + n >= curbuf->b_ml.ml_line_count)
|
||||||
lnum = curbuf->b_ml.ml_line_count;
|
lnum = curbuf->b_ml.ml_line_count;
|
||||||
else if (hasAnyFolding(curwin)) {
|
else if (hasAnyFolding(curwin)) {
|
||||||
|
@ -1684,12 +1684,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
|||||||
}
|
}
|
||||||
} else if (ea.addr_count != 0) {
|
} else if (ea.addr_count != 0) {
|
||||||
if (ea.line2 > curbuf->b_ml.ml_line_count) {
|
if (ea.line2 > curbuf->b_ml.ml_line_count) {
|
||||||
/* With '-' in 'cpoptions' a line number past the file is an
|
ea.line2 = curbuf->b_ml.ml_line_count;
|
||||||
* 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ea.line2 < 0)
|
if (ea.line2 < 0)
|
||||||
|
@ -127,7 +127,6 @@
|
|||||||
#define CPO_FILTER '!'
|
#define CPO_FILTER '!'
|
||||||
#define CPO_MATCH '%'
|
#define CPO_MATCH '%'
|
||||||
#define CPO_PLUS '+' /* ":write file" resets 'modified' */
|
#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_SPECI '<' /* don't recognize <> in mappings */
|
||||||
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
|
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
|
||||||
/* POSIX flags */
|
/* POSIX flags */
|
||||||
@ -142,9 +141,9 @@
|
|||||||
* cursor would not move */
|
* cursor would not move */
|
||||||
/* default values for Vim, Vi and POSIX */
|
/* default values for Vim, Vi and POSIX */
|
||||||
#define CPO_VIM "aABceFs"
|
#define CPO_VIM "aABceFs"
|
||||||
#define CPO_VI "aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%-+<>;"
|
#define CPO_VI "aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
|
||||||
#define CPO_ALL \
|
#define CPO_ALL \
|
||||||
"aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%-+<>#{|&/\\.;"
|
"aAbBcCdDeEfFiIjJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>#{|&/\\.;"
|
||||||
|
|
||||||
/* characters for p_ww option: */
|
/* characters for p_ww option: */
|
||||||
#define WW_ALL "bshl<>[],~"
|
#define WW_ALL "bshl<>[],~"
|
||||||
|
Loading…
Reference in New Issue
Block a user