-
Notifications
You must be signed in to change notification settings - Fork 143
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
feat: notify when changing the current directory #406
Conversation
Hm.. Strange... I've just double-checked myself, and executed the :lua vim.cmd({ cmd = "tcd", args = { "/Users" } }) This way my nvim just outputs the notification with the latest directory as expected: However, for some reason when exactly the same code executes from the oil codebase, it does not trigger the notification. And it does not even add an entry to the I'm not a vim/lua expert, and I still don't know why it behaves this way. But I'm pretty sure to say, that "fix" suggested in this PR is wrong. So closing this for now. Would appreciate any ideas about why the |
OK, it seems the difference is the keymap. If I invoke Since the lack of any feedback for |
I had to think about this a good bit, but I don't think that we want this. The behavior of For the same reason here, I think that the default action makes sense to keep minimal and not have any impact on message history. If you want to get feedback, you can easily add on to the builtins require("oil").setup({
keymaps = {
["`"] = function()
require("oil.actions").tcd.callback()
print(vim.fn.getcwd())
end,
},
}) |
@stevearc Thank you for taking this into consideration and for your response! I agree it does probably make sense to silence the Since the oil is supposed to provide just an "edit like a normal buffer" experience(that I like a lot!), I would expect the However, it does not affect my text anymore, instead it changes my |
To express my concern better, let's stop thinking about the Let's assume any other normal mode key is overwritten by the oil silently. So now the Even if we ignore the newcomers possible scenario, I can still imagine people pressing the |
That's a fair point. My main concern about this was that if you make the action notify, then there's no way for the end user to silence it if they don't want that notification, but there is a way for them to add the notification if they do want it. I think I have a way in mind to parameterize actions, so if I can get that into decent shape then that can take care of the problem. I'll merge this in now and see about parameterizing it later. |
Great! Thank you. |
Right now both
actions.tcd
andactions.cd
seem to do their job silently. That made me think the~
key is broken(#397).We can improve UX by providing these actions with info notifications, so the keypresses provide some visual response to the user.