4 /* Functions to handle cursor movement for */
6 /* This code is released to the public domain. */
7 /* "Share and enjoy...." ;) */
8 /* See the UNLICENSE file for details. */
14 #include "pd_readline.h"
16 /* Note - make the up and down funcs return a buffer. */
17 /* A line from the history file can be put into the */
18 /* array member of the buffer. */
19 /* Also test for the top and bottom of the history file. */
22 /* Move up in history list. */
31 /* Move down in history list. */
39 /* Move cursor to left. */
47 /* Move cursor to right. */
77 /* Find if a number is in a given range. */
78 int range(int rstart, int rend, int i)
80 if ( (rstart <= i) && (i <= rend) ) return 1;
86 /* Assign a type depending on the range that a */
92 if ( range(0, 9, i) == 1 ) ret = 1;
93 else if ( range(10, 10, i) == 1 ) ret = 2;
94 else if ( range(27, 27, i) == 1 ) ret = 3;
95 else if ( range(32, 126, i) == 1 ) ret = 4;
96 else if ( range(127, 127, i) == 1 ) ret = 5;
104 /* Function for special key combinations */
105 /* (Ctrl, Alt, function keys. */