This patch is based on the original stale patch by Guido Cella @guidocella.
It has been modified to apply cleanly to the latest v5.0 tag. Since the SLOC
limit is now lifted, this core feature should be merged into dwl upstream.
Thanks to Dima Krasner @dimkr for the cherry-pick.
Closes: #559, #525