Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
f46db55b
Commit
f46db55b
authored
Dec 31, 2015
by
Jacek Sowiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit the highlighted task in $EDITOR with 'e' key
parent
ab4566c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
topydo/ui/TodoListWidget.py
topydo/ui/TodoListWidget.py
+18
-0
No files found.
topydo/ui/TodoListWidget.py
View file @
f46db55b
...
@@ -124,6 +124,10 @@ class TodoListWidget(urwid.LineBox):
...
@@ -124,6 +124,10 @@ class TodoListWidget(urwid.LineBox):
self
.
keystate
=
'p'
self
.
keystate
=
'p'
elif
p_key
==
'd'
:
elif
p_key
==
'd'
:
self
.
_remove_selected_item
()
self
.
_remove_selected_item
()
elif
p_key
==
'e'
:
self
.
_edit_selected_item
()
# force screen redraw after editing
return
self
.
listbox
.
keypress
(
p_size
,
'ctrl l'
)
elif
p_key
==
'u'
:
elif
p_key
==
'u'
:
urwid
.
emit_signal
(
self
,
'execute_command'
,
"revert"
)
urwid
.
emit_signal
(
self
,
'execute_command'
,
"revert"
)
elif
p_key
==
'j'
:
elif
p_key
==
'j'
:
...
@@ -186,3 +190,17 @@ class TodoListWidget(urwid.LineBox):
...
@@ -186,3 +190,17 @@ class TodoListWidget(urwid.LineBox):
except
AttributeError
:
except
AttributeError
:
# No todo item selected
# No todo item selected
pass
pass
def
_edit_selected_item
(
self
):
"""
Opens the highlighted todo item in $EDITOR for editing.
"""
try
:
todo
=
self
.
listbox
.
focus
.
todo
self
.
view
.
todolist
.
number
(
todo
)
urwid
.
emit_signal
(
self
,
'execute_command'
,
"edit {}"
.
format
(
str
(
self
.
view
.
todolist
.
number
(
todo
))))
except
AttributeError
:
# No todo item selected
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment