AutoYADM commit: 2025-06-10 15:28:37
This commit is contained in:
parent
b654a2f572
commit
f096e44679
2 changed files with 21 additions and 11 deletions
|
@ -237,6 +237,13 @@ define-command -params 2 lsp-diag-query %{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hook global KakEnd .* %{
|
||||||
|
nop %sh{
|
||||||
|
printf 'exit\n' >"$kak_opt_diagpipe_in"
|
||||||
|
read result < "$kak_opt_diagpipe_out"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
define-command lsp-diag-hover-enable %{
|
define-command lsp-diag-hover-enable %{
|
||||||
hook window User lsp-diag-hover-false %{
|
hook window User lsp-diag-hover-false %{
|
||||||
try inlay-diagnostics-off
|
try inlay-diagnostics-off
|
||||||
|
@ -252,13 +259,6 @@ define-command lsp-diag-hover-enable %{
|
||||||
hook window WinSetOption lsp_inline_diagnostics=.* %{
|
hook window WinSetOption lsp_inline_diagnostics=.* %{
|
||||||
lsp-diag-set
|
lsp-diag-set
|
||||||
}
|
}
|
||||||
hook global KakEnd .* %{
|
|
||||||
nop %sh{
|
|
||||||
printf 'exit\n' >"$kak_opt_diagpipe_in"
|
|
||||||
read result < "$kak_opt_diagpipe_out"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hook global User lsp-enabled %{
|
hook global User lsp-enabled %{
|
||||||
|
|
|
@ -9,6 +9,7 @@ import os
|
||||||
import tempfile
|
import tempfile
|
||||||
import signal
|
import signal
|
||||||
import types
|
import types
|
||||||
|
import selectors
|
||||||
|
|
||||||
Position = tuple[int, int]
|
Position = tuple[int, int]
|
||||||
SpecList = list[tuple[Position, Position]]
|
SpecList = list[tuple[Position, Position]]
|
||||||
|
@ -104,12 +105,21 @@ def main():
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
daemonize(in_path, out_path, fifo_dir)
|
daemonize(in_path, out_path, fifo_dir)
|
||||||
|
|
||||||
with open(in_path, "r") as infile, open(out_path, "w") as outfile:
|
sel = selectors.DefaultSelector()
|
||||||
|
infile = open(in_path, "r", buffering=1)
|
||||||
|
outfile = open(out_path, "w", buffering=1)
|
||||||
|
sel.register(infile.fileno(), selectors.EVENT_READ, data=infile)
|
||||||
|
|
||||||
|
# with open(in_path, "r") as infile, open(out_path, "w") as outfile:
|
||||||
diagnostics: SpecList = []
|
diagnostics: SpecList = []
|
||||||
while True:
|
while True:
|
||||||
line = infile.readline()
|
for key, _ in sel.select(timeout=None):
|
||||||
|
infile_obj = key.data
|
||||||
|
line = infile_obj.readline()
|
||||||
|
# line = infile.readline()
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
line = line.strip()
|
||||||
assert isinstance(line, str)
|
assert isinstance(line, str)
|
||||||
# # subprocess.run(["notify-send", f"Received command: {line}"])
|
# # subprocess.run(["notify-send", f"Received command: {line}"])
|
||||||
if line.startswith("set "):
|
if line.startswith("set "):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue