Add source code.

This commit is contained in:
alejo committed 2026-10-17 03:29:11 -03:00
1 parent dab19ace02
commit 0b8a7b3cdc
31 files changed
+2809

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <string>
#include <vector>
namespace ExternalEditor {
// $VISUAL, then $EDITOR, then the first of nano/vim/vi found on PATH.
// Empty if nothing was found.
std::string defaultCommand();
// Is the first word of `command` an executable we can find?
bool commandExists(const std::string& command);
// Well-known editors that are installed (used for tab completion).
std::vector<std::string> installedEditors();
// Opens `initialText` in the editor and returns the edited text.
// Throws std::runtime_error if the editor cannot be run or exits with an error.
std::string edit(const std::string& command, const std::string& initialText);
} // namespace ExternalEditor