mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-29 14:44:56 +03:00
Merge remote-tracking branch 'occivink/source-with-args'
This commit is contained in:
commit
a0ac3c8c4c
@ -67,8 +67,9 @@ command *q!* has to be used). Aliases are mentionned below each commands.
|
||||
*rename-buffer* <name>::
|
||||
set current buffer name
|
||||
|
||||
*source* <filename>::
|
||||
*source* <filename> <param>...::
|
||||
execute commands in <filename>
|
||||
parameters are avilable in the sourced script through the `arg` values
|
||||
|
||||
== Clients and Sessions
|
||||
|
||||
|
@ -1285,8 +1285,8 @@ const CommandDesc debug_cmd = {
|
||||
const CommandDesc source_cmd = {
|
||||
"source",
|
||||
nullptr,
|
||||
"source <filename>: execute commands contained in <filename>",
|
||||
single_param,
|
||||
"source <filename> <params>...: execute commands contained in <filename>",
|
||||
ParameterDesc{ {}, ParameterDesc::Flags::None, 1, (size_t)-1 },
|
||||
CommandFlags::None,
|
||||
CommandHelper{},
|
||||
filename_completer,
|
||||
@ -1300,8 +1300,9 @@ const CommandDesc source_cmd = {
|
||||
MappedFile file_content{path};
|
||||
try
|
||||
{
|
||||
auto params = parser | skip(1) | gather<Vector<String>>();
|
||||
CommandManager::instance().execute(file_content, context,
|
||||
{{}, {{"source", path}}});
|
||||
{params, {{"source", path}}});
|
||||
}
|
||||
catch (Kakoune::runtime_error& err)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user