aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/eval.txt8
-rw-r--r--runtime/doc/indent.txt5
-rw-r--r--runtime/doc/index.txt25
-rw-r--r--runtime/doc/options.txt3
-rw-r--r--runtime/doc/pattern.txt2
-rw-r--r--runtime/doc/visual.txt2
-rw-r--r--runtime/indent/python.vim104
7 files changed, 97 insertions, 52 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index cfc183ec42..aa7e58acc4 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2576,9 +2576,9 @@ assert_false({actual} [, {msg}]) *assert_false()*
"Expected False but got {actual}" is produced.
assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()*
- This asserts number values. When {actual} is lower than
- {lower} or higher than {upper} an error message is added to
- |v:errors|.
+ This asserts number and |Float| values. When {actual} is lower
+ than {lower} or higher than {upper} an error message is added
+ to |v:errors|. Also see |assert-return|.
When {msg} is omitted an error in the form
"Expected range {lower} - {upper}, but got {actual}" is
produced.
@@ -4631,7 +4631,7 @@ gettabinfo([{arg}]) *gettabinfo()*
tabnr tab page number.
variables a reference to the dictionary with
tabpage-local variables
- windows List of |window-ID|s in the tag page.
+ windows List of |window-ID|s in the tab page.
gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()*
Get the value of a tab-local variable {varname} in tab page
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 721aa93442..e69497e1ab 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -944,6 +944,11 @@ can sometimes be slow, thus it timeouts after 150 msec. If you notice the
indenting isn't correct, you can set a larger timeout in msec: >
let g:pyindent_searchpair_timeout = 500
+If looking back for unclosed parenthesis is still too slow, especially during
+a copy-paste operation, or if you don't need indenting inside multi-line
+parentheses, you can completely disable this feature: >
+ let g:pyindent_disable_parentheses_indenting = 1
+
R *ft-r-indent*
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 03523042c6..305d5be404 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -155,6 +155,20 @@ commands in CTRL-X submode *i_CTRL-X_index*
|i_CTRL-X_s| CTRL-X s spelling suggestions
{not available when compiled without the |+insert_expand| feature}
+commands in completion mode (see |popupmenu-keys|)
+
+|complete_CTRL-E| CTRL-E stop completion and go back to original text
+|complete_CTRL-Y| CTRL-Y accept selected match and stop completion
+ CTRL-L insert one character from the current match
+ <CR> insert currently selected match
+ <BS> delete one character and redo search
+ CTRL-H same as <BS>
+ <Up> select the previous match
+ <Down> select the next match
+ <PageUp> select a match several entries back
+ <PageDown> select a match several entries forward
+ other stop completion and insert the typed character
+
==============================================================================
2. Normal mode *normal-index*
@@ -840,6 +854,17 @@ tag char note action in Normal mode ~
|z<Right>| z<Right> same as "zl"
==============================================================================
+2.6 Operator-pending mode *operator-pending-index*
+
+These can be used after an operator, but before a {motion} has been entered.
+
+tag char action in Insert mode ~
+-----------------------------------------------------------------------
+|o_v| v force operator to work characterwise
+|o_V| V force operator to work linewise
+|o_CTRL-V| CTRL-V force operator to work blockwise
+
+==============================================================================
3. Visual mode *visual-index*
Most commands in Visual mode are the same as in Normal mode. The ones listed
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index d0ead3c256..a94bbc5599 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1880,6 +1880,9 @@ A jump table for the options with a short description can be found at |Q_op|.
context:{n} Use a context of {n} lines between a change
and a fold that contains unchanged lines.
When omitted a context of six lines is used.
+ When using zero the context is actually one,
+ since folds require a line in between, also
+ for a deleted line.
See |fold-diff|.
iblank Ignore changes where lines are all blank. Adds
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 9e68bb8af1..7f6a74e3f6 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1201,7 +1201,7 @@ x A single character, with no special meaning, matches itself
\%u20AC Matches the character specified with up to four hexadecimal
characters.
\%U1234abcd Matches the character specified with up to eight hexadecimal
- characters.
+ characters, up to 0x7fffffff
==============================================================================
7. Ignoring case in a pattern */ignorecase*
diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt
index 252a1ca8b8..4f29577680 100644
--- a/runtime/doc/visual.txt
+++ b/runtime/doc/visual.txt
@@ -103,6 +103,8 @@ gn Search forward for the last used search pattern, like
E.g., "dgn" deletes the text of the next match.
If Visual mode is active, extends the selection
until the end of the next match.
+ Note: Unlinke `n` the search direction does not depend
+ on the previous search command.
*gN* *v_gN*
gN Like |gn| but searches backward, like with `N`.
diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim
index 7ab3cb9f50..e53987a0de 100644
--- a/runtime/indent/python.vim
+++ b/runtime/indent/python.vim
@@ -2,7 +2,7 @@
" Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu>
-" Last Change: 2013 Jul 9
+" Last Change: 2019 Feb 21
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -53,58 +53,68 @@ function GetPythonIndent(lnum)
return 0
endif
- " searchpair() can be slow sometimes, limit the time to 100 msec or what is
- " put in g:pyindent_searchpair_timeout
- let searchpair_stopline = 0
- let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
-
- " If the previous line is inside parenthesis, use the indent of the starting
- " line.
- " Trick: use the non-existing "dummy" variable to break out of the loop when
- " going too far back.
call cursor(plnum, 1)
- let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
- \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
- \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
- \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
- \ searchpair_stopline, searchpair_timeout)
- if parlnum > 0
- let plindent = indent(parlnum)
- let plnumstart = parlnum
- else
+
+ " Identing inside parentheses can be very slow, regardless of the searchpair()
+ " timeout, so let the user disable this feature if he doesn't need it
+ let disable_parentheses_indenting = get(g:, "pyindent_disable_parentheses_indenting", 0)
+
+ if disable_parentheses_indenting == 1
let plindent = indent(plnum)
let plnumstart = plnum
- endif
-
+ else
+ " searchpair() can be slow sometimes, limit the time to 150 msec or what is
+ " put in g:pyindent_searchpair_timeout
+ let searchpair_stopline = 0
+ let searchpair_timeout = get(g:, 'pyindent_searchpair_timeout', 150)
+
+ " If the previous line is inside parenthesis, use the indent of the starting
+ " line.
+ " Trick: use the non-existing "dummy" variable to break out of the loop when
+ " going too far back.
+ let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
+ \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
+ \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
+ \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
+ \ searchpair_stopline, searchpair_timeout)
+ if parlnum > 0
+ let plindent = indent(parlnum)
+ let plnumstart = parlnum
+ else
+ let plindent = indent(plnum)
+ let plnumstart = plnum
+ endif
- " When inside parenthesis: If at the first line below the parenthesis add
- " two 'shiftwidth', otherwise same as previous line.
- " i = (a
- " + b
- " + c)
- call cursor(a:lnum, 1)
- let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
- \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
- \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
- \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
- \ searchpair_stopline, searchpair_timeout)
- if p > 0
- if p == plnum
- " When the start is inside parenthesis, only indent one 'shiftwidth'.
- let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
- \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
- \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
- \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
- \ searchpair_stopline, searchpair_timeout)
- if pp > 0
- return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
+ " When inside parenthesis: If at the first line below the parenthesis add
+ " two 'shiftwidth', otherwise same as previous line.
+ " i = (a
+ " + b
+ " + c)
+ call cursor(a:lnum, 1)
+ let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
+ \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
+ \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
+ \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
+ \ searchpair_stopline, searchpair_timeout)
+ if p > 0
+ if p == plnum
+ " When the start is inside parenthesis, only indent one 'shiftwidth'.
+ let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
+ \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
+ \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
+ \ . " =~ '\\(Comment\\|Todo\\|String\\)$'",
+ \ searchpair_stopline, searchpair_timeout)
+ if pp > 0
+ return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
+ endif
+ return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2))
endif
- return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2))
- endif
- if plnumstart == p
- return indent(plnum)
+ if plnumstart == p
+ return indent(plnum)
+ endif
+ return plindent
endif
- return plindent
+
endif