Skip to content

Commit

Permalink
Merge branch 'elfmz:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
m32 authored Oct 6, 2024
2 parents 249096b + 0b7aba4 commit e9095b8
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 134 deletions.
7 changes: 7 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,10 @@ far2l uses this to resolve symlink destination when user selects plugin's item t
* `ECTL_GETTRUECOLOR` - retrieves coloring of editor like ECTL_GETCOLOR does but gets 24 RGB color using EditorTrueColor structure.

Note that all true-color capable messages extend but don't replace 'base' 16 palette colors. This is done intentionally as far2l may run in terminal that doesn't support true color palette, and in such case 24bit colors will be ignored and base palette attributes will be used instead.

### Added new flags:
* Flags to **manage markers** in **panel** from plugins API
(a la global parameters `Opt.ShowFilenameMarks` and `Opt.FilenameMarksAlign`):
- `OPIF_HL_MARKERS_NOSHOW` and `OPIF_HL_MARKERS_NOALIGN` (in `enum OPENPLUGININFO_FLAGS`);
- `PFLAGS_HL_MARKERS_NOSHOW` and `PFLAGS_HL_MARKERS_NOALIGN` (in `enum PANELINFOFLAGS`).

4 changes: 2 additions & 2 deletions NetRocks/src/PluginImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,8 @@ void PluginImpl::GetOpenPluginInfo(struct OpenPluginInfo *Info)
// fprintf(stderr, "NetRocks::GetOpenPluginInfo: '%ls' \n", &_cur_dir[0]);
// snprintf(_panel_title, ARRAYSIZE(_panel_title),
// " Inside: %ls@%s ", _dir.c_str(), _name.c_str());
Info->Flags = OPIF_SHOWPRESERVECASE;
Info->Flags = OPIF_SHOWPRESERVECASE | OPIF_USEHIGHLIGHTING;
if (_remote) {
Info->Flags |= OPIF_USEHIGHLIGHTING;
IHost::Identity identity;
_remote->GetIdentity(identity);
const auto *pi = ProtocolInfoLookup(identity.protocol.c_str());
Expand All @@ -425,6 +424,7 @@ void PluginImpl::GetOpenPluginInfo(struct OpenPluginInfo *Info)
}
}
else {
Info->Flags|= OPIF_HL_MARKERS_NOSHOW; // for site connections list always don't show markers
// for site connections list don't use current far2l panel modes
// - only name column(s) without dependence on panel Align file extensions
static struct PanelMode PanelModesArray[10] = {
Expand Down
13 changes: 13 additions & 0 deletions WinPort/src/Backend/WX/wxWinTranslations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ bool KeyTracker::RightControl() const
//////////////////////

static DWORD s_cached_led_state = 0;
#ifdef __WXOSX__
static bool s_toggle_numlock = false;
#endif

#if defined (__WXGTK__) && defined (__HASX11__)
static int X11KeyCodeLookupUncached(wxUint32 keyflags)
Expand Down Expand Up @@ -594,6 +597,11 @@ wx2INPUT_RECORD::wx2INPUT_RECORD(BOOL KeyDown, const wxKeyEvent& event, const Ke
Event.KeyEvent.dwControlKeyState|= ENHANCED_KEY;
}

#ifdef __WXOSX__
if (Event.KeyEvent.wVirtualKeyCode == VK_CLEAR && KeyDown)
s_toggle_numlock = !s_toggle_numlock;
#endif

if (KeyDown || WINPORT(GetTickCount)() - key_tracker.LastKeydownTicks() > 500) {
s_cached_led_state = WxKeyboardLedsState();
}
Expand Down Expand Up @@ -649,8 +657,13 @@ DWORD WxKeyboardLedsState()
// to use wxGetKeyState with unsupported key causes assert callback
// to be invoked several times on each key event thats not good.
// Avoid asserts all the time by 'caching' unsupported state.
#ifdef __WXOSX__
// NumLock emulation with Clear button
if (s_toggle_numlock) {
#else
s_wx_assert_cache_bit = 1;
if ((s_wx_assert_cached_bits & 1) == 0 && wxGetKeyState(WXK_NUMLOCK)) {
#endif
out|= NUMLOCK_ON;
}

Expand Down
194 changes: 97 additions & 97 deletions far2l/bootstrap/scripts/FarRus.hlf.m4

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions far2l/bootstrap/scripts/farlang.templ.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ upd:"Disable &write cache"
"Выключыць кэ&шаванне запісу"

CopyXAttr
"Копировать расширенные а&ттрибуты"
"Копировать расширенные а&трибуты"
"Copy extended a&ttributes"
upd:"Copy extended a&ttributes"
upd:"Copy extended a&ttributes"
Expand Down Expand Up @@ -2432,7 +2432,7 @@ upd:"Override base colors &palette"
"Ужываць сваю &палітру колераў"

ConfigExclusiveKeys
"&Экслюзивная обработка нажатий, включающих:"
"&Эксклюзивная обработка нажатий, включающих:"
"&Exclusively handle hotkeys that include:"
upd:"&Exclusively handle hotkeys that include:"
upd:"&Exclusively handle hotkeys that include:"
Expand Down Expand Up @@ -16053,7 +16053,7 @@ upd:"(current target '%ls')"
upd:"(current target '%ls')"

SetAttrSymlinkWarn4
"Пропустить или все-равно изменить объект симлинка?"
"Пропустить или все равно изменить объект симлинка?"
"Skip or change symlink target anyway?"
upd:"Skip or change symlink target anyway?"
upd:"Skip or change symlink target anyway?"
Expand Down Expand Up @@ -26280,7 +26280,7 @@ upd:"In this case user can't change tab style by Ctrl+F5"
"У гэтым выпадку карыстач не можа змяніць стыль таба па Ctrl+F5"

EditorConfigOrgProblemCharset
"В этом случае пользователь не может изменить кодировку по F8 or Shift+F8"
"В этом случае пользователь не может изменить кодировку по F8 или Shift+F8"
"In this case user can't change codepage by F8 or Shift+F8"
upd:"In this case user can't change codepage by F8 or Shift+F8"
upd:"In this case user can't change codepage by F8 or Shift+F8"
Expand Down
4 changes: 4 additions & 0 deletions far2l/far2sdk/farplug-mb.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ namespace oldfar
PFLAGS_REALNAMES = 0x00000020,
PFLAGS_NUMERICSORT = 0x00000040,
PFLAGS_PANELLEFT = 0x00000080,
PFLAGS_HL_MARKERS_NOSHOW = 0x00000800,
PFLAGS_HL_MARKERS_NOALIGN = 0x00001000,
};

enum PANELINFOTYPE
Expand Down Expand Up @@ -1755,6 +1757,8 @@ namespace oldfar
OPIF_EXTERNALDELETE = 0x00002000,
OPIF_EXTERNALMKDIR = 0x00004000,
OPIF_USEATTRHIGHLIGHTING = 0x00008000,
OPIF_HL_MARKERS_NOSHOW = 0x00020000,
OPIF_HL_MARKERS_NOALIGN = 0x00040000,
};


Expand Down
4 changes: 4 additions & 0 deletions far2l/far2sdk/farplug-wide.h
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ enum PANELINFOFLAGS
PFLAGS_DIRECTORIESFIRST = 0x00000100,
PFLAGS_USECRC32 = 0x00000200,
PFLAGS_CASESENSITIVESORT = 0x00000400,
PFLAGS_HL_MARKERS_NOSHOW = 0x00000800,
PFLAGS_HL_MARKERS_NOALIGN = 0x00001000,
};

enum PANELINFOTYPE
Expand Down Expand Up @@ -2244,6 +2246,8 @@ enum OPENPLUGININFO_FLAGS
OPIF_EXTERNALMKDIR = 0x00004000,
OPIF_USEATTRHIGHLIGHTING = 0x00008000,
OPIF_USECRC32 = 0x00010000,
OPIF_HL_MARKERS_NOSHOW = 0x00020000,
OPIF_HL_MARKERS_NOALIGN = 0x00040000,
};


Expand Down
3 changes: 3 additions & 0 deletions far2l/src/console/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,10 @@ FarKey CalcKeyCode(INPUT_RECORD *rec, int RealKey, int *NotMacros)
return '9';

return Modif | (Opt.UseNumPad ? KEY_NUMPAD9 : KEY_PGUP);
#ifndef __APPLE__
// Clear button is used as NumLock emulator on OSX
case VK_CLEAR:
#endif
case VK_NUMPAD5:

if (CtrlState & ENHANCED_KEY) {
Expand Down
38 changes: 15 additions & 23 deletions far2l/src/hilight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,24 @@ static void SetDefaultHighlighting()
{L"*", 1, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_DIRECTORY, 0x10 | F_CYAN, 0xFFFFFFFD0F, 0x30 | F_DARKGRAY, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY, 0x00, 0x10 | F_CYAN, 0xFFFFFFFD0F, 0x30 | F_DARKGRAY, 0xFFFFFFFD0F, 0xFF002F /*/*/, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_SYSTEM, 0x00, 0x10 | F_CYAN, 0xFFFFFFFD0F, 0x30 | F_DARKGRAY, 0xFFFFFFFD0F, 0xFF263C, 1, 0},
{L"*|..", 0, FILE_ATTRIBUTE_DIRECTORY, 0x00, 0x10 | F_WHITE, 0xFFFFFFFD0F, 0x30 | F_WHITE, 0xFFFFFFFD0F, 0xFF002F /*/*/, 0, 0},
{L"..", 0, FILE_ATTRIBUTE_DIRECTORY, 0x00, 0x00, 0xFFFFFFFD0F, 0x00, 0xFFFFFFFD0F, 0x00002F /*/*/, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_EXECUTABLE, 0, 0x10 | F_GREEN, 0xFFFFFFFD0F, 0x30 | F_GREEN, 0xFFFFFFFD0F, 0xFF002A /***/, 0, 0},

{MasksSoundFiles,0, 0x00,0x00, (0xAAFF00ull << 16) | (0x10 | F_LIGHTGREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x005500ull << 16) | (0x30 | F_LIGHTGREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF266A, 0, FFF_DISABLED},
{MaskSharedObjects,0, 0x00,0x00, (0x00b800ull << 16) | (0x10 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x005500ull << 16) | (0x30 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskSourceFiles,0, 0x00,0x00, (0xffbcacull << 16) | (0x10 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x8F0C00ull << 16) | (0x30 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskVideoFiles,0, 0x00,0x00, (0x30b8ffull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x006767ull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskImageFiles,0, 0x00,0x00, (0x00ffaeull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x00432eull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskModelFiles,0, 0x00,0x00, (0x00ffaeull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x00432eull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskTextFiles,0, 0x00,0x00, (0xccccccull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x767676ull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},

{MasksScripts, 0, 0x00,0x00, 0x10 | F_LIGHTGREEN, 0xFFFFFFFD0F, 0x30 | F_LIGHTGREEN, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MasksArchives, 0, 0x00,0x00, 0x10 | F_LIGHTMAGENTA, 0xFFFFFFFD0F, 0x30 | F_LIGHTMAGENTA, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MasksTemporary, 0, 0x00,0x00, 0x10 | F_BROWN, 0xFFFFFFFD0F, 0x30 | F_BROWN, 0xFFFFFFFD0F, 0xFF0000, 0, 0},

// это настройка для каталогов на тех панелях, которые должны раскрашиваться
// без учета масок (например, список хостов в "far navigator")
{L"*", 1, FILE_ATTRIBUTE_EXECUTABLE | FILE_ATTRIBUTE_REPARSE_POINT, 0, 0x10 | F_GREEN, 0xFFFFFFFD0F, 0x30 | F_GREEN, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_DIRECTORY, 0x00, 0x10 | F_WHITE, 0xFFFFFFFD0F, 0x30 | F_WHITE, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_DEVICE_CHAR, 0x00, 0x10 | F_LIGHTBLUE, 0xFFFFFFFD0F, 0x30 | F_BLUE, 0xFFFFFFFD0F, 0, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_DEVICE_BLOCK, 0x00, 0x10 | F_LIGHTBLUE, 0xFFFFFFFD0F, 0x30 | F_BLUE, 0xFFFFFFFD0F, 0, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_DEVICE_FIFO, 0x00, 0x10 | F_LIGHTBLUE, 0xFFFFFFFD0F, 0x30 | F_BLUE, 0xFFFFFFFD0F, 0, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_DEVICE_SOCK, 0x00, 0x10 | F_LIGHTBLUE, 0xFFFFFFFD0F, 0x30 | F_BLUE, 0xFFFFFFFD0F, 0, 0, 0},
// {L"*.*", 0, 0x00, 0x00, 0x10 | F_LIGHTCYAN, 0xFFFFFFFD0F, 0x30 | F_BLUE, 0xFFFFFFFD0F, 0xFF0000, 0}, // Чтобы не раскрашивало на NTFS все файлы в зеленый
{L"*", 1, FILE_ATTRIBUTE_EXECUTABLE, 0x00, 0x10 | F_LIGHTGREEN, 0xFFFFFFFD0F, 0x30 | F_LIGHTGREEN, 0xFFFFFFFD0F, 0xFF0000, 0, 0}
{L"*|..", 0, FILE_ATTRIBUTE_DIRECTORY, 0x00, 0x10 | F_WHITE, 0xFFFFFFFD0F, 0x30 | F_WHITE, 0xFFFFFFFD0F, 0xFF002F /*/*/, 0, 0},
{L"..", 0, FILE_ATTRIBUTE_DIRECTORY, 0x00, 0x00, 0xFFFFFFFD0F, 0x00, 0xFFFFFFFD0F, 0x00002F /*/*/, 0, 0},
{L"*", 1, FILE_ATTRIBUTE_EXECUTABLE, FILE_ATTRIBUTE_DIRECTORY, 0x10 | F_GREEN, 0xFFFFFFFD0F, 0x30 | F_GREEN, 0xFFFFFFFD0F, 0xFF002A /***/, 1, 0},

{MasksSoundFiles,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0xAAFF00ull << 16) | (0x10 | F_LIGHTGREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x005500ull << 16) | (0x30 | F_LIGHTGREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF266A, 0, FFF_DISABLED},
{MaskSharedObjects,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0x00b800ull << 16) | (0x10 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x005500ull << 16) | (0x30 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskSourceFiles,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0xffbcacull << 16) | (0x10 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x8F0C00ull << 16) | (0x30 | F_GREEN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskVideoFiles,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0x30b8ffull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x006767ull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskImageFiles,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0x00ffaeull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x00432eull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskModelFiles,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0x00ffaeull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x00432eull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MaskTextFiles,0, 0x00, FILE_ATTRIBUTE_DIRECTORY, (0xccccccull << 16) | (0x10 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, (0x767676ull << 16) | (0x30 | F_BROWN) | FOREGROUND_TRUECOLOR, 0xFFFFFFFD0F, 0xFF0000, 0, 0},

{MasksScripts, 0, 0x00, FILE_ATTRIBUTE_DIRECTORY, 0x10 | F_LIGHTGREEN, 0xFFFFFFFD0F, 0x30 | F_LIGHTGREEN, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MasksArchives, 0, 0x00, FILE_ATTRIBUTE_DIRECTORY, 0x10 | F_LIGHTMAGENTA, 0xFFFFFFFD0F, 0x30 | F_LIGHTMAGENTA, 0xFFFFFFFD0F, 0xFF0000, 0, 0},
{MasksTemporary, 0, 0x00, FILE_ATTRIBUTE_DIRECTORY, 0x10 | F_BROWN, 0xFFFFFFFD0F, 0x30 | F_BROWN, 0xFFFFFFFD0F, 0xFF0000, 0, 0},

};

Expand Down
2 changes: 1 addition & 1 deletion far2l/src/panels/filelist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class FileList : public Panel
void Scroll(int Count);
void CorrectPosition();
void ShowFileList(int Fast);
void ShowList(int ShowStatus, int StartColumn);
void ShowList(int ShowStatus, int StartColumn, OpenPluginInfo &Info);
void SetShowColor(int Position, int ColorType = HIGHLIGHTCOLORTYPE_FILE);
DWORD64 GetShowColor(int Position, int ColorType);
void ShowSelectedSize();
Expand Down
15 changes: 10 additions & 5 deletions far2l/src/panels/flshow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void FileList::ShowFileList(int Fast)
ShowTotalSize(Info);
}

ShowList(FALSE, 0);
ShowList(FALSE, 0, Info);
ShowSelectedSize();

if (Opt.ShowPanelScrollbar) {
Expand Down Expand Up @@ -859,7 +859,7 @@ static int MakeCurLeftPos(int ColumnWidth, const wchar_t *Str, int LeftPos, int
return out;
}

void FileList::ShowList(int ShowStatus, int StartColumn)
void FileList::ShowList(int ShowStatus, int StartColumn, OpenPluginInfo &Info)
{
int StatusShown = FALSE;
int MaxLeftPos = 0, MinLeftPos = FALSE;
Expand Down Expand Up @@ -909,7 +909,7 @@ void FileList::ShowList(int ShowStatus, int StartColumn)

if (ListPos < ListData.Count()) {
if (!ShowStatus && !StatusShown && CurFile == ListPos && Opt.ShowPanelStatus) {
ShowList(TRUE, CurColumn);
ShowList(TRUE, CurColumn, Info);
GotoXY(CurX, CurY);
StatusShown = TRUE;
SetShowColor(ListPos);
Expand Down Expand Up @@ -950,10 +950,15 @@ void FileList::ShowList(int ShowStatus, int StartColumn)
{ /// Draw mark str
size_t prews = std::min(Opt.MinFilenameIndentation, Opt.MaxFilenameIndentation);

if (Opt.ShowFilenameMarks && Opt.Highlight ) {
if (Opt.ShowFilenameMarks && Opt.Highlight
&& (PanelMode != PLUGIN_PANEL
|| ( !(Info.Flags & OPIF_HL_MARKERS_NOSHOW) && (Info.Flags & OPIF_USEHIGHLIGHTING) ))
) {
const HighlightDataColor *const hl = ListData[ListPos]->ColorsPtr;

if (Opt.FilenameMarksAlign && MarkLM > prews)
if (Opt.FilenameMarksAlign
&& (PanelMode != PLUGIN_PANEL || !(Info.Flags & OPIF_HL_MARKERS_NOALIGN))
&& MarkLM > prews)
prews = std::min(MarkLM, (size_t)Opt.MaxFilenameIndentation);

if (hl->MarkLen && Width > 2) {
Expand Down
8 changes: 8 additions & 0 deletions far2l/src/panels/panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,8 @@ int Panel::SetPluginCommand(int Command, int Param1, LONG_PTR Param2)
} PFLAGS[] = {
{&Opt.ShowHidden, PFLAGS_SHOWHIDDEN},
{&Opt.Highlight, PFLAGS_HIGHLIGHT },
{&Opt.ShowFilenameMarks, PFLAGS_HL_MARKERS_NOSHOW },
{&Opt.FilenameMarksAlign, PFLAGS_HL_MARKERS_NOALIGN },
};
DWORD Flags = 0;

Expand Down Expand Up @@ -1741,6 +1743,12 @@ int Panel::SetPluginCommand(int Command, int Param1, LONG_PTR Param2)
if (PInfo.Flags & OPIF_USECRC32)
Info->Flags|= PFLAGS_USECRC32;

if (PInfo.Flags & OPIF_HL_MARKERS_NOSHOW) // (?) condition added by analogy:
Info->Flags|= PFLAGS_HL_MARKERS_NOSHOW; // may not be completely correct

if (PInfo.Flags & OPIF_HL_MARKERS_NOALIGN) // (?) condition added by analogy:
Info->Flags|= PFLAGS_HL_MARKERS_NOALIGN; // may not be completely correct

Reenter--;
}

Expand Down
9 changes: 7 additions & 2 deletions far2l/src/vt/vtcompletor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ bool VTCompletor::TalkWithShell(const std::string &cmd, std::string &reply, cons
std::string done = "K2Ld8Gfg"; // another most unique string in Universe
AvoidMarkerCollision(done, cmd); // if it still not enough unique
AvoidMarkerCollision(begin, cmd); // if it still not enough unique
begin+= '\n';
//begin+= '\n';
// dont do that: done+= '\n'; otherwise proposed command is executed, see https://github.com/elfmz/far2l/issues/1244

std::string sendline = " PS1=''; PS2=''; PS3=''; PS4=''; PROMPT_COMMAND=''";
Expand All @@ -182,6 +182,7 @@ bool VTCompletor::TalkWithShell(const std::string &cmd, std::string &reply, cons
sendline+= '\n';

sendline+= begin;
sendline+= '\n';
sendline+= cmd;
sendline+= tabs;
sendline+= done;
Expand Down Expand Up @@ -240,9 +241,13 @@ bool VTCompletor::TalkWithShell(const std::string &cmd, std::string &reply, cons
fclose(f);
}

size_t p = reply.find(begin);
size_t p = reply.find(begin + '\n');
if (p == std::string::npos) {
p = reply.find(begin + '\r');
}
if (p != std::string::npos) {
reply.erase(0, p + begin.size());
StrTrimLeft(reply, "\r\n");
}
for (;;) {
p = reply.rfind('\a');
Expand Down
2 changes: 2 additions & 0 deletions multiarc/src/arccmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,10 @@ int ArcCommand::ReplaceVar(std::string &Command)
break;
}
}
/*
if (Command.empty() && DefaultCodepage > 0)
Command = StrPrintf("CP%u", DefaultCodepage);
*/

break;

Expand Down

0 comments on commit e9095b8

Please sign in to comment.