Skip to content

Commit 6a35631

Browse files
author
Charles PIGNEROL
committed
Version 6.4.3. Correctif de l'emplacement du point d'insertion (de la prochaine instruction) lors de l'ajout dans la console d'une instruction avec commentaire multi-lignes. Dans un tel cas le commentaire était coupé en 2 par l'instruction suivante.
1 parent b630de2 commit 6a35631

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

cmake/version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
# Pour la bibliothèque QtPython :
66
set (QT_PYTHON_MAJOR_VERSION "6")
77
set (QT_PYTHON_MINOR_VERSION "4")
8-
set (QT_PYTHON_RELEASE_VERSION "2")
8+
set (QT_PYTHON_RELEASE_VERSION "3")
99
set (QT_PYTHON_VERSION ${QT_PYTHON_MAJOR_VERSION}.${QT_PYTHON_MINOR_VERSION}.${QT_PYTHON_RELEASE_VERSION})
1010

1111
# Pour la bibliothèque QtPython3 :
1212
set (QT_PYTHON_3_MAJOR_VERSION "6")
1313
set (QT_PYTHON_3_MINOR_VERSION "4")
14-
set (QT_PYTHON_3_RELEASE_VERSION "2")
14+
set (QT_PYTHON_3_RELEASE_VERSION "3")
1515
set (QT_PYTHON_3_VERSION ${QT_PYTHON_3_MAJOR_VERSION}.${QT_PYTHON_3_MINOR_VERSION}.${QT_PYTHON_3_RELEASE_VERSION})
1616

src/QtPython3/QtPythonConsole.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,10 +1754,12 @@ void QtPythonConsole::addToHistoric (
17541754
line += lineNumber (comment.utf8 ( ));
17551755
cursor.insertText (UTF8TOQSTRING (comment));
17561756
cursor.insertText ("\n");
1757-
block = block.next ( );
1757+
// v 6.4.3. Rem CP : chaque ligne (=> "\n") ajoutée équivaut à un cursor.addBlock (ligne), d'où la boucle for ci-dessous.
1758+
for (int b = 0; b < commentLineNum; b++) // v 6.4.3
1759+
block = block.next ( );
17581760
cursor.setPosition (block.position ( ), QTextCursor::MoveAnchor);
17591761
setTextCursor (cursor);
1760-
line -= commentLineNum; // v 6.3.2
1762+
line--; // v 6.4.3
17611763
} // if (false == scriptingLog.getComment ( ).empty ( ))
17621764
else
17631765
line--; // v 6.3.2
@@ -1778,7 +1780,10 @@ void QtPythonConsole::addToHistoric (
17781780
cursor.insertText (UTF8TOQSTRING (err));
17791781
cursor.insertText ("\n");
17801782
log (ErrorLog (UTF8String (error, Charset::UTF_8)));
1781-
block = block.next ( );
1783+
// v 6.4.3. Rem CP : chaque ligne (=> "\n") ajoutée équivaut à un cursor.addBlock (ligne), d'où la boucle for ci-dessous.
1784+
const int errorLineNum = lineNumber (err);
1785+
for (int b = 0; b < errorLineNum; b++) // v 6.4.3
1786+
block = block.next ( );
17821787
cursor.setPosition (block.position ( ), QTextCursor::MoveAnchor);
17831788
setTextCursor (cursor);
17841789
} // if (true == statusErr)

versions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 6.4.3 : 04/10/24
2+
===============
3+
4+
Correctif de l'emplacement du point d'insertion (de la prochaine instruction) lors de l'ajout dans la console d'une instruction avec commentaire
5+
multi-lignes dans QtPythonConsole::addToHistoric. Dans un tel cas le commentaire �tait coup� en 2 par l'instruction suivante.
6+
7+
18
Version 6.4.2 : 28/08/24
29
===============
310

0 commit comments

Comments
 (0)