EditorSetParameter

Far Manager

EditorSetParameter

The EditorSetParameter structure is used in the EditorControl function to change the settings of the current FAR editor.
struct EditorSetParameter
{
  int Type;
  union {
    int iParam;
    char *cParam;
    DWORD Reserved1;
  } Param;
  DWORD Flags;
  DWORD Reserved2;
};

Elements

Type
Which setting to change. Can have one of the following values (the EDITOR_SETPARAMETER_TYPES enum):
OptionDescription
ESPT_AUTOINDENT Sets the "Auto indent" mode according to iParam=TRUE or FALSE.
ESPT_CHARCODEBASE Display format of the current character code in the editor status line. iParam can have one of the following values:
  • 0 - octal (3 characters with leading zeros)
  • 1 - decimal (3 characters with leading spaces)
  • 2 - hexadecimal (2 digits + the character 'h')
ESPT_CHARTABLE Sets the current character table in the editor. The value of iParam can be:
  • 1 - OEM
  • 2 - ANSI
  • 3 - character table with the index 0
  • ...
  • N - character table with the index (N-3)
In case of an error, FALSE is returned by EditorControl and the character table is not changed.
ESPT_CURSORBEYONDEOL Sets the "Cursor beyond end of line" mode according to iParam=TRUE or FALSE.
ESPT_EXPANDTABS Controls the behaviour of tabs to spaces convertion.
iParam can be one of the following flags (EXPAND_TABS enum):
FlagDescription
EXPAND_NOTABS
EXPAND_ALLTABS
EXPAND_NEWTABS

Attention! Attention!

  • This operation is not reversible; that is, if a file contained tabs instead of spaces, the sequences of spaces in the file will not be converted to tabs when the "Expand tabs to spaces" mode is disabled.
ESPT_LOCKMODE Prohibit or allow user to modify the text in the editor (similar to Ctrl-L) according to iParam=TRUE or FALSE.
ESPT_SAVEFILEPOSITION Sets the "Save file position" option according to iParam=TRUE or FALSE.
ESPT_SETWORDDIV Changes the word delimiter set (using the cParam field) for the current editor instance.
If cParam is NULL or the empty string, the default delimiter set - "~!%^&*()+|{}:"<>?`-=\[];',./" - is used. The word delimiter set cannot contain more than 255 characters.
ESPT_GETWORDDIV Retrieves the word delimiter set (using the cParam field) for the current editor instance.
cParam should point to a buffer of at least 256 characters.
ESPT_TABSIZE Changes the tabsize. iParam is the new value - between 1 and 512. If iParam is out of range, tabsize is set to 8.
iParam
Contains a numeric setting; see the description of the individual settings.
cParam
Contains a pointer to a null-terminated text string; see the description of individual settings.
Reserved1
Not used; reserved for future use.
Flags
Contains additional flags or data; see the description of individual settings.
Reserved2
Not used; reserved for future use. Must be set to 0.

Remarks

If a plugin changes the values of the "Tabsize" and "Expand tabs to spaces" parameters at the same time, it is recommended to set the tabsize first and then set the "Expand tabs to spaces" mode.
See also: