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

Do not change undo history when auto updating metadata #1112

Closed
1 task done
champignoom opened this issue Oct 12, 2023 · 5 comments
Closed
1 task done

Do not change undo history when auto updating metadata #1112

champignoom opened this issue Oct 12, 2023 · 5 comments
Labels
feature Issues related to feature proposals. Please attach a module.

Comments

@champignoom
Copy link
Contributor

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

Normally, u followed by <ctrl-r> should be a no-op.

But if I save the file in between, that is u then :w then <ctrl-r>, the saving action modifies the timestamp and creates a new undo branch, which prevents redo.

It would be nice if the undo status can somehow remain unaffected upon saving.

Help

Yes

Implementation help

No response

@champignoom champignoom added the feature Issues related to feature proposals. Please attach a module. label Oct 12, 2023
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Oct 12, 2023
@max397574
Copy link
Contributor

if we'd just set vim.o.ul=vim.o.ul that'll create a new "undo break" or however you want to call that. Then you can undo the change and switch to a different undo branch (idk how but somehow it's possible in vanilla, otherwise use e.g. undotree.vim) and you're able to redo the change.

@champignoom
Copy link
Contributor Author

Never mind. We just have to replace <ctrl-r> with g-, so u then :w then g- does the job.

@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Oct 18, 2023
@kflak
Copy link

kflak commented Jan 8, 2024

Not sure if this is even the same issue, but using metadata makes undo unusable for me... It only happens when the updated field exists, otherwise no problem.

2024-01-08_12.12.31.mp4

System:
Arch linux latest,
❯ nvim -v
NVIM v0.10.0-dev-741+g996dd36c77
Build type: RelWithDebInfo
LuaJIT 2.1.1702233742
Run "nvim -V1 -v" for more info

Neorg commit: 5432be2

Best, and thanks for an awesom plugin!

@benlubas
Copy link
Contributor

@kflak this is b/c you have an autosave plugin. I use one too, just spent a little time solving it. but the way that I went about doing it seems like a hack, and requires that you remap your u/<c-r> keys for the best experience. see the PR that just got linked.

@kflak
Copy link

kflak commented Jan 11, 2024

aaaah... makes sense! Had similar issues with autosave and Oil.nvim now that you mention it. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues related to feature proposals. Please attach a module.
Projects
None yet
Development

No branches or pull requests

4 participants