patch 8.0.1660: the terminal API "drop" command doesn't support options
Problem: The terminal API "drop" command doesn't support options.
Solution: Implement the options.
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index 54c7e1f..f575c82 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -25,7 +25,7 @@
MS-Windows |terminal-ms-windows|
2. Terminal communication |terminal-communication|
Vim to job: term_sendkeys() |terminal-to-job|
- Job to Vim: JSON API |terminal-api|
+ Job to Vim: JSON API |terminal-api|
Using the client-server feature |terminal-client-server|
3. Remote testing |terminal-testing|
4. Diffing screen dumps |terminal-diff|
@@ -352,7 +352,7 @@
can even run Vim in the terminal! That's used for debugging, see below.
Environment variables are used to pass information to the running job:
- TERM name of the terminal, 'term'
+ TERM name of the terminal, from the 'term' option
ROWS number of rows in the terminal initially
LINES same as ROWS
COLUMNS number of columns in the terminal initially
@@ -443,11 +443,25 @@
< Output from `:echo` may be erased by a redraw, use `:echomsg`
to be able to see it with `:messages`.
- drop {filename}
+ drop {filename} [options]
Let Vim open a file, like the `:drop` command. If {filename}
is already open in a window, switch to that window. Otherwise
open a new window to edit {filename}.
+
+ [options] is only used when opening a new window. If present,
+ it must be a Dict. Similarly to |++opt|, These entries are recognized:
+ "ff" file format: "dos", "mac" or "unix"
+ "fileformat" idem
+ "enc" overrides 'fileencoding'
+ "encoding" idem
+ "bin" sets 'binary'
+ "binary" idem
+ "nobin" resets 'binary'
+ "nobinary" idem
+ "bad" specifies behavior for bad characters, see
+ |++bad|
+
Example in JSON: >
["drop", "path/file.txt", {"ff": "dos"}]