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

Return boolean in goBack function #7

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

pbogut
Copy link
Contributor

@pbogut pbogut commented Nov 9, 2021

Returns boolean flag in goBack function that is true if can go back and false if it can't.

Reason

I'm using <bs> for my for a file browser (dirvish), but I also prefere to have it mapped to goBack when in markdawn files.
With this change I can set it up so I have my file browser opened when I cant go back. Works perfect for me and this change should not have any effect for existing users.

If you don't like this solution then maybe I can add public method canGoBack and use that in my mapping?

My mapping for reference:

if not require('mkdnflow').files.goBack() then
  vim.cmd('Dirvish %:p')
end

@jakewvincent
Copy link
Owner

@pbogut Thanks for the PR! I'll test this out shortly--AFAIK it shouldn't hurt anything.

@jakewvincent jakewvincent merged commit 5228490 into jakewvincent:main Nov 10, 2021
@pbogut pbogut deleted the go-back-return-boolean branch November 13, 2021 18:37
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.

None yet

2 participants