aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lsp.c')
-rw-r--r--src/lsp.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lsp.c b/src/lsp.c
index 2c1f89b..ff7ddc7 100644
--- a/src/lsp.c
+++ b/src/lsp.c
@@ -444,16 +444,9 @@ teco_lsp_launch(GError **error)
G_SPAWN_STDERR_TO_DEV_NULL;
static const gchar lsp_reg_name[] = "$SCITECO_LSP";
- teco_qreg_t *reg = teco_qreg_table_find(&teco_qreg_table_globals,
- lsp_reg_name, strlen(lsp_reg_name));
- if (!reg) {
- g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Q-Register %s is undefined.", lsp_reg_name);
- return FALSE;
- }
-
g_auto(teco_string_t) command = {NULL, 0};
- if (!reg->vtable->get_string(reg, &command.data, &command.len, NULL, error))
+ if (!teco_qreg_table_get_string(&teco_qreg_table_globals, lsp_reg_name,
+ &command.data, &command.len, error))
return FALSE;
if (teco_string_contains(command, '\0')) {
teco_error_qregcontainsnull_set(error, lsp_reg_name, strlen(lsp_reg_name), FALSE);
@@ -497,8 +490,8 @@ teco_lsp_launch(GError **error)
g_auto(teco_string_t) root = {NULL, 0};
static const gchar root_reg_name[] = "$SCITECO_LSP_ROOT";
- reg = teco_qreg_table_find(&teco_qreg_table_globals,
- root_reg_name, strlen(root_reg_name));
+ teco_qreg_t *reg = teco_qreg_table_find(&teco_qreg_table_globals,
+ root_reg_name, strlen(root_reg_name));
if (reg) {
if (!reg->vtable->get_string(reg, &root.data, &root.len, NULL, error))
return FALSE;