Skip to content

Commit

Permalink
EditWrap. v1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Oct 8, 2014
1 parent 95b731d commit d2e623f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions EditWrap/Release/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.9
+ Hack for checking if the scroll bar is visible at the moment of wrap.

1.8
+ Far 3 build 4040 (bis recommended)

Expand Down
15 changes: 15 additions & 0 deletions EditWrap/src/EditWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,21 @@ HANDLE WINAPI OpenPluginW(
if (psi.AdvControl(PluginNumber, ACTL_GETFARRECT, FADV1988 &rcFar))
{
iMaxWidth = rcFar.Right - rcFar.Left;
// Нет способа проверить через API, включена ли прокрутка
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi = {};
GetConsoleScreenBufferInfo(hOut, &csbi);
CHAR_INFO ch[2]; COORD crSize = {1,2}; COORD crRead = {0,0};
int iTop = 1; // csbi.dwSize.Y - rcFar.Bottom;
SMALL_RECT srRegion = {rcFar.Right, rcFar.Top+iTop, rcFar.Right, rcFar.Top+1+iTop};
if (ReadConsoleOutput(hOut, ch, crSize, crRead, &srRegion))
{
if ((ch[0].Char.UnicodeChar == L'')
&& ((ch[1].Char.UnicodeChar == L'') || (ch[1].Char.UnicodeChar == L'')))
{
iMaxWidth--;
}
}
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion EditWrap/src/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#define MVV_1 1
#define MVV_2 8
#define MVV_2 9
#define MVV_3 0
#define MVV_4 FARMANAGERVERSION_BUILD
#define MVV_4a ""
Expand Down

0 comments on commit d2e623f

Please sign in to comment.