File: 001_default-editor.patch

package info (click to toggle)
task 3.4.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 7,332 kB
  • sloc: cpp: 42,567; python: 12,689; sh: 775; perl: 189; makefile: 35
file content (72 lines) | stat: -rw-r--r-- 2,805 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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          | 3 +--
 src/commands/CmdEdit.cpp | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in
index d604483..d2221c1 100644
--- a/doc/man/taskrc.5.in
+++ b/doc/man/taskrc.5.in
@@ -272,12 +272,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 f3c8725..a7630c9 100644
--- a/src/Context.cpp
+++ b/src/Context.cpp
@@ -93,7 +93,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"
@@ -478,7 +478,6 @@ std::string configurationDefaults =
     "end.after:now-4wks)\n"
     "report.timesheet.context=0\n"
     "\n";
-
 // Supported modifiers, synonyms on the same line.
 static const char* modifierNames[] = {
     "before",     "under", "below",    "after", "over", "above", "by",       "none",
diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp
index b6535f1..ba82566 100644
--- a/src/commands/CmdEdit.cpp
+++ b/src/commands/CmdEdit.cpp
@@ -637,8 +637,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 += ' ';
   editor += '"' + file.str() + '"';