本文整理汇总了C++中KateView::gotoLineNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ KateView::gotoLineNumber方法的具体用法?C++ KateView::gotoLineNumber怎么用?C++ KateView::gotoLineNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KateView
的用法示例。
在下文中一共展示了KateView::gotoLineNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: args
//.........这里部分代码省略.........
// find a integer value > 0
if ( ! args.count() )
KCC_ERR( i18n("Missing argument. Usage: %1 <value>").arg( cmd ) );
bool ok;
int val ( args.first().toInt( &ok ) );
if ( !ok )
KCC_ERR( i18n("Failed to convert argument '%1' to integer.")
.arg( args.first() ) );
if ( cmd == "set-tab-width" )
{
if ( val < 1 )
KCC_ERR( i18n("Width must be at least 1.") );
v->setTabWidth( val );
}
else if ( cmd == "set-indent-width" )
{
if ( val < 1 )
KCC_ERR( i18n("Width must be at least 1.") );
v->doc()->config()->setIndentationWidth( val );
}
else if ( cmd == "set-word-wrap-column" )
{
if ( val < 2 )
KCC_ERR( i18n("Column must be at least 1.") );
v->doc()->setWordWrapAt( val );
}
else if ( cmd == "goto" )
{
if ( val < 1 )
KCC_ERR( i18n("Line must be at least 1") );
if ( (uint)val > v->doc()->numLines() )
KCC_ERR( i18n("There is not that many lines in this document") );
v->gotoLineNumber( val - 1 );
}
return true;
}
// ALL commands that takes 1 boolean argument.
else if ( cmd == "set-icon-border" ||
cmd == "set-folding-markers" ||
cmd == "set-line-numbers" ||
cmd == "set-replace-tabs" ||
cmd == "set-remove-trailing-space" ||
cmd == "set-show-tabs" ||
cmd == "set-indent-spaces" ||
cmd == "set-mixed-indent" ||
cmd == "set-word-wrap" ||
cmd == "set-wrap-cursor" ||
cmd == "set-replace-tabs-save" ||
cmd == "set-remove-trailing-space-save" ||
cmd == "set-show-indent" )
{
if ( ! args.count() )
KCC_ERR( i18n("Usage: %1 on|off|1|0|true|false").arg( cmd ) );
bool enable;
if ( getBoolArg( args.first(), &enable ) )
{
if ( cmd == "set-icon-border" )
v->setIconBorder( enable );
else if (cmd == "set-folding-markers")
v->setFoldingMarkersOn( enable );
else if ( cmd == "set-line-numbers" )
v->setLineNumbersOn( enable );
else if ( cmd == "set-show-indent" )
v->renderer()->setShowIndentLines( enable );