From 0b015320382e74fcb385a46a81304f588ed27f77 Mon Sep 17 00:00:00 2001 From: xomachine Date: Sun, 25 Feb 2018 01:55:48 +0300 Subject: Implementation of the non-blocking process running Lua API Rationale A modern text editor usually includes tools for helping user to avoid mistakes in texts. Those tools include spell checkers and programming language integrations. Though vis explicitly states that the full featured IDE is not a goal, implementing some of the tools might be achieved using its Lua API. Unfortunatelly the API misses the ability to start a process and to perform a communication with it without completely blocking the editor UI, which is crucial for any tool that performs background tracking of the inserted text (e. g. language servers). Implementation details New feature introduces new API method: communicate. The method start a new process and returns a handle to communicate with the process instantly. The patch inserts stderr and stdout file descriptors of the process to the pselect call of the main loop used for reading user input to track the process state without blocking the main loop until the process is finished. Any changes in the process state cause the iteration of the main loop and are being exposed to the Lua API as new event: PROCESS_RESPONSE. --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index da8de29..5969f8b 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ SRC = array.c \ vis-prompt.c \ vis-registers.c \ vis-text-objects.c \ + vis-subprocess.c \ $(REGEX_SRC) OBJ = $(SRC:%.c=obj/%.o) -- cgit v1.2.3