fix: Correct icons for clipboards files#845
Conversation
WalkthroughThe change updates the Changes
Assessment against linked issues
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code Graph Analysis (1)src/internal/common/string_function.go (1)
🔇 Additional comments (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [yorukot/superfile](https://github.com/yorukot/superfile) | patch | `v1.3.0` -> `v1.3.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>yorukot/superfile (yorukot/superfile)</summary> ### [`v1.3.1`](https://github.com/yorukot/superfile/releases/tag/v1.3.1) [Compare Source](yorukot/superfile@v1.3.0...v1.3.1) Hey folks. Releasing v1.3.1, providing some recent bug fixes for v1.3.0 , and a new feature. #### Install: [**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation) #### Highlights - Bug fix for String Width check causing startup failure on RUNEWIDTH_EASTASIAN=1 . Thanks [@​YHYJBPXR](https://github.com/YHYJBPXR) for creating the issue, and [@​mnixry](https://github.com/mnixry) for finding the root cause. - Bug fix for correcting icons for clipboard panel. Thanks [@​Frost-Phoenix](https://github.com/Frost-Phoenix) for this quick bug fix. - Added a new sort type - you can now sort files by their Type (file extension) - Thanks [@​trejdof](https://github.com/trejdof) for the idea and implementation. - Code improvements and refactoring . Thanks [@​JassonCordones](https://github.com/JassonCordones) for your code improvements. Discussion for any questions/clarifications : - yorukot/superfile#855 (comment) #### Detailed Change Summary <details><summary>Details</summary> <p> - Correct icons for clipboard files [`#845`](yorukot/superfile#845) by [@​Frost-Phoenix](https://github.com/Frost-Phoenix) - Update main.go [`#839`](yorukot/superfile#839) by [@​JassonCordones](https://github.com/JassonCordones) - Purego package update [`#837`](yorukot/superfile#837) by [@​daeho-ro](https://github.com/daeho-ro) - Replace custom giscus implementation with official starlight-giscus plugin [`#843`](yorukot/superfile#843) by [@​yorukot](https://github.com/yorukot) - Add 'Type' option for sorting by file extension with fallback [`#829`](yorukot/superfile#829) by [@​trejdof](https://github.com/trejdof) - Replace mattn/rundwidth with ansi package for more robust StringWidth [`#848`](yorukot/superfile#848) by [@​lazysegtree](https://github.com/lazysegtree) </p> </details> #### New Contributors * @​daeho-ro made their first contribution in yorukot/superfile#837 * @​trejdof made their first contribution in yorukot/superfile#829 **Full Changelog**: yorukot/superfile@v1.3.0...v1.3.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4yNi4xIiwidXBkYXRlZEluVmVyIjoiNDAuMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
This PR closes #832
The issue is that
ClipboardPrettierName(name string, width int, isDir bool, isSelected bool) string, which is called when rendering the clipboard panel, is called with the file full path (e.g./home/name/Documents/file.txt) . ButGetElementIcon(file string, isDir bool, nerdFont bool) icon.Style, witch is used to retrived the file icon, expect only the file base name (e.g.file.txt). So for files likego.modthat relies on the full base name to get the icon, the full path of the file will be given and not just the base name.After the changes:

Summary by CodeRabbit