Skip to content

Commit

Permalink
1. уточнение 4673 для ECTL_SETPOSITION.
Browse files Browse the repository at this point in the history
  • Loading branch information
zg0 committed May 17, 2016
1 parent 1584703 commit 2bd4fab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
6 changes: 5 additions & 1 deletion far/changelog
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,8 @@
drkns 16.05.2016 22:55:36 +0200 - build 4675 zg 17.05.2016 13:03:38 +0200 - build 4676

1. уточнение 4673 для ECTL_SETPOSITION.

drkns 16.05.2016 22:55:36 +0200 - build 4675


1. Ещё одно уточнение работы запускателя. 1. Ещё одно уточнение работы запускателя.


Expand Down
19 changes: 12 additions & 7 deletions far/editor.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -643,12 +643,12 @@ __int64 Editor::VMProcess(int OpCode,void *vParam,__int64 iParam)
const auto _NumLine = m_it_CurLine.Number(); const auto _NumLine = m_it_CurLine.Number();
int _CurPos=m_it_CurLine->GetTabCurPos(); int _CurPos=m_it_CurLine->GetTabCurPos();


GoToLine(iLine); GoToLineAndShow(iLine);
m_it_CurLine->SetCurPos(m_it_CurLine->TabPosToReal(iPos)); m_it_CurLine->SetCurPos(m_it_CurLine->TabPosToReal(iPos));


if (!EdOpt.CursorBeyondEOL && m_it_CurLine->GetCurPos() > m_it_CurLine->GetLength()) if (!EdOpt.CursorBeyondEOL && m_it_CurLine->GetCurPos() > m_it_CurLine->GetLength())
{ {
GoToLine(_NumLine); GoToLineAndShow(_NumLine);
m_it_CurLine->SetCurPos(m_it_CurLine->TabPosToReal(_CurPos)); m_it_CurLine->SetCurPos(m_it_CurLine->TabPosToReal(_CurPos));
return 0; return 0;
} }
Expand Down Expand Up @@ -2844,7 +2844,7 @@ int Editor::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent)
else else
{ {
while (IsMouseButtonPressed()) while (IsMouseButtonPressed())
GoToLine((m_LinesCount-1)*(IntKeyState.MouseY-m_Y1)/(m_Y2-m_Y1)); GoToLineAndShow((m_LinesCount-1)*(IntKeyState.MouseY-m_Y1)/(m_Y2-m_Y1));
} }


return TRUE; return TRUE;
Expand Down Expand Up @@ -4451,10 +4451,15 @@ void Editor::GoToLine(int Line)
// if (!EdOpt.PersistentBlocks) // if (!EdOpt.PersistentBlocks)
// UnmarkBlock(); // UnmarkBlock();
// </GOTO_UNMARK> // </GOTO_UNMARK>
Show();
return; return;
} }


void Editor::GoToLineAndShow(int Line)
{
GoToLine(Line);
Show();
}

void Editor::GoToPosition() void Editor::GoToPosition()
{ {
DialogBuilder Builder(MEditGoToLine, L"EditorGotoPos"); DialogBuilder Builder(MEditGoToLine, L"EditorGotoPos");
Expand Down Expand Up @@ -4768,7 +4773,7 @@ void Editor::Undo(int redo)
{ {
if (ud->m_Type != UNDO_BEGIN && ud->m_Type != UNDO_END) if (ud->m_Type != UNDO_BEGIN && ud->m_Type != UNDO_END)
{ {
GoToLine(ud->m_StrNum); GoToLineAndShow(ud->m_StrNum);
} }


switch (ud->m_Type) switch (ud->m_Type)
Expand Down Expand Up @@ -6973,7 +6978,7 @@ void Editor::SetCacheParams(EditorPosCache &pc, bool count_bom)


if (pc.cur.Line >= pc.cur.ScreenLine) if (pc.cur.Line >= pc.cur.ScreenLine)
{ {
GoToLine(pc.cur.Line-pc.cur.ScreenLine); GoToLineAndShow(pc.cur.Line-pc.cur.ScreenLine);
m_it_TopScreen = m_it_CurLine; m_it_TopScreen = m_it_CurLine;


repeat(pc.cur.ScreenLine, [this](){ ProcessKey(Manager::Key(KEY_DOWN)); }); repeat(pc.cur.ScreenLine, [this](){ ProcessKey(Manager::Key(KEY_DOWN)); });
Expand Down Expand Up @@ -7207,7 +7212,7 @@ int Editor::GetCurCol() const


void Editor::SetCurPos(int NewCol, int NewRow) void Editor::SetCurPos(int NewCol, int NewRow)
{ {
GoToLine(NewRow); GoToLineAndShow(NewRow);
m_it_CurLine->SetTabCurPos(NewCol); m_it_CurLine->SetTabCurPos(NewCol);
} }


Expand Down
1 change: 1 addition & 0 deletions far/editor.hpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class Editor: public SimpleScreenObject
void ScrollUp(); void ScrollUp();
BOOL Search(int Next); BOOL Search(int Next);
void GoToLine(int Line); void GoToLine(int Line);
void GoToLineAndShow(int Line);
void GoToPosition(); void GoToPosition();
void TextChanged(bool State); void TextChanged(bool State);
int CalcDistance(const numbered_iterator& From, const numbered_iterator& To) const; int CalcDistance(const numbered_iterator& From, const numbered_iterator& To) const;
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
m4_define(BUILD,4675)m4_dnl m4_define(BUILD,4676)m4_dnl

0 comments on commit 2bd4fab

Please sign in to comment.