2 * ion/mod_query/wedln-wrappers.c
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
14 * Move backward one character.
17 void wedln_back(WEdln
*wedln
)
19 edln_back(&(wedln
->edln
));
23 * Move forward one character.
26 void wedln_forward(WEdln
*wedln
)
28 edln_forward(&(wedln
->edln
));
32 * Transpose characters.
35 void wedln_transpose_chars(WEdln
*wedln
)
37 edln_transpose_chars(&(wedln
->edln
));
44 void wedln_transpose_words(WEdln
*wedln
)
46 edln_transpose_words(&(wedln
->edln
));
50 * Go to the beginning of line.
53 void wedln_bol(WEdln
*wedln
)
55 edln_bol(&(wedln
->edln
));
59 * Go to the end of line.
62 void wedln_eol(WEdln
*wedln
)
64 edln_eol(&(wedln
->edln
));
68 * Go to to end of current sequence of whitespace followed by alphanumeric
72 void wedln_skip_word(WEdln
*wedln
)
74 edln_skip_word(&(wedln
->edln
));
78 * Go to to beginning of current sequence of alphanumeric characters
79 * followed by whitespace.
82 void wedln_bskip_word(WEdln
*wedln
)
84 edln_bskip_word(&(wedln
->edln
));
88 * Delete current character.
91 void wedln_delete(WEdln
*wedln
)
93 edln_delete(&(wedln
->edln
));
97 * Delete previous character.
100 void wedln_backspace(WEdln
*wedln
)
102 edln_backspace(&(wedln
->edln
));
106 * Delete all characters from current to end of line.
109 void wedln_kill_to_eol(WEdln
*wedln
)
111 edln_kill_to_eol(&(wedln
->edln
));
115 * Delete all characters from previous to beginning of line.
118 void wedln_kill_to_bol(WEdln
*wedln
)
120 edln_kill_to_bol(&(wedln
->edln
));
124 * Delete the whole line.
127 void wedln_kill_line(WEdln
*wedln
)
129 edln_kill_line(&(wedln
->edln
));
133 * Starting from the current point, delete possible whitespace and
134 * following alphanumeric characters until next non-alphanumeric character.
137 void wedln_kill_word(WEdln
*wedln
)
139 edln_kill_word(&(wedln
->edln
));
143 * Starting from the previous characters, delete possible whitespace and
144 * preceding alphanumeric characters until previous non-alphanumeric character.
147 void wedln_bkill_word(WEdln
*wedln
)
149 edln_bkill_word(&(wedln
->edln
));
153 * Set \emph{mark} to current cursor position.
156 void wedln_set_mark(WEdln
*wedln
)
158 edln_set_mark(&(wedln
->edln
));
165 void wedln_clear_mark(WEdln
*wedln
)
167 edln_clear_mark(&(wedln
->edln
));
171 * Copy text between \emph{mark} and current cursor position to clipboard
172 * and then delete that sequence.
175 void wedln_cut(WEdln
*wedln
)
177 edln_cut(&(wedln
->edln
));
181 * Copy text between \emph{mark} and current cursor position to clipboard.
184 void wedln_copy(WEdln
*wedln
)
186 edln_copy(&(wedln
->edln
));
190 * Replace line editor contents with next entry in history if one exists.
191 * If \var{match} is \code{true}, the initial part of the history entry
192 * must match the current line from beginning to point.
195 void wedln_history_next(WEdln
*wedln
, bool match
)
197 edln_history_next(&(wedln
->edln
), match
);
201 * Replace line editor contents with previous in history if one exists.
202 * If \var{match} is \code{true}, the initial part of the history entry
203 * must match the current line from beginning to point.
206 void wedln_history_prev(WEdln
*wedln
, bool match
)
208 edln_history_prev(&(wedln
->edln
), match
);
213 * Input \var{str} in wedln at current editing point.
215 EXTL_EXPORT_AS(WEdln
, insstr
)
216 void wedln_insstr_exported(WEdln
*wedln
, const char *str
)
218 edln_insstr(&(wedln
->edln
), str
);
223 * Get line editor contents.
227 const char *wedln_contents(WEdln
*wedln
)
229 return wedln
->edln
.p
;
233 * Get current editing point.
234 * Beginning of the edited line is point 0.
238 int wedln_point(WEdln
*wedln
)
240 return wedln
->edln
.point
;
244 * Get current mark (start of selection) for \var{wedln}.
245 * Return value of -1 indicates that there is no mark, and
246 * 0 is the beginning of the line.
250 int wedln_mark(WEdln
*wedln
)
252 return wedln
->edln
.mark
;
257 * Set history context for \var{wedln}.
260 void wedln_set_context(WEdln
*wedln
, const char *context
)
262 edln_set_context(&(wedln
->edln
), context
);
267 * Get history context for \var{wedln}.
271 const char *wedln_context(WEdln
*wedln
)
273 return wedln
->edln
.context
;