Skip to content

fix(template): Use env variable USERNAME in Windows #931

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

Merged

Conversation

Nekketsu
Copy link
Contributor

@Nekketsu Nekketsu commented Mar 14, 2025

Summary

When creating capturing templates we can un the %n variable to insert the current user. It is done by using the environment variable USER. However, in Windows the variable is called USERNAME. This PR fixes this issue.

This PR adds..

Related Issues

Related #

Closes #

Changes

  • Check whether it is being run in Windows.
  • If is running in Windows it uses the environment variable USERNAME to query the current user name, otherwise it uses the USER variable.

Checklist

I confirm that I have:

  • Followed the
    Conventional Commits
    specification
    (e.g., feat: add new feature, fix: correct bug,
    docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with
    make test.
  • Checked for breaking changes and documented them, if any.

@Nekketsu Nekketsu force-pushed the template-windows-username branch 3 times, most recently from f8d12b4 to 900ca3f Compare March 14, 2025 08:29
@Nekketsu Nekketsu force-pushed the template-windows-username branch from 900ca3f to 4446069 Compare March 14, 2025 08:45
@Nekketsu Nekketsu changed the title Fix(template): Use env variable USERNAME in Windows fix(template): Use env variable USERNAME in Windows Mar 14, 2025
@Nekketsu Nekketsu requested a review from kristijanhusak March 14, 2025 11:36
Copy link
Member

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kristijanhusak kristijanhusak merged commit 8b4555b into nvim-orgmode:master Mar 14, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants