editor.GetString

LuaFAR 3

editor.GetString


Note:
  This function is an extension over its prototype in Far API.

LineInfo = editor.GetString (EditorId, StringNumber, Mode)
    or
StringText, StringEOL = editor.GetString (EditorId, StringNumber, Mode)

Parameters:
  EditorId:     integer (default=CURRENT_EDITOR)
  StringNumber: integer, 1-based (default=0)
  Mode:         integer (0,1,2,3; default=0)

Returns:
  LineInfo: table (Mode<2), or 2 strings (Mode>=2), or nil
    fields of LineInfo:
      StringNumber: integer, 1-based
      StringText:   string
      StringEOL:    string
      StringLength: integer
      SelStart:     integer, 1-based
      SelEnd:       integer, 1-based

Description:
  The function's behavior depends on its Mode argument:
  Mode:  0 = returns: table LineInfo;        changes current position: no
         1 = returns: table LineInfo;        changes current position: yes
         2 = returns: StringText,StringEOL;  changes current position: yes
         3 = returns: StringText,StringEOL;  changes current position: no

  Modes 1 and 2 have a side effect: the current line position in the Editor
  is set to StringNumber.

Far API used:
  EditorControl, ECTL_GETINFO, ECTL_SETPOSITION, ECTL_GETSTRING