Skip to content

Commit 0080686

Browse files
committed
window: Escape ampersand in tab title and recent files menu
Fixes #682.
1 parent 4352908 commit 0080686

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ReText/window.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,9 @@ def printError(self):
570570

571571
def updateTabTitle(self, ind, tab):
572572
changed = tab.editBox.document().isModified()
573+
title = tab.getBaseName().replace('&', '&&')
573574
if changed:
574-
title = tab.getBaseName() + '*'
575-
else:
576-
title = tab.getBaseName()
575+
title += '*'
577576
self.tabWidget.setTabText(ind, title)
578577

579578
def tabFileNameChanged(self, tab):
@@ -851,7 +850,8 @@ def updateRecentFiles(self):
851850
for f in filesOld:
852851
if QFile.exists(f):
853852
files.append(f)
854-
self.recentFilesActions.append(self.act(f, trig=self.openFunction(f)))
853+
action = self.act(f.replace('&', '&&'), trig=self.openFunction(f))
854+
self.recentFilesActions.append(action)
855855
globalCache.recentFileList = files
856856
for action in self.recentFilesActions:
857857
self.menuRecentFiles.addAction(action)

0 commit comments

Comments
 (0)