Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First character of file path cut off in command palette if no templates folder set #1436

Closed
Nostromos opened this issue Aug 20, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Nostromos
Copy link

Nostromos commented Aug 20, 2024

Plugin information (please complete the following information):

  • OS: MacOS 14.6.1
  • Templater version: 2.4.1
  • Obsidian version: 1.6.7
  • Templater settings: Vanilla

Describe the bug
When I use any templater command palette option, the first character of every template entry is cut off IF no template folder location is configured. It's not a serious bug but it is kinda annoying. See attached.

Expected behavior
Full pathnames with no missing characters.

Screenshots
Screenshot 2024-08-20 at 10 52 36 AM (2)

Additional context
I have a pretty vanilla install of Obsidian - I'm really new to it. No custom themes and the only setting I've changed for anything is viewing properties as source.

I'll probably dig into this and put in a PR if this isn't touched by next week.

@Nostromos Nostromos added the bug Something isn't working label Aug 20, 2024
@Nostromos Nostromos changed the title First letter of file path cut off in command palette First character of file path cut off in command palette if no templates folder set Aug 20, 2024
@Zachatoo
Copy link
Collaborator

I'm guessing it was caused by this recent PR #1418

They were likely testing with Templater settings that had a template folder path that didn't end with a /, and your template folder path probably does end with a /. The code probably needs to be updated to handle both cases.

@Nostromos
Copy link
Author

Gah great point. I should have looked at recent PRs. If it's a matter of file paths, seems an easy enough fix and I've been itching to contribute anywhere that'll have me.

Mind if I take a swing? Might take me a day or two.

@Zachatoo
Copy link
Collaborator

Absolutely, will definitely accept a PR to fix this when you find time, thanks!

@I-Pch
Copy link

I-Pch commented Sep 3, 2024

I have no idea if this would be useful in any way 😇 , but just in case: This bug is also reproducible with one fresh install of Templater (i.e.: without even opening Templater's settings after enabling it) and then clicking on Templater's icon in the ribbon to trigger the template selection modal.

(Seen in the Sandbox Vault of Obsidian 1.7.1 (Installer 1.6.7) + Templater 2.6.0)

@Erallie
Copy link
Contributor

Erallie commented Sep 3, 2024

Hey, I just want to throw this out there, that this can easily be fixed by just checking to see if the path is empty before removing the length of the path (plus one) from the beginning of the string. I can easily fix it, but I know that @Nostromos requested to be the contributor, so I'm letting you know this so that maybe he can consider it in his Pull request?

Or if you're too busy Nostromos, I could take a stab.

@Erallie
Copy link
Contributor

Erallie commented Sep 3, 2024

I have no idea if this would be useful in any way 😇 , but just in case: This bug is also reproducible if one freshly install and enable Templater (i.e.: without even opening Templater's settings) and then click on Templater's icon in the ribbon to trigger the template selection modal.

(Seen in the Sandbox Vault of Obsidian 1.7.1 (Installer 1.6.7) + Templater 2.6.0)

@I-Pch Yes, I believe this is probably because on a newly installed vault, the template folder is empty, so it's basically the same problem.

@Nostromos
Copy link
Author

@Erallie All you! I had kid stuff pop up and interviews and never got around to it.

@Erallie
Copy link
Contributor

Erallie commented Sep 11, 2024

I created pull request #1454 to fix this.

Zachatoo added a commit that referenced this issue Sep 12, 2024
Merge pull request #1454 from Erallie/master
Fix first letter of suggest modal being cut off
refs: #1436
@Zachatoo Zachatoo assigned Erallie and unassigned Nostromos Sep 12, 2024
@Zachatoo
Copy link
Collaborator

This has been released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants