| Did you know ... | Search Documentation: |
| Get methods |
<-contents
and
text_buffer<-sub
only differ in the interface. text_buffer<-sub
is compatible to char_array<-sub
and the preferred interface.
from: Start the search from this index for: Search for this string times (1): Return the nth occurrence return (start): start: first character,end: last characterexactcase (@on): @off: case does not matter wordmode (@off): @on: find whole words only
Fails silently if the requested string cannot be found. See also class regex.
<-find_all.
This method is commonly used to find fragments with a certain attribute overlapping the caret position:
...
get(TextBuffer, find_all_fragments,
and(message(@arg1, overlap, Caret),
@arg1?style == active),
Fragments),
...
See also text_buffer->for_all_fragments, text_buffer<-find_fragment.
<-find_all_fragments,
text_buffer->for_all_fragments.-size.from holds a text_buffer<-character bracket.
If no bracket is specified, the text_buffer<-character
at from is used. Specifying the bracket is useful to find the start of
the bracketed environment point is in.
start_of_compound_statement(TB, Here, Start) :-
get(TB, matching_bracket, Here, '}', Start).
If this method traps -while scanning-, a bracket mismatch (e.g.
(hello}) it will generate a mismatched_bracket error. See class error
and the predicate pce_catch_error/2.
See class syntax_table for defining brackets.
This method deals with string and comment. See text_buffer->in_string,
text_buffer->in_comment
and text_buffer<-scan.
from, scanning in the
indicated direction. Class syntax_table
defines quotes and escape sequences for quotes.->forward_word,
editor->transpose_terms,
etc. Arguments:
from Index to start scanning unit Unit to scan for times Number of units to skip (<0: backwards) return start: start of unit, end: end of unit
For example,
get(TextBuffer, scan, 200, word, 2, start, Index)
will scan two words from index 200 and return the start of the 2nd word.
The definitions of the units is determined by the associated text_buffer<-syntax.
See also text_buffer<-matching_bracket.
<-syntax
object. Scanning starts at from, which is assumed to be
outside comment and strings. The return-value is a tuple
object, whose first part is a name indicating the syntactical category
at to and whose second part denotes the start-position of
this syntactical object.
Returned syntactical categories:
See also class syntax_table, text_buffer<-skip_comment, text_buffer<-skip_layout,
text_buffer<-matching_bracket.
-sizefrom points to a layout character or the start of a
comment. Return the first location not in a comment and not whitespace.
If
skip_layout is @off,
just comment will be skipped.
See also text_buffer->in_comment
and text_buffer<-skip_layout
and class syntax_table.
See also text_buffer<-skip_comment, text_buffer<-scan, text_buffer<-find, regex->search.