Courtesy of Smart Indentation, now with relative path handling