1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 03:03:12 +02:00

Add keyword "input_pos" to get/set cursor position in plugin API functions buffer_get_integer and buffer_set

This commit is contained in:
Sebastien Helleu
2010-01-13 17:03:40 +01:00
parent b8a42996c1
commit 0e6b33b5be
5 changed files with 36 additions and 2 deletions
+9
View File
@@ -664,6 +664,8 @@ gui_buffer_get_integer (struct t_gui_buffer *buffer, const char *property)
return buffer->text_search_exact;
else if (string_strcasecmp (property, "text_search_found") == 0)
return buffer->text_search_found;
else if (string_strcasecmp (property, "input_pos") == 0)
return buffer->input_buffer_pos;
}
return 0;
@@ -1073,6 +1075,13 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
gui_input_insert_string (buffer, value, 0);
gui_input_text_changed_modifier_and_signal (buffer);
}
else if (string_strcasecmp (property, "input_pos") == 0)
{
error = NULL;
number = strtol (value, &error, 10);
if (error && !error[0])
gui_input_set_pos (buffer, number);
}
else if (string_strcasecmp (property, "input_get_unknown_commands") == 0)
{
error = NULL;