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

When renaming a non-ignored file to a name that matches the "Ignore Regex Rule", the title still gets synchronized #64

Open
fkuersch opened this issue Oct 30, 2022 · 2 comments

Comments

@fkuersch
Copy link

Steps to Reproduce:

  • Set the "Ignore Regex Rule" to "^+.*" to match files starting with +
  • Create a new file
  • Set a h1, ie. # example title
    • The plugin renames the file to "example title"
  • Change the file name to "+shouldbeignored"

Expected behavior:

  • The h1 should stay the same ("example title")

Actual behavior:

  • The h1 gets renamed to "+shouldbeignored"

Possible solution:

The current handleSyncFilenameToHeading checks for the old path only. It should also check whether the new file name is ignored.

@dvcrn
Copy link
Owner

dvcrn commented Nov 1, 2022

Yeah currently it only looks at the current file name. If added, this should probably behind an option because I can imagine some people don't want this

@fkuersch
Copy link
Author

fkuersch commented Nov 1, 2022

Since I've only been using this plugin for a few days by now, I find it hard to think of a situation where you would want an option for that. There might be use cases for that option, but I just cannot imagine a specific situation.

After a little thought, i want to put it a little more broadly:

Current behavior:
Change from non-ignored to ignored* -> sync
Change from ignored to non-ignored* -> don't sync

Expected behavior:
Change from non-ignored to ignored* -> don't sync
Change from ignored to non-ignored* -> sync

*That is in each case in both directions (h1 -> filename and filename -> h1)

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

No branches or pull requests

2 participants