_M.textadept.filter_through - Textadept API

# Textadept

- Home |
- Download |
- Lua API |
- Source |
- Language Modules |
- Stats |
- Wiki |
- Mailing List

# _M.textadept.filter_through

Filters text through shell commands.

## Functions

### `filter_through`(cmd)

Passes selected or all buffer text to string shell command cmd as standard input (stdin) and replaces the input text with the command’s standard output (stdout). Standard input is as follows:

1. If text is selected and spans multiple lines, all text on the lines containing the selection is used. However, if the end of the selection is at the beginning of a line, only the EOL (end of line) characters from the previous line are included as input. The rest of the line is excluded.
2. If text is selected and spans a single line, only the selected text is used.
3. If no text is selected, the entire buffer is used.

Parameters:

- `cmd`: The Linux, BSD, Mac OSX, or Windows shell command to filter text through.