diff options
author | Marko Njezic <devnull@localhost> | 2011-06-10 14:38:39 +0200 |
---|---|---|
committer | Marko Njezic <devnull@localhost> | 2011-06-10 14:38:39 +0200 |
commit | eb5cb13123d45c775db0499583dde98b7c8341ee (patch) | |
tree | 7e9f785f2814491f4a85797005def46b2b2aef80 /src/Editor.cxx | |
parent | 02d0fdde768bafca67b49ec9d1f2663c40ba2fc7 (diff) | |
download | scintilla-mirror-eb5cb13123d45c775db0499583dde98b7c8341ee.tar.gz |
Add an option to control how wrapped lines are selected when clicking on margin.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 6b86987fa..79c9f6c0f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6195,7 +6195,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b if (!shift) { // Single click in margin: select whole line or only subline if word wrap is enabled lineAnchorPos = newPos.Position(); - selectionType = (wrapState != eWrapNone) ? selSubLine : selWholeLine; + selectionType = ((wrapState != eWrapNone) && (vs.marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine; LineSelection(lineAnchorPos, lineAnchorPos, selectionType == selWholeLine); } else { // Single shift+click in margin: select from line anchor to clicked line @@ -6208,7 +6208,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b // Otherwise, if there's a non empty selection, reset selection type only if it differs from selSubLine and selWholeLine. // This ensures that we continue selecting in the same selection mode. if (sel.Empty() || (selectionType != selSubLine && selectionType != selWholeLine)) - selectionType = (wrapState != eWrapNone) ? selSubLine : selWholeLine; + selectionType = ((wrapState != eWrapNone) && (vs.marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine; LineSelection(newPos.Position(), lineAnchorPos, selectionType == selWholeLine); } @@ -8797,6 +8797,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARGINGETSTYLEOFFSET: return vs.marginStyleOffset; + case SCI_SETMARGINOPTIONS: + vs.marginOptions = wParam; + break; + + case SCI_GETMARGINOPTIONS: + return vs.marginOptions; + case SCI_MARGINSETTEXT: pdoc->MarginSetText(wParam, CharPtrFromSPtr(lParam)); break; |