Module modules.scite.editing
Editing commands for the scite module. There are several option variables used: PLATFORM: OS platform (linux or windows). FILE_IN: Location of the temporary file used as STDIN for various operations. FILE_OUT: Location of the temporary file that will contain output for various operations. REDIRECT: The command line symbol used for redirecting STDOUT to a file. RUBY_CMD: The command that executes the Ruby interpreter. FMTP_CMD: (Linux only) The command used for reformatting paragraphs.
Functions
| _G.OnChar (c) |
SciTE Lua OnChar extension function. |
| current_word (action) |
Selects the current word under the caret and if action indicates, delete it. |
| enclose (str) |
Encloses text in an enclosure set. |
| get_preceding_number () |
[Local function] Returns the number to the left of the caret. |
| get_sel_or_line () |
[Local function] Returns the current selection or the contents of the current line. |
| goto_ctag () |
Jumps to a buffer and location specified by a CTag selected or on the current line. |
| insert_into_kill_ring (txt) |
[Local function] Inserts text into kill_ring. |
| join_lines () |
Joins the current line with the line below, eliminating whitespace. |
| lua_exec () |
Executes the selection or contents of the current line as Lua code, replacing the text with the output. |
| move_line (direction) |
Moves the current line in the specified direction up or down. |
| reformat_paragraph () |
Reformats the selected text or current paragraph using the command FMTP_CMD. |
| ruby_exec () |
Executes the selection or contents of the current line as Ruby code, replacing the text with the output. |
| scroll_kill_ring (direction) |
[Local function] Scrolls kill_ring in the specified direction. |
| select_enclosed (str) |
Selects text in a specified enclosure. |
| select_indented_block () |
Selects indented blocks intelligently. |
| select_line () |
Selects the current line. |
| select_paragraph () |
Selects the current paragraph. |
| select_scope () |
Selects all text with the same scope/style as under the caret. |
| smart_cutcopy (action) |
Cuts or copies text ranges intelligently. |
| smart_paste (action) |
Retrieves the top item off the kill-ring and pastes it. |
| squeeze (char) |
Reduces multiple characters occurances to just one. |
| transpose_chars () |
Transposes characters intelligently. |
Tables
| char_matches |
[Local table] Character matching. |
| enclosure |
[Local table] Enclosures for enclosing or selecting ranges of text. |
| kill_ring |
[Local table] The kill-ring. |
Functions
- _G.OnChar (c)
-
SciTE Lua OnChar extension function. Matches characters specified in char_matches if the editor pane has focus.
Parameters
- current_word (action)
-
Selects the current word under the caret and if action indicates, delete it.
Parameters
-
action: Optional action to perform with selected word. If 'delete', it is deleted.
- enclose (str)
-
Encloses text in an enclosure set. If text is selected, it is enclosed. Otherwise, the previous word is enclosed. The n previous words can be enclosed by appending n (a number) to the end of the last word. When enclosing with a character, append the character to the end of the word(s). To enclose previous word(s) with n characters, append n (a number) to the end of character set. Examples: enclose this2 -> 'enclose this' (enclose in sng_quotes) enclose this2**2 -> **enclose this**
Parameters
-
str: The enclosure type in enclosure.
See also:
- get_preceding_number ()
-
[Local function] Returns the number to the left of the caret. This is used for the enclose function.
See also:
- get_sel_or_line ()
-
[Local function] Returns the current selection or the contents of the current line.
- goto_ctag ()
-
Jumps to a buffer and location specified by a CTag selected or on the current line.
- insert_into_kill_ring (txt)
-
[Local function] Inserts text into kill_ring. If it grows larger than maxn, the oldest inserted text is replaced.
Parameters
See also:
- join_lines ()
-
Joins the current line with the line below, eliminating whitespace.
- lua_exec ()
-
Executes the selection or contents of the current line as Lua code, replacing the text with the output.
- move_line (direction)
-
Moves the current line in the specified direction up or down.
Parameters
-
direction: 'up' moves the current line up, 'down' moves it down.
- reformat_paragraph ()
-
Reformats the selected text or current paragraph using the command FMTP_CMD.
- ruby_exec ()
-
Executes the selection or contents of the current line as Ruby code, replacing the text with the output.
- scroll_kill_ring (direction)
-
[Local function] Scrolls kill_ring in the specified direction.
Parameters
-
direction: The direction to scroll: 'forward' (default) or 'reverse'.
See also:
- select_enclosed (str)
-
Selects text in a specified enclosure.
Parameters
-
str: The enclosure type in enclosure. If str is not specified, matching character pairs defined in char_matches are searched for from the caret outwards.
See also:
- select_indented_block ()
-
Selects indented blocks intelligently. If no block of text is selected, all text with the current level of indentation is selected. If a block of text is selected and the lines to the top and bottom of it are one indentation level lower, they are added to the selection. In all other cases, the behavior is the same as if no text is selected.
- select_line ()
-
Selects the current line.
- select_paragraph ()
-
Selects the current paragraph. Paragraphs are delimited by two consecutive newlines.
- select_scope ()
-
Selects all text with the same scope/style as under the caret.
- smart_cutcopy (action)
-
Cuts or copies text ranges intelligently. (Behaves like Emacs.) If no text is selected, all text from the cursor to the end of the line is cut or copied as indicated by action and pushed onto the kill-ring. If there is text selected, it is cut or copied and pushed onto the kill-ring.
Parameters
-
action: The action to perform. Cut is done by default. 'copy' copies text instead.
See also:
- smart_paste (action)
-
Retrieves the top item off the kill-ring and pastes it. If an action is specified, the text is kept selected for scrolling through the kill-ring.
Parameters
-
action: If given, specifies whether to cycle through the kill-ring in normal or reverse order. A value of 'cycle' cycles through normally, 'reverse' in reverse.
See also:
- squeeze (char)
-
Reduces multiple characters occurances to just one. If char is not given, the character to be squeezed is the one under the caret.
Parameters
-
char: The character to be used for squeezing.
- transpose_chars ()
-
Transposes characters intelligently. If the carat is at the end of the current word, the two characters before the caret are transposed. Otherwise the characters to the left and right of the caret are transposed.
Tables
- char_matches
- [Local table] Character matching. Matches parentheses, brackets, braces, and quotes.
- enclosure
- [Local table] Enclosures for enclosing or selecting ranges of text. Note chars and tag enclosures are generated at runtime.
- kill_ring
- [Local table] The kill-ring.
Fields
-
maxn: The maximum size of the kill-ring.