예제 #1
0
KCompletion *KateCommands::CoreCommands::completionObject( const QString &cmd, Kate::View *view )
{
  if ( cmd == "set-highlight" )
  {
    KateView *v = (KateView*)view;
    QStringList l;
    for ( uint i = 0; i < v->doc()->hlModeCount(); i++ )
      l << v->doc()->hlModeName( i );

    KateCmdShellCompletion *co = new KateCmdShellCompletion();
    co->setItems( l );
    co->setIgnoreCase( true );
    return co;
  }
  return 0L;
}
예제 #2
0
KCompletion *Commands::completionObject(KTextEditor::View *view, const QString &cmd)
{
    Q_UNUSED(view)

    KTextEditor::ViewPrivate *v = static_cast<KTextEditor::ViewPrivate *>(view);

    if (v && (cmd == QLatin1String("nn") || cmd == QLatin1String("nnoremap"))) {
        QStringList l = m_viGlobal->mappings()->getAll(Mappings::NormalModeMapping);

        KateCmdShellCompletion *co = new KateCmdShellCompletion();
        co->setItems(l);
        co->setIgnoreCase(false);
        return co;
    }
    return 0L;
}