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

Hack to enable neovim support #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

malramsay64
Copy link

This is a very first attempt at enabling neovim support for
vim-taskwarrior #132 . In my use the only functions that require interaction
are undo and delete, for these two functions there is a check
has('nvim') which changes execution from ! to terminal and there is
also no taskwarrior#refresh() call, which is done using a BufEnter
autocmd.

There is likely a better solution that I don't yet know about.

This is a very first attempt at enabling neovim support for
vim-taskwarrir. In my use the only functions that require interaction
are undo and delete, for these two functions there is a check
`has('nvim')` which changes execution from `!` to `terminal`. There is
also no `taskwarrior#refresh()` call, which is done in a BufEnter
autocmd.
The refresh of the terminal occurred before sync had updated so any new
tasks were not showing up when syncing in neovim.
endif
endif
if !has('nvim')
call taskwarrior#refresh()

Choose a reason for hiding this comment

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

I think you have in indentation problem here

call taskwarrior#list()
else
execute 'terminal task '.taskwarrior#data#get_uuid().' delete'
endif

Choose a reason for hiding this comment

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

it's generally better if you start with the positive route if has('nvim')

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback, I think I have fixed/improved the bits of code that you picked up.

All the conditionals in the check for nvim have been modified to check
for the positive rather than negative.
I am creating a new window every time there is a call to terminal, as
without it when there are multiple windows or tabs open the terminal
call will close the current window.
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