summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2010-07-24 20:27:03 +0200
committerBram Moolenaar <bram@vim.org>2010-07-24 20:27:03 +0200
commit240be5d591b05743b077e6e21a71b80c8019e740 (patch)
treec90c573cb566a26efaa5fd2e859d9cfa5f237529 /runtime
parentc928c99760497eff0c3e7ca91d4526471fa5d3b5 (diff)
downloadvim-240be5d591b05743b077e6e21a71b80c8019e740.tar.gz
Add the 'undoreload' option to be able to undo a file reload.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt18
-rw-r--r--runtime/doc/tags3
-rw-r--r--runtime/doc/todo.txt3
-rw-r--r--runtime/doc/version7.txt5
-rw-r--r--runtime/optwin.vim2
5 files changed, 27 insertions, 4 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 09e9ab35..13932e0a 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -7361,6 +7361,8 @@ A jump table for the options with a short description can be found at |Q_op|.
file on buffer read.
The directory where the undo file is stored is specified by 'undodir'.
For more information about this feature see |undo-persistence|.
+ The undo file is not read when 'undoreload' causes the buffer from
+ before a reload to be saved for undo.
WARNING: this is a very new feature. Use at your own risk!
*'undolevels'* *'ul'*
@@ -7382,6 +7384,22 @@ A jump table for the options with a short description can be found at |Q_op|.
< This helps when you run out of memory for a single change.
Also see |clear-undo|.
+ *'undoreload'* *'ur'*
+'undoreload' 'ur' number (default 10000)
+ global
+ {not in Vi}
+ Save the whole buffer for undo when reloading it. This applies to the
+ ":e!" command and reloading for when the buffer changed outside of
+ Vim. |FileChangedShell|
+ The save only happens when this options is negative or when the number
+ of lines is smaller than the value of this option.
+ Set this option to zero to disable undo for a reload.
+
+ When saving undo for a reload, any undo file is not read.
+
+ Note that this causes the whole buffer to be stored in memory. Set
+ this option to a lower value if you run out of memory.
+
*'updatecount'* *'uc'*
'updatecount' 'uc' number (default: 200)
global
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 45ee674c..78edec11 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -1029,8 +1029,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'undodir' options.txt /*'undodir'*
'undofile' options.txt /*'undofile'*
'undolevels' options.txt /*'undolevels'*
+'undoreload' options.txt /*'undoreload'*
'updatecount' options.txt /*'updatecount'*
'updatetime' options.txt /*'updatetime'*
+'ur' options.txt /*'ur'*
'ut' options.txt /*'ut'*
'vb' options.txt /*'vb'*
'vbs' options.txt /*'vbs'*
@@ -6081,6 +6083,7 @@ hl-Directory syntax.txt /*hl-Directory*
hl-ErrorMsg syntax.txt /*hl-ErrorMsg*
hl-FoldColumn syntax.txt /*hl-FoldColumn*
hl-Folded syntax.txt /*hl-Folded*
+hl-Ignore syntax.txt /*hl-Ignore*
hl-IncSearch syntax.txt /*hl-IncSearch*
hl-LineNr syntax.txt /*hl-LineNr*
hl-MatchParen syntax.txt /*hl-MatchParen*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index acbacb5e..8327884d 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -40,9 +40,6 @@ Add documentation for Python 3 support.
New patch 2010 Jul 24
Docs patch by Dominique Pelle, Mar 25 included?
-'undoreload' option: when fewer lines than these consider a reload as a change
-action and save the text before the reload, don't clear undo info.
-
Patch for :find completion. (Nazri Ramliy)
But I prefer to keep term.h and include/term.h He will work on it.
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 9fa0dabe..de2a7de1 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt* For Vim version 7.3b. Last change: 2010 Jul 20
+*version7.txt* For Vim version 7.3b. Last change: 2010 Jul 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7171,6 +7171,9 @@ Added ":earlier 1f" and ":later 1f".
Add file save counter to undo information.
Added the |undotree()| and |undofile()| functions.
+Also added the 'undoreload' option. This makes it possible to save the
+current text when reloading the buffer, so that it can be undone.
+
More encryption *new-more-encryption*
---------------
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index c27fbd5d..404cf897 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -722,6 +722,8 @@ call <SID>OptionG("km", &km)
call <SID>Header("editing text")
call append("$", "undolevels\tmaximum number of changes that can be undone")
call append("$", " \tset ul=" . &ul)
+call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload")
+call append("$", " \tset ur=" . &ur)
call append("$", "modified\tchanges have been made and not written to a file")
call append("$", "\t(local to buffer)")
call <SID>BinOptionL("mod")