--- a/EditTextView.st Mon Jun 22 18:16:14 2015 +0100
+++ b/EditTextView.st Tue Jul 28 17:31:58 2015 +0100
@@ -2599,10 +2599,12 @@
"/
"/ in st80Mode, the cursor may not be positioned
- "/ beyond the last line
+ "/ beyond the last line
+ "/ (but it must be posible to place it on one line below the last one
+ "/ - otherwise deleteSelection and some others fail to delete from previousToLastLine)
"/
self st80EditMode ifTrue:[
- ^ (line min:(list size)) max:1
+ ^ (line min:(list size + 1)) max:1
].
^ line
@@ -3205,6 +3207,10 @@
|wasOn beginCol beginLine endCol endLine|
self checkModificationsAllowed ifFalse:[ ^ self].
+ cursorCol <= 1 ifTrue:[
+ self deleteCharBeforeCursor.
+ ^ self
+ ].
wasOn := self hideCursor.
self
@@ -3215,6 +3221,7 @@
beginCol := cursorCol.
beginLine := cursorLine.
self deleteFromLine:beginLine col:beginCol toLine:endLine col:endCol.
+ self cursorLine:cursorLine col:beginCol.
]
info:'Delete Word'.
wasOn ifTrue:[ self showCursor ].
@@ -3278,7 +3285,8 @@
srcY "{ Class: SmallInteger }"
dstY "{ Class: SmallInteger }" |
- autoIndent ifTrue:[
+ "wrong when pasting multiple lines"
+ false "autoIndent" ifTrue:[
indent := self leftIndentForLine:lineNr.
text := someText
@@ -6373,6 +6381,7 @@
('Indent' indent )
('Toggle Case' convertSelectionToLowercaseOrUppercaseOrUppercaseFirst ConvertSelectionToLowercaseOrUppercaseOrUppercaseFirst)
('Sort' sort )
+ ('Split...' splitLinesAtCharacterOrString )
('-' )
('Google Spell Check' googleSpellingSuggestion )
('Builtin Spell Check' internalSpellingSuggestion )
@@ -6466,7 +6475,8 @@
m disable:#copySelection.
].
self hasSelection ifFalse:[
- m disableAll:#(cut googleSpellingSuggestion babelFishTranslate openFileBrowserOnIt openWorkspaceWithIt sort indent).
+ m disableAll:#(cut googleSpellingSuggestion babelFishTranslate openFileBrowserOnIt
+ openWorkspaceWithIt sort indent splitLinesAtCharacterOrString).
] ifTrue:[
(Error handle:[:ex |
ex return:false
@@ -7303,6 +7313,30 @@
clickLabel:'Click to Insert Character'.
!
+splitLinesAtCharacterOrString
+ "ask user for the character and split after it"
+
+ |sel in out separator record|
+
+ selectionStartLine isNil ifTrue:[^ self].
+
+ separator := Dialog request:(resources string:'Split selected lines after which separator character or string:').
+ separator isEmptyOrNil ifTrue:[^ self].
+
+ sel := self selectionAsString.
+ in := sel readStream.
+ out := CharacterWriteStream on:(String new).
+ [in atEnd] whileFalse:[
+ record := in throughAll:separator.
+ out nextPutLine:record.
+ ].
+ self
+ undoableDo:[
+ self replaceSelectionBy:(out contents).
+ ]
+ info:'Split Selection'
+!
+
undoablePaste:someText
self undoablePaste:someText info:nil.
@@ -8973,11 +9007,11 @@
!EditTextView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.637 2015-03-27 13:12:57 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.637 2015-03-27 13:12:57 cg Exp $'
+ ^ '$Header$'
!
version_HG