summaryrefslogtreecommitdiffstats
path: root/src/cmds_command.c
diff options
context:
space:
mode:
authormongo <andmarti@gmail.com>2017-04-26 19:11:15 -0300
committermongo <andmarti@gmail.com>2017-04-26 19:11:15 -0300
commitb3f75cacdc06f9cc97df87099f0b70bb880e3c4c (patch)
treea8437bcfd0109a186a6b905800cab7d5de44c90f /src/cmds_command.c
parent4db041841caa49178c53232c24e0523553433e8f (diff)
gnuplot interaction
Diffstat (limited to 'src/cmds_command.c')
-rw-r--r--src/cmds_command.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/cmds_command.c b/src/cmds_command.c
index cbb40ea..ae23d2f 100644
--- a/src/cmds_command.c
+++ b/src/cmds_command.c
@@ -22,7 +22,6 @@
#include "maps.h"
#include "xls.h"
#include "xlsx.h"
-
#include "cmds_visual.h"
#ifdef UNDO
@@ -90,6 +89,7 @@ L"nmap",
L"nnoremap",
L"nunmap",
L"pad",
+L"plot",
L"q",
L"q!",
L"quit!",
@@ -647,6 +647,21 @@ void do_commandmode(struct block * sb) {
swprintf(interp_line + wcslen(interp_line), BUFFERSIZE, L"%s", coltoa(cf)); // B
send_to_interp(interp_line);
+ } else if ( ! wcsncmp(inputline, L"plot ", 5) ) {
+ int r = currow, c = curcol, rf = currow, cf = curcol;
+ if (p != -1) {
+ c = sr->tlcol;
+ r = sr->tlrow;
+ rf = sr->brrow;
+ cf = sr->brcol;
+ }
+ wchar_t aux[wcslen(inputline)+1];
+ wcscpy(aux, inputline);
+ del_range_wchars(aux, 0, 4);
+ swprintf(interp_line, BUFFERSIZE, L"plot \"%ls\" %s%d:", aux, coltoa(c), r);
+ swprintf(interp_line + wcslen(interp_line), BUFFERSIZE, L"%s%d", coltoa(cf), rf);
+ send_to_interp(interp_line);
+
} else if ( ! wcscmp(inputline, L"set") ) {
char valores[ (get_maxkey_length(user_conf_d) + get_maxvalue_length(user_conf_d) + 1) * user_conf_d->len ];
get_conf_values(valores);