Index: CodeEditor.cpp =================================================================== --- CodeEditor.cpp (revision 8904) +++ CodeEditor.cpp (working copy) @@ -561,13 +561,18 @@ void CodeEditor::LeftDouble(Point p, dword keyflags) { int l, h; int pos = GetMousePos(p); - if(GetWordPos(pos, l, h)) + if(GetWordPos(pos, l, h)) { SetSelection(l, h); - else + selmode = SM_DOUBLE; + } + else { SetSelection(pos, pos + 1); + selmode = SM_SINGLE; + } } void CodeEditor::LeftDown(Point p, dword keyflags) { + selmode = SM_SINGLE; if((keyflags & K_CTRL) && WhenCtrlClick) { WhenCtrlClick(GetMousePos(p)); return; @@ -611,8 +616,16 @@ } void CodeEditor::MouseMove(Point p, dword f) { - LineEdit::MouseMove(p, f); - if(IsSelection()) return; + LineEdit::MouseMove(p, f); + if(IsSelection()) + { + if ( selmode == SM_DOUBLE ) { + int l, h, ml, mh; + if (GetWordPos(mpos, ml, mh ) && GetWordPos(GetMousePos(p), l, h)) + SetSelection(min( l, ml ), max ( h, mh )); + } + return; + } tippos = GetMousePos(p); SyncTip(); } @@ -992,6 +1005,7 @@ mark_lines = true; check_edited = false; tippos = -1; + selmode= SM_NONE; } CodeEditor::~CodeEditor() {} Index: CodeEditor.h =================================================================== --- CodeEditor.h (revision 8904) +++ CodeEditor.h (working copy) @@ -185,6 +185,7 @@ virtual bool Key(dword code, int count); virtual void LeftDown(Point p, dword keyflags); virtual void LeftDouble(Point p, dword keyflags); + virtual void LeftUp(Point p, dword keyflags) { LineEdit::LeftUp(p,keyflags); selmode= SM_NONE; } virtual void MouseMove(Point p, dword keyflags); virtual Image CursorImage(Point p, dword keyflags); virtual void Serialize(Stream& s); @@ -226,6 +227,7 @@ int highlight_bracket_pos; bool bracket_flash; int bracket_start; + enum { SM_NONE, SM_SINGLE, SM_DOUBLE } selmode; bool barline : 1; double stat_edit_time;