update
This commit is contained in:
@@ -5,6 +5,8 @@ from typing import Any
|
||||
from pynvim import Nvim, command, plugin
|
||||
from pynvim.api import Buffer
|
||||
|
||||
from .ui import Select
|
||||
|
||||
from .clickup import ClickupSession, ClickupTask
|
||||
from .hints import JSONData
|
||||
from .yaml import load, dump
|
||||
@@ -119,7 +121,6 @@ class MrPyPlugin:
|
||||
self.nvim.buffers[temp_buf.number].options["modified"] = False
|
||||
self.nvim.api.win_set_buf(0, temp_buf)
|
||||
|
||||
@command("Mrpy", nargs="*")
|
||||
def entry(self, args: Sequence[str] = ()) -> None:
|
||||
match args:
|
||||
case (str() as task_id,):
|
||||
@@ -130,7 +131,6 @@ class MrPyPlugin:
|
||||
case tags:
|
||||
self.select_task_id(set(tags))
|
||||
|
||||
@command("MrpyPush", nargs="?")
|
||||
def on_vbuf_write(self, args: Sequence[str] = ()) -> None:
|
||||
match args:
|
||||
case "0", *_:
|
||||
@@ -153,7 +153,6 @@ class MrPyPlugin:
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
@command("MrpyNew", nargs=0)
|
||||
def on_new_task(self) -> None:
|
||||
task = ClickupTask(name="", status="backlog", markdown_content="", parent_list="")
|
||||
temp_buf: Buffer = self.nvim.api.create_buf(True, False)
|
||||
@@ -178,7 +177,6 @@ class MrPyPlugin:
|
||||
self.nvim.buffers[temp_buf.number].options["modified"] = False
|
||||
self.nvim.api.win_set_buf(0, temp_buf)
|
||||
|
||||
@command("MrpyPushNew", nargs=1)
|
||||
def on_new_vbuf_write(self, buf_no: Sequence[Any] = ()) -> None:
|
||||
buf_no = int(buf_no[0])
|
||||
|
||||
@@ -199,3 +197,9 @@ class MrPyPlugin:
|
||||
self.entry([new_task_id])
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
def handle_test(self, choice: Any) -> None:
|
||||
self.nvim.err_write(str(choice))
|
||||
|
||||
def test(self) -> None:
|
||||
self.nvim.ui.select(["a", "b"], {"prompt": "hi"}, self.handle_test)
|
||||
|
||||
Reference in New Issue
Block a user