Index: tools/gn/command_args.cc |
diff --git a/tools/gn/command_args.cc b/tools/gn/command_args.cc |
index e2f4a9c09a7f11acab47339bbc0163ee60ec49d3..8098ea18f9e51f164ad6f4ab5ceb53c4981dd306 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"; |