aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-08-11 09:35:17 -0400
committerJames McCoy <jamessan@jamessan.com>2016-08-11 13:37:42 -0400
commitd0c0930acfeb8d6dc299a56d2c12cd0aa3fc960f (patch)
tree50c4f5100ef19bd2caaa583bb9d3e28e6c9e86b4
parentb805a7149580685edfcebcc96285e1bb96bb103d (diff)
downloadrneovim-d0c0930acfeb8d6dc299a56d2c12cd0aa3fc960f.tar.gz
rneovim-d0c0930acfeb8d6dc299a56d2c12cd0aa3fc960f.tar.bz2
rneovim-d0c0930acfeb8d6dc299a56d2c12cd0aa3fc960f.zip
Restore ":browse oldfiles" behavior from Vim
In 3b12bb225adda2aac40a55f7009cae05311b2a43, ":oldfiles" was taught to behave like Vim's ":browse oldfiles" if ":oldfiles!" was used. However, this conflates the use of ! for abandoning a modified buffer with choosing one file out of a list of oldfiles. Now that ":browse" is supported again, ":browse oldfiles" will allow the user to select an old file, while still complaining if that would cause a modified buffer to be abandoned. ":browse oldfiles!" will just abandon the buffer, as expected.
-rw-r--r--runtime/doc/starting.txt3
-rw-r--r--runtime/doc/vim_diff.txt1
-rw-r--r--src/nvim/eval.c4
-rw-r--r--test/functional/ex_cmds/oldfiles_spec.lua4
4 files changed, 5 insertions, 7 deletions
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 8249f8e71f..c6f51d47b9 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1200,11 +1200,10 @@ running) you have additional options:
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
*:o* *:ol* *:oldfiles*
-:o[ldfiles][!] List the files that have marks stored in the ShaDa
+:o[ldfiles] List the files that have marks stored in the ShaDa
file. This list is read on startup and only changes
afterwards with ":rshada!". Also see |v:oldfiles|.
The number can be used with |c_#<|.
- Use ! to get a file selection prompt.
:bro[wse] o[ldfiles][!]
List file names as with |:oldfiles|, and then prompt
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 3c8b728b95..9bd129a7c2 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -188,7 +188,6 @@ Additional differences:
compatibility reasons.
- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old
commands are still kept.
-- |:oldfiles| supports !.
- When writing (|:wshada| without bang or at exit) it merges much more data,
and does this according to the timestamp. Vim merges only marks.
|shada-merging|
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 38aa587d37..f6545a5ca9 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -21722,8 +21722,8 @@ void ex_oldfiles(exarg_T *eap)
/* Assume "got_int" was set to truncate the listing. */
got_int = FALSE;
- // File selection prompt on ":oldfiles!"
- if (eap->forceit) {
+ // File selection prompt on ":browse oldfiles"
+ if (cmdmod.browse) {
quit_more = false;
nr = prompt_for_number(false);
msg_starthere();
diff --git a/test/functional/ex_cmds/oldfiles_spec.lua b/test/functional/ex_cmds/oldfiles_spec.lua
index b7109f2f98..716c1ebfb2 100644
--- a/test/functional/ex_cmds/oldfiles_spec.lua
+++ b/test/functional/ex_cmds/oldfiles_spec.lua
@@ -47,7 +47,7 @@ describe(':oldfiles', function()
end)
end)
-describe(':oldfiles!', function()
+describe(':browse oldfiles', function()
local filename
local filename2
local oldfiles
@@ -74,7 +74,7 @@ describe(':oldfiles!', function()
ok(filename == oldfiles[1] or filename == oldfiles[2])
ok(filename2 == oldfiles[1] or filename2 == oldfiles[2])
- execute('oldfiles!')
+ execute('browse oldfiles')
end)
after_each(function()