Skip to content

Commit 9456ee7

Browse files
fix(lint): remove unnecessary shared_ptr copy in FolderSearchEngine
docs(readme): mention find-in-folder search feature Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7a12e09 commit 9456ee7

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A full PTY terminal built on libvterm and libptyqt, with mouse reporting and a s
2222

2323
### The editor itself
2424

25-
It's still Notepad++ at heart: a tabbed, splittable interface (Qt Advanced Docking System) with syntax highlighting for 80+ languages through vendored Scintilla and Lexilla. Macro recording and playback, session management, and an embedded Lua scripting layer are all here. If you're coming from Notepad++, it imports your config and sessions. There's also an editor minimap and live preview for Markdown and HTML.
25+
It's still Notepad++ at heart: a tabbed, splittable interface (Qt Advanced Docking System) with syntax highlighting for 80+ languages through vendored Scintilla and Lexilla. Macro recording and playback, session management, and an embedded Lua scripting layer are all here. If you're coming from Notepad++, it imports your config and sessions. There's also an editor minimap, live preview for Markdown and HTML, and a find-in-folder search that scans workspace directories with regex support.
2626

2727
### Extras worth knowing
2828

src/FolderSearchEngine.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,16 @@ void FolderSearchEngine::startSearch(const QString &folderPath,
136136
sink->cancelled.store(false);
137137
// DFS runs on pool thread — must not capture raw `this`.
138138
// Use the sink's enumerationDone + a file list field instead.
139-
auto sinkCopy = sink;
140-
QtConcurrent::run([folder, gen, sinkCopy]() {
141-
if (sinkCopy->generation.load(std::memory_order_relaxed) != gen) return;
139+
QtConcurrent::run([folder, gen, sink]() {
140+
if (sink->generation.load(std::memory_order_relaxed) != gen) return;
142141
auto cancel = std::make_shared<std::atomic<bool>>(false);
143142
QStringList files = walkDfsFiltered(folder, cancel);
144-
if (sinkCopy->generation.load(std::memory_order_relaxed) != gen) return;
145-
// Store enumerated files in the sink for the UI timer to pick up
143+
if (sink->generation.load(std::memory_order_relaxed) != gen) return;
146144
{
147-
QMutexLocker lock(&sinkCopy->mutex);
148-
sinkCopy->enumeratedFiles = std::move(files);
145+
QMutexLocker lock(&sink->mutex);
146+
sink->enumeratedFiles = std::move(files);
149147
}
150-
sinkCopy->enumerationDone.store(true, std::memory_order_release);
148+
sink->enumerationDone.store(true, std::memory_order_release);
151149
});
152150
return;
153151
}

0 commit comments

Comments
 (0)