5 * 14407 SW Teal Blvd. #C
11 /* This file contains movement functions that perform character searches */
17 static MARK (*prevfwdfn
)(); /* function to search in same direction */
18 static MARK (*prevrevfn
)(); /* function to search in opposite direction */
19 static char prev_key
; /* sought cvhar from previous [fFtT] */
21 MARK
m__ch(m
, cnt
, cmd
)
22 MARK m
; /* current position */
24 char cmd
; /* command: either ',' or ';' */
30 msg("No previous f, F, t, or T command");
36 m
= (*prevrevfn
)(m
, cnt
, prev_key
);
38 /* Oops! we didn't want to change the prev*fn vars! */
40 prevfwdfn
= prevrevfn
;
47 return (*prevfwdfn
)(m
, cnt
, prev_key
);
51 /* move forward within this line to next occurrence of key */
52 MARK
m_fch(m
, cnt
, key
)
53 MARK m
; /* where to search from */
55 char key
; /* what to search for */
66 text
= ptext
+ markidx(m
);
73 } while (*text
&& *text
!= key
);
82 /* move backward within this line to previous occurrence of key */
83 MARK
m_Fch(m
, cnt
, key
)
84 MARK m
; /* where to search from */
86 char key
; /* what to search for */
97 text
= ptext
+ markidx(m
);
104 } while (text
>= ptext
&& *text
!= key
);
113 /* move forward within this line almost to next occurrence of key */
114 MARK
m_tch(m
, cnt
, key
)
115 MARK m
; /* where to search from */
117 char key
; /* what to search for */
119 /* skip the adjacent char */
121 if (plen
<= markidx(m
))
127 m
= m_fch(m
, cnt
, key
);
139 /* move backward within this line almost to previous occurrence of key */
140 MARK
m_Tch(m
, cnt
, key
)
141 MARK m
; /* where to search from */
143 char key
; /* what to search for */
145 /* skip the adjacent char */
152 m
= m_Fch(m
, cnt
, key
);