Skip to content

Commit 21a5899

Browse files
authored
Merge branch 'FarGroup:master' into master
2 parents daeab02 + 436399a commit 21a5899

65 files changed

Lines changed: 678 additions & 313 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

enc/enc_lua/luafar_manual.tsi

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ lv=3
19061906
dt=Text
19071907
nm=actl namespace
19081908
ctime=3917945155
1909-
mtime=3939576259
1909+
mtime=3968044811
19101910
<article>
19111911
#_This is an alternative interface to FAR's advanced control commands.
19121912
#_It is shorter and more expressive, e.g. the following 2 calls do the
@@ -1937,7 +1937,7 @@ mtime=3939576259
19371937
#_ SetProgressState ACTL_SETPROGRESSSTATE
19381938
#_ SetProgressValue ACTL_SETPROGRESSVALUE
19391939
#_ Synchro ACTL_SYNCHRO
1940-
#_ Waitkey ACTL_WAITKEY
1940+
#_ WaitKey ACTL_WAITKEY
19411941
#_
19421942
#_@@@
19431943
#_{actl_commit}: $(ENC_URL)/service_functions/advcontrol.html#ACTL_COMMIT
@@ -9920,7 +9920,7 @@ lv=3
99209920
dt=Text
99219921
nm=win.GetFileTimes
99229922
ctime=3790916234
9923-
mtime=3790917671
9923+
mtime=3968140988
99249924
<article>
99259925
#_times = win.GetFileTimes (FileName)
99269926
#_
@@ -9933,12 +9933,13 @@ mtime=3790917671
99339933
#_ LastWriteTime: `bit64-userdata`
99349934
#_ LastAccessTime: `bit64-userdata`
99359935
#_ CreationTime: `bit64-userdata`
9936+
#_ ChangeTime: `bit64-userdata`
99369937
#_
99379938
#_**Note:**
99389939
#_ All time values are expressed in 100-ns intervals elapsed since 1601-01-01,00:00:00.
99399940
#_
99409941
#_**Windows API used:**
9941-
#_ CreateFile, GetFileTime
9942+
#_ CreateFile, NtQueryInformationFile
99429943
#_
99439944
#_@@@
99449945
#_[bit64-userdata]: 405.html
@@ -10154,7 +10155,7 @@ lv=3
1015410155
dt=Text
1015510156
nm=win.SetFileTimes
1015610157
ctime=3790916254
10157-
mtime=3790917726
10158+
mtime=3968141009
1015810159
<article>
1015910160
#_result = win.SetFileTimes (FileName, times)
1016010161
#_
@@ -10165,6 +10166,7 @@ mtime=3790917726
1016510166
#_ LastWriteTime: `bit64-userdata` or number
1016610167
#_ LastAccessTime: `bit64-userdata` or number
1016710168
#_ CreationTime: `bit64-userdata` or number
10169+
#_ ChangeTime: `bit64-userdata` or number
1016810170
#_
1016910171
#_**Returns:**
1017010172
#_ result: boolean
@@ -10173,7 +10175,7 @@ mtime=3790917726
1017310175
#_ All time values are expressed in 100-ns intervals elapsed since 1601-01-01,00:00:00.
1017410176
#_
1017510177
#_**Windows API used:**
10176-
#_ CreateFile, SetFileTime
10178+
#_ CreateFile, NtSetInformationFile
1017710179
#_
1017810180
#_@@@
1017910181
#_[bit64-userdata]: 405.html

extra/Addons/Macros/Edit.SyncEditorAndFindAllMenu.lua

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ local function LowerBound(N, Target, GetData, Less)
5353
end
5454
end
5555

56-
local function CoordinatesFromMenuItem(I)
57-
return Menu.GetItemExtendedData(I)
58-
end
59-
6056
local function CoordinatesLess(A, B)
6157
if A.Line ~= B.Line then return A.Line < B.Line end
6258
if A.Position ~= B.Position then return A.Position < B.Position end
@@ -112,24 +108,24 @@ end
112108
local function SetupMenuAndEditor(FarDialogEvent)
113109
local SelectPos = 1
114110
if PositionMenuOnStart then
115-
SelectPos = LowerBound(Object.ItemCount,
111+
SelectPos = LowerBound(FarDialogEvent.hDlg:send(F.DM_LISTINFO, 1).ItemsNumber,
116112
{ Line = EditorInfo.CurLine, Position = EditorInfo.CurPos, Length = 0 },
117-
CoordinatesFromMenuItem,
113+
function(I) return Menu.GetItemExtendedData(FarDialogEvent.hDlg, I) end,
118114
CoordinatesLess)
119115
FarDialogEvent.hDlg:send(F.DM_LISTSETCURPOS, 1, { SelectPos = SelectPos })
120116
end
121-
LastSeenItemData = Menu.GetItemExtendedData(SelectPos)
117+
LastSeenItemData = Menu.GetItemExtendedData(FarDialogEvent.hDlg, SelectPos)
122118
if TrackMenu then HighlighText() end
123119
end
124120

125121
local function OnInitDialog(FarDialogEvent)
126122
KeepHighlightOnExit = false
127123
EditorInfo = editor.GetInfo(nil)
128-
mf.postmacro(function() SetupMenuAndEditor(FarDialogEvent) end)
124+
SetupMenuAndEditor(FarDialogEvent)
129125
end
130126

131-
local function OnListChange()
132-
LastSeenItemData = Menu.GetItemExtendedData()
127+
local function OnListChange(FarDialogEvent)
128+
LastSeenItemData = Menu.GetItemExtendedData(FarDialogEvent.hDlg)
133129
if TrackMenu then HighlighText() end
134130
end
135131

@@ -146,7 +142,7 @@ local function OnCloseDialog(FarDialogEvent)
146142
DelColor()
147143
if FarDialogEvent.Param1 > 0 then
148144
if KeepHighlightOnExit then
149-
LastSeenItemData = Menu.GetItemExtendedData()
145+
LastSeenItemData = Menu.GetItemExtendedData(FarDialogEvent.hDlg)
150146
AddColor()
151147
end
152148
else
@@ -172,7 +168,7 @@ Event {
172168
end;
173169
action = function(Event, FarDialogEvent)
174170
if FarDialogEvent.Msg == F.DN_INITDIALOG then OnInitDialog(FarDialogEvent)
175-
elseif FarDialogEvent.Msg == F.DN_LISTCHANGE then OnListChange()
171+
elseif FarDialogEvent.Msg == F.DN_LISTCHANGE then OnListChange(FarDialogEvent)
176172
elseif FarDialogEvent.Msg == F.DN_CONTROLINPUT
177173
and FarDialogEvent.Param2.EventType == F.KEY_EVENT then OnKeyEvent(far.InputRecordToName(FarDialogEvent.Param2))
178174
elseif FarDialogEvent.Msg == F.DN_CLOSE then OnCloseDialog(FarDialogEvent)

extra/Addons/Macros/Panel.JumpToSelectedFile.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ local cyclic = true -- set false to disable cyclic jump
22

33
local is_selected = 8
44
local function JumpToSelected (from, to)
5-
for pos=from,to,from<to and 1 or -1 do
5+
for pos=from,to,to==1 and -1 or 1 do
66
if Panel.Item(0,pos,is_selected) then return Panel.SetPosIdx(0,pos) end
77
end
88
if cyclic then
99
mf.beep()
10-
JumpToSelected(APanel.ItemCount-to,to)
10+
JumpToSelected(APanel.ItemCount-to+1,to)
1111
end
1212
end
1313

far/changelog

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
--------------------------------------------------------------------------------
2+
drkns 2025-10-04 00:00:33+01:00 - build 6569
3+
4+
1. Refactoring.
5+
6+
2. More ASAN tests.
7+
8+
3. Reorganize headers.
9+
10+
--------------------------------------------------------------------------------
11+
drkns 2025-10-03 20:47:49+01:00 - build 6568
12+
13+
1. gh-1022: crash on smb share.
14+
This was already fixed in 1805 and broken again in 5838.
15+
16+
--------------------------------------------------------------------------------
17+
drkns 2025-10-03 11:10:57+01:00 - build 6567
18+
19+
1. Correction of 6549 for old OSes.
20+
21+
--------------------------------------------------------------------------------
22+
rohitab 2025-10-01 13:36:49+10:00 - build 6566
23+
24+
1. gh-1019: Enable saving find all results from modal editors.
25+
26+
--------------------------------------------------------------------------------
27+
drkns 2025-10-01 00:35:30+01:00 - build 6565
28+
29+
1. gh-1018: Cursor is missing when first console command is run with echo off.
30+
31+
2. Minor fixes.
32+
33+
--------------------------------------------------------------------------------
34+
zg 2025-09-28 23:02:00+03:00 - build 6564
35+
36+
1. Menu.GetItemExtendedData now has 1st optional parameter: dialog handle.
37+
138
--------------------------------------------------------------------------------
239
drkns 2025-09-21 18:06:25+01:00 - build 6563
340

far/common.tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ TEST_CASE("common.NullToEmpty")
8686
//----------------------------------------------------------------------------
8787

8888
#if COMPILER(GCC)
89-
#include "common/cpp.hpp"
89+
#include "common/polyfills.hpp"
9090

9191
TEST_CASE("cpp.const_return")
9292
{
Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#ifndef CPP_HPP_95E41B70_5DB2_4E5B_A468_95343C6438AD
2-
#define CPP_HPP_95E41B70_5DB2_4E5B_A468_95343C6438AD
1+
#ifndef POLYFILLS_HPP_95E41B70_5DB2_4E5B_A468_95343C6438AD
2+
#define POLYFILLS_HPP_95E41B70_5DB2_4E5B_A468_95343C6438AD
33
#pragma once
44

55
/*
6-
cpp.hpp
6+
polyfills.hpp
77
8-
Some workarounds & emulations for C++ features, missed in currently used compilers & libraries.
8+
Emulation of C++ features missing in supported compilers & libraries
99
1010
Here be dragons
1111
*/
@@ -42,46 +42,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242

4343
//----------------------------------------------------------------------------
4444

45-
#ifdef FAR_ENABLE_CORRECT_ISO_CPP_WCHAR_H_OVERLOADS
46-
// These inline implementations in gcc/cwchar are wrong and non-compilable if _CONST_RETURN is defined.
47-
namespace std
48-
{
49-
inline wchar_t* wcschr(wchar_t* p, wchar_t c)
50-
{
51-
return const_cast<wchar_t*>(wcschr(const_cast<const wchar_t*>(p), c));
52-
}
53-
54-
inline wchar_t* wcspbrk(wchar_t* s1, const wchar_t* s2)
55-
{
56-
return const_cast<wchar_t*>(wcspbrk(const_cast<const wchar_t*>(s1), s2));
57-
}
58-
59-
inline wchar_t* wcsrchr(wchar_t* p, wchar_t c)
60-
{
61-
return const_cast<wchar_t*>(wcsrchr(const_cast<const wchar_t*>(p), c));
62-
}
63-
64-
inline wchar_t* wcsstr(wchar_t* s1, const wchar_t* s2)
65-
{
66-
return const_cast<wchar_t*>(wcsstr(const_cast<const wchar_t*>(s1), s2));
67-
}
68-
69-
inline wchar_t* wmemchr(wchar_t* p, wchar_t c, size_t n)
70-
{
71-
return const_cast<wchar_t*>(wmemchr(const_cast<const wchar_t*>(p), c, n));
72-
}
73-
}
74-
75-
using std::wcschr;
76-
using std::wcspbrk;
77-
using std::wcsrchr;
78-
using std::wcsstr;
79-
using std::wmemchr;
80-
81-
#endif
82-
83-
//----------------------------------------------------------------------------
84-
8545
#if COMPILER(GCC) && !defined(_GLIBCXX_HAS_GTHREADS)
8646

8747
namespace std::this_thread
@@ -182,6 +142,7 @@ WARNING_DISABLE_MSC(4455) // 'operator operator': literal suffix identifiers tha
182142
WARNING_POP()
183143

184144
#endif
145+
185146
//----------------------------------------------------------------------------
186147

187-
#endif // CPP_HPP_95E41B70_5DB2_4E5B_A468_95343C6438AD
148+
#endif // POLYFILLS_HPP_95E41B70_5DB2_4E5B_A468_95343C6438AD

far/common/shims_post.hpp

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#ifndef SHIMS_POST_HPP_8044E77C_AF33_4C40_8C9A_59C722E54280
2+
#define SHIMS_POST_HPP_8044E77C_AF33_4C40_8C9A_59C722E54280
3+
#pragma once
4+
5+
/*
6+
shims_post.hpp
7+
8+
Workarounds for supported compilers & libraries
9+
10+
Here be dragons
11+
*/
12+
/*
13+
Copyright © 2025 Far Group
14+
All rights reserved.
15+
16+
Redistribution and use in source and binary forms, with or without
17+
modification, are permitted provided that the following conditions
18+
are met:
19+
1. Redistributions of source code must retain the above copyright
20+
notice, this list of conditions and the following disclaimer.
21+
2. Redistributions in binary form must reproduce the above copyright
22+
notice, this list of conditions and the following disclaimer in the
23+
documentation and/or other materials provided with the distribution.
24+
3. The name of the authors may not be used to endorse or promote products
25+
derived from this software without specific prior written permission.
26+
27+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
28+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
31+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
*/
38+
39+
#include "compiler.hpp"
40+
41+
#include <version>
42+
43+
//----------------------------------------------------------------------------
44+
45+
#if COMPILER(CL)
46+
47+
48+
49+
#endif
50+
51+
//----------------------------------------------------------------------------
52+
53+
#if COMPILER(GCC)
54+
55+
// These inline implementations in gcc/cwchar are wrong and non-compilable if _CONST_RETURN is defined.
56+
namespace std
57+
{
58+
inline wchar_t* wcschr(wchar_t* p, wchar_t c)
59+
{
60+
return const_cast<wchar_t*>(wcschr(const_cast<const wchar_t*>(p), c));
61+
}
62+
63+
inline wchar_t* wcspbrk(wchar_t* s1, const wchar_t* s2)
64+
{
65+
return const_cast<wchar_t*>(wcspbrk(const_cast<const wchar_t*>(s1), s2));
66+
}
67+
68+
inline wchar_t* wcsrchr(wchar_t* p, wchar_t c)
69+
{
70+
return const_cast<wchar_t*>(wcsrchr(const_cast<const wchar_t*>(p), c));
71+
}
72+
73+
inline wchar_t* wcsstr(wchar_t* s1, const wchar_t* s2)
74+
{
75+
return const_cast<wchar_t*>(wcsstr(const_cast<const wchar_t*>(s1), s2));
76+
}
77+
78+
inline wchar_t* wmemchr(wchar_t* p, wchar_t c, size_t n)
79+
{
80+
return const_cast<wchar_t*>(wmemchr(const_cast<const wchar_t*>(p), c, n));
81+
}
82+
}
83+
84+
using std::wcschr;
85+
using std::wcspbrk;
86+
using std::wcsrchr;
87+
using std::wcsstr;
88+
using std::wmemchr;
89+
90+
#endif
91+
92+
//----------------------------------------------------------------------------
93+
94+
#if COMPILER(CLANG)
95+
96+
97+
98+
#endif
99+
100+
//----------------------------------------------------------------------------
101+
102+
#endif // SHIMS_POST_HPP_8044E77C_AF33_4C40_8C9A_59C722E54280

0 commit comments

Comments
 (0)