Commit ac0b5ef4 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

FileFilter: don't create a hotspot for '................'

Only '.' and '..' could be valid hotspots, but '..........' isn't. The
latter is used by some CLI tools to indicate progress ...etc.

To test, in any dir use `ls -a`, Ctrl + clicking '.' and '..' should
open the current dir and parent of the current dir respectively.

Type .......... at the prompt, before it would get underlined, after no
hotspot will be created for it.

BUG: 432779
parent f5be10b1
......@@ -92,6 +92,12 @@ QSharedPointer<HotSpot> FileFilter::newHotSpot(int startLine, int startColumn, i
filename.chop(1);
}
// '.' and '..' could be valid hotspots, but '..................' most likely isn't
static const QRegularExpression allDotRe{QRegularExpression::anchoredPattern(QStringLiteral("\\.{3}"))};
if (allDotRe.match(filename).hasMatch()) {
return nullptr;
}
if (filename.startsWith(QLatin1String("[/"))) { // ctest error output
filename.remove(0, 1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment