aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html9
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--src/Editor.cxx4
5 files changed, 16 insertions, 4 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 93b9a9e70..6e94e52e3 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -1696,9 +1696,14 @@ struct Sci_TextToFind {
<b id="SCI_SETVIRTUALSPACEOPTIONS">SCI_SETVIRTUALSPACEOPTIONS(int virtualSpace)</b><br />
<b id="SCI_GETVIRTUALSPACEOPTIONS">SCI_GETVIRTUALSPACEOPTIONS</b><br />
Virtual space can be enabled or disabled for rectangular selections or in other circumstances or in both.
- There are two bit flags <code>SCVS_RECTANGULARSELECTION</code>=1 and
- <code>SCVS_USERACCESSIBLE</code>=2 which can be set independently.
+ There are three bit flags <code>SCVS_RECTANGULARSELECTION</code>=1,
+ <code>SCVS_USERACCESSIBLE</code>=2, and
+ <code>SCVS_NOWRAPLINESTART</code>=4 which can be set independently.
<code>SCVS_NONE</code>=0, the default, disables all use of virtual space.</p>
+ <p><code>SCVS_NOWRAPLINESTART</code> prevents left arrow movement and selection
+ from wrapping to the previous line.
+ This is most commonly desired in conjunction with virtual space but is an independent
+ setting so works without virtual space.</p>
<p>
<b id="SCI_SETRECTANGULARSELECTIONMODIFIER">SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)</b><br />
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index e8d806040..04acc3ca4 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -512,6 +512,11 @@
Released 24 May 2016.
</li>
<li>
+ SCVS_NOWRAPLINESTART option stops left arrow from wrapping to the previous line.
+ Most commonly wanted when virtual space is used.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1648/">Bug #1648</a>.
+ </li>
+ <li>
The HTML lexer no longer treats "&lt;?" inside a string in a script as potentially starting an XML document.
<a href="http://sourceforge.net/p/scintilla/bugs/767/">Bug #767</a>.
</li>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 99bc6e7b1..8f0cd44b1 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -895,6 +895,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCVS_NONE 0
#define SCVS_RECTANGULARSELECTION 1
#define SCVS_USERACCESSIBLE 2
+#define SCVS_NOWRAPLINESTART 4
#define SCI_SETVIRTUALSPACEOPTIONS 2596
#define SCI_GETVIRTUALSPACEOPTIONS 2597
#define SCI_SETRECTANGULARSELECTIONMODIFIER 2598
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 310d877a9..140cb70f4 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -2331,6 +2331,7 @@ enu VirtualSpace=SCVS_
val SCVS_NONE=0
val SCVS_RECTANGULARSELECTION=1
val SCVS_USERACCESSIBLE=2
+val SCVS_NOWRAPLINESTART=4
set void SetVirtualSpaceOptions=2596(int virtualSpaceOptions,)
get int GetVirtualSpaceOptions=2597(,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 3fbf4b341..bcba9bdf4 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3283,7 +3283,7 @@ int Editor::HorizontalMove(unsigned int iMessage) {
case SCI_CHARLEFTRECTEXTEND:
if (pdoc->IsLineEndPosition(spCaret.Position()) && spCaret.VirtualSpace()) {
spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
- } else {
+ } else if ((virtualSpaceOptions & SCVS_NOWRAPLINESTART) == 0 || pdoc->GetColumn(spCaret.Position()) > 0) {
spCaret = SelectionPosition(spCaret.Position() - 1);
}
break;
@@ -3328,7 +3328,7 @@ int Editor::HorizontalMove(unsigned int iMessage) {
case SCI_CHARLEFTEXTEND:
if (spCaret.VirtualSpace()) {
spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
- } else {
+ } else if ((virtualSpaceOptions & SCVS_NOWRAPLINESTART) == 0 || pdoc->GetColumn(spCaret.Position()) > 0) {
spCaret = SelectionPosition(spCaret.Position() - 1);
}
break;