Skip to content

Commit 460b007

Browse files
committed
[pyqgis-console] adds a "\n" at the end of the header text if it has not been inserted from translators
1 parent 9f6e933 commit 460b007

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/console/console_output.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ def insertInitText(self):
137137
"Python {0} on {1}\n"
138138
"## Type help(iface) for more info and list of methods.\n").format(sys.version,
139139
socket.gethostname())
140-
initText = self.setText(txtInit)
140+
## some translation string for the console header ends without '\n'
141+
## and the first command in console will be appended at the header text.
142+
## The following code add a '\n' at the end of the string if not present.
143+
if txtInit.endswith('\n'):
144+
initText = self.setText(txtInit)
145+
else:
146+
initText = self.setText(txtInit + '\n')
141147

142148
def refreshLexerProperties(self):
143149
self.setLexers()

0 commit comments

Comments
 (0)