File: default-editor.diff

package info (click to toggle)
task 2.3.0%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,728 kB
  • ctags: 4,813
  • sloc: cpp: 34,267; perl: 18,509; python: 298; sh: 257; makefile: 73; ruby: 32
file content (53 lines) | stat: -rw-r--r-- 2,075 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
Description: use “editor”, not “vi”
 Use “editor” (rather than “vi”) as the default editor,
 as per Policy §11.4.
Author: Jakub Wilk <jwilk@debian.org>
Forwarded: not-needed
Last-Update: 2014-05-31

--- a/doc/man/taskrc.5.in
+++ b/doc/man/taskrc.5.in
@@ -217,12 +217,12 @@
 Hyphenates lines when wrapping breaks occur mid-word.  Default value is 'on'.
 
 .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 edit.verbose=on
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -72,7 +72,7 @@
   "defaultheight=24                               # Without detection, assumed height\n"
   "avoidlastcolumn=no                             # Fixes Cygwin width problem\n"
   "hyphenate=on                                   # 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"
--- a/src/commands/CmdEdit.cpp
+++ b/src/commands/CmdEdit.cpp
@@ -765,13 +765,13 @@
   std::string before_orig = before;
   File::write (file.str (), before);
 
-  // Determine correct editor: .taskrc:editor > $VISUAL > $EDITOR > vi
+  // Determine correct editor: .taskrc:editor > $VISUAL > $EDITOR > editor
   std::string editor = context.config.get ("editor");
   char* peditor = getenv ("VISUAL");
   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 += " ";