summaryrefslogtreecommitdiff
path: root/apps/gui/gwps-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r--apps/gui/gwps-common.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index b25168f252..2cdb92d964 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1969,29 +1969,3 @@ bool gui_wps_refresh(struct gui_wps *gwps,
1969 return true; 1969 return true;
1970} 1970}
1971 1971
1972int wps_subline_index(struct wps_data *data, int line, int subline)
1973{
1974 return data->lines[line].first_subline_idx + subline;
1975}
1976
1977int wps_first_token_index(struct wps_data *data, int line, int subline)
1978{
1979 int first_subline_idx = data->lines[line].first_subline_idx;
1980 return data->sublines[first_subline_idx + subline].first_token_idx;
1981}
1982
1983int wps_last_token_index(struct wps_data *data, int line, int subline)
1984{
1985 int first_subline_idx = data->lines[line].first_subline_idx;
1986 int idx = first_subline_idx + subline;
1987 if (idx < data->num_sublines - 1)
1988 {
1989 /* This subline ends where the next begins */
1990 return data->sublines[idx+1].first_token_idx - 1;
1991 }
1992 else
1993 {
1994 /* The last subline goes to the end */
1995 return data->num_tokens - 1;
1996 }
1997}