private int getMaxResultsTabIndex() {
        int maxIndex = 0;
        for (CTabItem tab : resultTabs.getItems()) {
            if (tab.getData() instanceof QueryResultsContainer qrc) {
                maxIndex = Math.max(maxIndex, qrc.getResultSetIndex());
            }
            if (tab.getData() instanceof SingleTabQueryProcessor stqp) {
                List<QueryResultsContainer> results = stqp.getResultContainers();
                maxIndex = Math.max(maxIndex, results.get(results.size() - 1).getResultSetIndex());
            }
        }
        return maxIndex;
    }
Build and update icon and title
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java