@@ -163,9 +163,12 @@ class $b15434387a78119d$var$PathsProvider extends $igPDg$events.EventEmitter {
163163 if (fuzzyMatcher) files = (0, $igPDg$zadeh.filter)(files, fuzzyMatcher, {
164164 maxResults: 10
165165 });
166+ const showImagePreview = atom.config.get("autocomplete-paths.imagePreview");
167+ const imgRegex = /\.(png|svg|jpg|jpeg|jfif|pjpeg|pjp|gif|apng|ico|cur)$/;
166168 const suggestions = files.map((pathName)=>{
167169 let text = pathName;
168170 const normalizeSlashes = atom.config.get("autocomplete-paths.normalizeSlashes");
171+ const absolutePath = $b15434387a78119d$var$_path.default.resolve($b15434387a78119d$var$_path.default.dirname(request2.editor.getPath()), pathName);
169172 const projectRelativePath = atom.project.relativizePath(text)[1];
170173 let displayText = projectRelativePath;
171174 if (directoryGiven) displayText = $b15434387a78119d$var$_path.default.relative(requestedDirectoryPath, text);
@@ -188,12 +191,13 @@ class $b15434387a78119d$var$PathsProvider extends $igPDg$events.EventEmitter {
188191 });
189192 // Calculate distance to file
190193 const distanceToFile = relativePath.split($b15434387a78119d$var$_path.default.sep).length;
194+ const iconHTML = showImagePreview && imgRegex.test(absolutePath) ? `<image style="background-position: center; background-repeat: no-repeat; background-size: contain; background-image: url(${absolutePath}); height:29px; width:29px;"></image>` : '<i class="icon-file-code"></i>';
191195 return {
192196 text: text,
193197 replacementPrefix: pathPrefix,
194198 displayText: displayText,
195199 type: "import",
196- iconHTML: '<i class="icon-file-code"></i>' ,
200+ iconHTML: iconHTML ,
197201 score: (0, $igPDg$zadeh.score)(displayText, request2.prefix),
198202 distanceToFile: distanceToFile
199203 };
@@ -13990,6 +13994,11 @@ const $661f0ec0189dd3b0$var$config = {
1399013994 default: false,
1399113995 description: "Follow directory symlinks. Disable if you have a self-referencing symlink."
1399213996 },
13997+ imagePreview: {
13998+ type: "boolean",
13999+ default: false,
14000+ description: "Show preview icon for images."
14001+ },
1399314002 ignoredNames: {
1399414003 type: "boolean",
1399514004 default: true,
0 commit comments