Skip to content

Commit

Permalink
Make vim.env.CMPR_DOC_WIDTH effective
Browse files Browse the repository at this point in the history
  • Loading branch information
jalvesaq committed Mar 19, 2024
1 parent 4a0057d commit 20f42d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/r/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ local start_rnvimserver = function()
on_exit = require("r.job").on_exit,
env = rns_env,
}
-- require("r.job").start( "Server", {
-- require("r.job").start("Server", {
-- "valgrind",
-- "--leak-check=full",
-- "--log-file=/tmp/rnvimserver_valgrind_log",
Expand Down Expand Up @@ -267,7 +267,11 @@ local build_objls_exit = function()
table.concat(o_err, "\n")
)
building_objls = false
job.stdin("Server", "41\n")
if vim.env.CMPR_DOC_WIDTH then
job.stdin("Server", "41" .. vim.env.CMPR_DOC_WIDTH .. "\n")
else
job.stdin("Server", "4158\n")
end
end

-- List R libraries from buffer
Expand Down
3 changes: 3 additions & 0 deletions nvimcom/src/apps/rnvimserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ void stdin_loop(void) {
msg++;
switch (*msg) {
case '1':
msg++;
setenv("CMPR_DOC_WIDTH", msg, 1);
finished_building_objls();
break;
case '2':
Expand Down Expand Up @@ -224,6 +226,7 @@ void stdin_loop(void) {
break;
#endif
case '9': // Quit now
stop_server();
exit(0);
break;
default:
Expand Down

0 comments on commit 20f42d9

Please sign in to comment.