mirror of
https://github.com/paul-nameless/tg
synced 2025-02-16 18:48:24 +00:00
Add enter to act as "l" and "a" to send msg
This commit is contained in:
parent
6b8630ee87
commit
c70933c4b1
1 changed files with 7 additions and 12 deletions
|
@ -88,7 +88,7 @@ class Controller:
|
|||
elif keys == "I":
|
||||
# open vim or emacs to write long messages
|
||||
pass
|
||||
elif keys == "i":
|
||||
elif keys in ("i", "a"):
|
||||
# write new message
|
||||
msg = self.view.get_input()
|
||||
if msg:
|
||||
|
@ -112,7 +112,7 @@ class Controller:
|
|||
log.info("Pressed keys: %s", keys)
|
||||
if keys == "q":
|
||||
return
|
||||
elif keys in ("l", "^E"):
|
||||
elif keys in ("l", "^J"):
|
||||
rc = self.handle_msgs()
|
||||
if rc == "QUIT":
|
||||
return
|
||||
|
@ -121,28 +121,23 @@ class Controller:
|
|||
self.refresh_chats()
|
||||
|
||||
elif keys in ("j", "^N"):
|
||||
is_changed = self.model.next_chat(repeat_factor)
|
||||
if is_changed:
|
||||
if self.model.next_chat(repeat_factor):
|
||||
self.refresh_chats()
|
||||
|
||||
elif keys in ("k", "^P"):
|
||||
is_changed = self.model.prev_chat(repeat_factor)
|
||||
if is_changed:
|
||||
if self.model.prev_chat(repeat_factor):
|
||||
self.refresh_chats()
|
||||
|
||||
elif keys in ("J",):
|
||||
is_changed = self.model.next_chat(10)
|
||||
if is_changed:
|
||||
if self.model.next_chat(10):
|
||||
self.refresh_chats()
|
||||
|
||||
elif keys in ("K",):
|
||||
is_changed = self.model.prev_chat(10)
|
||||
if is_changed:
|
||||
if self.model.prev_chat(10):
|
||||
self.refresh_chats()
|
||||
|
||||
elif keys == "gg":
|
||||
is_changed = self.model.first_chat()
|
||||
if is_changed:
|
||||
if self.model.first_chat():
|
||||
self.refresh_chats()
|
||||
|
||||
def refresh_chats(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue