Beispiel #1
0
void NYView::guiSetCommandLineText(const QString& text)
{
    yzDebug() << "NYView::guiSetCommandLineText: " << text << endl;
    commandline = text;
    static QChar modeChar = ':';

    switch(modePool()->current()->modeType()) {
    case YMode::ModeEx:
        modeChar = ':';
        break;

    case YMode::ModeSearch:
        modeChar = '/';
        break;

    case YMode::ModeSearchBackward:
        modeChar = '?';
        break;

    default:
        modeChar = ' ';
    }

    werase(statusbar);
    waddstr(statusbar, (modeChar + commandline).toLocal8Bit().constData());
    wrefresh(statusbar);
    statusbarHasCommand = true;
}
Beispiel #2
0
YView* KYSession::guiCreateView(YBuffer* buffer)
{
    yzDebug() << "doCreateView( " << buffer->toString() << ")" << endl;
    KYView* view = new KYView(buffer);
    YASSERT_MSG(view, "KYSession::createView : failed creating a new KYView");
    return view;
}
Beispiel #3
0
void YBufferOperation::performOperation( YView* pView, bool opposite)
{
    OperationType t = type;

    yzDebug("YZUndoBuffer") << "YBufferOperation: " << (opposite ? "undo " : "redo ") << toString() << endl;

    if (opposite == true) {
        switch ( type ) {
			case OpAddRegion: t = OpDelRegion; break;
			case OpDelRegion: t = OpAddRegion; break;
        }
    }

    switch ( t) {
		case OpAddRegion:
			pView->buffer()->insertRegion(interval.fromPos(), data);
			break;
		case OpDelRegion:
			pView->buffer()->deleteRegion(interval);
			break;
    }

    // yzDebug("YZUndoBuffer") << "YBufferOperation::performOperation Buf -> '" << buf->getWholeText() << "'\n";
}