Skip to content

Commit

Permalink
enhanced pwsh complete
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Jun 16, 2022
1 parent 1f8e4d4 commit 02de225
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tom/src/tom/commands/completecommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ int CompleteCommand::run()

// Currently proccessed tom command
const auto currentCommandSplitted = commandlineArg.split(SPACE);
Q_ASSERT(!currentCommandSplitted.isEmpty());

const auto currentCommandArg = currentCommandSplitted.size() >= 2
? std::make_optional(currentCommandSplitted[1])
: std::nullopt;
const auto tomCommandSize = currentCommandSplitted[0].size();
#else
const auto cwordArg = static_cast<QString::size_type>(value(cword_).toLongLong());

Expand All @@ -103,8 +106,9 @@ int CompleteCommand::run()
--- */
#ifdef _MSC_VER
if (!isOptionArgument(wordArg) && wordArg.isEmpty() &&
positionArg >= commandlineArgSize &&
(!commandlineArg.contains(SPACE) || currentCommandArg == Help)
(positionArg == tomCommandSize + 1 ||
(positionArg >= commandlineArgSize &&
(!commandlineArg.contains(SPACE) || currentCommandArg == Help)))
)
#else
if (!isOptionArgument(wordArg) && wordArg.isEmpty() &&
Expand Down

0 comments on commit 02de225

Please sign in to comment.