Skip to content

Commit

Permalink
Fixes indentation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
xomachine committed Jan 18, 2021
1 parent f3573ca commit 564d5c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lua/vis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ local events = {
WIN_OPEN = "Event::WIN_OPEN", -- see @{win_open}
WIN_STATUS = "Event::WIN_STATUS", -- see @{win_status}
TERM_CSI = "Event::TERM_CSI", -- see @{term_csi}
PROCESS_RESPONSE = "Event::PROCESS_RESPONSE", -- see @{process_response}
PROCESS_RESPONSE = "Event::PROCESS_RESPONSE", -- see @{process_response}
}

events.file_close = function(...) events.emit(events.FILE_CLOSE, ...) end
Expand Down
2 changes: 1 addition & 1 deletion vis-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -3200,7 +3200,7 @@ void vis_lua_process_response(Vis *vis, const char *name,
lua_State *L = vis->lua;
if (!L)
return;
vis_lua_event_get(L, "process_response");
vis_lua_event_get(L, "process_response");
if (lua_isfunction(L, -1)) {
lua_pushstring(L, name);
if (rtype == EXIT || rtype == SIGNAL)
Expand Down
20 changes: 10 additions & 10 deletions vis-subprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Process *vis_process_communicate(Vis *vis, const char *name,
* returns the subprocess information structure, containing file descriptors
* of the process.
* Also stores the subprocess information to the internal pool to track
* its status and responses.
* its status and responses.
* `name` - the string than should contain an unique name of the subprocess.
* This name will be passed to the PROCESS_RESPONSE event handler
* This name will be passed to the PROCESS_RESPONSE event handler
* to distinguish running subprocesses.
* `invalidator` - a pointer to the pointer which shows that the subprocess
* is invalid when set to NULL. When subprocess dies, it is being set to NULL.
Expand Down Expand Up @@ -136,12 +136,12 @@ int vis_process_before_tick(fd_set *readfds) {

void read_and_fire(Vis* vis, int fd, const char *name, ResponseType rtype) {
/* Reads data from the given subprocess file descriptor `fd` and fires
* the PROCESS_RESPONSE event in Lua with given subprocess `name`,
* the PROCESS_RESPONSE event in Lua with given subprocess `name`,
* `rtype` and the read data as arguments. */
static char buffer[MAXBUFFER];
size_t obtained = read(fd, &buffer, MAXBUFFER-1);
if (obtained > 0)
vis_lua_process_response(vis, name, buffer, obtained, rtype);
static char buffer[MAXBUFFER];
size_t obtained = read(fd, &buffer, MAXBUFFER-1);
if (obtained > 0)
vis_lua_process_response(vis, name, buffer, obtained, rtype);
}

void vis_process_tick(Vis *vis, fd_set *readfds) {
Expand All @@ -168,9 +168,9 @@ void vis_process_tick(Vis *vis, fd_set *readfds) {
waitpid(current->pid, &status, 0);
just_destroy:
if (WIFSIGNALED(status))
vis_lua_process_response(vis, current->name, NULL, WTERMSIG(status), SIGNAL);
vis_lua_process_response(vis, current->name, NULL, WTERMSIG(status), SIGNAL);
else
vis_lua_process_response(vis, current->name, NULL, WEXITSTATUS(status), EXIT);
vis_lua_process_response(vis, current->name, NULL, WEXITSTATUS(status), EXIT);
destroy(pointer);
}
}
}

0 comments on commit 564d5c4

Please sign in to comment.