Skip to content

Commit

Permalink
chore(release): 2.17.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Nov 29, 2021
1 parent a5546b9 commit 76e6011
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [2.17.0](https://github.com/atom-community/autocomplete-paths/compare/v2.16.0...v2.17.0) (2021-11-29)


### Features

* add setting to show image preview ([#188](https://github.com/atom-community/autocomplete-paths/issues/188)) ([a5546b9](https://github.com/atom-community/autocomplete-paths/commit/a5546b9d43a8adfc0d9f720b2f0f1c5ba1dc6782))

# [2.16.0](https://github.com/atom-community/autocomplete-paths/compare/v2.15.2...v2.16.0) (2021-11-29)


Expand Down
11 changes: 10 additions & 1 deletion dist/autocomplete-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@ class $b15434387a78119d$var$PathsProvider extends $igPDg$events.EventEmitter {
if (fuzzyMatcher) files = (0, $igPDg$zadeh.filter)(files, fuzzyMatcher, {
maxResults: 10
});
const showImagePreview = atom.config.get("autocomplete-paths.imagePreview");
const imgRegex = /\.(png|svg|jpg|jpeg|jfif|pjpeg|pjp|gif|apng|ico|cur)$/;
const suggestions = files.map((pathName)=>{
let text = pathName;
const normalizeSlashes = atom.config.get("autocomplete-paths.normalizeSlashes");
const absolutePath = $b15434387a78119d$var$_path.default.resolve($b15434387a78119d$var$_path.default.dirname(request2.editor.getPath()), pathName);
const projectRelativePath = atom.project.relativizePath(text)[1];
let displayText = projectRelativePath;
if (directoryGiven) displayText = $b15434387a78119d$var$_path.default.relative(requestedDirectoryPath, text);
Expand All @@ -188,12 +191,13 @@ class $b15434387a78119d$var$PathsProvider extends $igPDg$events.EventEmitter {
});
// Calculate distance to file
const distanceToFile = relativePath.split($b15434387a78119d$var$_path.default.sep).length;
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>';
return {
text: text,
replacementPrefix: pathPrefix,
displayText: displayText,
type: "import",
iconHTML: '<i class="icon-file-code"></i>',
iconHTML: iconHTML,
score: (0, $igPDg$zadeh.score)(displayText, request2.prefix),
distanceToFile: distanceToFile
};
Expand Down Expand Up @@ -13990,6 +13994,11 @@ const $661f0ec0189dd3b0$var$config = {
default: false,
description: "Follow directory symlinks. Disable if you have a self-referencing symlink."
},
imagePreview: {
type: "boolean",
default: false,
description: "Show preview icon for images."
},
ignoredNames: {
type: "boolean",
default: true,
Expand Down
2 changes: 1 addition & 1 deletion dist/autocomplete-paths.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autocomplete-paths",
"version": "2.16.0",
"version": "2.17.0",
"description": "Adds path autocompletion to autocomplete+",
"repository": "https://github.com/atom-community/autocomplete-paths",
"license": "MIT",
Expand Down

0 comments on commit 76e6011

Please sign in to comment.