From: Jakub Wilk <jwilk@debian.org>
Date: Mon, 14 Dec 2020 08:33:06 +0000
Subject: =?utf-8?b?dXNlIOKAnGVkaXRvcuKAnSwgbm90IOKAnHZp4oCd?=
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Forwarded: not-needed
Last-Update: 2014-05-31

Use “editor” (rather than “vi”) as the default editor,
as per Policy §11.4.
---
 doc/man/taskrc.5.in      | 4 ++--
 src/Context.cpp          | 2 +-
 src/commands/CmdEdit.cpp | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in
index e65901d..d0e0a7c 100644
--- a/doc/man/taskrc.5.in
+++ b/doc/man/taskrc.5.in
@@ -265,12 +265,12 @@ Cygwin users. Default value is '0'.
 Hyphenates lines when wrapping breaks occur mid-word. Default value is '1'.
 
 .TP
-.B editor=vi
+.B editor=editor
 Specifies which text editor you wish to use for when the
 .B task edit <ID>
 command is used. Taskwarrior will first look for this configuration variable. If
 found, it is used. Otherwise it will look for the $VISUAL or $EDITOR
-environment variables, before it defaults to using "vi".
+environment variables, before it defaults to using "editor".
 
 .TP
 .B reserved.lines=1
diff --git a/src/Context.cpp b/src/Context.cpp
index bd755e8..3ffa705 100644
--- a/src/Context.cpp
+++ b/src/Context.cpp
@@ -87,7 +87,7 @@ std::string configurationDefaults =
   "defaultheight=24                               # Without detection, assumed height\n"
   "avoidlastcolumn=0                              # Fixes Cygwin width problem\n"
   "hyphenate=1                                    # Hyphenates lines wrapped on non-word-breaks\n"
-  "#editor=vi                                     # Preferred text editor\n"
+  "#editor=editor                                 # Preferred text editor\n"
   "reserved.lines=1                               # Assume a 1-line prompt\n"
   "\n"
   "# Miscellaneous\n"
diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp
index 5c83b0e..5cecd52 100644
--- a/src/commands/CmdEdit.cpp
+++ b/src/commands/CmdEdit.cpp
@@ -784,7 +784,7 @@ CmdEdit::editResult CmdEdit::editFile (Task& task)
   if (editor == "" && peditor) editor = std::string (peditor);
   peditor = getenv ("EDITOR");
   if (editor == "" && peditor) editor = std::string (peditor);
-  if (editor == "") editor = "vi";
+  if (editor == "") editor = "editor";
 
   // Complete the command line.
   editor += ' ';
