/
luafar_manual.tsi
12234 lines (12234 loc) · 282 KB
/
luafar_manual.tsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<header>
tag=SMZ1
ver=2.7
</header>
<node>
id=91
lv=0
dt=Text
nm=Manual of LuaFAR 3
mtime=3652173155
<article>
#_<markdown>
#_### Brief description of LuaFAR package
#_
#_This package's purpose is to facilitate writing plugins for FAR in Lua programming language. The package provides source code for **`luafar3.dll`** (main product) and a **`luaplug.dll`** ("generic" plugin).
#_
#_`luafar3.dll` allows:
#_
#_* To program functions exported by the plugin in Lua: e.g., the function `OpenW` should be named [`export.Open`](109.html) in the Lua program, the same goes for all functions exported by the plugin.
#_
#_* To call FAR service functions from a Lua program. The service functions are placed in the `far`, `editor`, `viewer`, `panel` and `regex` tables, and their names aren't identical to the names of the respective FAR API functions. For instance, function `EditorControl` with parameter `ECTL_GETINFO` will be named [`editor.GetInfo`](29.html) in Lua programs.
#_
#_* **Note:** the functions of the Unicode LuaFAR library assume string arguments and string return values to be in the **UTF-8** encoding. (There are a few exceptions from this rule, mostly when strings are used to exchange binary data).
#_
#_Currently, the documentation on LuaFAR API is incomplete and may be somewhat inaccurate. When in doubt, consult the source code. The API may change in the future.
#_
#_As `luafar3.dll` itself is not a plugin, it should not be placed in the `%FARHOME%\Plugins` subtree (instead, place it in any directory listed in `PATH`). The usual way of using `luafar3.dll` is to create a wrapper plugin that redirects FAR's calls of the exported functions to `luafar3.dll`, that in turn calls the functions written in Lua. This way, one instance of `luafar3.dll` can "serve" arbitrary number of plugins at the same time. An example of "wrapper plugin" is `luaplug.dll` (its source code is part of this package).
#_
#_There are two Lua files that must be present in plugin's DLL directory:
#_
#_1. **`_globalinfo.lua`** (it should only contain the function
#_ [`export.GetGlobalInfo`](402.html)).<br>
#_ This script must not call functions from [`far`](131.html) library (e.g., `far.Message`),
#_ as they are not yet available to LuaFAR when Far calls `GetGlobalInfoW`.
#_
#_1. The starting (or "default") Lua script, that is searched in the following order (see [`LF_RunDefaultScript`](130.html) for details):
#_ 1. The plugin name with the extension `.lua` is looked for, e.g.:
#_ `luaplug.dll -> luaplug.lua`
#_ 1. If the plugin name contains a hyphen, then its part preceding the last
#_ hyphen is looked for, e.g.: `luaplug-x64.dll -> luaplug.lua`.
#_
#_When the starting script is run it receives one boolean argument:
#_
#_ - `true` - on its first run and after Lua state was [recreated](495.html)
#_ - `false` - on subsequent runs caused by setting
#_ [`far.ReloadDefaultScript`](173.html) `=` `true`.
#_
#_@@@
#_{ectl_getinfo}: http://api.farmanager.com/ru/service_functions/editorcontrol.html#ECTL_GETINFO
#_{editorcontrol}: http://api.farmanager.com/ru/service_functions/editorcontrol.html
#_{getglobalinfow}: http://api.farmanager.com/ru/exported_functions/getglobalinfow.html
#_{openw}: http://api.farmanager.com/ru/exported_functions/openw.html
#_
</article>
</node>
<node>
id=329
lv=1
dt=Text
nm=Flags
ctime=3480257526
mtime=3602510587
<article>
#_<markdown>
#_
#_As Far API makes wide use of named integer constants, there is a necessity to represent those constants in Lua. LuaFAR keeps the names and values of the constants in tables. Most constants are embedded into LuaFAR, in the tables [`far.Flags`](57.html) and [`far.Colors`](437.html).
#_
#_This manual uses the term **flags** for both a single constant contained in the table `far.Flags`, and for the [bitwise OR](405.html) of two or more such constants.
#_
#_When some function parameter in this manual is denoted as *flags*, it can be supplied from Lua as either an integer, a string (when a combination consists of one flag), or a table, with keys corresponding to constants' names and having non-false values.
#_
#_#### Example 1 (single flag)
#_The following 2 calls are equivalent:
#_ (1) editor.UndoRedo(nil, F.EUR_UNDO) -- where F=far.Flags
#_ (2) editor.UndoRedo(nil, "EUR_UNDO")
#_
#_#### Example 2 (flags combination)
#_The 7-th parameter to function [`editor.Editor`](21.html) can be
#_supplied from Lua in the following equivalent forms:
#_ (1) bit64.bor(F.EF_NONMODAL, F.EF_IMMEDIATERETURN, ....)
#_ (2) { EF_NONMODAL=1, EF_IMMEDIATERETURN=1, .... }
#_
#_@@@
#_{ef_immediatereturn}: http://api.farmanager.com/ru/service_functions/editor.html#EF_IMMEDIATERETURN
#_{ef_nonmodal}: http://api.farmanager.com/ru/service_functions/editor.html#EF_NONMODAL
#_
</article>
</node>
<node>
id=336
lv=1
dt=Text
nm=Unicode support
ctime=3480525243
mtime=3631634304
<article>
#_<markdown>
#_
#_### Passing string arguments and returning string values
#_
#_The functions of the Unicode LuaFAR library assume string
#_arguments and string return values to be in the **UTF-8**
#_encoding. (There are a few exceptions from this rule, mostly
#_when strings are used to exchange binary data).
#_
#_### Calling functions on strings with colon syntax
#_
#_LuaFAR modifies the `__index` field of the strings metatable
#_to point to `unicode.utf8` table of [Selene Unicode](250.html)
#_library, rather than to `string` table.<br>
#_That means `("abc"):match("b")` is equivalent to `unicode.utf8.match("abc", "b")`
#_rather than to `string.match("abc", "b")`.<br>
#_Operator # is not affected by this change.
#_
#_### Unicode-capable Lua libraries and functions
#_
#_The following standard Lua libraries and functions were modified by LuaFAR
#_in order to work with file names and paths in UTF-8 encoding:
#_
#_* `io`
#_* `dofile`
#_* `loadfile`
#_* `require`
#_* `package.loadlib`
#_
#_### Unicode-capable functions using Windows API
#_
#_* [`win.CopyFile`](360.html)
#_* [`win.CreateDir`](372.html)
#_* [`win.DeleteFile`](361.html)
#_* [`win.GetEnv`](152.html)
#_* [`win.GetFileAttr`](433.html)
#_* [`win.GetFileInfo`](213.html)
#_* [`win.MoveFile`](362.html)
#_* [`win.RemoveDir`](373.html)
#_* [`win.RenameFile`](363.html)
#_* [`win.SearchPath`](429.html)
#_* [`win.SetEnv`](192.html)
#_* [`win.SetFileAttr`](434.html)
#_* [`win.ShellExecute`](428.html)
#_* [`win.SHGetFolderPath`](440.html)
#_* [`win.system`](508.html)
#_
</article>
</node>
<node>
id=214
lv=1
dt=Text
nm=Generic LuaFAR plugin
mtime=3624032846
<article>
#_<markdown>
#_
#_There are two files in the LuaFAR distribution (**`luaplug.c`** and **`luaplug.mak`**) that do not participate in the build of LuaFAR DLL, they comprise the "generic LuaFAR plugin". It is called generic, since most of a LuaFAR plugin functionality is contained in its Lua part, and its C-part is more or less the same for most LuaFAR plugins.
#_
#_- [Customizing the generic plugin](494.html)
#_- [Recreation of the Lua virtual machine](495.html)
#_- [Extra exported functions](500.html)
#_- [Other functions](502.html)
#_
</article>
</node>
<node>
id=494
lv=2
dt=Text
nm=Customizing the generic plugin
ctime=3612528153
mtime=3675075603
<article>
#_<markdown>
#_
#_The easiest way to build a LuaFAR plugin DLL is via `luaplug.mak`
#_makefile (MinGW is required). This makefile can be used either directly or included in another makefile. It accepts the following parameters:
#_
#_- **`TARGET`** - name of the resulting DLL, e.g.: "`TARGET = helloworld.dll`".
#_
#_- **`FAR_EXPORTS`** - list of functions that should be exported by the plugin (in uppercase, whitespace-separated, final letter `W` removed), e.g.:<br>
#_ "`FAR_EXPORTS = OPEN PROCESSEDITORINPUT`".<br>
#_The following functions are always exported, so there's no need to include them in the list:
#_`GetGlobalInfoW`, `SetStartupInfoW`, `GetPluginInfoW`, `ExitFARW` and `ProcessSynchroEventW`.
#_
#_- **`FARDIR`** - the root directory of Far Manager source tree, e.g. "`FARDIR = C:\farmanager`".
#_
#_- **`MYCFLAGS`** - list of additional compilation flags
#_
#_- **`MYLDFLAGS`** - list of additional linking-stage flags
#_
#_@@@
#_{exitfarw}: http://api.farmanager.com/ru/exported_functions/exitfarw.html
#_{getglobalinfow}: http://api.farmanager.com/ru/exported_functions/getglobalinfow.html
#_{getplugininfow}: http://api.farmanager.com/ru/exported_functions/getplugininfow.html
#_{processsynchroeventw}: http://api.farmanager.com/ru/exported_functions/processsynchroeventw.html
#_{setstartupinfow}: http://api.farmanager.com/ru/exported_functions/setstartupinfow.html
#_
#_
</article>
</node>
<node>
id=511
lv=2
dt=Text
nm=luafar_init.lua
ctime=3639761849
mtime=3639831155
<article>
#_<markdown>
#_
#_If the file `%FARPROFILE%\luafar_init.lua` exists it is executed before the first run of
#_the plugin's default script.<br>
#_It is also executed when the Lua state is [recreated][1].<br>
#_It is **not** executed when the default script is reloaded due to `far.ReloadDefaultScript == true`.
#_
#_### Note
#_This feature is disabled by default. To enable it, add `-DRUN_LUAFAR_INIT` to compilation flags.
#_
#_See also:<br>
#_[`LF_LuafarInit`](510.html)<br>
#_[`LF_RunDefaultScript`](130.html)<br>
#_[`LF_Open`](173.html)<br>
#_
#_[1]: 495.html
#_
#_@@@
#_{setstartupinfow}: http://api.farmanager.com/ru/exported_functions/setstartupinfow.html
#_
</article>
</node>
<node>
id=495
lv=2
dt=Text
nm=Recreation of the Lua virtual machine
ctime=3612528168
mtime=3653914601
<article>
#_<markdown>
#_
#_It is possible to "recreate" the Lua virtual machine (`lua_State`), used by the plugin, i.e: to close the current one and create a new one.
#_
#_* In order to do that the global variable `RecreateLuaState` should be
#_ assigned a true value.
#_* The analysis of `RecreateLuaState` and the virtual machine recreation
#_ are conducted in the `OpenW` plugin's exported function, just before
#_ returning control to Far Manager.
#_* Prior to the virtual machine recreation the [`LF_ExitFAR`](162.html)
#_ function is called.
#_* After the virtual machine is recreated all actions that normally occur
#_ when Far Manager loads a LuaFAR plugin are conducted, including running
#_ the plugin's "starting" Lua script (which in this case receives `true`
#_ as an argument).
#_* After the virtual machine is recreated the global variable `IsLuaStateRecreated`
#_ is set to true.
#_
</article>
</node>
<node>
id=500
lv=2
dt=Text
nm=Extra exported functions
ctime=3624032175
mtime=3624032175
<article>
</article>
</node>
<node>
id=501
lv=3
dt=Text
nm=GetLuaState
ctime=3624032286
mtime=3624038104
<article>
#_<markdown>
#_
#_`lua_State* GetLuaState()`
#_
#_Returns the current main `lua_State` of the plugin.
#_
#_Do not store the returned value for further use, as it may be invalidated by [recreation][1]. Instead, call this function again whenever needed.
#_
#_[1]: 495.html
#_
</article>
</node>
<node>
id=496
lv=3
dt=Text
nm=luaopen_luaplug
ctime=3612528187
mtime=3612535539
<article>
#_<markdown>
#_
#_Some libraries (e.g. `rings`) can create additional `lua_State` instances from Lua scripts. To initialize those instances with libraries included in LuaFAR (`far`, `bit64`, `win`, `unicode`), call `luaopen_luaplug()` passing it the `lua_State*` to be initialized.
#_
#_This function is also accessible from Lua as the global variable `_luaplug`.
#_It is NOT intended to be called from the running `lua_State` but rather to be passed
#_to another `lua_State` for its initialization.
#_
#_Alternatively, this function can be loaded via `package.loadlib` as in the following example.
#_
#_**Example:**
#_ local rings = require "rings"
#_ local r1 = rings.new()
#_ r1:dostring([[
#_ local modname = ...
#_ assert(package.loadlib(modname, "luaopen_luaplug"))()
#_ far.Message ("Hello world", "Called from a ring")
#_ ]], far.PluginStartupInfo().ModuleName)
#_
#_**Note:**<br>
#_After replacing the standard Lua 5.1 DLL with one from LuaJIT 2.0, this example has stopped working. The issue is investigated.
#_
</article>
</node>
<node>
id=502
lv=2
dt=Text
nm=Other functions
ctime=3624032810
mtime=3624032810
<article>
</article>
</node>
<node>
id=503
lv=3
dt=Text
nm=GetPluginStartupInfo
ctime=3624032892
mtime=3624033776
<article>
#_<markdown>
#_
#_`struct PluginStartupInfo* GetPluginStartupInfo()`
#_
#_This helper function is needed when the plugin consists of more than one C-file. It gives access to Far API functions to files other than `luaplug.c`.
#_
#_(The same could be achieved by making the struct accessible, but it is not.)
#_
</article>
</node>
<node>
id=149
lv=0
dt=Text
nm=What's new in this version
mtime=3541947364
<article>
#_<markdown>
#_
</article>
</node>
<node>
id=400
lv=1
dt=Text
nm=Version 2.8.0
ctime=3505938627
mtime=3505938647
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`far.GetDriveType`](398.html)
#_1. [`far.GetLogicalDriveStrings`](397.html)
#_
#_###Extended functions
#_1. [`far.AdvControl`](153.html): `ACTL_KEYMACRO`: field `AKey` added
#_1. [`far.GetPluginInfo`](105.html): field `SysId` added.
#_1. [`far.OpenPlugin`](109.html): handles `OPEN_FROMMACRO`
#_1. [`far.PluginsControl`](334.html): `PCTL_FORCEDLOADPLUGIN` added.
#_1. [`far.SendDlgMessage`](71.html): (a) `DM_LISTGETDATA` fixed,
#_ (b) `DM_LISTSETDATA` implemented.
#_
#_###Bug fixes
#_1. [`far.DialogRun`](379.html): errors in the dialog procedure
#_ were ignored (did not prevent the script from normal run flow).
#_1. [`far.SetRegKey`](73.html): data corruption with
#_ `(DataType=="string")`.
#_
#_@@@
#_{dm_listgetdata}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_listgetdata.html
#_{dm_listsetdata}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_listsetdata.html
#_{open_frommacro}: http://api.farmanager.com/ru/structures/openinfo.html#OPEN_FROMMACRO
#_{pctl_forcedloadplugin}: http://api.farmanager.com/ru/service_functions/pluginscontrol.html#PCTL_FORCEDLOADPLUGIN
#_
</article>
</node>
<node>
id=396
lv=1
dt=Text
nm=Version 2.7.0
ctime=3504008153
mtime=3612528603
<article>
#_<markdown>
#_
#_* The first LuaFAR version that compiles for both 32
#_ and 64-bit DLLs.
#_* Generic plugin [customization](494.html):
#_ added a new parameter `ENV_PREFIX`.
#_* Source code: all C++ files were rewritten in C.
#_
#_###Added functions
#_1. [`far.CtrlSetCaseSensitiveSort`](395.html)
#_1. [`far.EnumSystemCodePages`](394.html)
#_1. [`far.GetACP`](391.html)
#_1. [`far.GetCPInfo`](393.html)
#_1. [`far.GetOEMCP`](392.html)
#_
#_###Extended functions
#_1. [`far.SendDlgMessage`](71.html): `DM_GETCONSTTEXTPTR` added.
#_1. [`far.MultiByteToWideChar`](370.html): *flags* parameter added.
#_1. [`LF_RunDefaultScript`](130.html): plugin DLL's name can have a suffix that is ignored in searching the default script.
#_
#_###Modified functions
#_1. Implementation of [`far.OemToUtf8`](256.html) and [`far.Utf8ToOem`](257.html) changed.
#_
#_###Bug fixes
#_1. Fixes related to 64-bit compilation.
#_
#_@@@
#_{dm_getconsttextptr}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_getconsttextptr.html
#_
</article>
</node>
<node>
id=387
lv=1
dt=Text
nm=Version 2.6.0
ctime=3499339019
mtime=3612528784
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`regex:gsub`](386.html)
#_1. [`LF_InitLuaState`](385.html)
#_1. [`luaopen_luaplug`](496.html)
#_
#_###Modified functions
#_1. [`far.Editor`](21.html) -- default values for `StartLine`, `StartChar` made `-1` (was: `0`).
#_1. [`far.GetPluginInfo`](105.html) -- field `DiskMenuNumbers` removed from the returned table, as it does not exist in Far builds `>= 2.0.1692`.
#_
#_
</article>
</node>
<node>
id=383
lv=1
dt=Text
nm=Version 2.5.0
ctime=3492942340
mtime=3498897310
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`far.CtrlGetPanelFormat`](381.html)
#_1. [`far.CtrlGetPanelHostFile`](382.html)
#_1. [`far.DialogInit`](378.html)
#_1. [`far.DialogRun`](379.html)
#_1. [`far.DialogFree`](380.html)
#_1. [`regex:bracketscount`](377.html)
#_
#_###Extended functions
#_1. [`far.AdvControl`](153.html) -- added `ACTL_PROGRESSNOTIFY`.
#_
#_###Modified functions
#_1. All [reqular expression functions](273.html) renamed to lower case.
#_1. [`far.gsub`](270.html) - "invalid capture number" error in the
#_ replace pattern is detected before entering the search/replace loop.
#_1. [`LF_RunDefaultScript`](130.html) - better error handling.
#_
#_###Bug fixes
#_1. [`far.gsub`](270.html) - fix crash (poorly handled `%` at the end
#_ of the replace string).
#_1. [`far.GetDlgItem`](54.html), [`far.SendDlgMessage`](71.html)
#_ (`DM_GETDLGITEM`) - fix crash with invalid item number.
#_
#_###Misc
#_1. `LF_GetMinFarVersionW` function is removed.
#_2. New setting `MINFARVERSION` in the [generic plugin's](214.html)
#_ makefile.
#_
#_@@@
#_{actl_progressnotify}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_PROGRESSNOTIFY
#_{dm_getdlgitem}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_getdlgitem.html
#_
</article>
</node>
<node>
id=375
lv=1
dt=Text
nm=Version 2.4.0
ctime=3489519174
mtime=3489519189
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`far.MultiByteToWideChar`](370.html)
#_1. [`far.CreateDir`](372.html) (works with UTF-8 names)
#_1. [`far.RemoveDir`](373.html) (works with UTF-8 names)
#_
#_###Extended functions
#_1. [`far.EditorSetParam`](140.html) - 2-nd parameter can be boolean.
#_
#_###Modified functions
#_1. [`far.ViewerSetPosition`](142.html) - actual value of `StartPos`
#_ is returned (number; was: boolean).
#_
#_###Bug fixes
#_1. [`far.EditorSetParam`](140.html) - `ESPT_GETWORDDIV` did not work.
#_1. [`far.AdvControl`](153.html) - `ACTL_GETSYSWORDDIV` did not work.
#_
#_###Misc
#_1. Version information is embedded into the DLL (`.rc` file added).
#_
#_@@@
#_{espt_getworddiv}: http://api.farmanager.com/ru/structures/editorsetparameter.html#ESPT_GETWORDDIV
#_
</article>
</node>
<node>
id=369
lv=1
dt=Text
nm=Version 2.3.0
ctime=3487755221
mtime=3487755239
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`far.GetConsoleScreenBufferInfo`](359.html)
#_1. [`far.Timer`](346.html)
#_1. [`far.GetCustomData`](364.html) (experimental)
#_1. [`far.CopyFile`](360.html) (works with UTF-8 names)
#_1. [`far.DeleteFile`](361.html) (works with UTF-8 names)
#_1. [`far.MoveFile`](362.html) (works with UTF-8 names)
#_1. [`far.RenameFile`](363.html) (works with UTF-8 names)
#_
#_###Extended functions
#_1. [`far.Message`](65.html) - standard button combinations supported.
#_1. [`far.AdvControl`](153.html) - added `ACTL_GETFARRECT`,
#_ `ACTL_GETCURSORPOS`, `ACTL_SETCURSORPOS`.
#_
#_###Modified functions
#_1. [`far.Editor`](21.html) - autodetect code page if not specified.
#_1. [`far.Viewer`](77.html) - autodetect code page if not specified.
#_1. [`far.EditorGetSelection`](30.html) - API (table fields) changed.
#_
#_###Bug fixes
#_1. [`far.EditorGetString`](31.html) - work with strings containing
#_ nuls.
#_1. [`far.Gsub`](270.html) - fix crash (a missing `lua_pop` call).
#_1. [`far.Gsub`](270.html) - fix ignoring errors in replace function.
#_1. [`far.Message`](65.html) - fix to work with Far 2.0 builds 1564+.
#_1. [`far.SendDlgMessage`](71.html) (`DM_LISTGETCURPOS`) - returned
#_ `nil` when `SendDlgMessage` returned `0`.
#_1. [`far.ViewerSetPosition`](142.html) - fix case with extra
#_ arguments.
#_
#_@@@
#_{actl_getcursorpos}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_GETCURSORPOS
#_{actl_getfarrect}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_GETFARRECT
#_{actl_setcursorpos}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_SETCURSORPOS
#_{dm_listgetcurpos}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_listgetcurpos.html
#_{senddlgmessage}: http://api.farmanager.com/ru/service_functions/senddlgmessage.html
#_
</article>
</node>
<node>
id=345
lv=1
dt=Text
nm=Version 2.2.0
ctime=3482049351
mtime=3482049368
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`far.CtrlClearSelection`](330.html)
#_1. [`far.CtrlGetCmdLineSelection`](331.html)
#_1. [`far.CtrlIsActivePanel`](320.html)
#_1. [`far.CtrlSetCmdLineSelection`](332.html)
#_1. [`far.LoadFile`](338.html)
#_1. [`far.LoadLib`](342.html)
#_1. [`far.PluginsControl`](334.html)
#_1. [`far.ProcessSynchroEvent`](319.html)
#_1. [`far.Require`](343.html)
#_1. [`far.XLat`](335.html)
#_1. [File Filter Control](322.html) - a function and 4 methods
#_1. [`uio`](344.html) library
#_
#_###Extended functions
#_1. [`far.AdvControl`](153.html) - `ACTL_KEYMACRO` -
#_ added support for `MCMD_CHECKMACRO`
#_1. [`far.AdvControl`](153.html) - `ACTL_SYNCHRO` added
#_1. [`far.OpenFilePlugin`](108.html) - return value `-2`
#_ is passed on to Far unchanged (see Far API)
#_1. [`far.OpenPlugin`](109.html) - return value `0` is passed
#_ on to Far unchanged (see Far API)
#_1. [`far.ProcessDialogEvent`](221.html) - second return added
#_1. [`far.SendDlgMessage`](71.html) - `DM_GETDIALOGINFO` added
#_
#_###Modified functions
#_1. [`far.CtrlGetCmdLinePos`](6.html) - position made 1-based
#_1. [`far.CtrlSetCmdLinePos`](12.html) - position made 1-based
#_1. [`far.EditorSetTitle](45.html) - `nil` argument is allowed
#_1. [`far.ProcessKey`](114.html) - API changed: made closer to Far API
#_1. [`far.SendDlgMessage`](71.html): changed return values for
#_ `DM_RESIZEDIALOG` and `DM_MOVEDIALOG`.
#_1. [`LF_LuaOpen`](129.html) - API changed: type of the 3-rd parameter
#_1. [Regular expression](273.html) functions: the optimisation stage
#_ is skipped now, as it is too slow.
#_
#_@@@
#_{actl_synchro}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_SYNCHRO
#_{dm_getdialoginfo}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_getdialoginfo.html
#_{dm_movedialog}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_movedialog.html
#_{dm_resizedialog}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_resizedialog.html
#_
</article>
</node>
<node>
id=317
lv=1
dt=Text
nm=Version 2.1.0
ctime=3478898780
mtime=3478898797
<article>
#_<markdown>
#_
#_###Added functions
#_1. [`far.ConvertPath`](284.html)
#_1. [`far.EditorUndoRedo`](283.html)
#_1. [`far.GetVirtualKeys`](315.html)
#_1. [`far.MakeMenuItems`](280.html)
#_1. [`far.Show`](282.html)
#_
#_###Extended functions
#_1. [`far.AdvControl`](153.html) -- commands `ACTL_QUIT`,
#_ `ACTL_SETPROGRESSSTATE` and `ACTL_SETPROGRESSVALUE` added.
#_1. [`far.Dialog`](20.html) -- more conforming processing of the
#_ following events:
#_ [`DN_CTLCOLORDLGLIST`](286.html), [`DN_DRAWDLGITEM`](287.html),
#_ [`DN_EDITCHANGE`](288.html), [`DN_GETDIALOGINFO`](305.html),
#_ [`DN_HELP`](289.html), [`DN_MOUSECLICK`](290.html),
#_ [`DN_MOUSEEVENT`](291.html), [`DN_RESIZECONSOLE`](292.html).
#_1. [`far.Menu`](64.html) -- *checked* property of a menu item can
#_ be a string (only its first character is used).
#_
#_###Modified functions
#_1. [`LF_LuaOpen`](129.html)
#_
#_@@@
#_{actl_quit}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_QUIT
#_{actl_setprogressstate}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_SETPROGRESSSTATE
#_{actl_setprogressvalue}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_SETPROGRESSVALUE
#_
</article>
</node>
<node>
id=281
lv=1
dt=Text
nm=Version 2.0.1
ctime=3476605589
mtime=3476605606
<article>
#_<markdown>
#_
#_1. **Selene Unicode** library: fixed a serious bug in the
#_ function `gmatch`.
#_
</article>
</node>
<node>
id=278
lv=1
dt=Text
nm=Version 2.0.0
ctime=3476017157
mtime=3476017221
<article>
#_<markdown>
#_
#_This is the first release of the **Unicode LuaFAR** -
#_intended for use by plugins working with Unicode Far (Far 2.0).
#_
</article>
</node>
<node>
id=255
lv=2
dt=Text
nm=What's new in Unicode version
<article>
#_<markdown>
#_
#_### Passing string arguments and returning string values
#_
#_The functions of the Unicode LuaFAR library assume string
#_arguments and string return values to be in the **UTF-8**
#_encoding. (There are a few exceptions from this rule, mostly
#_when strings are used to exchange binary data).
#_
#_### Removed functions
#_
#_1. `far.ConvertNameToReal`
#_1. `far.CtrlGetPanelShortInfo`
#_1. `far.DetectCharTable`
#_1. `far.EditorEditorToOEM`
#_1. `far.EditorLower`
#_1. `far.EditorOEMToEditor`
#_1. `far.EditorStrCmp`
#_1. `far.EditorStriCmp`
#_1. `far.EditorUpper`
#_1. `far.ExpandEnvironmentStr`
#_1. `far.GetCharTable`
#_
#_### Changed structures and functions
#_
#_1. [`FindData`](90.html)
#_1. [`PluginPanelItem`](85.html)
#_1. [`ViewerInfo.CurMode`](133.html)
#_1. [`far.AdvControl`](153.html)
#_1. [`far.CtrlGetPanelInfo`](7.html)
#_1. [`far.CtrlSetSelection`](14.html)
#_1. [`far.CtrlSetSortOrder`](148.html)
#_1. [`far.Editor`](21.html)
#_1. [`far.EditorGetInfo`](29.html)
#_1. [`far.OpenFilePlugin`](108.html)
#_1. [`far.Viewer`](77.html)
#_1. [`far.ViewerGetInfo`](132.html)
#_1. [`LF_LuaOpen`](129.html)
#_
#_### Added functions
#_
#_1. [`far.CompareString`](274.html)
#_1. [`far.CtrlGetColumnTypes`](258.html)
#_1. [`far.CtrlGetColumnWidths`](259.html)
#_1. [`far.CtrlGetCurrentPanelItem`](252.html)
#_1. [`far.CtrlGetPanelDir`](260.html)
#_1. [`far.CtrlGetPanelItem`](253.html)
#_1. [`far.CtrlGetSelectedPanelItem`](254.html)
#_1. [`far.EditorGetFileName`](261.html)
#_1. [`far.Find`](271.html)
#_1. [`far.GetCurrentDirectory`](262.html)
#_1. [`far.Gmatch`](269.html)
#_1. [`far.Gsub`](270.html)
#_1. [`far.Match`](272.html)
#_1. [`far.OemToUtf8`](256.html)
#_1. [`far.Regex`](266.html)
#_1. [`far.Utf8ToOem`](257.html)
#_1. [`far.Utf16ToUtf8`](264.html)
#_1. [`far.Utf8ToUtf16`](265.html)
#_1. [`far.wcscmp`](275.html)
#_
</article>
</node>
<node>
id=263
lv=1
dt=Text
nm=Version 1.0.1
<article>
#_<markdown>
#_
#_* [`far.CtrlGetPanelInfo`](7.html) and
#_ [`far.CtrlGetPanelShortInfo`](8.html): fields `ItemsNumber`
#_ and `SelectedItemsNumber` added to the return table.
#_* [`far.Menu`](64.html): fields `grayed` and `hidden` added to
#_ menu item.
#_* Several bug fixes.
#_
</article>
</node>
<node>
id=248
lv=1
dt=Text
nm=Version 1.0.0
mtime=3601969207
<article>
#_<markdown>
#_
#_###Important:
#_* This version of LuaFAR adds functions and constants from
#_ FAR 1.75 API, that are not present in FAR 1.70 API.
#_* LuaFAR plugins that make no use of this API will work
#_ fine under FAR 1.70. However, the library itself does no
#_ verification of whether some feature is supported by the
#_ running FAR version - it is the plugin's responsibility.
#_
#_###Changes:
#_
#_1. [Auxiliary files](154.html): *farkeys.lua* and
#_ *farcolor.lua* updated to FAR 1.75 build 2614.
#_1. [`far.AdvControl`](153.html): `ACTL_REDRAWALL` command
#_ supported.
#_1. [`far.CtrlGetUserScreen`](228.html): service function
#_ added.
#_1. [`far.EditorAddStackBookmark`](223.html): service
#_ function added.
#_1. [`far.EditorClearStackBookmarks`](224.html): service
#_ function added.
#_1. [`far.EditorDeleteStackBookmark`](225.html): service
#_ function added.
#_1. [`far.EditorGetStackBookmarks`](230.html): service
#_ function added.
#_1. [`far.EditorNextStackBookmark`](227.html): service
#_ function added.
#_1. [`far.EditorPrevStackBookmark`](226.html): service
#_ function added.
#_1. [`far.GetFlags`](57.html): added new flags, covering FAR
#_ API up to FAR 1.75 build 2614.
#_1. [`far.Message`](65.html)
#_ * new flag '`o`' added.
#_ * removed hard limit of message box sizes.
#_1. [`far.OpenPlugin`](109.html): added support for opening
#_ plugin from dialogs.
#_1. [`far.ProcessDialogEvent`](221.html): exported function
#_ added.
#_1. [`far.ProcessEditorEvent`](110.html): `EE_GOTFOCUS` and
#_ `EE_KILLFOCUS` commands supported.
#_1. [`far.ProcessViewerEvent`](127.html): `VE_GOTFOCUS` and
#_ `VE_KILLFOCUS` commands supported.
#_1. [`far.SendDlgMessage`](71.html): `DM_GETCOMBOBOXEVENT`,
#_ `DM_GETEDITPOSITION`, `DM_SETCOMBOBOXEVENT` and
#_ `DM_SETEDITPOSITION` commands supported.
#_1. [`far.ViewerSetMode`](229.html): service function added.
#_1. [`far.AdvControl`](153.html) (`ACTL_GETFARVERSION`):
#_ result can be obtained either as a string, or as 3 numbers.
#_1. [`far.LuafarVersion`](191.html):
#_ result can be obtained either as a string, or as 3 numbers.
#_
#_@@@
#_{actl_redrawall}: http://api.farmanager.com/ru/service_functions/advcontrol.html#ACTL_REDRAWALL
#_{dm_getcomboboxevent}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_getcomboboxevent.html
#_{dm_geteditposition}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_geteditposition.html
#_{dm_setcomboboxevent}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_setcomboboxevent.html
#_{dm_seteditposition}: http://api.farmanager.com/ru/dialogapi/dmsg/dm_seteditposition.html
#_{ee_gotfocus}: http://api.farmanager.com/ru/structures/processeditoreventinfo.html#EE_GOTFOCUS
#_{ee_killfocus}: http://api.farmanager.com/ru/structures/processeditoreventinfo.html#EE_KILLFOCUS
#_{ve_gotfocus}: http://api.farmanager.com/ru/structures/processviewereventinfo.html#VE_GOTFOCUS
#_{ve_killfocus}: http://api.farmanager.com/ru/structures/processviewereventinfo.html#VE_KILLFOCUS
#_
</article>
</node>
<node>
id=231
lv=1
dt=Text
nm=Version 0.9.0
mtime=3601969228
<article>
#_<markdown>
#_###Service Functions added:
#_1. [`far.DefDlgProc`](219.html)
#_
#_###FAR Standard Functions added:
#_
#_1. [`far.ConvertNameToReal`](198.html)
#_1. [`far.FarRecursiveSearch`](211.html)
#_1. [`far.GetPathRoot`](199.html)
#_1. [`far.GetReparsePointInfo`](200.html)
#_1. [`far.LIsAlpha`](201.html)
#_1. [`far.LIsAlphanum`](202.html)
#_1. [`far.LIsLower`](203.html)
#_1. [`far.LIsUpper`](204.html)
#_1. [`far.LLowerBuf`](205.html)
#_1. [`far.LUpperBuf`](206.html)
#_1. [`far.MkLink`](208.html)
#_1. [`far.MkTemp`](207.html)
#_1. [`far.TruncPathStr`](209.html)
#_1. [`far.TruncStr`](210.html)
#_
#_###Other functions added:
#_
#_1. [`far.FileTimeToSystemTime`](215.html)
#_1. [`far.GetFileInfo`](213.html)
#_1. [`far.GetSystemTime`](217.html)
#_1. [`far.GetTimeZoneInformation`](212.html)
#_1. [`far.SystemTimeToFileTime`](216.html)
#_
#_###Changes:
#_
#_1. [`FindData`](90.html) structure: some fields changed.
#_1. [`PluginPanelItem`](85.html) structure: one field changed.
#_1. [`far.Dialog`](20.html) function: changed meaning of `DlgProc`
#_ return values.
#_1. The [generic LuaFAR plugin](214.html) will export only functions
#_ listed explicitly in the makefile.
#_
#_@@@
#_{dlgproc}: http://api.farmanager.com/ru/defs/dlgproc.html
#_
</article>
</node>
<node>
id=232
lv=1
dt=Text
nm=Version 0.8.0
mtime=3601969238
<article>
#_<markdown>
#_The following new functions were added:
#_
#_1. [`far.FarInputRecordToKey`](186.html)
#_1. [`far.LStricmp`](188.html)
#_1. [`far.LStrnicmp`](189.html)
#_1. [`far.LuafarVersion`](191.html)
#_1. [`far.ProcessName`](190.html)
#_1. [`far.SetEnv`](192.html)
#_
#_The following functions were enhanced:
#_
#_1. [`far.GetRegKey`](61.html), [`far.SetRegKey`](73.html):
#_ added support of `REG_EXPAND_SZ` and `REG_MULTI_SZ` data types.
#_
#_
</article>
</node>
<node>
id=234
lv=1
dt=Text
nm=Version 0.7.2
mtime=3601969246
<article>
#_<markdown>
#_1. [`far.CPluginStartupInfo`](185.html) - new function added
#_
#_
</article>
</node>
<node>
id=236
lv=1
dt=Text
nm=Version 0.7
mtime=3601969255
<article>
#_<markdown>
#_1. [`far.SendDlgMessage`](71.html) - fixed and extended
#_ (practically all message types are supported).
#_
#_2. [`far.Dialog`](20.html) - added support for the following
#_ controls: `DI_LISTBOX` and `DI_COMBOBOX`
#_
#_@@@
#_{di_combobox}: http://api.farmanager.com/ru/dialogapi/controls/di_combobox.html
#_{di_listbox}: http://api.farmanager.com/ru/dialogapi/controls/di_listbox.html
#_
</article>
</node>
<node>
id=237
lv=1
dt=Text
nm=Version 0.6
mtime=3601969261
<article>
#_<markdown>
#_1. [`far.AdvControl](153.html) - added
#_1. [`far.GetEnv`](152.html) - added
#_1. [`far.ProcessEditorInput`](111.html) - extended
#_1. [farcolor.lua](154.html) - module added
#_1. [Lua BitOp](143.html) - library updated to version 1.0.1
#_
#_
</article>
</node>
<node>
id=238
lv=1
dt=Text
nm=Version 0.5.1
<article>
#_<markdown>
#_
#_1. Added virtual keys that formerly were not available (keys with
#_ punctuation marks).
#_
#_