diff --git a/far/changelog b/far/changelog index 995406b6ea..c0d063196f 100644 --- a/far/changelog +++ b/far/changelog @@ -1,4 +1,8 @@ -drkns 19.03.2015 22:55:49 +0200 - build 4319 +drkns 20.03.2015 09:36:40 +0200 - build 4320 + +1. Продолжение 4309. + +drkns 19.03.2015 22:55:49 +0200 - build 4319 1. Уточнение 4280. diff --git a/far/editor.cpp b/far/editor.cpp index b9af6d4c6d..965afa9a7c 100644 --- a/far/editor.cpp +++ b/far/editor.cpp @@ -966,9 +966,7 @@ int Editor::ProcessKey(const Manager::Key& Key) if (!m_Flags.Check(FEDITOR_MARKINGBLOCK)) { UnmarkBlock(); - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; - m_it_AnyBlockStart=m_it_CurLine; + BeginStreamMarking(m_it_CurLine); SelFirst=TRUE; SelStart=SelEnd=CurPos; } @@ -1507,7 +1505,7 @@ int Editor::ProcessKey(const Manager::Key& Key) { if (/*!EdOpt.PersistentBlocks && */ !IsAnySelection()) { - m_it_AnyBlockStart = m_it_CurLine; + BeginStreamMarking(m_it_CurLine); m_it_CurLine->AddSelect(0,-1); Show(); } @@ -2572,9 +2570,7 @@ int Editor::ProcessKey(const Manager::Key& Key) if (m_it_CurLine->IsSelection()) { - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; - m_it_AnyBlockStart=m_it_CurLine; + BeginStreamMarking(m_it_CurLine); //SelFirst=TRUE; //BUGBUG, never used SelStart=SStart; @@ -2942,9 +2938,7 @@ int Editor::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) if (m_it_CurLine->IsSelection()) { - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; - m_it_AnyBlockStart = m_it_CurLine; + BeginStreamMarking(m_it_CurLine); } EditorPrevDoubleClick=0; @@ -3671,10 +3665,8 @@ BOOL Editor::Search(int Next) Pasting++; Lock(); UnmarkBlock(); - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; + BeginStreamMarking(CurPtr); CurPtr->Select(iFoundPos, iFoundPos+SearchLength); - m_it_AnyBlockStart = CurPtr; Unlock(); Pasting--; } @@ -3834,10 +3826,8 @@ BOOL Editor::Search(int Next) if (EdOpt.SearchSelFound && !ReplaceMode) { UnmarkBlock(); - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; + BeginStreamMarking(CurPtr); CurPtr->Select(LocalCurPos, LocalCurPos + static_cast(strReplaceStrCurrent.size())); - m_it_AnyBlockStart = CurPtr; } if (at_end) @@ -3927,10 +3917,8 @@ BOOL Editor::Search(int Next) Lock(); // if (!EdOpt.PersistentBlocks) UnmarkBlock(); - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; + BeginStreamMarking(m_it_CurLine); m_it_CurLine->Select(coord->Pos, coord->Pos+coord->SearchLen); - m_it_AnyBlockStart = m_it_CurLine; Unlock(); Pasting--; } @@ -3983,10 +3971,8 @@ BOOL Editor::Search(int Next) Lock(); // if (!EdOpt.PersistentBlocks) UnmarkBlock(); - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; + BeginStreamMarking(m_it_CurLine); m_it_CurLine->Select(coord->Pos, coord->Pos+coord->SearchLen); - m_it_AnyBlockStart = m_it_CurLine; Unlock(); Pasting--; } @@ -4051,7 +4037,8 @@ void Editor::Paste(const wchar_t *Src) m_it_CurLine->SetOvertypeMode(false); } - m_it_AnyBlockStart=m_it_CurLine; + BeginStreamMarking(m_it_CurLine); + /* $ 19.05.2001 IS Ðåøåíèå ïðîáëåìû íåïðîøåíîé êîíâåðòàöèè òàáóëÿöèè (êîòîðàÿ äîëæíà áûòü äîáàâëåíà â íà÷àëî ñòðîêè ïðè àâòîîòñòóïå) â ïðîáåëû. @@ -4912,8 +4899,7 @@ void Editor::Undo(int redo) void Editor::SelectAll() { - m_it_AnyBlockStart = FirstLine(); - m_BlockType = BTYPE_STREAM; + BeginStreamMarking(FirstLine()); FOR(auto& i, Lines) { @@ -5284,10 +5270,8 @@ void Editor::VPaste(const wchar_t *ClipText) m_it_CurLine->SetOvertypeMode(false); } - m_it_AnyBlockStart = m_it_CurLine; + BeginVBlockMarking(); int StartPos=m_it_CurLine->GetTabCurPos(); - VBlockX=StartPos; - VBlockSizeX=0; VBlockSizeY=0; auto SavedTopScreen = m_it_TopScreen; @@ -5793,9 +5777,7 @@ int Editor::EditorControl(int Command, intptr_t Param1, void *Param2) if (Sel->BlockType==BTYPE_STREAM) { - m_Flags.Set(FEDITOR_MARKINGBLOCK); - m_BlockType = BTYPE_STREAM; - m_it_AnyBlockStart = CurPtr; + BeginStreamMarking(CurPtr); for (int i=0; i < Sel->BlockHeight; i++) { @@ -5810,9 +5792,7 @@ int Editor::EditorControl(int Command, intptr_t Param1, void *Param2) } else if (Sel->BlockType==BTYPE_COLUMN) { - m_Flags.Set(FEDITOR_MARKINGVBLOCK); - m_BlockType = BTYPE_COLUMN; - m_it_AnyBlockStart = CurPtr; + BeginVBlockMarking(CurPtr); VBlockX=Sel->BlockStartPos; @@ -6613,17 +6593,29 @@ void Editor::ProcessVBlockMarking() BeginVBlockMarking(); } -void Editor::BeginVBlockMarking() +void Editor::BeginVBlockMarking(const numbered_iterator& Where) { UnmarkBlock(); - m_it_AnyBlockStart = m_it_CurLine; - VBlockX=m_it_CurLine->GetTabCurPos(); + m_it_AnyBlockStart = Where; + VBlockX = Where->GetTabCurPos(); VBlockSizeX=0; VBlockSizeY=1; m_Flags.Set(FEDITOR_MARKINGVBLOCK); m_BlockType = BTYPE_COLUMN; } +void Editor::BeginVBlockMarking() +{ + return BeginVBlockMarking(m_it_CurLine); +} + +void Editor::BeginStreamMarking(const numbered_iterator& Where) +{ + m_it_AnyBlockStart = Where; + m_BlockType = BTYPE_STREAM; + m_Flags.Set(FEDITOR_MARKINGBLOCK); +} + void Editor::AdjustVBlock(int PrevX) { int x=GetLineCurPos(); diff --git a/far/editor.hpp b/far/editor.hpp index 76efdf9a00..484a3ecd97 100644 --- a/far/editor.hpp +++ b/far/editor.hpp @@ -315,7 +315,10 @@ class Editor: public SimpleScreenObject bool IsStreamSelection() const { return IsAnySelection() && m_BlockType == BTYPE_STREAM; } bool IsVerticalSelection() const { return IsAnySelection() && m_BlockType == BTYPE_COLUMN; } - void Unselect() { m_it_AnyBlockStart = EndIterator(); m_BlockType = BTYPE_NONE; } + void Unselect() { m_it_AnyBlockStart = EndIterator(); m_BlockType = BTYPE_NONE; TurnOffMarkingBlock(); } + + void BeginStreamMarking(const numbered_iterator& Where); + void BeginVBlockMarking(const numbered_iterator& Where); // Ìëàäøèé áàéò (ìàñêà 0xFF) þçàåòñÿ êëàññîì ScreenObject!!! enum editor_flags diff --git a/far/vbuild.m4 b/far/vbuild.m4 index b4e175287c..15ee6a371b 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -m4_define(BUILD,4319)m4_dnl +m4_define(BUILD,4320)m4_dnl