| 1639 | } |
| 1640 | |
| 1641 | void App::updateDocInfo( TextDocument& doc ) { |
| 1642 | if ( !doc.isRunningTransaction() && !doc.isLoading() && mConfig.editor.showDocInfo && |
| 1643 | mDocInfo && mSplitter->curEditorExistsAndFocused() ) { |
| 1644 | mDocInfo->setVisible( true ); |
| 1645 | updateDocInfoLocation(); |
| 1646 | String infoStr( String::format( |
| 1647 | "%s: %lld / %zu %s: %lld %s %s%s %s", i18n( "line_abbr", "line" ).toUtf8(), |
| 1648 | doc.getSelection().start().line() + 1, doc.linesCount(), |
| 1649 | i18n( "col_abbr", "col" ).toUtf8(), mSplitter->getCurEditor()->getCurrentColumnCount(), |
| 1650 | doc.getSyntaxDefinition().getLanguageName(), |
| 1651 | TextFormat::encodingToString( doc.getEncoding() ), doc.isBOM() ? " (with BOM)"sv : ""sv, |
| 1652 | TextFormat::lineEndingToString( doc.getLineEnding() ) ) ); |
| 1653 | mDocInfo->debounce( [this, infoStr] { mDocInfo->setText( infoStr ); }, Time::Zero, |
| 1654 | String::hash( "ecode::doc_info::update" ) ); |
| 1655 | } |
| 1656 | } |
| 1657 | |
| 1658 | void App::syncProjectTreeWithEditor( UICodeEditor* editor ) { |
| 1659 | if ( mProjectTreeView && mConfig.editor.syncProjectTreeWithEditor && editor != nullptr && |
no test coverage detected