Skip to content

Commit d2e623f

Browse files
committed
EditWrap. v1.9
1 parent 95b731d commit d2e623f

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

EditWrap/Release/changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.9
2+
+ Hack for checking if the scroll bar is visible at the moment of wrap.
3+
14
1.8
25
+ Far 3 build 4040 (bis recommended)
36

EditWrap/src/EditWrap.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,21 @@ HANDLE WINAPI OpenPluginW(
613613
if (psi.AdvControl(PluginNumber, ACTL_GETFARRECT, FADV1988 &rcFar))
614614
{
615615
iMaxWidth = rcFar.Right - rcFar.Left;
616+
// Нет способа проверить через API, включена ли прокрутка
617+
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
618+
CONSOLE_SCREEN_BUFFER_INFO csbi = {};
619+
GetConsoleScreenBufferInfo(hOut, &csbi);
620+
CHAR_INFO ch[2]; COORD crSize = {1,2}; COORD crRead = {0,0};
621+
int iTop = 1; // csbi.dwSize.Y - rcFar.Bottom;
622+
SMALL_RECT srRegion = {rcFar.Right, rcFar.Top+iTop, rcFar.Right, rcFar.Top+1+iTop};
623+
if (ReadConsoleOutput(hOut, ch, crSize, crRead, &srRegion))
624+
{
625+
if ((ch[0].Char.UnicodeChar == L'')
626+
&& ((ch[1].Char.UnicodeChar == L'') || (ch[1].Char.UnicodeChar == L'')))
627+
{
628+
iMaxWidth--;
629+
}
630+
}
616631
}
617632
#endif
618633

EditWrap/src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
#define MVV_1 1
3-
#define MVV_2 8
3+
#define MVV_2 9
44
#define MVV_3 0
55
#define MVV_4 FARMANAGERVERSION_BUILD
66
#define MVV_4a ""

0 commit comments

Comments
 (0)