[PATCH 8/8] SymbolView: Fix: Find new current item when symbol is in first line

loh.tar loh.tar at googlemail.com
Sun Jul 22 14:06:53 BST 2018


This happens really rare because mostly is some comment above some symbol,
like copyright notice or shebang, so this bug was noticed while coding
a new parser type, plaint-text-parser
---
 addons/symbolviewer/plugin_katesymbolviewer.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/addons/symbolviewer/plugin_katesymbolviewer.cpp b/addons/symbolviewer/plugin_katesymbolviewer.cpp
index 0c9a0e9b9..1d90a48b6 100644
--- a/addons/symbolviewer/plugin_katesymbolviewer.cpp
+++ b/addons/symbolviewer/plugin_katesymbolviewer.cpp
@@ -270,8 +270,7 @@ QTreeWidgetItem *KatePluginSymbolViewerView::newActveItem(int &newItemLine, int
   QTreeWidgetItem *newItem = nullptr;
   QTreeWidgetItem *tmp = nullptr;
   int itemLine = item->data(1, Qt::DisplayRole).toInt();
-
-  if ((itemLine <= currLine) && (itemLine > newItemLine)) {
+  if ((itemLine <= currLine) && (itemLine >= newItemLine)) {
     newItemLine = itemLine;
     m_firstLine = itemLine;
     m_lastLine  = qMax(m_lastLine, m_firstLine);
-- 
2.18.0



More information about the KWrite-Devel mailing list