-
Notifications
You must be signed in to change notification settings - Fork 42
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,23 +85,34 @@ function! taskwarrior#action#modify(mode) | |
endfunction | ||
|
||
function! taskwarrior#action#delete() | ||
let uuid = taskwarrior#data#get_uuid() | ||
if uuid == '' | ||
call taskwarrior#action#annotate('del') | ||
else | ||
let ccol = taskwarrior#data#current_column() | ||
if index(['project', 'tags', 'due', 'priority', 'start', 'depends'], ccol) != -1 | ||
call taskwarrior#system_call(uuid, 'modify', ccol.':', 'silent') | ||
let uuid = taskwarrior#data#get_uuid() | ||
if uuid == '' | ||
call taskwarrior#action#annotate('del') | ||
else | ||
execute '!task '.uuid.' delete' | ||
let ccol = taskwarrior#data#current_column() | ||
if index(['project', 'tags', 'due', 'priority', 'start', 'depends'], ccol) != -1 | ||
call taskwarrior#system_call(uuid, 'modify', ccol.':', 'silent') | ||
else | ||
if !has('nvim') | ||
execute '!task '.uuid.' delete' | ||
else | ||
execute terminal 'task'.uuid.'delete' | ||
endif | ||
endif | ||
endif | ||
if !has('nvim') | ||
call taskwarrior#refresh() | ||
endif | ||
endif | ||
call taskwarrior#refresh() | ||
endfunction | ||
|
||
function! taskwarrior#action#remove() | ||
execute '!task '.taskwarrior#data#get_uuid().' delete' | ||
call taskwarrior#list() | ||
if !has('nvim') | ||
execute '!task '.taskwarrior#data#get_uuid().' delete' | ||
call taskwarrior#list() | ||
else | ||
execute 'terminal task '.taskwarrior#data#get_uuid().' delete' | ||
endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's generally better if you start with the positive route There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
endfunction | ||
|
||
function! taskwarrior#action#annotate(op) | ||
|
@@ -297,21 +308,27 @@ function! taskwarrior#action#move_cursor(direction, mode) | |
endfunction | ||
|
||
function! taskwarrior#action#undo() | ||
if has("gui_running") | ||
if exists('g:task_gui_term') && g:task_gui_term == 1 | ||
!task rc.color=off undo | ||
elseif executable('xterm') | ||
silent !xterm -e 'task undo' | ||
elseif executable('urxvt') | ||
silent !urxvt -e task undo | ||
elseif executable('gnome-terminal') | ||
silent !gnome-terminal -e 'task undo' | ||
endif | ||
if has('nvim') | ||
terminal task undo | ||
else | ||
sil !clear | ||
!task undo | ||
if has("gui_running") | ||
if exists('g:task_gui_term') && g:task_gui_term == 1 | ||
!task rc.color=off undo | ||
elseif executable('xterm') | ||
silent !xterm -e 'task undo' | ||
elseif executable('urxvt') | ||
silent !urxvt -e task undo | ||
elseif executable('gnome-terminal') | ||
silent !gnome-terminal -e 'task undo' | ||
endif | ||
else | ||
sil !clear | ||
!task undo | ||
endif | ||
if has('nvim') | ||
call taskwarrior#refresh() | ||
endif | ||
endif | ||
call taskwarrior#refresh() | ||
endfunction | ||
|
||
function! taskwarrior#action#clear_completed() | ||
|
@@ -321,7 +338,9 @@ endfunction | |
|
||
function! taskwarrior#action#sync(action) | ||
execute '!task '.a:action.' ' | ||
call taskwarrior#refresh() | ||
if !has('nvim') | ||
call taskwarrior#refresh() | ||
endif | ||
endfunction | ||
|
||
function! taskwarrior#action#select() | ||
|
There was a problem hiding this comment.
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