Add source code.
This commit is contained in:
1 parent
dab19ace02
commit
0b8a7b3cdc
31 files changed
+2809
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user