| Did you know ... | Search Documentation: |
| Send methods |
->dabbrev_expandindex
[editor<-caret]
will have editor<-indentation column.
When layout characters are deleted, at least a single space remains.
Useful for realising automatic indentation and alignment of comments in syntax driven editors.
<-left_margin
is used. See also editor->align,
align_region and editor->indent_line.->align_line
to all lines in the current region (mark, caret).<-left_margin
is not zero, editor->align
the last line to editor<-left_margin.
Then append the text. If editor<-auto_newline
is @on, append
a newline too. Set the editor->caret
at the end of the buffer.
editor->print editor->insert’s
the text at the editor<-caret,
followed by a newline character if editor<-auto_newline
equals @on.
Bugs: Messy. New code should use the editor->align
and editor->format
methods.
-left_margin -auto_newline->format
and string->format
(argument specification).->insert_self_fill
detected a long line. The default implementation fills from the start of
the current line to the end of the paragraph, using the left-margin from
the current indentation.
This method is intended for redefinition in language mode to perform more mode-dependent filling such as breaking long comments, log argument lists, etc.
-fill_modetimes the indicated unit backwards. The
definition of words, sentences and paragraphs depends on the syntax_table
object associate to the editor<-text_buffer.
See also text_buffer<-scan.->kill
and editor->yank
for details on killing and yanking (cut/copy) text.->capitalise_word/editor->upcase_word
and editor->downcase_word
group, but affects the word before rather than after the editor<-caret.
Saves keystrokes when used to correct typos while entering text.<-caret
up to the end of this word. editor->capitalise_word
maps the first letter to uppercase and the remainder to lowercase.->clear.
Deletes the selection and sets the editor<-caret
to 0.<-column->compute.
Next verifies that the editor<-caret
is in the window and moves the window if necessary. Finally update the
editor<-text_cursor, editor<-margin
and editor<-scroll_bar.|event_id\C-x or \C-c as
Emacs prefix keys or CUA-mode Cut/Copy commands. The rules for this are
based on cua.el, a GNU-Emacs mode merging CUA
and Emacs by Kim F. Storm (storm@cua.dk):
<-mark_status),
map them to copy or cut..25
seconds, use map them to their Emacs prefix behaviour.
According to Kim this results in pretty normal behaviour for both
Emacs and CUA users. CUA users expect the bevahiour on the selection
only. Emacs users have some trouble with
\C-c or \C-x commands that act on the region,
but luckily these conflicts are acceptable.
The underlying behaviour is implemented by key_binding->typed.
->delete, editor->grab
and editor->kill
operate on characters in the range [from, to) (i.e. to
minus from characters). If to <
from, the arguments are first swapped. The commands may or
may not delete the range and may or may not add the deleted text to the
kill-buffer @text_kill_ring:
editor ->deleteJust deletes the text editor ->killeditor ->delete and add the deleted text to the kill ringeditor ->grabAdd the text to the kill-ring without deleting it.
See also @text_kill_ring and editor->yank.
->delete_horizontal_space
and editor->just_one_space.->just_one_space.<-mark
... editor<-caret)
to the specified case. editor->capitalise_region
will map any first letter of a word to uppercase and any other letter to
lowercase.
->upcase_regionThis method may be used to indicate a related position. For example if the user types a closing-bracket this method may be used to indicate the matching opening bracket.
Defaults: The default time to restore the caret is 0.5
seconds.
->show_caret_at
->event
succeeds. This allows for redefining event-handling on any of the parts
of the editor.->typed.->active
status.->event
to this object and return the result thereof.<-mark
with editor<-caret.
Note that commands operating on the region (the text between the two) do
not care which of the two has the lowest index.
-mark<-left_margin
and editor<-right_margin.
If justify equals @on, editor->fill
inserts spaces such that the right_margin will be straight.
Bugs: Only works properly with fixed-width fonts,
->fill_region.->fill
the specified text. The margins default to
editor<-left_margin
and editor<-right_margin.
-right_margin -left_margin<-cut_buffer
as a plain string. Respects editor<-exact_case.
If the string is found it is selected, otherwise a warning is editor->report’ed.<-caret
location. See string->format
for a description on the format specification. See also editor->appendf.times the indicated unit forwards. The
definition of words, sentences and paragraphs depends on the
syntax_table
object associate to the editor<-text_buffer.
See also
text_buffer<-scan.<-scroll_bar, editor<-image
and editor<-margin.
The minimum size is defined to be 50x20 pixels.->gosmacs_transpose
this requires a single keystroke. Using
editor->transpose_chars
this requires 3 keystrokes.-size<-indent_increment.->indent_region.<-indent_increment.<-indent_increment.->undent_region.arg
times editor<-indent_increment.
This group of methods is compatible to the Dope editor and allows for
manipulating the indentation when editing source-code. See also editor->align_line.
-indent_increment
The margin specifies the with of the text_margin
object attached to the right side used for annotations. The default is
0, attaching no annotation margin. See also editor->margin.
<-cut_buffer.
Move caret to the end.times times.
The editor->insert
method calls editor->insert_self_fill
if editor<-auto_fill_mode equals @on.
The editor->insert_self_fill
calls editor->auto_fill
if -after the insertion-, the text extends the editor<-right_margin.
Normally this fills the remainder of the paragraph. By redefining editor->auto_fill,
more specialised handling of long lines can be implemented.
-fill_mode<-exact_case)
and indicate the first hit using the selection on each
subsequent letter typed by the user. While searching, the following keys
have special meaning:
keyboard_quit Abort and revert to where search started isearch_backward isearch_forward Revert direction or search for next backward_delete_char Remove the last character from the target ESCAPE Terminate search \C-w Extend target to current word
->fill
the specified unit of text. The justify argument of editor->fill
is set to @on,
creating a straight right margin.|code<-bindings
using key_binding->function
to this object. The key_binding remains local to the receiving editor.
The method editor<-key_binding
requests the current binding (local or global) using key_binding<-function.->kill
the current region. Otherwise
editor->grab
the region.<-label_text.
The font of the label is dictated by editor.label_font.
See also editor<->show_label.->normalise.->clear Clear the editor `text_buffer ->insert_file` Insert the file contents <-file Assign the file variable ->caret: 0 Put the caret `home` `text_buffer ->modified: @off` Clear modified `text_buffer ->reset_undo` Clear undo info ->editable: Bool
If file->access
succeeds, editor->editable: @on
is invoked on the editor, otherwise editor->editable: @off.
-file<-text_buffer
if it is being freed. By default, this method will simply send object->free
to the editor, or its associated view
object.
This method may be redefined, but should either free the editor, or associate another (new) text_buffer object with the editor.
See also text_buffer->unlink.
-margin, editor<-margin_width
-icon -margin <-mark
... editor<-caret)
or [editor<-caret
.. editor<-mark)
if the caret is before the mark. The old position of the mark is pushed
in editor<-mark_ring.
If the mark is
active, it can be used for region-commands.
See also editor->set_mark, editor<-mark_ring
and editor->selection.
times newline characters. editor->newline
inserts before the caret,
editor->open_line after
the caret, so the caret remains at the same line.<-column
is used. Normally the column is maintained by class key_binding.
from resides will be the
first line displayed. See also editor->line_to_top_of_window
and
editor->recenter.
Defaults: Both arguments default to editor<-caret
->selection<-caret
to the editor<-mark.
In most cases editor->exchange_point_and_mark
is to be preferred. See also editor->set_mark.
-mark->line_number.->line_to_top_of_window,
but centers the current line on the window rather than making it the
first line.<-error_message
is not @nil,
execute it using the following arguments:
@receiver The editor <-master of the editor@arg1 The editor @arg2 the kind@arg3 The message
See visual->report
for a discussion on the reporting mechanism.
<-file
or named file. If no file is specified and editor<-file
is
@nil, this
method fails. If the file to save in exists, a backup is created using file->backup.
Next, the contents of the editor is saved into the named file. If a file
was specified, editor<-file
will be filled with the argument file.
-file<-file
if it is editor<-modified or the argument
is not
@default. If
the operation succeeds, the editor<-modified
flag is cleared. Diagnostics are reported using editor->report.
-fileone_line versions of this method, the default is to scroll
a single line. For editor->scroll_up/editor->scroll_down
the default is a screenful minus a line.
See text_buffer<-scan.
<-scroll_bar.
Normally there is no reason to deal with this method yourself. We
document it here to explain the three scrolling models used by the
editor.
If the text_buffer<-size
(i.e. the number of characters held by the
editor) is large, It determines the position and size of the scrollbar
based on character offsets.
If the size gets medium, it counts physical lines, i.e.
the number of newline characters.
If the size gets small, it computes the line-layout, including
line-heigth using the current editor<-wrap
setting. This mode provides relyable precise scrolling, but quickly gets
too costly for real-time usage.
Inherits description from: editor<-length
<-selected_fragment.
See also editor->margin_width, editor->selection_style
and class style.
->normalise
on the same range to make the selection or as much as possible thereof
visible. If to is equal to
from, no selection is visible and the editor is not
normalised.
The selection is determined by editor<-mark
and editor<-caret.
It can be in three modes as described with editor<->mark_status.
See also editor<-selected, editor<-selection, editor<-selection_start
and editor<-selection_end.
Defaults: The first argument (from) defaults to
the current start of the selection; the second (to) to the
current end of the selection.
->normalise-left_margin
-right_margin -left_margin<-mark
at editor<-caret,
starting an active selection, also called region. With an argument this
command cycles through the list marks in the editor<-mark_ring.
Programmatic access to the mark is provided by editor->mark.
-mark->editable.<-start
and editor<-view).
This method is used by
editor->electric_caret..
->electric_caret<-label_text,
one is created. Otherwise the graphical<->displayed
attribute of the label_text is used to control the visibility of the
label. The method editor->geometry
is invoked to realise the proper layout of the components of the editor
object.<-caret)
using editor->electric_caret.-size->sort-styles
-exact_case
-exact_case<-tab_stops<-text_buffer|event_id->event
to handle typing. Handles editor<-focus_function
and/or invokes key_binding->typed
on editor<-bindings.
-bindings->event.->downcase_region-size<-wrap<-element
of
@text_kill_ring. Text is inserted in the kill-ring using editor->kill
or
editor->grab.