summaryrefslogtreecommitdiff
path: root/src/buffer_utils.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-05-10 15:21:49 +1000
committerMaxime Coste <mawww@kakoune.org>2020-05-10 19:30:13 +1000
commit60154300f9235d935e3cfd8e15c2d493fdcfb4ff (patch)
treece3058a83222a1d60edcc7858794f4a6fdb2cee0 /src/buffer_utils.cc
parent2104af07713edc37be5f3df1444bc9a39b6637a7 (diff)
Support piping data to client stdin
Pass the client stdin fd to the server and open a fifo buffer from it. Fixes #3394
Diffstat (limited to 'src/buffer_utils.cc')
-rw-r--r--src/buffer_utils.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc
index 0162822c..d8daa944 100644
--- a/src/buffer_utils.cc
+++ b/src/buffer_utils.cc
@@ -265,4 +265,15 @@ Vector<String> undo_group_as_strings(const Buffer::UndoGroup& undo_group)
return res;
}
+String generate_buffer_name(StringView pattern)
+{
+ auto& buffer_manager = BufferManager::instance();
+ for (int i = 0; true; ++i)
+ {
+ String name = format(pattern, i);
+ if (buffer_manager.get_buffer_ifp(name) == nullptr)
+ return name;
+ }
+}
+
}