summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/gn/command_args.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gn/command_args.cc b/tools/gn/command_args.cc
index e2f4a9c..8098ea1 100644
--- a/tools/gn/command_args.cc
+++ b/tools/gn/command_args.cc
@@ -196,9 +196,10 @@ bool RunEditor(const base::FilePath& file_to_edit) {
#else // POSIX
bool RunEditor(const base::FilePath& file_to_edit) {
- // Prefer $VISUAL, then $EDITOR, then vi.
const char* editor_ptr = getenv("VISUAL");
if (!editor_ptr)
+ editor_ptr = getenv("GN_EDITOR");
+ if (!editor_ptr)
editor_ptr = getenv("EDITOR");
if (!editor_ptr)
editor_ptr = "vi";