Merge jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 02 Sep 2016 17:42:50 +0100
branchjv
changeset 5840 7b658477a2a1
parent 5839 2cdb82875bf2 (diff)
parent 5837 9f78a5caa596 (current diff)
child 5844 4ebd8fb3feda
Merge
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,16 @@
+
+syntax: glob
+*Init.c   
+makefile
+*.so
+*.H
+*.o
+*.STH
+*.sc
+objbc
+objvc
+*.class
+java/libs/*.jar
+java/libs-src/*.jar
+*-Test.xml
+st.chg
--- a/EditField.st	Thu Sep 01 12:31:56 2016 +0200
+++ b/EditField.st	Fri Sep 02 17:42:50 2016 +0100
@@ -1948,7 +1948,7 @@
     DefaultBackgroundColor notNil ifTrue:[
         bgColor := DefaultBackgroundColor onDevice:device.
 "/        bgColor ditherForm notNil ifTrue:[
-"/            bgColor := (bgColor copy) exactOrNearestOn:self graphicsDevice
+"/            bgColor := (bgColor copy) exactOrNearestOn:device
 "/        ].
         self viewBackground:bgColor.
     ].
--- a/EditTextView.st	Thu Sep 01 12:31:56 2016 +0200
+++ b/EditTextView.st	Fri Sep 02 17:42:50 2016 +0100
@@ -2,7 +2,7 @@
 
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -153,7 +153,7 @@
 copyright
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -178,124 +178,124 @@
 
     [Instance variables:]
 
-	cursorLine              <Number>        line where cursor sits (1..)
-
-	cursorVisibleLine       <Number>        visible line where cursor sits (1..nLinesShown)
-
-	cursorCol               <Number>        col where cursor sits (1..)
-
-	cursorShown             <Boolean>       true, if cursor is currently shown
-
-	readOnly                <Boolean>       true, if text may not be edited
-
-	modifiedChannel         <ValueHolder>   holding true, if text has been modified.
-						cleared on accept.
-
-	acceptChannel           <ValueHolder>   holding true, if text has been accepted.
-
-	fixedSize               <Boolean>       true, if no lines may be added/removed
-
-	exceptionBlock          <Block>         block to be evaluated when readonly text is about to be modified
-						if it returns true, the modification will be done anyway.
-						if it returns anything else, the modification is not done.
-
-	cursorFgColor           <Color>         color used for cursor drawing
-	cursorBgColor           <Color>         color used for cursor drawing
-
-	cursorType              <Symbol>        how the cursor is drawn; currently implemented
-						are #none, #block (solid-block cursor), #ibeam
-						(vertical bar at insertion point)
-						and #caret (caret below insertion-point).
-						see cursorType: for an up-to-date list.
-
-	cursorTypeNoFocus       <Symbol>        like above, if view has no focus
-						nil means: hide the cursor.
-
-	undoAction              <Block>         block which undoes last cut, paste or replace
-						(not yet fully implemented)
-
-	typeOfSelection         <Symbol>        #paste, if selection created by paste, nil otherwise
-						this affects the next keyPress: if #paste it does not
-						replace; otherwise it replaces the selection.
-
-	lastCut                 <String>        last cut or replaced string
-
-	lastReplacementInfo     <LastReplacementInfo>        holds the information about the last replace action
-							     lastStringToReplace is the string to be replaced by lastReplacement
-							     lastReplacement is the string to replace lastStringToReplace
-
-	lastStringFromReplaceForNextSearch   <String>        string to be taken be the next search action
-							     (cleared after a new selection)
-
-	replacing               <Boolean>       true if entered characters replace last selection
-
-	showMatchingParenthesis <Boolean>       if true, shows matching parenthesis
-						when entering one; this is the default.
-
-	hasKeyboardFocus        <Boolean>       true if this view has the focus
-
-	acceptAction            <Block>         accept action - evaluated passing the contents as
-						argument
-
-	tabMeansNextField       <Boolean>       if true, Tab is ignored as input and shifts keyboard
-						focus to the next field. For editTextViews, this is false
-						by default (i.e. tabs can be entered into the text).
-						For some subclasses (inputFields), this may be true.
-
-	trimBlankLines          <Boolean>       if true, trailing blanks are
-						removed when editing.
-						Default is true.
-
-	wordWrap                <Boolean>       Currently not used.
-
-	lockUpdates             <Boolean>       internal, private
-
-	prevCursorState         <Boolean>       temporary, private
-
-	cursorMovementWhenUpdating
-				<Symbol>        defines where the cursor is to be positioned if the
-						model changes its value by some outside activity
-						(i.e. not by user input into the field).
-						Can be one of:
-						    #keep / nil     -> stay where it was
-						    #endOfText      -> cursor to the end
-						    #endOfLine      -> stay in the line, but move to end
-						    #beginOfText    -> cursor to the beginning
-						    #beginOfLine    -> stay in the line, but move to begin
-						The default is #beginOfText
-
-
-
-	dropTarget              <DropTarget|nil> drop operation descriptor or nil (drop disabled)
+        cursorLine              <Number>        line where cursor sits (1..)
+
+        cursorVisibleLine       <Number>        visible line where cursor sits (1..nLinesShown)
+
+        cursorCol               <Number>        col where cursor sits (1..)
+
+        cursorShown             <Boolean>       true, if cursor is currently shown
+
+        readOnly                <Boolean>       true, if text may not be edited
+
+        modifiedChannel         <ValueHolder>   holding true, if text has been modified.
+                                                cleared on accept.
+
+        acceptChannel           <ValueHolder>   holding true, if text has been accepted.
+
+        fixedSize               <Boolean>       true, if no lines may be added/removed
+
+        exceptionBlock          <Block>         block to be evaluated when readonly text is about to be modified
+                                                if it returns true, the modification will be done anyway.
+                                                if it returns anything else, the modification is not done.
+
+        cursorFgColor           <Color>         color used for cursor drawing
+        cursorBgColor           <Color>         color used for cursor drawing
+
+        cursorType              <Symbol>        how the cursor is drawn; currently implemented
+                                                are #none, #block (solid-block cursor), #ibeam
+                                                (vertical bar at insertion point)
+                                                and #caret (caret below insertion-point).
+                                                see cursorType: for an up-to-date list.
+
+        cursorTypeNoFocus       <Symbol>        like above, if view has no focus
+                                                nil means: hide the cursor.
+
+        undoAction              <Block>         block which undoes last cut, paste or replace
+                                                (not yet fully implemented)
+
+        typeOfSelection         <Symbol>        #paste, if selection created by paste, nil otherwise
+                                                this affects the next keyPress: if #paste it does not
+                                                replace; otherwise it replaces the selection.
+
+        lastCut                 <String>        last cut or replaced string
+
+        lastReplacementInfo     <LastReplacementInfo>        holds the information about the last replace action
+                                                             lastStringToReplace is the string to be replaced by lastReplacement
+                                                             lastReplacement is the string to replace lastStringToReplace
+
+        lastStringFromReplaceForNextSearch   <String>        string to be taken be the next search action 
+                                                             (cleared after a new selection)
+
+        replacing               <Boolean>       true if entered characters replace last selection
+
+        showMatchingParenthesis <Boolean>       if true, shows matching parenthesis
+                                                when entering one; this is the default.
+
+        hasKeyboardFocus        <Boolean>       true if this view has the focus
+
+        acceptAction            <Block>         accept action - evaluated passing the contents as
+                                                argument
+
+        tabMeansNextField       <Boolean>       if true, Tab is ignored as input and shifts keyboard
+                                                focus to the next field. For editTextViews, this is false
+                                                by default (i.e. tabs can be entered into the text).
+                                                For some subclasses (inputFields), this may be true.
+
+        trimBlankLines          <Boolean>       if true, trailing blanks are
+                                                removed when editing.
+                                                Default is true.
+
+        wordWrap                <Boolean>       Currently not used.
+
+        lockUpdates             <Boolean>       internal, private
+
+        prevCursorState         <Boolean>       temporary, private
+
+        cursorMovementWhenUpdating
+                                <Symbol>        defines where the cursor is to be positioned if the
+                                                model changes its value by some outside activity
+                                                (i.e. not by user input into the field).
+                                                Can be one of:
+                                                    #keep / nil     -> stay where it was
+                                                    #endOfText      -> cursor to the end
+                                                    #endOfLine      -> stay in the line, but move to end
+                                                    #beginOfText    -> cursor to the beginning
+                                                    #beginOfLine    -> stay in the line, but move to begin
+                                                The default is #beginOfText
+
+
+
+        dropTarget              <DropTarget|nil> drop operation descriptor or nil (drop disabled)
 
 
     userPreference values:
-	userPreferences.st80EditMode
-				<Boolean>       if true, cursor positioning is
-						done as in vi or ST80; i.e.
-						wysiwyg mode is somewhat relaxed,
-						in that the cursor cannot be
-						positioned behind a lines end.
-						This is not yet completely implemented.
+        userPreferences.st80EditMode
+                                <Boolean>       if true, cursor positioning is
+                                                done as in vi or ST80; i.e.
+                                                wysiwyg mode is somewhat relaxed,
+                                                in that the cursor cannot be
+                                                positioned behind a lines end.
+                                                This is not yet completely implemented.
     used globals:
 
-	DeleteHistory           <Text>          last 1000 lines of deleted text
-						(but only if this variable exists already)
+        DeleteHistory           <Text>          last 1000 lines of deleted text
+                                                (but only if this variable exists already)
 
     [styleSheet parameters:]
 
-	textCursorForegroundColor <Color>          cursor fg color; default: text background
-	textCursorBackgroundColor <Color>          cursor bg color; default: text foreground
-	textCursorNoFocusForegroundColor
-				  <Color>          cursor fg color if no focus; default: cursor fg color
-	textCursorType            <Symbol>         cursor type; default:  #block
+        textCursorForegroundColor <Color>          cursor fg color; default: text background
+        textCursorBackgroundColor <Color>          cursor bg color; default: text foreground
+        textCursorNoFocusForegroundColor
+                                  <Color>          cursor fg color if no focus; default: cursor fg color
+        textCursorType            <Symbol>         cursor type; default:  #block
 
     [author:]
-	Claus Gittinger
+        Claus Gittinger
 
     [see also:]
-	CodeView Workspace TextView ListView
-	EditField
+        CodeView Workspace TextView ListView
+        EditField
 "
 !
 
@@ -304,176 +304,239 @@
   non MVC operation:
 
     basic setup:
-									[exBegin]
-	|top textView|
-
-	top := StandardSystemView new.
-	top extent:300@200.
-
-	textView := EditTextView new.
-	textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top addSubView:textView.
-
-	textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
-
-	top open.
-									[exEnd]
+                                                                        [exBegin]
+        |top textView|
+
+        top := StandardSystemView new.
+        top extent:300@200.
+
+        textView := EditTextView new.
+        textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top addSubView:textView.
+
+        textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
+
+        top open.
+                                                                        [exEnd]
 
 
     with vertical scrollbar:
-									[exBegin]
-	|top scrollView textView|
-
-	top := StandardSystemView new.
-	top extent:300@200.
-
-	scrollView := ScrollableView for:EditTextView.
-	textView := scrollView scrolledView.
-	scrollView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top addSubView:scrollView.
-
-	textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
-
-	top open.
-									[exEnd]
+                                                                        [exBegin]
+        |top scrollView textView|
+
+        top := StandardSystemView new.
+        top extent:300@200.
+
+        scrollView := ScrollableView for:EditTextView.
+        textView := scrollView scrolledView.
+        scrollView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top addSubView:scrollView.
+
+        textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
+
+        top open.
+                                                                        [exEnd]
 
 
     with horizontal & vertical scrollbars:
-									[exBegin]
-	|top scrollView textView|
-
-	top := StandardSystemView new.
-	top extent:300@200.
-
-	scrollView := HVScrollableView for:EditTextView.
-	textView := scrollView scrolledView.
-	scrollView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top addSubView:scrollView.
-
-	textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
-
-	top open.
-									[exEnd]
+                                                                        [exBegin]
+        |top scrollView textView|
+
+        top := StandardSystemView new.
+        top extent:300@200.
+
+        scrollView := HVScrollableView for:EditTextView.
+        textView := scrollView scrolledView.
+        scrollView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top addSubView:scrollView.
+
+        textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
+
+        top open.
+                                                                        [exEnd]
 
 
     set the action for accept:
-									[exBegin]
-	|top textView|
-
-	top := StandardSystemView new.
-	top extent:300@200.
-
-	textView := EditTextView new.
-	textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top addSubView:textView.
-
-	textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
-	textView acceptAction:[:contents |
-				Transcript showCR:'will not overwrite the file with:'.
-				Transcript showCR:contents asString
-			      ].
-	top open.
-									[exEnd]
+                                                                        [exBegin]
+        |top textView|
+
+        top := StandardSystemView new.
+        top extent:300@200.
+
+        textView := EditTextView new.
+        textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top addSubView:textView.
+
+        textView contents:('/etc/hosts' asFilename contentsOfEntireFile).
+        textView acceptAction:[:contents |
+                                Transcript showCR:'will not overwrite the file with:'.
+                                Transcript showCR:contents asString
+                              ].
+        top open.
+                                                                        [exEnd]
 
 
 
     non-string (text) items:
-									[exBegin]
-	|top textView list|
-
-	list := '/etc/hosts' asFilename contentsOfEntireFile asStringCollection.
-	1 to:list size by:2 do:[:nr |
-	    list at:nr put:(Text string:(list at:nr)
-				 emphasis:(Array with:#bold with:(#color->Color red)))
-	].
-
-	top := StandardSystemView new.
-	top extent:300@200.
-
-	textView := EditTextView new.
-	textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top addSubView:textView.
-
-	textView contents:list.
-	top open.
-									[exEnd]
+                                                                        [exBegin]
+        |top textView list|
+
+        list := '/etc/hosts' asFilename contentsOfEntireFile asStringCollection.
+        1 to:list size by:2 do:[:nr |
+            list at:nr put:(Text string:(list at:nr)
+                                 emphasis:(Array with:#bold with:(#color->Color red)))
+        ].
+
+        top := StandardSystemView new.
+        top extent:300@200.
+
+        textView := EditTextView new.
+        textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top addSubView:textView.
+
+        textView contents:list.
+        top open.
+                                                                        [exEnd]
 
 
 
   MVC operation:
     (the examples model here is a plug simulating a real model;
      real world applications would not use a plug ..)
-									[exBegin]
-	|top textView model|
-
-	model := Plug new.
-	model respondTo:#accepted:
-		   with:[:newContents |
-				Transcript showCR:'will not overwrite the file with:'.
-				Transcript showCR:newContents asString
-			].
-	model respondTo:#getList
-		   with:['/etc/hosts' asFilename contentsOfEntireFile].
-
-
-	top := StandardSystemView new.
-	top extent:300@200.
-
-	textView := EditTextView new.
-	textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top addSubView:textView.
-
-	textView listMessage:#getList;
-		 model:model;
-		 changeMessage:#accepted:;
-		 aspect:#list.
-	top open.
-									[exEnd]
+                                                                        [exBegin]
+        |top textView model|
+
+        model := Plug new.
+        model respondTo:#accepted:
+                   with:[:newContents |
+                                Transcript showCR:'will not overwrite the file with:'.
+                                Transcript showCR:newContents asString
+                        ].
+        model respondTo:#getList
+                   with:['/etc/hosts' asFilename contentsOfEntireFile].
+
+
+        top := StandardSystemView new.
+        top extent:300@200.
+
+        textView := EditTextView new.
+        textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top addSubView:textView.
+
+        textView listMessage:#getList;
+                 model:model;
+                 changeMessage:#accepted:;
+                 aspect:#list.
+        top open.
+                                                                        [exEnd]
 
 
     two textViews on the same model:
-									[exBegin]
-	|top1 textView1 top2 textView2 model currentContents|
-
-	model := Plug new.
-	model respondTo:#accepted:
-		   with:[:newContents |
-				Transcript showCR:'accepted:'.
-				Transcript showCR:newContents asString.
-				currentContents := newContents.
-				model changed:#contents
-			].
-	model respondTo:#getList
-		   with:[Transcript showCR:'query'.
-			 currentContents].
-
-
-	top1 := StandardSystemView new.
-	top1 extent:300@200.
-
-	textView1 := EditTextView new.
-	textView1 origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top1 addSubView:textView1.
-
-	textView1 listMessage:#getList;
-		  model:model;
-		  aspect:#contents;
-		  changeMessage:#accepted:.
-	top1 open.
-
-	top2 := StandardSystemView new.
-	top2 extent:300@200.
-
-	textView2 := EditTextView new.
-	textView2 origin:0.0 @ 0.0 corner:1.0 @ 1.0.
-	top2 addSubView:textView2.
-
-	textView2 listMessage:#getList;
-		  model:model;
-		  aspect:#contents;
-		  changeMessage:#accepted:.
-	top2 open.
-									[exEnd]
+                                                                        [exBegin]
+        |top1 textView1 top2 textView2 model currentContents|
+
+        model := Plug new.
+        model respondTo:#accepted:
+                   with:[:newContents |
+                                Transcript showCR:'accepted:'.
+                                Transcript showCR:newContents asString.
+                                currentContents := newContents.
+                                model changed:#contents
+                        ].
+        model respondTo:#getList
+                   with:[Transcript showCR:'query'.
+                         currentContents].
+
+
+        top1 := StandardSystemView new.
+        top1 extent:300@200.
+
+        textView1 := EditTextView new.
+        textView1 origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top1 addSubView:textView1.
+
+        textView1 listMessage:#getList;
+                  model:model;
+                  aspect:#contents;
+                  changeMessage:#accepted:.
+        top1 open.
+
+        top2 := StandardSystemView new.
+        top2 extent:300@200.
+
+        textView2 := EditTextView new.
+        textView2 origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+        top2 addSubView:textView2.
+
+        textView2 listMessage:#getList;
+                  model:model;
+                  aspect:#contents;
+                  changeMessage:#accepted:.
+        top2 open.
+                                                                        [exEnd]
+"
+!
+
+selection_and_cursor_movement
+"
+Changes done to implement 'standard' behaviour (that's how vast majority of widgets used in todays desktops behaves)
+as opposed to 'traditional' which is what how it was in St/X 'ever since'
+
+* Numerous off-by-one bugs
+
+* Extending selection by dragging:
+  Scenario:
+    1. Select & drag to expand beggining of the selection (i.e., drag from 'end' to 'beggining'
+    2. Stop dragging
+    3. Press Shift-Left / Shift-Right (to refine selection)
+
+    Traditional ST/X: end of selection is moved
+    Standard:  beginning of selection is moved
+      (checked on Notepad, Gedit (GTK+), Sublime (Win+Lin), Eclipse, Firefox)
+
+* Extending selection by Shift-Home / Shift-End
+  Scenario:
+    1. Position cursor in the middle of the line
+    2. Press Shift-Home (line for beginning should be selected)
+    3. Press Shift-Right (to refine selection)
+
+    Traditional ST/X: end of selection is moved
+    Standard:  beginning of selection is moved
+      (checked on Notepad, Gedit (GTK+), Sublime (Win+Lin), Eclipse, Firefox)
+
+* Selection flip by Shift-Home / Shift-End
+  Scenario A:
+    1. Position cursor in the middle of the line to column C
+    2. Press Shift-Home (line from beginning should be selected)
+    2. Press Shift-End
+
+    Traditional ST/X: end of selection is moved so whole line is selected
+    Standard: Selection 'flips' so part of line from column C to the end is selected
+      (checked on Notepad, Gedit (GTK+), Sublime (Win+Lin), Eclipse, Firefox)
+
+  Scenario B:
+    1. Position cursor in the middle of the line to column C
+    2. Press Shift-End (column C to the end of line should be selected)
+    2. Press Shift-Home
+
+    Traditional ST/X: beginning of selection is moved so whole line is selected
+    Standard: Selection 'flips' so part of line from the beginning to column C is selected
+      (checked on Notepad, Gedit (GTK+), Sublime (Win+Lin), Eclipse, Firefox)
+
+  NOTE: This could be controlled by 
+    UserPreferences current selectionExtensionMode
+
+
+* Extending selection with Ctrl-Shift-Left / Ctrl-Shift-Right
+  Scenario A:
+    1. Position cursor in the middle of the line to column C
+    2. Select word
+    3. Press Ctrl-Shift-Right, Ctrl-Shift-Right
+
+    Traditional ST/X: nothing happens at all
+    Standard: Selection is extended to include a space (first press) and a word right to previously selected one
+      (checked on Notepad, Gedit (GTK+), Sublime (Win+Lin), Eclipse, Firefox)
+
 "
 ! !
 
@@ -518,10 +581,10 @@
     "extract values from the styleSheet and cache them in class variables"
 
     <resource: #style (#'textCursor.foregroundColor' #'textCursor.backgroundColor'
-		       #'textCursor.noFocusForegroundColor'
-		       #'textCursor.type'
-		       #'textCursor.typeNoFocus'
-		       #'editText.st80Mode')>
+                       #'textCursor.noFocusForegroundColor'
+                       #'textCursor.type'
+                       #'textCursor.typeNoFocus'
+                       #'editText.st80Mode')>
 
     DefaultCursorForegroundColor := StyleSheet colorAt:'textCursor.foregroundColor'.
     DefaultCursorBackgroundColor := StyleSheet colorAt:'textCursor.backgroundColor'.
@@ -553,165 +616,165 @@
 
     ^
      #(FullSpec
-	name: searchReplaceDialogSpec
-	window:
+        name: searchReplaceDialogSpec
+        window:
        (WindowSpec
-	  label: 'String Search and Replace'
-	  name: 'String Search and Replace'
-	  min: (Point 283 196)
-	  max: (Point 283 196)
-	  bounds: (Rectangle 0 0 279 192)
-	)
-	component:
+          label: 'String Search and Replace'
+          name: 'String Search and Replace'
+          min: (Point 283 196)
+          max: (Point 283 196)
+          bounds: (Rectangle 0 0 279 192)
+        )
+        component:
        (SpecCollection
-	  collection: (
-	   (LabelSpec
-	      label: 'Search Pattern:'
-	      name: 'label'
-	      layout: (LayoutFrame 1 0.0 3 0 -1 1.0 20 0)
-	      level: 0
-	      translateLabel: true
-	      adjust: left
-	    )
-	   (ComboBoxSpec
-	      name: 'patternComboBox'
-	      layout: (LayoutFrame 3 0.0 26 0 -3 1.0 48 0)
-	      tabable: true
-	      model: searchPattern
-	      immediateAccept: false
-	      acceptOnLeave: true
-	      acceptOnReturn: true
-	      acceptOnTab: true
-	      acceptOnLostFocus: true
-	      acceptOnPointerLeave: false
-	      autoSelectInitialText: true
-	      comboList: patternList
-	    )
-	   (ComboBoxSpec
-	      name: 'replaceComboBox'
-	      layout: (LayoutFrame 3 0.0 76 0 -3 1.0 98 0)
-	      tabable: true
-	      model: replacePattern
-	      immediateAccept: false
-	      acceptOnLeave: true
-	      acceptOnReturn: true
-	      acceptOnTab: true
-	      acceptOnLostFocus: true
-	      acceptOnPointerLeave: false
-	      autoSelectInitialText: true
-	      comboList: patternList
-	    )
-	   (CheckBoxSpec
-	      label: 'Ignore Case'
-	      name: 'ignoreCaseCheckBox'
-	      layout: (LayoutFrame 3 0.0 107 0 -3 1.0 130 0)
-	      level: 0
-	      tabable: true
-	      model: ignoreCase
-	      translateLabel: true
-	    )
-	   (VariableVerticalPanelSpec
-	      name: 'VariableVerticalPanel1'
-	      layout: (LayoutFrame 0 0 -64 1 0 1 -4 1)
-	      component:
-	     (SpecCollection
-		collection: (
-		 (HorizontalPanelViewSpec
-		    name: 'HorizontalPanel1'
-		    level: 0
-		    horizontalLayout: fitSpace
-		    verticalLayout: center
-		    horizontalSpace: 3
-		    verticalSpace: 3
-		    ignoreInvisibleComponents: true
-		    reverseOrderIfOKAtLeft: true
-		    component:
-		   (SpecCollection
-		      collection: (
-		       (ActionButtonSpec
-			  label: 'Replace'
-			  name: 'replaceButton'
-			  level: 2
-			  translateLabel: true
-			  tabable: true
-			  model: replaceAction
-			  extent: (Point 134 21)
-			)
-		       (ActionButtonSpec
-			  label: 'Replace All'
-			  name: 'replaceAllButton'
-			  level: 2
-			  borderWidth: 1
-			  translateLabel: true
-			  tabable: true
-			  model: replaceAllAction
-			  extent: (Point 134 21)
-			)
-		       )
-
-		    )
-		  )
-		 (HorizontalPanelViewSpec
-		    name: 'horizontalPanelView'
-		    level: 0
-		    horizontalLayout: fitSpace
-		    verticalLayout: center
-		    horizontalSpace: 3
-		    verticalSpace: 3
-		    ignoreInvisibleComponents: true
-		    reverseOrderIfOKAtLeft: true
-		    component:
-		   (SpecCollection
-		      collection: (
-		       (ActionButtonSpec
-			  label: 'Cancel'
-			  name: 'cancelButton'
-			  level: 2
-			  translateLabel: true
-			  tabable: true
-			  model: cancel
-			  extent: (Point 88 21)
-			)
-		       (ActionButtonSpec
-			  label: 'Prev'
-			  name: 'prevButton'
-			  level: 2
-			  translateLabel: true
-			  tabable: true
-			  model: prevAction
-			  extent: (Point 89 21)
-			)
-		       (ActionButtonSpec
-			  label: 'Next'
-			  name: 'nextButton'
-			  level: 2
-			  borderWidth: 1
-			  translateLabel: true
-			  tabable: true
-			  model: nextAction
-			  isDefault: true
-			  extent: (Point 88 21)
-			)
-		       )
-
-		    )
-		  )
-		 )
-
-	      )
-	      handles: (Any 0.5 1.0)
-	    )
-	   (LabelSpec
-	      label: 'Replace By:'
-	      name: 'ReplaceLabel'
-	      layout: (LayoutFrame 1 0.0 53 0 -1 1.0 70 0)
-	      level: 0
-	      translateLabel: true
-	      adjust: left
-	    )
-	   )
-
-	)
+          collection: (
+           (LabelSpec
+              label: 'Search Pattern:'
+              name: 'label'
+              layout: (LayoutFrame 1 0.0 3 0 -1 1.0 20 0)
+              level: 0
+              translateLabel: true
+              adjust: left
+            )
+           (ComboBoxSpec
+              name: 'patternComboBox'
+              layout: (LayoutFrame 3 0.0 26 0 -3 1.0 48 0)
+              tabable: true
+              model: searchPattern
+              immediateAccept: false
+              acceptOnLeave: true
+              acceptOnReturn: true
+              acceptOnTab: true
+              acceptOnLostFocus: true
+              acceptOnPointerLeave: false
+              autoSelectInitialText: true
+              comboList: patternList
+            )
+           (ComboBoxSpec
+              name: 'replaceComboBox'
+              layout: (LayoutFrame 3 0.0 76 0 -3 1.0 98 0)
+              tabable: true
+              model: replacePattern
+              immediateAccept: false
+              acceptOnLeave: true
+              acceptOnReturn: true
+              acceptOnTab: true
+              acceptOnLostFocus: true
+              acceptOnPointerLeave: false
+              autoSelectInitialText: true
+              comboList: patternList
+            )
+           (CheckBoxSpec
+              label: 'Ignore Case'
+              name: 'ignoreCaseCheckBox'
+              layout: (LayoutFrame 3 0.0 107 0 -3 1.0 130 0)
+              level: 0
+              tabable: true
+              model: ignoreCase
+              translateLabel: true
+            )
+           (VariableVerticalPanelSpec
+              name: 'VariableVerticalPanel1'
+              layout: (LayoutFrame 0 0 -64 1 0 1 -4 1)
+              component:
+             (SpecCollection
+                collection: (
+                 (HorizontalPanelViewSpec
+                    name: 'HorizontalPanel1'
+                    level: 0
+                    horizontalLayout: fitSpace
+                    verticalLayout: center
+                    horizontalSpace: 3
+                    verticalSpace: 3
+                    ignoreInvisibleComponents: true
+                    reverseOrderIfOKAtLeft: true
+                    component:
+                   (SpecCollection
+                      collection: (
+                       (ActionButtonSpec
+                          label: 'Replace'
+                          name: 'replaceButton'
+                          level: 2
+                          translateLabel: true
+                          tabable: true
+                          model: replaceAction
+                          extent: (Point 134 21)
+                        )
+                       (ActionButtonSpec
+                          label: 'Replace All'
+                          name: 'replaceAllButton'
+                          level: 2
+                          borderWidth: 1
+                          translateLabel: true
+                          tabable: true
+                          model: replaceAllAction
+                          extent: (Point 134 21)
+                        )
+                       )
+
+                    )
+                  )
+                 (HorizontalPanelViewSpec
+                    name: 'horizontalPanelView'
+                    level: 0
+                    horizontalLayout: fitSpace
+                    verticalLayout: center
+                    horizontalSpace: 3
+                    verticalSpace: 3
+                    ignoreInvisibleComponents: true
+                    reverseOrderIfOKAtLeft: true
+                    component:
+                   (SpecCollection
+                      collection: (
+                       (ActionButtonSpec
+                          label: 'Cancel'
+                          name: 'cancelButton'
+                          level: 2
+                          translateLabel: true
+                          tabable: true
+                          model: cancel
+                          extent: (Point 88 21)
+                        )
+                       (ActionButtonSpec
+                          label: 'Prev'
+                          name: 'prevButton'
+                          level: 2
+                          translateLabel: true
+                          tabable: true
+                          model: prevAction
+                          extent: (Point 89 21)
+                        )
+                       (ActionButtonSpec
+                          label: 'Next'
+                          name: 'nextButton'
+                          level: 2
+                          borderWidth: 1
+                          translateLabel: true
+                          tabable: true
+                          model: nextAction
+                          isDefault: true
+                          extent: (Point 88 21)
+                        )
+                       )
+
+                    )
+                  )
+                 )
+
+              )
+              handles: (Any 0.5 1.0)
+            )
+           (LabelSpec
+              label: 'Replace By:'
+              name: 'ReplaceLabel'
+              layout: (LayoutFrame 1 0.0 53 0 -1 1.0 70 0)
+              level: 0
+              translateLabel: true
+              adjust: left
+            )
+           )
+
+        )
       )
 
     "Modified: / 11-10-2006 / 21:05:09 / cg"
@@ -768,7 +831,7 @@
     line := self lineOfCharacterPosition:aCharacterPosition.
     col := aCharacterPosition - (self characterPositionOfLine:line col:1) + 1.
     col < 1 ifTrue:[
-	col := 1
+        col := 1
     ].
     self insertString:aString atLine:line col:col.
 
@@ -851,8 +914,8 @@
     "/ Applications should set it explictly, however, to make it behavinh like
     "/ CodeView2, I kept fetching code here for now.
     ^((app := self topView application) notNil and:[app respondsTo: #codeAspect])
-	ifTrue:[app codeAspect]
-	ifFalse:[nil]
+        ifTrue:[app codeAspect]
+        ifFalse:[nil]
 
     "Created: / 27-09-2013 / 09:53:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
@@ -934,10 +997,10 @@
     lNr := self cursorLine.
     line := self listAt:lNr.
     line notEmptyOrNil ifTrue:[
-	doSelect ifTrue:[
-	    self selectLine:lNr.
-	].
-	^ line
+        doSelect ifTrue:[
+            self selectLine:lNr.
+        ].
+        ^ line
     ].
 
     ^ nil
@@ -1023,11 +1086,11 @@
     "return what is be done with the cursor,
      when I get a new text (via the model or the #contents/#list)
      Allowed arguments are:
-	#keep / nil     -> stay where it was
-	#endOfText      -> position cursor to the end
-	#beginOfText    -> position cursor to the beginning
-	#endOfLine      -> position cursor to the current lines end
-	#beginOfLine    -> position cursor to the current lines start
+        #keep / nil     -> stay where it was
+        #endOfText      -> position cursor to the end
+        #beginOfText    -> position cursor to the beginning
+        #endOfLine      -> position cursor to the current lines end
+        #beginOfLine    -> position cursor to the current lines start
      The default is #beginOfText.
      This may be useful for fields which get new values assigned from
      the program (i.e. not from the user)"
@@ -1041,11 +1104,11 @@
     "define what should be done with the cursor,
      when I get a new text (via the model or the #contents/#list)
      Allowed arguments are:
-	#keep / nil     -> stay where it was
-	#endOfText      -> position cursor to the end
-	#beginOfText    -> position cursor to the beginning
-	#endOfLine      -> position cursor to the current lines end
-	#beginOfLine    -> position cursor to the current lines start
+        #keep / nil     -> stay where it was
+        #endOfText      -> position cursor to the end
+        #beginOfText    -> position cursor to the beginning
+        #endOfLine      -> position cursor to the current lines end
+        #beginOfLine    -> position cursor to the current lines start
      The default is #beginOfText.
      This may be useful for fields which get new values assigned from
      the program (i.e. not from the user)"
@@ -1065,7 +1128,11 @@
      This selection will not be replaced by followup user input,
      so multiple pastes will be possible."
 
-    typeOfSelection := #paste
+    self hasSelection ifTrue:[ 
+        typeOfSelection := #paste
+    ].
+
+    "Modified: / 02-05-2015 / 21:17:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 editModeHolder
@@ -1101,10 +1168,10 @@
 
     self obsoleteMethodWarning:'use #readOnly:'.
     readOnly == true ifFalse:[
-	readOnly := true.
-	(menu := self middleButtonMenu) notNil ifTrue:[
-	    menu disableAll:#(cut paste replace indent)
-	]
+        readOnly := true.
+        (menu := self middleButtonMenu) notNil ifTrue:[
+            menu disableAll:#(cut paste replace indent)
+        ]
     ]
 
     "Modified: 14.2.1997 / 17:35:24 / cg"
@@ -1118,8 +1185,8 @@
 
 insertModeHolder
     ^ BlockValue
-	with:[:m | m isInsertMode]
-	argument:(editMode).
+        with:[:m | m isInsertMode]
+        argument:(editMode).
 
     "Modified: / 08-03-2007 / 22:58:37 / cg"
 !
@@ -1146,14 +1213,14 @@
     "a valueHolder, which contains 'L' (learnMode), I (insertMode) or empty"
 
     ^ BlockValue
-	with:[:e :l |
-	    self isReadOnly ifTrue:[
-		''
-	    ] ifFalse:[
-		l ifTrue:[ 'L' allBold withColor:#red]
-		  ifFalse:[ e infoPrintString]]]
-	argument:(self editModeHolder)
-	argument:(self learnModeHolder).
+        with:[:e :l |
+            self isReadOnly ifTrue:[
+                ''
+            ] ifFalse:[
+                l ifTrue:[ 'L' allBold withColor:#red]
+                  ifFalse:[ e infoPrintString]]]
+        argument:(self editModeHolder)
+        argument:(self learnModeHolder).
 
     "Modified: / 08-03-2007 / 22:58:59 / cg"
 !
@@ -1264,7 +1331,7 @@
      this is not undoably, unless you care for yourself"
 
     (self at:lineNr) = aLine ifFalse:[
-	super at:lineNr put:aLine.
+        super at:lineNr put:aLine.
     ].
 !
 
@@ -1276,8 +1343,8 @@
 
     oldLine := (self at:lineNr) ? ''.
     (oldLine sameStringAndEmphasisAs: (aLine? '')) ifFalse:[
-	super at:lineNr put:aLine.
-	self textChanged
+        super at:lineNr put:aLine.
+        self textChanged
     ].
 !
 
@@ -1300,7 +1367,7 @@
 characterUnderCursor
     "return the character under the cursor - space if beyond line.
      For non-block cursors, this is the character immediately to the right
-     of the insertion-bar or caret.
+     of the insertion-bar or caret. 
      For block cursors, this is the highlighted cursor-character"
 
     ^ self characterAtLine:cursorLine col:cursorCol
@@ -1330,7 +1397,7 @@
 
     super contents:something.
     keepUndoHistory ifFalse:[
-	undoSupport resetHistories.
+        undoSupport resetHistories.
     ].
 !
 
@@ -1340,8 +1407,8 @@
     list isNil ifTrue:[^ ''].
     self removeTrailingBlankLines.
     ^ (list collect:[:each | each isNil ifTrue:['']
-					ifFalse:[each string]
-		    ]) asStringWithCRs
+                                        ifFalse:[each string]
+                    ]) asStringWithCRs
 !
 
 contentsAsStringWithTabs
@@ -1351,10 +1418,10 @@
 
     list isNil ifTrue:[^ ''].
     self removeTrailingBlankLines.
-    ^ (list collect:[:each |
-	each isNil
-	    ifTrue:['']
-	    ifFalse:[each string withTabs]
+    ^ (list collect:[:each | 
+        each isNil 
+            ifTrue:['']
+            ifFalse:[each string withTabs]
        ]) asStringWithCRs
 !
 
@@ -1380,13 +1447,13 @@
 
 cursorLineAndColumnLabelHolder
     "return a valueHolder for the cursors line and column as an info string
-     of the form 'line : col'.
+     of the form 'line : col'. 
      This can be used directly as a model for a GUI label showing the cursor position (eg in the lower right)"
 
     ^ BlockValue
-	with:[:l :c | '%1 : %2' bindWith:l with:c]
-	argument:self cursorLineHolder
-	argument:self cursorColHolder
+        with:[:l :c | '%1 : %2' bindWith:l with:c]
+        argument:self cursorLineHolder
+        argument:self cursorColHolder
 !
 
 cursorLineHolder
@@ -1404,7 +1471,7 @@
 
     line := ((self at:cursorLine) ? '') string.
     line size < (cursorCol-1) ifTrue:[
-	^ line paddedTo:(cursorCol-1)
+        ^ line paddedTo:(cursorCol-1)
     ].
     ^ line copyTo:(cursorCol-1)
 !
@@ -1423,19 +1490,19 @@
 
     (cursorMovementWhenUpdating == #endOfText
     or:[cursorMovementWhenUpdating == #end]) ifTrue:[
-	^ self cursorToEndOfText
+        ^ self cursorToEndOfText
     ].
 
     (cursorMovementWhenUpdating == #endOfLine) ifTrue:[
-	^ self cursorLine:prevCursorLine col:(self listAt:cursorLine) size + 1.
+        ^ self cursorLine:prevCursorLine col:(self listAt:cursorLine) size + 1.
     ].
 
     (cursorMovementWhenUpdating == #beginOfText
     or:[cursorMovementWhenUpdating == #begin]) ifTrue:[
-	^ self cursorHome
+        ^ self cursorHome
     ].
     (cursorMovementWhenUpdating == #beginOfLine) ifTrue:[
-	^ self cursorLine:prevCursorLine col:1.
+        ^ self cursorLine:prevCursorLine col:1.
     ].
 
     "/ default: stay where it was
@@ -1443,7 +1510,7 @@
 !
 
 setContents:something
-    "replace the whole contents by something new
+    "replace the whole contents by something new 
      AND clear the remembered undo actions"
 
     |selType|
@@ -1463,14 +1530,14 @@
     |point|
 
     cursorVisibleLine isNil ifTrue:[
-	"/ take the end of the selection, if any
-	(selectionStartLine notNil
-	    and:[ self listLineIsVisible:selectionEndLine ])
-	ifTrue:[
-	    ^ self xOfCol:selectionEndCol inVisibleLine:selectionEndLine.
-	].
-
-"/        point := device
+        "/ take the end of the selection, if any
+        (selectionStartLine notNil 
+            and:[ self listLineIsVisible:selectionEndLine ])
+        ifTrue:[
+            ^ self xOfCol:selectionEndCol inVisibleLine:selectionEndLine.
+        ].
+
+"/        point := device 
 "/                    translatePoint:(device pointerPosition)
 "/                    fromView:nil
 "/                    toView:self.
@@ -1478,7 +1545,7 @@
 "/            ^ point x
 "/        ].
 "/        ^ 0
-	^ nil
+        ^ nil
     ].
     ^self xOfCol:cursorCol inVisibleLine:cursorVisibleLine.
 
@@ -1501,8 +1568,8 @@
 cursorType
     "return the style of the text cursor.
      Currently, supported are: #none
-			       #block, #frame, #ibeam, #caret, #solidCaret
-			       #bigCaret and #bigSolidCaret"
+                               #block, #frame, #ibeam, #caret, #solidCaret
+                               #bigCaret and #bigSolidCaret"
 
     ^ cursorType
 
@@ -1512,8 +1579,8 @@
 cursorType:aCursorTypeSymbol
     "set the style of the text cursor.
      Currently, supported are: #none
-			       #block, #frame, #ibeam, #caret, #solidCaret
-			       #bigCaret and #bigSolidCaret"
+                               #block, #frame, #ibeam, #caret, #solidCaret
+                               #bigCaret and #bigSolidCaret"
 
     cursorType := aCursorTypeSymbol.
 
@@ -1559,11 +1626,11 @@
      changeMessage."
 
     acceptEnabled == false ifTrue:[
-	self beep.
-	^ self
+        self beep.
+        ^ self
     ].
     (disableIfInvisible == true and:[self reallyRealized not]) ifTrue:[
-	^ self
+        ^ self
     ].
 
     lockUpdates := true.
@@ -1572,10 +1639,10 @@
     "/ ST-80 way of doing it
     "/
     model notNil ifTrue:[
-	self sendChangeMessage:changeMsg with:self argForChangeMessage.
-	acceptChannel notNil ifTrue:[
-	    acceptChannel value:true withoutNotifying:self.
-	].
+        self sendChangeMessage:changeMsg with:self argForChangeMessage.
+        acceptChannel notNil ifTrue:[
+            acceptChannel value:true withoutNotifying:self.
+        ].    
     ].
 
     "/
@@ -1585,7 +1652,7 @@
     "/ - not with the actual string
     "/
     acceptAction notNil ifTrue:[
-	acceptAction value:self list
+        acceptAction value:self list
     ].
 
     lockUpdates := false.
@@ -1611,8 +1678,8 @@
      ignore updates from my own change
     "
     lockUpdates ifTrue:[
-	lockUpdates := false.
-	^ self
+        lockUpdates := false.
+        ^ self
     ].
     super getListFromModel.
     undoSupport resetHistories.
@@ -1620,16 +1687,16 @@
     "/ validate the cursorLine
     (cursorLine notNil
      and:[ cursorLine > list size ]) ifTrue:[
-	self cursorLine:list size + 1 col:1
+        self cursorLine:list size + 1 col:1
     ].
 !
 
 update:something with:aParameter from:changedObject
     changedObject == acceptChannel ifTrue:[
-	acceptChannel value == true ifTrue:[
-	    self accept.
-	].
-	^ self.
+        acceptChannel value == true ifTrue:[
+            self accept.
+        ].
+        ^ self.
     ].
     super update:something with:aParameter from:changedObject
 
@@ -1646,9 +1713,9 @@
 
     self checkForExistingLine:(cursorLine + 1).
     cursorVisibleLine notNil ifTrue:[
-	nFullLinesShown notNil ifTrue:[
-	    (cursorVisibleLine >= nFullLinesShown) ifTrue:[self scrollDown]
-	]
+        nFullLinesShown notNil ifTrue:[
+            (cursorVisibleLine >= nFullLinesShown) ifTrue:[self scrollDown]
+        ]
     ].
 
     wasOn := self hideCursor.
@@ -1692,10 +1759,10 @@
 
     "/ cursor beyond text ?
     cursorLine > list size ifTrue:[
-	wasOn := self hideCursor.
-	self setValidatedCursorLine:(list size + 1) col:cursorCol.
-	self makeCursorVisibleAndShowCursor:wasOn.
-	self beep.
+        wasOn := self hideCursor.
+        self setValidatedCursorLine:(list size + 1) col:cursorCol.
+        self makeCursorVisibleAndShowCursor:wasOn.
+        self beep.
     ].
 
     "Modified: / 10.6.1998 / 17:00:23 / cg"
@@ -1707,30 +1774,30 @@
     |wasOn nv nL|
 
     (nL := cursorLine) isNil ifTrue:[
-	nL := firstLineShown
+        nL := firstLineShown
     ].
 
     self st80EditMode ifTrue:[
-	nL == list size ifTrue:[
-	    wasOn := self hideCursor.
-	    self setValidatedCursorLine:(list size) col:(self listAt:list size) size + 1.
-	    self makeCursorVisibleAndShowCursor:wasOn.
-	    self beep.
-	    ^ self.
-	]
+        nL == list size ifTrue:[
+            wasOn := self hideCursor.
+            self setValidatedCursorLine:(list size) col:(self listAt:list size) size + 1.
+            self makeCursorVisibleAndShowCursor:wasOn.
+            self beep.
+            ^ self.
+        ]
     ].
 
     cursorVisibleLine notNil ifTrue:[
-	wasOn := self hideCursor.
-	nv := cursorVisibleLine + n - 1.
-	(nv >= nFullLinesShown) ifTrue:[
-	    self scrollDown:(nv - nFullLinesShown + 1)
-	].
-	self setValidatedCursorLine:(cursorLine + n) col:cursorCol.
-	self makeCursorVisibleAndShowCursor:wasOn.
+        wasOn := self hideCursor.
+        nv := cursorVisibleLine + n - 1.
+        (nv >= nFullLinesShown) ifTrue:[
+            self scrollDown:(nv - nFullLinesShown + 1)
+        ].
+        self setValidatedCursorLine:(cursorLine + n) col:cursorCol.
+        self makeCursorVisibleAndShowCursor:wasOn.
     ] ifFalse:[
-	self setValidatedCursorLine:(nL + n) col:cursorCol.
-	self makeCursorVisible.
+        self setValidatedCursorLine:(nL + n) col:cursorCol.
+        self makeCursorVisible.
     ].
 
     "Modified: / 10.6.1998 / 16:59:17 / cg"
@@ -1756,14 +1823,14 @@
     "move cursor to left"
 
     (cursorCol ~~ 1) ifTrue:[
-	self cursorCol:(cursorCol - 1)
+        self cursorCol:(cursorCol - 1)
     ] ifFalse:[
-	cursorLine ~~ 1 ifTrue:[
-	    self st80EditMode ifTrue:[
-		self cursorUp.
-		self cursorToEndOfLine.
-	   ]
-	]
+        cursorLine ~~ 1 ifTrue:[
+            self st80EditMode ifTrue:[
+                self cursorUp.
+                self cursorToEndOfLine.
+           ]
+        ]
     ]
 
     "Modified: / 23.1.1998 / 12:37:13 / cg"
@@ -1773,7 +1840,7 @@
     "move cursor to left"
 
     n timesRepeat:[
-	self cursorLeft
+        self cursorLeft
     ].
 !
 
@@ -1794,21 +1861,21 @@
     self setValidatedCursorLine:line.
 
     (col < 1) ifTrue:[
-	newCol := 1
+        newCol := 1
     ] ifFalse:[
-	newCol := col.
+        newCol := col.
     ].
     self st80EditMode ifTrue:[
-	(cursorLine == list size
-	and:[cursorLine ~~ line]) ifTrue:[
-	    newCol := (self listAt:(list size)) size + 1.
-	]
+        (cursorLine == list size
+        and:[cursorLine ~~ line]) ifTrue:[
+            newCol := (self listAt:(list size)) size + 1.
+        ]
     ].
     self setValidatedCursorCol:newCol.
     makeVisibleBoolean ifTrue:[
-	self makeCursorVisibleAndShowCursor:wasOn.
+        self makeCursorVisibleAndShowCursor:wasOn.
     ] ifFalse:[
-	wasOn ifTrue:[self showCursor]
+        wasOn ifTrue:[self showCursor]
     ].
 
     "Modified: / 20.6.1998 / 18:19:06 / cg"
@@ -1844,13 +1911,13 @@
     |l|
 
     self st80EditMode ifTrue:[
-	l := (self listAt:cursorLine).
-	cursorCol >= (l size + 1) ifTrue:[
-	    cursorLine <= list size ifTrue:[
-		self cursorReturn:false. "/ no autoindent
-	    ].
-	    ^ self
-	]
+        l := (self listAt:cursorLine).
+        cursorCol >= (l size + 1) ifTrue:[
+            cursorLine <= list size ifTrue:[
+                self cursorReturn:false. "/ no autoindent
+            ].
+            ^ self
+        ]
     ].
     self cursorCol:(cursorCol + 1)
 
@@ -1861,7 +1928,7 @@
     "move cursor to right"
 
     n timesRepeat:[
-	self cursorRight
+        self cursorRight
     ].
 !
 
@@ -1872,16 +1939,16 @@
     |oldState|
 
     aBoolean == cursorShown ifTrue:[
-	^ cursorShown
+        ^ cursorShown
     ].
     oldState := cursorShown.
 
     aBoolean ifTrue:[
-	self drawCursor.
+        self drawCursor.
     ] ifFalse:[
-	(cursorShown and:[shown]) ifTrue: [
-	    self undrawCursor.
-	].
+        (cursorShown and:[shown]) ifTrue: [
+            self undrawCursor.
+        ].
     ].
     cursorShown := aBoolean.
 
@@ -1905,9 +1972,9 @@
     l := self listAt:cursorLine.
     textStart := l isNil ifTrue:[1] ifFalse:[l indexOfNonSeparator].
     cursorCol > textStart ifTrue:[
-	self cursorCol:textStart
+        self cursorCol:textStart
     ] ifFalse:[
-	self cursorCol:1
+        self cursorCol:1
     ]
 
     "Created: / 8.8.2004 / 18:51:21 / janfrog"
@@ -1922,7 +1989,7 @@
 
     newTop := list size - nFullLinesShown.
     (newTop < 1) ifTrue:[
-	newTop := 1
+        newTop := 1
     ].
     self scrollToLine:newTop.
 
@@ -1954,10 +2021,10 @@
     lineNr := list size.
 
     cursorLine >= lineNr ifTrue:[
-	line := self listAt:cursorLine.
-	(line isEmptyOrNil) ifTrue:[
-	    ^ self
-	]
+        line := self listAt:cursorLine.
+        (line isEmptyOrNil) ifTrue:[
+            ^ self
+        ]
     ].
 
     wasOn := self hideCursor.
@@ -1965,7 +2032,7 @@
     lineNr := lineNr + 1.
     newTop :=  lineNr - nFullLinesShown.
     (newTop < 1) ifTrue:[
-	newTop := 1
+        newTop := 1
     ].
     self scrollToLine:newTop.
 
@@ -1996,7 +2063,7 @@
 
     newTop := list size - nFullLinesShown.
     (newTop < 1) ifTrue:[
-	newTop := 1
+        newTop := 1
     ].
     self scrollToLine:newTop.
 
@@ -2016,9 +2083,9 @@
     (cursorLine > list size) ifTrue:[^ self].
 
     self wordAtLine:cursorLine col:cursorCol do:[
-	:beginLine :beginCol :endLine :endCol :style |
-
-	self cursorLine:endLine col:endCol+1
+        :beginLine :beginCol :endLine :endCol :style |
+
+        self cursorLine:endLine col:endCol+1
     ]
 
     "Created: / 28-06-2006 / 19:16:30 / cg"
@@ -2043,28 +2110,28 @@
 
     (cursorLine > list size) ifTrue:[^ self].
 
-    self
-	wordAtLine:cursorLine col:cursorCol
-	do:[
-	    :beginLine :beginCol :endLine :endCol :style |
-
-	    line := endLine.
-	    col := endCol + 1.
-	    searching := true.
-	    [searching and:[(self characterAtLine:line col:col) isSeparator]] whileTrue:[
-		self wordAtLine:line col:col do:[
-		    :beginLine :beginCol :endLine :endCol :style |
-
-		    (line > list size) ifTrue:[
-			"break out"
-			searching := false
-		    ] ifFalse:[
-			line := endLine.
-			col := endCol + 1.
-		    ]
-		]
-	    ].
-	    self cursorLine:line col:col
+    self 
+        wordAtLine:cursorLine col:cursorCol 
+        do:[
+            :beginLine :beginCol :endLine :endCol :style |
+
+            line := endLine.
+            col := endCol + 1.
+            searching := true.
+            [searching and:[(self characterAtLine:line col:col) isSeparator]] whileTrue:[
+                self wordAtLine:line col:col do:[
+                    :beginLine :beginCol :endLine :endCol :style |
+
+                    (line > list size) ifTrue:[
+                        "break out"
+                        searching := false
+                    ] ifFalse:[
+                        line := endLine.
+                        col := endCol + 1.
+                    ]
+                ]
+            ].
+            self cursorLine:line col:col
     ]
 !
 
@@ -2076,50 +2143,50 @@
     (cursorLine > list size) ifTrue:[^ self].      "/ this is rubbish
 
     self wordAtLine:cursorLine col:cursorCol do:[
-	:beginLine :beginCol :endLine :endCol :style |
-
-	line := beginLine.
-	col := beginCol.
-	style == #wordLeft ifTrue:[
-	    col := col + 1
-	].
-
-	(cursorLine == line
-	and:[cursorCol == col]) ifTrue:[
-	    searching := true.
-
-	    col > 1 ifTrue:[
-		col := col - 1.
-	    ].
-
-	    [searching] whileTrue:[
-		(col == 1) ifTrue:[
-		    line == 1 ifTrue:[
-			searching := false
-		    ] ifFalse:[
-			line := line - 1.
-			l := list at:line.
-			col := l size + 1.
-		    ]
-		] ifFalse:[
-		    (self characterAtLine:line col:col) isSeparator ifFalse:[
-			self wordAtLine:line col:col do:[
-			    :beginLine :beginCol :endLine :endCol :style |
-
-			    line := beginLine.
-			    col := beginCol.
-			    style == #wordLeft ifTrue:[
-				col := col + 1
-			    ].
-			    searching := false.
-			]
-		    ] ifTrue:[
-			col := col - 1
-		    ]
-		]
-	    ]
-	].
-	self cursorLine:line col:col
+        :beginLine :beginCol :endLine :endCol :style |
+
+        line := beginLine.
+        col := beginCol.
+        style == #wordLeft ifTrue:[
+            col := col + 1
+        ].
+
+        (cursorLine == line
+        and:[cursorCol == col]) ifTrue:[
+            searching := true.
+
+            col > 1 ifTrue:[
+                col := col - 1.
+            ].
+
+            [searching] whileTrue:[
+                (col == 1) ifTrue:[
+                    line == 1 ifTrue:[
+                        searching := false
+                    ] ifFalse:[
+                        line := line - 1.
+                        l := list at:line.
+                        col := l size + 1.
+                    ]
+                ] ifFalse:[
+                    (self characterAtLine:line col:col) isSeparator ifFalse:[
+                        self wordAtLine:line col:col do:[
+                            :beginLine :beginCol :endLine :endCol :style |
+
+                            line := beginLine.
+                            col := beginCol.
+                            style == #wordLeft ifTrue:[
+                                col := col + 1
+                            ].
+                            searching := false.
+                        ]
+                    ] ifTrue:[
+                        col := col - 1
+                    ]
+                ]
+            ]
+        ].
+        self cursorLine:line col:col
     ]
 
     "Created: 8.3.1996 / 21:52:48 / cg"
@@ -2144,22 +2211,22 @@
     |wasOn nv nl|
 
     cursorLine isNil ifTrue:[
-	self setCursorLine:(firstLineShown + nFullLinesShown - 1).
+        self setCursorLine:(firstLineShown + nFullLinesShown - 1).
     ].
     nl := cursorLine - n.
     nl < 1 ifTrue:[nl := 1].
 
     (nl ~~ cursorLine) ifTrue: [
-	wasOn := self hideCursor.
-	cursorVisibleLine notNil ifTrue:[
-	    nv := cursorVisibleLine - n.
-	    nv < 1 ifTrue:[
-		self scrollUp:(nv negated + 1)
-	    ].
-	].
-	self setValidatedCursorLine:nl col:cursorCol.
+        wasOn := self hideCursor.
+        cursorVisibleLine notNil ifTrue:[
+            nv := cursorVisibleLine - n.
+            nv < 1 ifTrue:[
+                self scrollUp:(nv negated + 1)
+            ].
+        ].
+        self setValidatedCursorLine:nl col:cursorCol.
 "/        wasOn ifTrue:[self showCursor].
-	self makeCursorVisibleAndShowCursor:wasOn.
+        self makeCursorVisibleAndShowCursor:wasOn.
     ]
 
     "Modified: 22.5.1996 / 18:28:11 / cg"
@@ -2178,7 +2245,7 @@
 
     newCol := colNr.
     (newCol < 1) ifTrue:[
-	newCol := 1
+        newCol := 1
     ].
     self setValidatedCursorCol:newCol.
 
@@ -2202,96 +2269,96 @@
      (but not, if there is a selection - to avoid confusion)"
 
     shown ifTrue:[
-	cursorVisibleLine notNil ifTrue:[
-	    self hasSelection ifFalse:[
-		self drawCursorCharacter
-	    ]
-	]
+        cursorVisibleLine notNil ifTrue:[
+            self hasSelection ifFalse:[
+                self drawCursorCharacter
+            ]
+        ]
     ]
 !
 
 drawCursor:cursorType with:fgColor and:bgColor
     "draw a cursor; the argument cursorType specifies what type
      of cursor should be drawn.
-     Currently, supported are: #none,
-			       #block, #frame, #ibeam, #caret, #solidCaret
-			       #bigCaret and #bigSolidCaret"
+     Currently, supported are: #none, 
+                               #block, #frame, #ibeam, #caret, #solidCaret
+                               #bigCaret and #bigSolidCaret"
 
     |x y w char y2 x1 x2 oldPaint oldClip|
 
     self hasSelection ifTrue:[
-	"
-	 hide cursor, if there is a selection
-	"
-	^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+        "
+         hide cursor, if there is a selection
+        "
+        ^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
     ].
 
     cursorType == #none ifTrue:[
-	^ self
+        ^ self
     ].
 
     cursorType == #block ifTrue:[
-	super drawVisibleLine:cursorVisibleLine col:cursorCol with:fgColor and:bgColor.
-	^ self
+        super drawVisibleLine:cursorVisibleLine col:cursorCol with:fgColor and:bgColor.
+        ^ self
     ].
     x := (self xOfCol:cursorCol inVisibleLine:cursorVisibleLine) - viewOrigin x.
     y := self yOfVisibleLine:cursorVisibleLine.
 
     oldPaint := self paint. "/ do not clobber GC
     cursorType == #frame ifTrue:[
-	super redrawVisibleLine:cursorVisibleLine col:cursorCol.
-
-	char := self characterUnderCursor asString.
-	self paint:bgColor.
-	self displayRectangleX:x y:y width:(gc font widthOf:char) height:fontHeight-2.
+        super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+
+        char := self characterUnderCursor asString.
+        self paint:bgColor.                       
+        self displayRectangleX:x y:y width:(gc font widthOf:char) height:fontHeight-2.
     ] ifFalse:[
-	self paint:bgColor.
-	cursorType == #ibeam ifTrue:[
-	    x1 := x - 1.
-	    y2 := y + fontHeight - lineSpacing - 1.
-	    self displayLineFromX:x1 y:y toX:x1 y:y2.
-	    self displayLineFromX:x y:y toX:x y:y2.
-	    ^ self
-	].
-
-	cursorType == #Ibeam ifTrue:[
-	    x1 := x - 1.
-	    y := y + 1.
-	    y2 := y + fontHeight - lineSpacing - 1.
-	    self displayLineFromX:x1 y:y toX:x1 y:y2.
-	    self displayLineFromX:x y:y toX:x y:y2.
-	    self displayLineFromX:x1-2 y:y toX:x+2 y:y.
-	    self displayLineFromX:x1-2 y:y2 toX:x+2 y:y2.
-	    ^ self
-	].
-
-	y := y + fontHeight - 3.
-	((cursorType == #bigCaret) or:[cursorType == #bigSolidCaret]) ifTrue:[
-	    w := (fontWidth * 2 // 3) max:4.
-	    y2 := y + w + (w//2).
-	] ifFalse:[
-	    w := (fontWidth // 2) max:4.
-	    y2 := y + w.
-	].
-	x1 := x - w.
-	x2 := x + w.
-
-	oldClip := self clippingRectangleOrNil.
-	self clippingRectangle:(margin@margin extent:(width-margin) @ (height-margin)).
-
-	cursorType == #caret ifTrue:[
-	    self lineWidth:2.
-	    self displayLineFromX:x1 y:y2 toX:x y:y.
-	    self displayLineFromX:x y:y toX:x2 y:y2.
-	] ifFalse:[
-	    "anything else: solidCaret"
-
-	    self fillPolygon:(Array with:(x1 @ y2)
-				    with:(x @ y)
-				    with:(x2 @ y2))
-	].
-
-	self clippingRectangle:oldClip
+        self paint:bgColor.
+        cursorType == #ibeam ifTrue:[
+            x1 := x - 1.
+            y2 := y + fontHeight - lineSpacing - 1.
+            self displayLineFromX:x1 y:y toX:x1 y:y2.
+            self displayLineFromX:x y:y toX:x y:y2.
+            ^ self
+        ].
+
+        cursorType == #Ibeam ifTrue:[
+            x1 := x - 1.
+            y := y + 1.
+            y2 := y + fontHeight - lineSpacing - 1.
+            self displayLineFromX:x1 y:y toX:x1 y:y2.
+            self displayLineFromX:x y:y toX:x y:y2.
+            self displayLineFromX:x1-2 y:y toX:x+2 y:y.
+            self displayLineFromX:x1-2 y:y2 toX:x+2 y:y2.
+            ^ self
+        ].
+
+        y := y + fontHeight - 3.
+        ((cursorType == #bigCaret) or:[cursorType == #bigSolidCaret]) ifTrue:[
+            w := (fontWidth * 2 // 3) max:4.
+            y2 := y + w + (w//2).
+        ] ifFalse:[
+            w := (fontWidth // 2) max:4.
+            y2 := y + w.
+        ].
+        x1 := x - w.
+        x2 := x + w.
+
+        oldClip := self clippingRectangleOrNil.
+        self clippingRectangle:(margin@margin extent:(width-margin) @ (height-margin)).
+
+        cursorType == #caret ifTrue:[
+            self lineWidth:2.
+            self displayLineFromX:x1 y:y2 toX:x y:y.
+            self displayLineFromX:x y:y toX:x2 y:y2.
+        ] ifFalse:[
+            "anything else: solidCaret"
+
+            self fillPolygon:(Array with:(x1 @ y2)
+                                    with:(x @ y)
+                                    with:(x2 @ y2))
+        ].
+
+        self clippingRectangle:oldClip
     ].
     self paint:oldPaint.
 
@@ -2306,9 +2373,9 @@
     (hasKeyboardFocus
      and:[self enabled
      and:[self isReadOnly not]]) ifTrue:[
-	self drawFocusCursor
+        self drawFocusCursor
     ] ifFalse:[
-	self drawNoFocusCursor
+        self drawNoFocusCursor
     ]
 
     "Modified: / 23.3.1999 / 13:52:48 / cg"
@@ -2318,10 +2385,10 @@
     "draw the cursor when the focus is in the view."
 
     self hasSelection ifTrue:[
-	^ super redrawVisibleLine:cursorVisibleLine col:(cursorCol max:1).
+        ^ super redrawVisibleLine:cursorVisibleLine col:(cursorCol max:1).
     ].
     cursorType == #none ifTrue:[
-	^ self undrawCursor
+        ^ self undrawCursor
     ].
     self drawCursor:cursorType with:cursorFgColor and:cursorBgColor.
 
@@ -2334,16 +2401,16 @@
     |cType|
 
     self hasSelection ifTrue:[
-	^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+        ^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
     ].
 
     cType := cursorTypeNoFocus ? cursorType.
     cType == #none ifTrue:[
-	^ self undrawCursor
+        ^ self undrawCursor
     ].
 
     cType == #block ifTrue:[
-	^ self drawCursor:#frame with:cursorNoFocusFgColor and:cursorBgColor
+        ^ self drawCursor:#frame with:cursorNoFocusFgColor and:cursorBgColor
     ].
 
     ^ self drawCursor:cType with:cursorNoFocusFgColor and:cursorNoFocusFgColor.
@@ -2375,24 +2442,24 @@
     |line col|
 
     cursorLine notNil ifTrue:[
-	line := cursorLine.
-	col := cursorCol.
-	"
-	 if there is a selection, its better to
-	 have its start being visible, instead of the end
-	"
-	(selectionStartLine notNil
-	and:[selectionEndLine notNil]) ifTrue:[
-	    expandingTop ~~ false ifTrue:[
-		line := selectionStartLine.
-		col := selectionStartCol.
-	    ] ifFalse:[
-		line := selectionEndLine.
-		col := selectionEndCol
-	    ]
-	].
-	self makeLineVisible:line.
-	self makeColVisible:col inLine:line
+        line := cursorLine.
+        col := cursorCol.
+        "
+         if there is a selection, its better to
+         have its start being visible, instead of the end
+        "
+        (selectionStartLine notNil
+        and:[selectionEndLine notNil]) ifTrue:[
+            expandingTop ~~ false ifTrue:[
+                line := selectionStartLine.
+                col := selectionStartCol.
+            ] ifFalse:[
+                line := selectionEndLine.
+                col := selectionEndCol
+            ]
+        ].
+        self makeLineVisible:line.
+        self makeColVisible:col inLine:line
     ]
 
     "Modified: 6.3.1996 / 13:46:46 / cg"
@@ -2467,15 +2534,15 @@
     line2 := self selectionEndLine.
     col2 := self selectionEndCol.
     (line1 notNil
-	and:[ col1 notNil
-	and:[ line2 notNil
-	and:[ col2 notNil ]]])
+        and:[ col1 notNil
+        and:[ line2 notNil
+        and:[ col2 notNil ]]])
     ifTrue:[
-	self insertString:Character quote asString atLine:line2 col:col2+1.
-	self insertString:Character quote asString atLine:line1 col:col1.
-	self selectFromLine:line1 col:col1 toLine:line2 col:col2+2.
+        self insertString:Character quote asString atLine:line2 col:col2+1.
+        self insertString:Character quote asString atLine:line1 col:col1.
+        self selectFromLine:line1 col:col1 toLine:line2 col:col2+2.
     ] ifFalse:[
-	self beep.
+        self beep.
     ]
 
     "Created: / 06-06-2016 / 11:03:36 / cg"
@@ -2487,78 +2554,78 @@
     |prevCol line oldClip x y e1 e2 e3|
 
     cursorVisibleLine notNil ifTrue:[
-	prevCol := cursorCol - 1.
-
-	"/ if there is any italic stuff in the cursor line,
-	"/ redraw it completely (because characters overlap).
-	cursorCol > 1 ifTrue:[
-	    (line := self listAt:cursorLine) notNil ifTrue:[
-		line hasChangeOfEmphasis ifTrue:[
-		    line size >= (cursorCol-1) ifTrue:[
-			e1 := Text extractEmphasis:#italic from:(line emphasisAt:cursorCol-1).
-			line size >= (cursorCol) ifTrue:[
-			    e2 := Text extractEmphasis:#italic from:(line emphasisAt:cursorCol).
-			    line size >= (cursorCol+1) ifTrue:[
-				e3 := Text extractEmphasis:#italic from:(line emphasisAt:cursorCol+1)
-			    ].
-			].
-		    ].
-		    (e1 notNil or:[e2 notNil or:[e3 notNil]]) ifTrue:[
-			^ super redrawVisibleLine:cursorVisibleLine
-		    ]
-		]
-	    ]
-	].
-
-	((cursorType == #caret)
-	 or:[cursorType == #solidCaret
-	 or:[cursorType == #bigSolidCaret
-	 or:[cursorType == #bigCaret
-	 or:[cursorType == #Ibeam]]]]) ifTrue:[
-	    "caret-cursor touches 4 characters"
-	    ((cursorCol > 1) and:[fontIsFixedWidth]) ifTrue:[
-		super redrawVisibleLine:cursorVisibleLine-1 from:prevCol to:cursorCol.
-		super redrawVisibleLine:cursorVisibleLine from:prevCol to:cursorCol.
-		super redrawVisibleLine:cursorVisibleLine+1 from:prevCol to:cursorCol.
-	    ] ifFalse:[
-		"care for left margin"
-		super redrawVisibleLine:cursorVisibleLine; redrawVisibleLine:cursorVisibleLine+1.
-	    ].
-	    ^ self
-	].
-
-	cursorType == #ibeam ifTrue:[
-	    "ibeam-cursor touches 2 characters"
-	    cursorCol > 1 ifTrue:[
-		super redrawVisibleLine:cursorVisibleLine from:prevCol to:cursorCol.
-	    ] ifFalse:[
-		"care for left margin"
-		super redrawVisibleLine:cursorVisibleLine.
-	    ].
-	    ^ self
-	].
-
-	"block cursor is simple - just one character under cursor"
-
-	"/ however, if italic characters are involved, we must care
-	"/ for the chars before/after the cursor.
-	"/ We redraw the part of the previous character which got
-	"/ detroyed by the block cursor.
-	"/ (must change the clip, to avoid destroying the prev-prev character)
-
-	line := self visibleAt:cursorVisibleLine.
-	(line notNil and:[line isText]) ifTrue:[
-	    cursorCol > 1 ifTrue:[
-		oldClip := self clippingRectangleOrNil.
-		x := (self xOfCol:cursorCol inVisibleLine:cursorVisibleLine) - viewOrigin x.
-		y := self yOfVisibleLine:cursorVisibleLine.
-		self clippingRectangle:(x@y extent:((gc font width * 2) @ fontHeight)).
-		super redrawVisibleLine:cursorVisibleLine from:cursorCol-1 to:cursorCol.
-		self clippingRectangle:oldClip.
-		^ self.
-	    ].
-	].
-	super redrawVisibleLine:cursorVisibleLine col:cursorCol
+        prevCol := cursorCol - 1.
+
+        "/ if there is any italic stuff in the cursor line,
+        "/ redraw it completely (because characters overlap).
+        cursorCol > 1 ifTrue:[
+            (line := self listAt:cursorLine) notNil ifTrue:[
+                line hasChangeOfEmphasis ifTrue:[
+                    line size >= (cursorCol-1) ifTrue:[
+                        e1 := Text extractEmphasis:#italic from:(line emphasisAt:cursorCol-1).
+                        line size >= (cursorCol) ifTrue:[
+                            e2 := Text extractEmphasis:#italic from:(line emphasisAt:cursorCol).
+                            line size >= (cursorCol+1) ifTrue:[
+                                e3 := Text extractEmphasis:#italic from:(line emphasisAt:cursorCol+1)
+                            ].
+                        ].
+                    ].
+                    (e1 notNil or:[e2 notNil or:[e3 notNil]]) ifTrue:[
+                        ^ super redrawVisibleLine:cursorVisibleLine
+                    ]
+                ]
+            ]
+        ].
+
+        ((cursorType == #caret)
+         or:[cursorType == #solidCaret
+         or:[cursorType == #bigSolidCaret
+         or:[cursorType == #bigCaret
+         or:[cursorType == #Ibeam]]]]) ifTrue:[
+            "caret-cursor touches 4 characters"
+            ((cursorCol > 1) and:[fontIsFixedWidth]) ifTrue:[
+                super redrawVisibleLine:cursorVisibleLine-1 from:prevCol to:cursorCol.
+                super redrawVisibleLine:cursorVisibleLine from:prevCol to:cursorCol.
+                super redrawVisibleLine:cursorVisibleLine+1 from:prevCol to:cursorCol.
+            ] ifFalse:[
+                "care for left margin"
+                super redrawVisibleLine:cursorVisibleLine; redrawVisibleLine:cursorVisibleLine+1.
+            ].
+            ^ self
+        ].
+
+        cursorType == #ibeam ifTrue:[
+            "ibeam-cursor touches 2 characters"
+            cursorCol > 1 ifTrue:[
+                super redrawVisibleLine:cursorVisibleLine from:prevCol to:cursorCol.
+            ] ifFalse:[
+                "care for left margin"
+                super redrawVisibleLine:cursorVisibleLine.
+            ].
+            ^ self
+        ].
+
+        "block cursor is simple - just one character under cursor"
+
+        "/ however, if italic characters are involved, we must care
+        "/ for the chars before/after the cursor.
+        "/ We redraw the part of the previous character which got
+        "/ detroyed by the block cursor.
+        "/ (must change the clip, to avoid destroying the prev-prev character)
+
+        line := self visibleAt:cursorVisibleLine.
+        (line notNil and:[line isText]) ifTrue:[
+            cursorCol > 1 ifTrue:[
+                oldClip := self clippingRectangleOrNil.
+                x := (self xOfCol:cursorCol inVisibleLine:cursorVisibleLine) - viewOrigin x.
+                y := self yOfVisibleLine:cursorVisibleLine.
+                self clippingRectangle:(x@y extent:((gc font width * 2) @ fontHeight)).
+                super redrawVisibleLine:cursorVisibleLine from:cursorCol-1 to:cursorCol.
+                self clippingRectangle:oldClip.
+                ^ self.
+            ].
+        ].
+        super redrawVisibleLine:cursorVisibleLine col:cursorCol
     ]
 
     "Modified: / 15.12.1999 / 22:25:59 / cg"
@@ -2584,11 +2651,11 @@
     "/ end of a line or beyond the last line of the text
 
     self st80EditMode ifTrue:[
-	l := (self listAt:line).
-	max := l size + 1.
-	col > max ifTrue:[
-	    ^ max
-	]
+        l := (self listAt:line).
+        max := l size + 1.
+        col > max ifTrue:[
+            ^ max
+        ]
     ].
     ^ col
 
@@ -2605,12 +2672,12 @@
 
     "/
     "/ in st80Mode, the cursor may not be positioned
-    "/ beyond the last line
-    "/ (but it must be posible to place it on one line below the last one
+    "/ 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 + 1)) max:1
+        ^ (line min:(list size + 1)) max:1
     ].
     ^ line
 
@@ -2622,11 +2689,11 @@
     "evaluate aBlock with cursor off; turn it on afterwards."
 
     (shown not or:[cursorShown not]) ifTrue:[
-	^ aBlock value
+        ^ aBlock value
     ].
     self hideCursor.
     aBlock ensure:[
-	self showCursor
+        self showCursor
     ]
 ! !
 
@@ -2636,15 +2703,15 @@
     "enable/disable drop support"
 
     aBoolean ifFalse:[
-	dropTarget := nil.
+        dropTarget := nil.
     ] ifTrue:[
-	dropTarget isNil ifTrue:[
-	    dropTarget := DropTarget
-				receiver:self
-				argument:nil
-				dropSelector:#'drop:'
-				canDropSelector:#'canDrop:'
-	]
+        dropTarget isNil ifTrue:[
+            dropTarget := DropTarget 
+                                receiver:self
+                                argument:nil
+                                dropSelector:#'drop:'
+                                canDropSelector:#'canDrop:'
+        ]
     ].
 !
 
@@ -2691,53 +2758,53 @@
 
     fn := aDropObject asFilename.
     (fn exists and:[fn isRegularFile]) ifTrue:[
-	enforcedDropMode := UserPreferences current enforcedDropModeForFiles.
-	(enforcedDropMode notNil
-	and:[enforcedDropMode ~~ #name or:[fn fileSize <= (1024*1024)]]) ifTrue:[
-	    pasteWhat := enforcedDropMode.
-	] ifFalse:[
-	    sensor := self sensor.
-	    (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
-		pasteWhat := #name.
-	    ] ifFalse:[
-		(sensor metaDown) ifTrue:[
-		    pasteWhat := #contents.
-		] ifFalse:[
-		    dontAskAgainHolder := false asValue.
-		    answer := Dialog
-			confirmWithCancel:(resources
-					    stringWithCRs:'Drop the Filename (%1)\or its Contents ?\\Hint: bypass this dialog by pressing SHIFT/CTRL or ALT during the next drop.\SHIFT/CTRL to drop the name, ALT for the contents.'
-					    with:fn name allBold)
-			labels:#( 'Cancel' 'Name' 'Contents' )
-			values:#( nil #name #contents )
-			default:#contents
-			check:(resources string:'Do not ask again; instead, always paste the contents of small files.') on:dontAskAgainHolder
-			title:(resources string:'Drop What').
-		    answer isNil ifTrue:[ ^ self ].
-
-		    dontAskAgainHolder value ifTrue:[
-			UserPreferences current enforcedDropModeForFiles:#contents
-		    ].
-		    pasteWhat := answer.
-		]
-	    ]
-	].
+        enforcedDropMode := UserPreferences current enforcedDropModeForFiles.
+        (enforcedDropMode notNil 
+        and:[enforcedDropMode ~~ #name or:[fn fileSize <= (1024*1024)]]) ifTrue:[
+            pasteWhat := enforcedDropMode.
+        ] ifFalse:[
+            sensor := self sensor.
+            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
+                pasteWhat := #name.
+            ] ifFalse:[
+                (sensor metaDown) ifTrue:[
+                    pasteWhat := #contents.
+                ] ifFalse:[
+                    dontAskAgainHolder := false asValue.
+                    answer := Dialog
+                        confirmWithCancel:(resources
+                                            stringWithCRs:'Drop the Filename (%1)\or its Contents ?\\Hint: bypass this dialog by pressing SHIFT/CTRL or ALT during the next drop.\SHIFT/CTRL to drop the name, ALT for the contents.'
+                                            with:fn name allBold)
+                        labels:#( 'Cancel' 'Name' 'Contents' )
+                        values:#( nil #name #contents )
+                        default:#contents
+                        check:(resources string:'Do not ask again; instead, always paste the contents of small files.') on:dontAskAgainHolder
+                        title:(resources string:'Drop What').
+                    answer isNil ifTrue:[ ^ self ].
+
+                    dontAskAgainHolder value ifTrue:[
+                        UserPreferences current enforcedDropModeForFiles:#contents
+                    ].
+                    pasteWhat := answer.
+                ]
+            ]
+        ].
     ].
 
     pasteWhat == #name ifTrue:[
-	text := fn pathName
+        text := fn pathName
     ] ifFalse:[
-	self withWaitCursorDo:[
-	    text := fn contentsAsString
-	].
-	(app := self application) notNil ifTrue:[
-	    app droppedFile:fn in:self
-	].
-    ].
-
-    self
-	undoablePaste:text
-	info:'Drop File'.
+        self withWaitCursorDo:[
+            text := fn contentsAsString
+        ].
+        (app := self application) notNil ifTrue:[
+            app droppedFile:fn in:self
+        ].
+    ].
+
+    self 
+        undoablePaste:text 
+        info:'Drop File'.
 
     "Created: / 13-10-2006 / 17:38:31 / cg"
     "Modified: / 28-07-2007 / 13:27:09 / cg"
@@ -2750,19 +2817,19 @@
     |text|
 
     (aDropObject isFileObject) ifTrue:[
-	self dropFileObject:aDropObject
+        self dropFileObject:aDropObject
     ] ifFalse:[
-	aDropObject isTextObject ifTrue:[
-	    text := aDropObject theObject.
-	    text isStringCollection ifTrue:[
-		text := text asStringWithoutFinalCR
-	    ].
-	] ifFalse:[
-	    text := aDropObject theObject asString
-	].
-	self
-	    undoablePaste:text
-	    info:'Drop'.
+        aDropObject isTextObject ifTrue:[
+            text := aDropObject theObject.
+            text isStringCollection ifTrue:[
+                text := text asStringWithoutFinalCR
+            ].
+        ] ifFalse:[
+            text := aDropObject theObject asString
+        ].
+        self 
+            undoablePaste:text 
+            info:'Drop'.
     ].
 
     "Created: / 13-10-2006 / 17:37:05 / cg"
@@ -2774,7 +2841,7 @@
      drop objects (old API)"
 
     aCollectionOfDropObjects do:[:el |
-	self dropObject:el
+        self dropObject:el
     ].
 
     "Created: / 13-10-2006 / 15:59:40 / cg"
@@ -2791,32 +2858,32 @@
     line1 := self selectionStartLine.
     line2 := self selectionEndLine.
     line1 isNil ifTrue:[
-	line1 := self perform:#cursorLine ifNotUnderstood:nil.
-	line1 notNil ifTrue:[
-	    line2 := line1
-	]
+        line1 := self perform:#cursorLine ifNotUnderstood:nil.
+        line1 notNil ifTrue:[
+            line2 := line1
+        ]
     ].
     line1 notNil ifTrue:[
-	line1 to:line2 do:[:lineNr |
-	    |line col1 col2 newLine|
-
-	    line := (self listAt:lineNr) copy.
-	    line size > 0 ifTrue:[
-		lineNr == line1 ifTrue:[
-		    col1 := selectionStartCol.
-		] ifFalse:[
-		    col1 := 1.
-		].
-		lineNr == line2 ifTrue:[
-		    col2 := selectionEndCol.
-		] ifFalse:[
-		    col2 := (self listAt:lineNr) size.
-		].
-		newLine := converter value:line value:lineNr value:col1 value:col2.
-		self withoutRedrawAt:lineNr put:newLine.
-		self invalidateLine:lineNr.
-	    ].
-	].
+        line1 to:line2 do:[:lineNr |
+            |line col1 col2 newLine|
+
+            line := (self listAt:lineNr) copy.
+            line size > 0 ifTrue:[
+                lineNr == line1 ifTrue:[
+                    col1 := selectionStartCol.
+                ] ifFalse:[
+                    col1 := 1.
+                ].
+                lineNr == line2 ifTrue:[
+                    col2 := selectionEndCol.
+                ] ifFalse:[
+                    col2 := (self listAt:lineNr) size.
+                ].
+                newLine := converter value:line value:lineNr value:col1 value:col2.
+                self withoutRedrawAt:lineNr put:newLine.
+                self invalidateLine:lineNr.
+            ].
+        ].
     ]
 
     "Created: / 06-06-2016 / 10:53:17 / cg"
@@ -2826,13 +2893,13 @@
     "to-lower selected text"
 
     self applyConverterToSelection:[:line :lnr :col1 :col2 |
-	col1 to:col2 do:[:col |
-	    |ch|
-
-	    ch := line at:col.
-	    line at:col put:ch asLowercase.
-	].
-	line.
+        col1 to:col2 do:[:col |
+            |ch|
+
+            ch := line at:col.
+            line at:col put:ch asLowercase.
+        ].
+        line.        
     ].
 
     "Created: / 06-06-2016 / 10:50:28 / cg"
@@ -2842,72 +2909,72 @@
     "toLower/toUppercaseFirst/toUpper selected text"
 
     self applyConverterToSelection:[:line :lineNr :col1 :col2 |
-	|isAllLower isLowerFirst isAllUpper isUpperFirst
-	 makeLowercase makeUppercase makeUppercaseFirst makeLowercaseFirst|
-
-	isAllLower := isAllUpper := isUpperFirst := isLowerFirst := true.
-	col1 to:col2 do:[:col |
-	    |ch|
-
-	    ch := line at:col.
-	    ch isUppercase ifTrue:[
-		isAllLower := false.
-		col == col1 ifTrue:[
-		    isLowerFirst := false.
-		].
-	    ] ifFalse:[
-		ch isLowercase ifTrue:[
-		    isAllUpper := false.
-		    col == col1 ifTrue:[
-			isUpperFirst := false.
-		    ].
-		]
-	    ].
-	].
-
-	makeLowercase := makeUppercase := makeUppercaseFirst := makeLowercaseFirst := false.
-	isLowerFirst ifTrue:[
-	    makeUppercaseFirst := true.
-	] ifFalse:[
-	    "/ must remember where we come from - otherwise, we end up
-	    "/ in upperFirst - lowerFirst cycle.
-	    "/ think about a good place to store this state
-	    false "(isUpperFirst and:[isAllUpper not])" ifTrue:[
-		makeLowercaseFirst := true.
-	     ] ifFalse:[
-		isAllUpper ifTrue:[
-		    makeLowercase := true.
-		] ifFalse:[
-		    makeUppercase := true.
-		]
-	    ]
-	].
-	makeUppercaseFirst ifTrue:[
-	    line at:col1 put:(line at:col1) asUppercase.
-	] ifFalse:[
-	    makeLowercaseFirst ifTrue:[
-		line at:col1 put:(line at:col1) asLowercase.
-	    ] ifFalse:[
-		col1 to:col2 do:[:col |
-		    |ch|
-
-		    ch := line at:col.
-		    ch := makeLowercase
-			    ifTrue:[ ch asLowercase ]
-			    ifFalse:[
-				makeUppercase
-				    ifTrue:[ ch asUppercase ]
-				    ifFalse:[
-					col == col1
-					    ifTrue:[ ch asUppercase ]
-					    ifFalse:[ ch asLowercase ]
-				    ]
-			    ].
-		    line at:col put:ch.
-		].
-	    ].
-	].
-	line
+        |isAllLower isLowerFirst isAllUpper isUpperFirst
+         makeLowercase makeUppercase makeUppercaseFirst makeLowercaseFirst|
+
+        isAllLower := isAllUpper := isUpperFirst := isLowerFirst := true.
+        col1 to:col2 do:[:col |
+            |ch|
+
+            ch := line at:col.
+            ch isUppercase ifTrue:[
+                isAllLower := false.
+                col == col1 ifTrue:[
+                    isLowerFirst := false.
+                ].
+            ] ifFalse:[
+                ch isLowercase ifTrue:[
+                    isAllUpper := false.
+                    col == col1 ifTrue:[
+                        isUpperFirst := false.
+                    ].
+                ]
+            ].
+        ].
+
+        makeLowercase := makeUppercase := makeUppercaseFirst := makeLowercaseFirst := false.
+        isLowerFirst ifTrue:[
+            makeUppercaseFirst := true.
+        ] ifFalse:[
+            "/ must remember where we come from - otherwise, we end up
+            "/ in upperFirst - lowerFirst cycle.
+            "/ think about a good place to store this state
+            false "(isUpperFirst and:[isAllUpper not])" ifTrue:[
+                makeLowercaseFirst := true.
+             ] ifFalse:[
+                isAllUpper ifTrue:[
+                    makeLowercase := true.
+                ] ifFalse:[
+                    makeUppercase := true.
+                ]
+            ]
+        ].
+        makeUppercaseFirst ifTrue:[
+            line at:col1 put:(line at:col1) asUppercase.
+        ] ifFalse:[
+            makeLowercaseFirst ifTrue:[
+                line at:col1 put:(line at:col1) asLowercase.
+            ] ifFalse:[
+                col1 to:col2 do:[:col |
+                    |ch|
+
+                    ch := line at:col.
+                    ch := makeLowercase
+                            ifTrue:[ ch asLowercase ]
+                            ifFalse:[
+                                makeUppercase
+                                    ifTrue:[ ch asUppercase ]
+                                    ifFalse:[
+                                        col == col1
+                                            ifTrue:[ ch asUppercase ]
+                                            ifFalse:[ ch asLowercase ]
+                                    ]
+                            ].
+                    line at:col put:ch.
+                ].
+            ].
+        ].
+        line
     ]
 
     "Created: / 14-07-2011 / 11:40:26 / cg"
@@ -2918,13 +2985,13 @@
     "to-upper selected text"
 
     self applyConverterToSelection:[:line :lnr :col1 :col2 |
-	col1 to:col2 do:[:col |
-	    |ch|
-
-	    ch := line at:col.
-	    line at:col put:ch asUppercase.
-	].
-	line.
+        col1 to:col2 do:[:col |
+            |ch|
+
+            ch := line at:col.
+            line at:col put:ch asUppercase.
+        ].
+        line.        
     ].
 
     "Created: / 06-06-2016 / 11:09:04 / cg"
@@ -2934,23 +3001,23 @@
     "to-upperFirst selected text"
 
     self applyConverterToSelection:[:line :lnr :col1 :col2 |
-	|state|
-
-	state := #first.
-	col1 to:col2 do:[:col |
-	    |ch|
-
-	    ch := line at:col.
-	    ch isSeparator ifFalse:[
-		state == #first ifTrue:[
-		    line at:col put:ch asUppercase.
-		    state := #skipRest
-		]
-	    ] ifTrue:[
-		state := #first
-	    ]
-	].
-	line.
+        |state|
+
+        state := #first.
+        col1 to:col2 do:[:col |
+            |ch|
+
+            ch := line at:col.
+            ch isSeparator ifFalse:[
+                state == #first ifTrue:[
+                    line at:col put:ch asUppercase.
+                    state := #skipRest
+                ]
+            ] ifTrue:[
+                state := #first
+            ]
+        ].
+        line.        
     ].
 
     "Created: / 06-06-2016 / 10:50:52 / cg"
@@ -2960,8 +3027,8 @@
     "copy the selection into the pastBuffer and delete it"
 
     selectionStartLine notNil ifTrue:[
-	self setClipboardText:(self selection).
-	self deleteSelection.
+        self setClipboardText:(self selection).
+        self deleteSelection.
     ].
 
     "Created: 27.1.1996 / 16:23:28 / cg"
@@ -2981,16 +3048,16 @@
     "delete a single character at colNr in line lineNr"
 
     self st80EditMode ifTrue:[
-	(self listAt:cursorLine) size + 1 = colNr ifTrue:[
-	    | wasOn |
-	    wasOn := self hideCursor.
-	    self
-		cursorReturn;
-		cursorCol:1;
-		deleteCharBeforeCursor.
-	    wasOn ifTrue:[ self showCursor].
-	    ^ self.
-	].
+        (self listAt:cursorLine) size + 1 = colNr ifTrue:[
+            | wasOn |
+            wasOn := self hideCursor.
+            self
+                cursorReturn;
+                cursorCol:1;
+                deleteCharBeforeCursor.
+            wasOn ifTrue:[ self showCursor].
+            ^ self.
+        ].
     ].
 
     self deleteCharsAtLine:lineNr fromCol:colNr toCol:colNr
@@ -3003,34 +3070,34 @@
 
     wasOn := self hideCursor.
     (autoIndent and:[ (tabPositions includes:cursorCol)]) ifTrue:[
-	prevTab := (self prevTabBefore:cursorCol) max:1.
-	ln := originalLine := (list at:cursorLine ifAbsent:'') ? ''.
-	ln size < prevTab ifTrue:[
-	    ln := ln , (String new:prevTab withAll:Character space).
-	].
-	(ln copyTo:prevTab) isBlank ifTrue:[
-	    (ln copyFrom:prevTab+1) isBlank ifTrue:[
-		cursorCol > prevTab ifTrue:[
-		    self st80EditMode ifTrue:[
-			"/ ensure that there is no conflict here: st80EditMode will
-			"/ not allow a cursor position beyond the end of line,
-			"/ so ensure that cursorLine:col: will force us to the beginning of the line
-			originalLine size < prevTab ifTrue:[
-			    self checkForExistingLine:cursorLine.
-			    self basicListAt:cursorLine put:ln
-			]
-		    ].
-		    self cursorLine:cursorLine col:prevTab.
-		    wasOn ifTrue:[ self showCursor ].
-		    ^  self
-		].
-	    ] ifFalse:[
-		self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
-		self cursorLine:cursorLine col:prevTab.
-		wasOn ifTrue:[ self showCursor ].
-		^  self.
-	    ]
-	].
+        prevTab := (self prevTabBefore:cursorCol) max:1.
+        ln := originalLine := (list at:cursorLine ifAbsent:'') ? ''.
+        ln size < prevTab ifTrue:[
+            ln := ln , (String new:prevTab withAll:Character space).
+        ].
+        (ln copyTo:prevTab) isBlank ifTrue:[
+            (ln copyFrom:prevTab+1) isBlank ifTrue:[
+                cursorCol > prevTab ifTrue:[
+                    self st80EditMode ifTrue:[
+                        "/ ensure that there is no conflict here: st80EditMode will
+                        "/ not allow a cursor position beyond the end of line,
+                        "/ so ensure that cursorLine:col: will force us to the beginning of the line
+                        originalLine size < prevTab ifTrue:[
+                            self checkForExistingLine:cursorLine.    
+                            self basicListAt:cursorLine put:ln
+                        ]
+                    ].
+                    self cursorLine:cursorLine col:prevTab.
+                    wasOn ifTrue:[ self showCursor ].
+                    ^  self
+                ].
+            ] ifFalse:[
+                self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
+                self cursorLine:cursorLine col:prevTab.
+                wasOn ifTrue:[ self showCursor ].
+                ^  self.
+            ]
+        ].
     ].
 
 "/        (autoIndent
@@ -3046,32 +3113,32 @@
 "/            ]
 "/        ]
 "/    ] ifFalse:[
-	soCol := 1.
+        soCol := 1.
 "/    ].
 
     (cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[
-	"
-	 somewhere in the middle of a line
-	"
-	self cursorLeft.
-	self deleteCharAtLine:cursorLine col:cursorCol.
+        "
+         somewhere in the middle of a line
+        "
+        self cursorLeft.
+        self deleteCharAtLine:cursorLine col:cursorCol.
     ] ifFalse:[
-	"
-	 at begin of line - merge with previous line;
-	 except for the very first line.
-	"
-	(cursorLine == 1) ifFalse:[
-	    lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
-	    lineNrAboveCursor < cursorLine ifTrue:[
-		(lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
-		    "/ we are beyond the end of the text.
-		    "/ move the cursor to the previous line.
-		    self cursorLine:lineNrAboveCursor col:1.
-		] ifFalse:[
-		    self mergeLine:lineNrAboveCursor removeBlanks:false.
-		]
-	    ]
-	]
+        "
+         at begin of line - merge with previous line;
+         except for the very first line.
+        "
+        (cursorLine == 1) ifFalse:[
+            lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
+            lineNrAboveCursor < cursorLine ifTrue:[
+                (lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
+                    "/ we are beyond the end of the text.
+                    "/ move the cursor to the previous line.
+                    self cursorLine:lineNrAboveCursor col:1.
+                ] ifFalse:[
+                    self mergeLine:lineNrAboveCursor removeBlanks:false.
+                ]
+            ]
+        ]
     ].
     wasOn ifTrue:[ self showCursor ]
 
@@ -3084,7 +3151,7 @@
     |line|
 
     (line := self listAt:lineNr) notNil ifTrue:[
-	self deleteCharsAtLine:lineNr fromCol:colNr toCol:(line size)
+        self deleteCharsAtLine:lineNr fromCol:colNr toCol:(line size)
     ]
 
 !
@@ -3121,8 +3188,8 @@
     line1 := self lineOfCharacterPosition:charPos1.
     col1 := charPos1 - (self characterPositionOfLine:line1 col:1) + 1.
     col1 == 0 ifTrue:[
-	line1 := line1 - 1.
-	col1 := (self listAt:line1) size + 1.
+        line1 := line1 - 1.
+        col1 := (self listAt:line1) size + 1.
     ].
 
     line2 := self lineOfCharacterPosition:charPos2.
@@ -3142,17 +3209,17 @@
     startLine > list size ifTrue:[ ^ self]. "/ deleted space below text
 
     (startLine == endLine) ifTrue:[
-	"/ delete chars within a line
-	self deleteCharsAtLine:startLine fromCol:startCol toCol:endCol.
-	^ self
+        "/ delete chars within a line
+        self deleteCharsAtLine:startLine fromCol:startCol toCol:endCol.
+        ^ self
     ].
 
     ((startCol == 1) and:[endCol == 0]) ifTrue:[
-	"/ delete full lines only
-	endLine > startLine ifTrue:[
-	    self deleteFromLine:startLine toLine:(endLine - 1)
-	].
-	^ self
+        "/ delete full lines only
+        endLine > startLine ifTrue:[
+            self deleteFromLine:startLine toLine:(endLine - 1)
+        ].
+        ^ self
     ].
 
     "/ delete right rest of 1st line
@@ -3160,39 +3227,39 @@
 
     "/ delete the inner lines ...
     endLine > (startLine + 1) ifTrue:[
-	self deleteFromLine:(startLine + 1) toLine:(endLine - 1)
+        self deleteFromLine:(startLine + 1) toLine:(endLine - 1)
     ].
 
     (endCol ~~ 0) ifTrue:[
-	"/ delete the left rest of the last line
-
-	self deleteCharsAtLine:(startLine + 1) toCol:endCol.
-
-	"/ must add blanks, if startCol lies beyond end of startLine
-	startLine <= list size ifTrue:[
-	    line := list at:startLine.
-	    lineSize := line size.
-	    (startCol > lineSize) ifTrue:[
-		newLine := line.
-		line isNil ifTrue:[
-		    newLine := String new:(startCol - 1)
-		] ifFalse:[
-		    nMore := startCol - 1 - lineSize.
-		    nMore > 0 ifTrue:[
-			newLine := line , (line species new:nMore)
-		    ]
-		].
-		newLine ~~ line ifTrue:[
-		    self basicListAt:startLine put:newLine.
-		].
-		"/ TODO: remember old maxwidth of linerange,
-		"/ only clear widthOfWidestLine, if this max
-		"/ length was (one of) the longest.
-		"/ avoids slow delete with huge texts.
-		widthOfWidestLine := nil. "/ i.e. unknown
-		self textChanged.
-	    ]
-	]
+        "/ delete the left rest of the last line
+
+        self deleteCharsAtLine:(startLine + 1) toCol:endCol.
+
+        "/ must add blanks, if startCol lies beyond end of startLine
+        startLine <= list size ifTrue:[
+            line := list at:startLine.
+            lineSize := line size.
+            (startCol > lineSize) ifTrue:[
+                newLine := line.
+                line isNil ifTrue:[
+                    newLine := String new:(startCol - 1)
+                ] ifFalse:[
+                    nMore := startCol - 1 - lineSize.
+                    nMore > 0 ifTrue:[
+                        newLine := line , (line species new:nMore)
+                    ]
+                ].
+                newLine ~~ line ifTrue:[
+                    self basicListAt:startLine put:newLine.
+                ].
+                "/ TODO: remember old maxwidth of linerange,
+                "/ only clear widthOfWidestLine, if this max
+                "/ length was (one of) the longest.
+                "/ avoids slow delete with huge texts.
+                widthOfWidestLine := nil. "/ i.e. unknown
+                self textChanged.
+            ]
+        ]
     ].
 
     "/ merge the left rest of 1st line with right rest of last line into one
@@ -3242,9 +3309,9 @@
 
     (list isNil or:[startLine > list size]) ifTrue:[^ false].
     (endLine > list size) ifTrue:[
-	lastLine := list size
+        lastLine := list size
     ] ifFalse:[
-	lastLine := endLine
+        lastLine := endLine
     ].
     self basicListRemoveFromIndex:startLine toIndex:lastLine.
     "/ TODO: remember old maxwidth of linerange,
@@ -3266,17 +3333,17 @@
     self checkModificationsAllowed ifFalse:[ ^ self].
 
     selectionStartLine notNil ifTrue:[
-	wasOn := self hideCursor.
-
-	startLine := selectionStartLine.
-	startCol := selectionStartCol.
-	endLine := selectionEndLine.
-	endCol := selectionEndCol.
-	self unselectWithoutRedraw.
-	self deleteFromLine:startLine col:startCol toLine:endLine col:endCol.
-	self setCursorLine:startLine col:startCol.
-
-	self makeCursorVisibleAndShowCursor:wasOn
+        wasOn := self hideCursor.
+
+        startLine := selectionStartLine.
+        startCol := selectionStartCol.
+        endLine := selectionEndLine.
+        endCol := selectionEndCol.
+        self unselectWithoutRedraw.
+        self deleteFromLine:startLine col:startCol toLine:endLine col:endCol.
+        self setCursorLine:startLine col:startCol.
+
+        self makeCursorVisibleAndShowCursor:wasOn
     ]
 !
 
@@ -3287,22 +3354,22 @@
 
     self checkModificationsAllowed ifFalse:[ ^ self].
     cursorCol <= 1 ifTrue:[
-	self deleteCharBeforeCursor.
-	^ self
+        self deleteCharBeforeCursor.
+        ^ self 
     ].
 
     wasOn := self hideCursor.
-    self
-	undoableDo:[
-	    endCol := cursorCol-1.
-	    endLine := cursorLine.
-	    self cursorToPreviousWord.
-	    beginCol := cursorCol.
-	    beginLine := cursorLine.
-	    self deleteFromLine:beginLine col:beginCol toLine:endLine col:endCol.
-	    self cursorLine:cursorLine col:beginCol.
-	]
-	info:'Delete Word'.
+    self 
+        undoableDo:[
+            endCol := cursorCol-1.
+            endLine := cursorLine.
+            self cursorToPreviousWord.
+            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 ].
 
     "Modified: / 22.2.2000 / 23:59:04 / cg"
@@ -3323,7 +3390,7 @@
 
     self basicInsert:aCharacter atLine:lineNr col:colNr.
     aCharacter ~~ Character cr ifTrue:[
-	self addUndo:(DeleteCharacters line:lineNr col:colNr info:'insert').
+        self addUndo:(DeleteCharacters line:lineNr col:colNr info:'insert').
     ]
 !
 
@@ -3334,15 +3401,15 @@
 
     wasOn := self hideCursor.
     aCharacter == Character tab ifTrue:[
-	"/ needs special care to advance cursor correctly
-	self insertTabAtCursor
+        "/ needs special care to advance cursor correctly
+        self insertTabAtCursor
     ] ifFalse:[
-	self insert:aCharacter atLine:cursorLine col:cursorCol.
-	aCharacter == (Character cr) ifTrue:[
-	    self basicCursorReturn
-	] ifFalse:[
-	    self cursorRight.
-	].
+        self insert:aCharacter atLine:cursorLine col:cursorCol.
+        aCharacter == (Character cr) ifTrue:[
+            self basicCursorReturn
+        ] ifFalse:[
+            self cursorRight.
+        ].
     ].
     self makeCursorVisibleAndShowCursor:wasOn.
 
@@ -3375,68 +3442,68 @@
 
     "wrong when pasting multiple lines"
     false "autoIndent" ifTrue:[
-	indent := self leftIndentForLine:lineNr.
-
-	text := someText
-	    collect:[:ln||line|
-		ln notNil ifTrue:[
-		    line := ln withoutLeadingSeparators.
-		    (line isEmpty or:[indent == 0]) ifFalse:[
-			line := (String new:indent), line
-		    ].
-		    line
-		] ifFalse:[
-		    nil
-		]
-	    ].
+        indent := self leftIndentForLine:lineNr.
+
+        text := someText 
+            collect:[:ln||line|
+                ln notNil ifTrue:[
+                    line := ln withoutLeadingSeparators.
+                    (line isEmpty or:[indent == 0]) ifFalse:[
+                        line := (String new:indent), line
+                    ].
+                    line
+                ] ifFalse:[
+                    nil
+                ]
+            ].
     ] ifFalse:[
-	text := someText
+        text := someText
     ].
 
     visLine := self listLineToVisibleLine:lineNr.
     (shown not or:[visLine isNil]) ifTrue:[
-	self withoutRedrawInsertLines:text
-	     from:start to:end
-	     before:lineNr.
+        self withoutRedrawInsertLines:text
+             from:start to:end
+             before:lineNr.
     ] ifFalse:[
-	nLines := end - start + 1.
-	((visLine + nLines) >= nLinesShown) ifTrue:[
-	    self withoutRedrawInsertLines:text
-		 from:start to:end
-		 before:lineNr.
-	    self redrawFromVisibleLine:visLine to:nLinesShown
-	] ifFalse:[
-	    w := self widthForScrollBetween:(lineNr + nLines)
-					and:(firstLineShown + nLines + nLinesShown).
-	    srcY := topMargin + ((visLine - 1) * fontHeight).
-	    dstY := srcY + (nLines * fontHeight).
-
-	    "/
-	    "/ scroll ...
-	    "/
-	    "
-	     stupid: must catchExpose before inserting new
-	     stuff - since catchExpose may perform redraws
-	    "
-	    self catchExpose.
-	    self withoutRedrawInsertLines:text
-		 from:start to:end
-		 before:lineNr.
-	    self
-		copyFrom:self
-		x:textStartLeft y:srcY
-		toX:textStartLeft y:dstY
-		width:w
-		height:(height - dstY)
-		async:true.
-	    self redrawFromVisibleLine:visLine to:(visLine + nLines - 1).
-	    self waitForExpose
-	].
+        nLines := end - start + 1.
+        ((visLine + nLines) >= nLinesShown) ifTrue:[
+            self withoutRedrawInsertLines:text
+                 from:start to:end
+                 before:lineNr.
+            self redrawFromVisibleLine:visLine to:nLinesShown
+        ] ifFalse:[
+            w := self widthForScrollBetween:(lineNr + nLines)
+                                        and:(firstLineShown + nLines + nLinesShown).
+            srcY := topMargin + ((visLine - 1) * fontHeight).
+            dstY := srcY + (nLines * fontHeight).
+
+            "/
+            "/ scroll ...
+            "/
+            "
+             stupid: must catchExpose before inserting new
+             stuff - since catchExpose may perform redraws
+            "
+            self catchExpose.
+            self withoutRedrawInsertLines:text
+                 from:start to:end
+                 before:lineNr.
+            self
+                copyFrom:self
+                x:textStartLeft y:srcY
+                toX:textStartLeft y:dstY
+                width:w
+                height:(height - dstY)
+                async:true.
+            self redrawFromVisibleLine:visLine to:(visLine + nLines - 1).
+            self waitForExpose
+        ].
     ].
     widthOfWidestLine notNil ifTrue:[
-	text do:[:line |
-	    widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:line).
-	]
+        text do:[:line |
+            widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:line).
+        ]
     ].
     self textChanged.
 
@@ -3451,38 +3518,38 @@
     |start end nLines wasOn|
 
     lines notNil ifTrue:[
-	nLines := lines size.
-	(nLines == 1) ifTrue:[
-	    self insertStringAtCursor:(lines at:1).
-	    withCr ifTrue:[
-		self insertCharAtCursor:(Character cr)
-	    ]
-	] ifFalse:[
-	    (cursorCol ~~ 1) ifTrue:[
-		self insertStringAtCursor:(lines at:1).
-		self insertCharAtCursor:(Character cr).
-		start := 2
-	    ] ifFalse:[
-		start := 1
-	    ].
-	    withCr ifTrue:[
-		end := nLines
-	    ] ifFalse:[
-		end := nLines - 1
-	    ].
-	    (start <= nLines) ifTrue:[
-		(end >= start) ifTrue:[
-		    wasOn := self hideCursor.
-		    self insertLines:lines from:start to:end before:cursorLine.
-		    self setCursorLine:(cursorLine + (end - start + 1)).
-		    wasOn ifTrue:[self showCursor].
-		]
-	    ].
-	    withCr ifFalse:[
-		"last line without cr"
-		self insertStringAtCursor:(lines at:nLines)
-	    ]
-	]
+        nLines := lines size.
+        (nLines == 1) ifTrue:[
+            self insertStringAtCursor:(lines at:1).
+            withCr ifTrue:[
+                self insertCharAtCursor:(Character cr)
+            ]
+        ] ifFalse:[
+            (cursorCol ~~ 1) ifTrue:[
+                self insertStringAtCursor:(lines at:1).
+                self insertCharAtCursor:(Character cr).
+                start := 2
+            ] ifFalse:[
+                start := 1
+            ].
+            withCr ifTrue:[
+                end := nLines
+            ] ifFalse:[
+                end := nLines - 1
+            ].
+            (start <= nLines) ifTrue:[
+                (end >= start) ifTrue:[
+                    wasOn := self hideCursor.
+                    self insertLines:lines from:start to:end before:cursorLine.
+                    self setCursorLine:(cursorLine + (end - start + 1)).
+                    wasOn ifTrue:[self showCursor].
+                ]
+            ].
+            withCr ifFalse:[
+                "last line without cr"
+                self insertStringAtCursor:(lines at:nLines)
+            ]
+        ]
     ]
 
     "Created: / 18.5.1996 / 15:32:06 / cg"
@@ -3511,7 +3578,7 @@
     startCol := cursorCol.
     self insertStringAtCursor:aString.
     self selectFromLine:startLine col:startCol
-		 toLine:cursorLine col:(cursorCol - 1).
+                 toLine:cursorLine col:(cursorCol - 1).
     self makeSelectionVisible.
 !
 
@@ -3523,12 +3590,12 @@
     line := self lineOfCharacterPosition:charPos.
     col := charPos - (self characterPositionOfLine:line col:1) + 1.
     col == 0 ifTrue:[
-	line > 1 ifTrue:[
-	    line := line - 1.
-	    col := (self listAt:line) size + 1.
-	] ifFalse:[
-	    col := 1.
-	]
+        line > 1 ifTrue:[
+            line := line - 1. 
+            col := (self listAt:line) size + 1. 
+        ] ifFalse:[
+            col := 1.
+        ]
     ].
     self insertString:aString atLine:line col:col
 !
@@ -3545,7 +3612,7 @@
 
     aString isNil ifTrue:[^ self].
     (aString includes:(Character cr)) ifFalse:[
-	^ self insertStringWithoutCRs:aString atLine:lineNr col:colNr
+        ^ self insertStringWithoutCRs:aString atLine:lineNr col:colNr
     ].
 
     l := lineNr.
@@ -3553,19 +3620,19 @@
     start := 1.
     end := aString size.
     [start <= end] whileTrue:[
-	stop := aString indexOf:(Character cr) startingAt:start.
-	stop == 0 ifTrue:[
-	    stop := end + 1
-	].
-	subString := aString copyFrom:start to:(stop - 1).
-	self insertStringWithoutCRs:subString atLine:l col:c.
-	(stop <= end) ifTrue:[
-	    c := c + subString size.
-	    self insert:(Character cr) atLine:l col:c.
-	    l := l + 1.
-	    c := 1
-	].
-	start := stop + 1
+        stop := aString indexOf:(Character cr) startingAt:start.
+        stop == 0 ifTrue:[
+            stop := end + 1
+        ].
+        subString := aString copyFrom:start to:(stop - 1).
+        self insertStringWithoutCRs:subString atLine:l col:c.
+        (stop <= end) ifTrue:[
+            c := c + subString size.
+            self insert:(Character cr) atLine:l col:c.
+            l := l + 1.
+            c := 1
+        ].
+        start := stop + 1
     ]
 
     "Modified: / 10.6.1998 / 19:03:59 / cg"
@@ -3576,12 +3643,12 @@
      handle cr's correctly. A nil argument is interpreted as an empty line."
 
     aString isNil ifTrue:[
-	"new:"
-	self insertCharAtCursor:(Character cr).
-	^ self
+        "new:"
+        self insertCharAtCursor:(Character cr).
+        ^ self
     ].
     (aString includes:(Character cr)) ifFalse:[
-	^ self insertStringWithoutCRsAtCursor:aString
+        ^ self insertStringWithoutCRsAtCursor:aString
     ].
 
     self insertLines:aString asStringCollection withCR:false.
@@ -3594,11 +3661,11 @@
 
     self withoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr.
     shown ifTrue:[
-	gc font hasOverlappingCharacters ifTrue:[
-	    self invalidateLine:lineNr.
-	] ifFalse:[
-	    self redrawLine:lineNr from:colNr
-	]
+        gc font hasOverlappingCharacters ifTrue:[
+            self invalidateLine:lineNr.
+        ] ifFalse:[
+            self redrawLine:lineNr from:colNr
+        ]
     ]
 
     "Modified: / 09-11-2010 / 13:43:03 / cg"
@@ -3611,19 +3678,19 @@
     |wasOn oldLen newLen deltaLen|
 
     aString size > 0 ifTrue:[
-	wasOn := self hideCursor.
-	(aString includes:Character tab) ifTrue:[
-	    self checkForExistingLine:cursorLine.
-	    oldLen := (list at:cursorLine) size.
-	    self insertString:aString atLine:cursorLine col:cursorCol.
-	    newLen := (list at:cursorLine) size.
-	    deltaLen := newLen - oldLen.
-	] ifFalse:[
-	    self insertString:aString atLine:(cursorLine ? 1) col:cursorCol.
-	    deltaLen := aString size.
-	].
-	self setCursorCol:(cursorCol + deltaLen).
-	wasOn ifTrue:[self showCursor]
+        wasOn := self hideCursor.
+        (aString includes:Character tab) ifTrue:[
+            self checkForExistingLine:cursorLine.
+            oldLen := (list at:cursorLine) size.
+            self insertString:aString atLine:cursorLine col:cursorCol.
+            newLen := (list at:cursorLine) size.
+            deltaLen := newLen - oldLen.
+        ] ifFalse:[
+            self insertString:aString atLine:(cursorLine ? 1) col:cursorCol.
+            deltaLen := aString size.
+        ].
+        self setCursorCol:(cursorCol + deltaLen).
+        wasOn ifTrue:[self showCursor]
     ]
 
     "Modified: / 10.6.1998 / 20:43:52 / cg"
@@ -3646,21 +3713,21 @@
     self checkModificationsAllowed ifFalse:[ ^ self].
 
     self
-	undoableDo:[
-	    |line col lineLen|
-
-	    line := cursorLine.
-	    col := cursorCol.
-	    lineLen := (list at:line) size.
-	    col > lineLen ifTrue:[
-		self insertString:(String new:col-lineLen) atLine:line col:col+1.
-	    ] ifFalse:[
-		self deleteCharsAtLine:line fromCol:col toCol:lineLen.
-	    ].
-	    self mergeLine:line removeBlanks:true.
-	    self cursorLine:line col:col.
-	]
-	info:'Join'
+        undoableDo:[
+            |line col lineLen|
+
+            line := cursorLine.
+            col := cursorCol.
+            lineLen := (list at:line) size.
+            col > lineLen ifTrue:[
+                self insertString:(String new:col-lineLen) atLine:line col:col+1.
+            ] ifFalse:[
+                self deleteCharsAtLine:line fromCol:col toCol:lineLen.
+            ].
+            self mergeLine:line removeBlanks:true.
+            self cursorLine:line col:col.
+        ]
+        info:'Join'
 !
 
 mergeLine:lineNr
@@ -3680,7 +3747,7 @@
 
     len := (self listAt:lineNr) size.
     self nonUndoableDo:[
-	self basicMergeLine:lineNr removeBlanks:removeBlanks.
+        self basicMergeLine:lineNr removeBlanks:removeBlanks.
     ].
     self addUndo:(PasteString new line:lineNr col:len+1 string:(Character cr asString) selected:false).
 !
@@ -3704,29 +3771,29 @@
     endLine := selectionEndLine.
     startCol := selectionStartCol.
     endCol := selectionEndCol.
-
+    
     newSelectionEnd := endCol.
-
+    
     (self characterAtLine:startLine col:startCol) == openingCharacter ifTrue:[
-	(self characterAtLine:endLine col:endCol) == closingCharacter ifTrue:[
-	    self deleteCharAtLine:endLine col:endCol.
-	    newSelectionEnd := newSelectionEnd-1.
-	].
-	self deleteCharAtLine:startLine col:startCol.
-	startLine == endLine ifTrue:[
-	    newSelectionEnd := newSelectionEnd-1.
-	]
+        (self characterAtLine:endLine col:endCol) == closingCharacter ifTrue:[
+            self deleteCharAtLine:endLine col:endCol.
+            newSelectionEnd := newSelectionEnd-1.
+        ].
+        self deleteCharAtLine:startLine col:startCol.
+        startLine == endLine ifTrue:[
+            newSelectionEnd := newSelectionEnd-1.
+        ]
     ] ifFalse:[
-	self insert:closingCharacter atLine:endLine col:endCol+1.
-	newSelectionEnd := newSelectionEnd+1.
-	self insert:openingCharacter atLine:startLine col:startCol.
-	startLine == endLine ifTrue:[
-	    newSelectionEnd := newSelectionEnd+1.
-	]
+        self insert:closingCharacter atLine:endLine col:endCol+1.
+        newSelectionEnd := newSelectionEnd+1.
+        self insert:openingCharacter atLine:startLine col:startCol.
+        startLine == endLine ifTrue:[
+            newSelectionEnd := newSelectionEnd+1.
+        ]
     ].
     self
-	selectFromLine:startLine col:startCol
-	toLine:endLine col:newSelectionEnd.
+        selectFromLine:startLine col:startCol
+        toLine:endLine col:newSelectionEnd.
 
     "Modified (comment): / 06-06-2016 / 11:00:37 / cg"
 !
@@ -3738,32 +3805,32 @@
      line finished|
 
     NoModificationError handle:[:ex |
-	^ self
+        ^ self
     ] do:[
-	lastLine := list size.
-	finished := false.
-	[finished] whileFalse:[
-	    (lastLine <= 1) ifTrue:[
-		finished := true
-	    ] ifFalse:[
-		line := list at:lastLine.
-		line notNil ifTrue:[
-		    line isBlank ifTrue:[
-			self basicListAt:lastLine put:nil.
-			line := nil
-		    ]
-		].
-		line notNil ifTrue:[
-		    finished := true
-		] ifFalse:[
-		    lastLine := lastLine - 1
-		]
-	    ]
-	].
-	(lastLine ~~ list size) ifTrue:[
-	    list grow:lastLine.
-	    "/ self textChanged
-	]
+        lastLine := list size.
+        finished := false.
+        [finished] whileFalse:[
+            (lastLine <= 1) ifTrue:[
+                finished := true
+            ] ifFalse:[
+                line := list at:lastLine.
+                line notNil ifTrue:[
+                    line isBlank ifTrue:[
+                        self basicListAt:lastLine put:nil.
+                        line := nil
+                    ]
+                ].
+                line notNil ifTrue:[
+                    finished := true
+                ] ifFalse:[
+                    lastLine := lastLine - 1
+                ]
+            ]
+        ].
+        (lastLine ~~ list size) ifTrue:[
+            list grow:lastLine.
+            "/ self textChanged
+        ]
     ].
 !
 
@@ -3783,29 +3850,29 @@
     pattern := patternArg string.
     replacePattern := replacePatternArg string.
     (pattern notEmpty and:[ replacePattern notEmpty ]) ifTrue:[
-	self rememberSearchPattern:pattern.
-	self rememberSearchPattern:replacePattern.
-	LastSearchIgnoredCase := ignoreCase.
-	self
-	    undoableDo:[
-		all ifTrue:[
-		    self
-			replaceString:pattern
-			to:replacePattern
-			ignoreCase:ignoreCase
-		] ifFalse:[
-		    (self selectionAsString notNil
-			and:[ self selectionAsString sameAs:pattern caseSensitive:ignoreCase not ])
-			    ifTrue:[
-				self replaceSelectionBy:replacePattern.
-				self
-				    search:pattern
-				    ignoreCase:ignoreCase
-				    forward:(lastSearchDirection = #forward).
-			    ].
-		]
-	    ]
-	    info:'Replace'
+        self rememberSearchPattern:pattern.
+        self rememberSearchPattern:replacePattern.
+        LastSearchIgnoredCase := ignoreCase.
+        self
+            undoableDo:[
+                all ifTrue:[
+                    self
+                        replaceString:pattern
+                        to:replacePattern
+                        ignoreCase:ignoreCase
+                ] ifFalse:[
+                    (self selectionAsString notNil
+                        and:[ self selectionAsString sameAs:pattern caseSensitive:ignoreCase not ])
+                            ifTrue:[
+                                self replaceSelectionBy:replacePattern.
+                                self
+                                    search:pattern
+                                    ignoreCase:ignoreCase
+                                    forward:(lastSearchDirection = #forward).
+                            ].
+                ]
+            ]
+            info:'Replace'
     ]
 
     "Created: / 11-07-2006 / 11:19:57 / fm"
@@ -3818,10 +3885,10 @@
 
     wasOn := self hideCursor.
     aCharacter == (Character cr) ifTrue:[
-	self cursorReturn
+        self cursorReturn
     ] ifFalse:[
-	self replace:aCharacter atLine:cursorLine col:cursorCol.
-	self cursorRight.
+        self replace:aCharacter atLine:cursorLine col:cursorCol.
+        self cursorRight.
     ].
     self makeCursorVisibleAndShowCursor:wasOn.
 
@@ -3853,7 +3920,7 @@
 
     originalLine := self listAt:lineNr.
     originalLine isNil ifTrue:[
-	self checkForExistingLine:lineNr
+        self checkForExistingLine:lineNr
     ].
     self list at:lineNr put:newText.
     self addUndo:(ReplaceLine line:lineNr string:originalLine info:'replace').
@@ -3871,22 +3938,22 @@
     |line col nLines wasOn|
 
     lines notNil ifTrue:[
-	wasOn := self hideCursor.
-	nLines := lines size.
-	line := cursorLine.
-	col := cursorCol.
-	lines keysAndValuesDo:[:i :l |
-	    self replaceString:(l ? '') atLine:line col:col.
-	    (i ~~ nLines or:[withCr]) ifTrue:[
-		line := line + 1.
-		col := 1.
-	    ] ifFalse:[
-		col := col + (l size).
-	    ]
-	].
-	self cursorLine:line col:col.
-	self makeCursorVisibleAndShowCursor:wasOn.
-	"/ wasOn ifTrue:[self showCursor].
+        wasOn := self hideCursor.
+        nLines := lines size.
+        line := cursorLine.
+        col := cursorCol.
+        lines keysAndValuesDo:[:i :l |
+            self replaceString:(l ? '') atLine:line col:col.
+            (i ~~ nLines or:[withCr]) ifTrue:[
+                line := line + 1.
+                col := 1.
+            ] ifFalse:[
+                col := col + (l size).
+            ]
+        ].
+        self cursorLine:line col:col.
+        self makeCursorVisibleAndShowCursor:wasOn.
+        "/ wasOn ifTrue:[self showCursor].
     ]
 
     "Created: / 18-05-1996 / 15:32:06 / cg"
@@ -3921,50 +3988,50 @@
 
     sel := self selectionAsString.
     sel isNil ifTrue:[
-	selStartLine := l.
-	selStartCol := c.
+        selStartLine := l.
+        selStartCol := c.
     ] ifFalse:[
-	selStartLine := selectionStartLine.
-	selStartCol := selectionStartCol.
-
-	self setLastStringToReplace: sel.
-
-	self deleteSelection.
-	replacing := true.
-	lastReplacementInfo rememberReplacement.
-	lastReplacementInfo lastReplacement: ''.
-	lastReplacementInfo stillCollectingInput:true.
-	undoSupport actionInfo:'replace'.
+        selStartLine := selectionStartLine.
+        selStartCol := selectionStartCol.
+
+        self setLastStringToReplace: sel.
+
+        self deleteSelection.
+        replacing := true.
+        lastReplacementInfo rememberReplacement.
+        lastReplacementInfo lastReplacement: ''.
+        lastReplacementInfo stillCollectingInput:true.
+        undoSupport actionInfo:'replace'.
     ].
 
     something isCharacter ifTrue:[
-	lastReplacementInfo lastReplacement notNil ifTrue:[
-	    lastReplacementInfo stillCollectingInput ifTrue:[
-		lastReplacementInfo lastReplacement: (lastReplacementInfo lastReplacement copyWith:something).
-	    ].
-	].
-	self isInInsertMode ifTrue:[
-	    self insertCharAtCursor:something
-	] ifFalse:[
-	    self replaceCharAtCursor:something
-	]
+        lastReplacementInfo lastReplacement notNil ifTrue:[
+            lastReplacementInfo stillCollectingInput ifTrue:[
+                lastReplacementInfo lastReplacement: (lastReplacementInfo lastReplacement copyWith:something).
+            ].
+        ].
+        self isInInsertMode ifTrue:[
+            self insertCharAtCursor:something
+        ] ifFalse:[
+            self replaceCharAtCursor:something
+        ]
     ] ifFalse:[
-	something isString ifTrue:[
-	    lastReplacementInfo lastReplacement: something.
-	    self isInInsertMode ifTrue:[
-		self insertStringAtCursor:something
-	    ] ifFalse:[
-		self replaceStringAtCursor:something
-	    ]
-	] ifFalse:[
-	    Transcript showCR:'EditTextView: non String-or-Character in replace'.
-	].
+        something isString ifTrue:[
+            lastReplacementInfo lastReplacement: something.
+            self isInInsertMode ifTrue:[
+                self insertStringAtCursor:something
+            ] ifFalse:[
+                self replaceStringAtCursor:something
+            ]
+        ] ifFalse:[
+            Transcript showCR:'EditTextView: non String-or-Character in replace'.
+        ].
     ].
     keep ifTrue:[
-	self cursorLine:l col:c
+        self cursorLine:l col:c
     ].
     selectNewText ifTrue:[
-	self selectFromLine:selStartLine col:selStartCol toLine:cursorLine col:cursorCol-1
+        self selectFromLine:selStartLine col:selStartCol toLine:cursorLine col:cursorCol-1
     ]
 
     "Modified: 9.10.1996 / 16:14:35 / cg"
@@ -3992,20 +4059,20 @@
     count := 0.
     continue := true.
     [ continue ] whileTrue:[
-	(self selectionAsString notNil
-	and:[ self selectionAsString sameAs:aString caseSensitive:ignoreCase not ])
-	    ifTrue:[
-		self replaceSelectionBy:aNewString.
-		count := count + 1.
-	    ].
-	self
-	    searchFwd:aString
-	    ignoreCase:ignoreCase
-	    ifAbsent:[
-		Dialog information:('%1 has been replaced by %2 %3 times'
-				    bindWith:aString with:aNewString with:count).
-		continue := false.
-	    ].
+        (self selectionAsString notNil
+        and:[ self selectionAsString sameAs:aString caseSensitive:ignoreCase not ])
+            ifTrue:[
+                self replaceSelectionBy:aNewString.
+                count := count + 1.
+            ].
+        self
+            searchFwd:aString
+            ignoreCase:ignoreCase
+            ifAbsent:[
+                Dialog information:('%1 has been replaced by %2 %3 times' 
+                                    bindWith:aString with:aNewString with:count).
+                continue := false.
+            ].
     ].
 
     "Created: / 10-07-2006 / 16:42:48 / fm"
@@ -4018,31 +4085,31 @@
 
     wasOn := self hideCursor.
     (aString includes:Character tab) ifTrue:[
-	"/ need special care for TAB (to move cursor correctly)
-	i1 := 1.
-	[i1 ~~ 0] whileTrue:[
-	    i2 := aString indexOf:Character tab startingAt:i1.
-	    i2 ~~ 0 ifTrue:[
-		i1 ~~ i2 ifTrue:[
-		    self replaceString:(aString copyFrom:i1 to:i2-1) atLine:cursorLine col:cursorCol.
-		    self cursorCol:(cursorCol + (i2 - i1)).
-		].
-		self replaceTABAtCursor.
-		i2 := i2 + 1.
-	    ] ifFalse:[
-		self replaceString:(aString copyFrom:i1) atLine:cursorLine col:cursorCol.
-		self cursorCol:(cursorCol + (aString size - i1 + 1)).
-	    ].
-	    i1 := i2.
-	]
+        "/ need special care for TAB (to move cursor correctly)
+        i1 := 1.
+        [i1 ~~ 0] whileTrue:[
+            i2 := aString indexOf:Character tab startingAt:i1.
+            i2 ~~ 0 ifTrue:[
+                i1 ~~ i2 ifTrue:[
+                    self replaceString:(aString copyFrom:i1 to:i2-1) atLine:cursorLine col:cursorCol.
+                    self cursorCol:(cursorCol + (i2 - i1)).
+                ].
+                self replaceTABAtCursor.
+                i2 := i2 + 1.
+            ] ifFalse:[
+                self replaceString:(aString copyFrom:i1) atLine:cursorLine col:cursorCol.
+                self cursorCol:(cursorCol + (aString size - i1 + 1)).
+            ].
+            i1 := i2.
+        ]
     ] ifFalse:[
-	self replaceString:aString atLine:cursorLine col:cursorCol.
-	self setValidatedCursorCol:(cursorCol + aString size).
-	"/ self cursorCol:(cursorCol + aString size).
+        self replaceString:aString atLine:cursorLine col:cursorCol.
+        self setValidatedCursorCol:(cursorCol + aString size).
+        "/ self cursorCol:(cursorCol + aString size).
     ].
     wasOn ifTrue:[
-	self sensor pushUserEvent:#makeCursorVisibleAndShowCursor: for:self withArguments:{ wasOn }
-	"/ self makeCursorVisibleAndShowCursor:wasOn.
+        self sensor pushUserEvent:#makeCursorVisibleAndShowCursor: for:self withArguments:{ wasOn } 
+        "/ self makeCursorVisibleAndShowCursor:wasOn.
     ].
 
     "Created: / 9.6.1998 / 20:33:20 / cg"
@@ -4073,7 +4140,7 @@
     endCol := cursorCol-1.
     endLine := cursorLine.
     self cursorToPreviousWord.
-    beginCol := cursorCol.
+    beginCol := cursorCol.     
     beginLine := cursorLine.
     self cursorLine:savCursorLine col:savCursorCol.
     self selectFromLine:beginLine col:beginCol toLine:endLine col:endCol.
@@ -4094,8 +4161,8 @@
      and 8-col tabs"
 
     (tabPositions == self class tab4Positions)
-	 ifTrue:[self setTab8]
-	 ifFalse:[self setTab4]
+         ifTrue:[self setTab8]
+         ifFalse:[self setTab4]
 
     "Created: / 06-06-2016 / 11:02:07 / cg"
 !
@@ -4141,7 +4208,7 @@
 
     self basicWithoutRedrawInsertLines:lines from:start to:end before:lineNr.
     self isReadOnly ifFalse:[
-	self addUndo:(DeleteRange line1:lineNr col1:1 line2:lineNr+end-start+1 col2:0 info:'insert').
+        self addUndo:(DeleteRange line1:lineNr col1:1 line2:lineNr+end-start+1 col2:0 info:'insert').
     ].
 !
 
@@ -4160,52 +4227,52 @@
     self checkModificationsAllowed ifFalse:[ ^ self].
 
     self hasSelection ifFalse:[
-	self selectLine:cursorLine.
+        self selectLine:cursorLine.
     ].
     string := self selectionAsString.
     string isEmptyOrNil ifTrue:[
-	Dialog information:(resources string:'Nothing selected.').
-	^ self.
+        Dialog information:(resources string:'Nothing selected.').
+        ^ self.
     ].
 
     answerString := Dialog request:(resources string:'Line length (wrap after how many chars)?') initialAnswer:80.
     lineLength := Number readFrom:answerString onError:nil.
     lineLength isNil ifTrue:[^ self].
     lineLength < 1 ifTrue:[
-	lineLength := 1.
+        lineLength := 1.
     ].
 
     self
-	undoableDo:[
-	    |inStream line col lineLen lastGoodCol lastStartCol word|
-
-	    line := selectionStartLine.
-	    col := selectionStartCol.
-
-	    self cutSelection.
-	    self cursorLine:line col:col.
-
-	    lastGoodCol := col.
-
-	    inStream := string readStream.
-	    [ inStream atEnd ] whileFalse:[
-		[inStream atEnd not and:[inStream peek isSeparator]] whileTrue:[ inStream next ].
-		word := CharacterWriteStream new.
-		[inStream atEnd not and:[inStream peek isSeparator not]] whileTrue:[ word nextPut:inStream next ].
-		(col + 1 + word size > lineLength) ifTrue:[
-		    self insertCharAtCursor:(Character cr).
-		    col := 1.
-		] ifFalse:[
-		    col ~~ 1 ifTrue:[
-			self insertStringAtCursor:' '.
-			col := col + 1.
-		    ]
-	       ].
-	       self insertStringAtCursor:word contents.
-	       col := col + word size.
-	    ].
-	]
-	info:'Wrap'
+        undoableDo:[
+            |inStream line col lineLen lastGoodCol lastStartCol word|
+
+            line := selectionStartLine.
+            col := selectionStartCol.
+
+            self cutSelection.
+            self cursorLine:line col:col.
+
+            lastGoodCol := col.
+
+            inStream := string readStream.
+            [ inStream atEnd ] whileFalse:[
+                [inStream atEnd not and:[inStream peek isSeparator]] whileTrue:[ inStream next ].
+                word := WriteStream on:(String new:10).
+                [inStream atEnd not and:[inStream peek isSeparator not]] whileTrue:[ word nextPut:inStream next ].
+                (col + 1 + word size > lineLength) ifTrue:[
+                    self insertCharAtCursor:(Character cr).
+                    col := 1.
+                ] ifFalse:[
+                    col ~~ 1 ifTrue:[ 
+                        self insertStringAtCursor:' '.
+                        col := col + 1.
+                    ]    
+               ].
+               self insertStringAtCursor:word contents.
+               col := col + word size.
+            ].
+        ]
+        info:'Wrap'
 
     "Modified: / 01-03-2012 / 19:56:22 / cg"
 ! !
@@ -4220,15 +4287,15 @@
     self unselect.
 
     cursorLine == lineNr ifTrue:[
-	cursorCol >= startCol ifTrue:[
-	    cursorCol >= endCol ifTrue:[
-		cursorCol := startCol.
-	    ] ifFalse:[
-		cursorCol := cursorCol - (endCol - startCol + 1).
-		"/ self assert:(cursorCol >= 0).
-		cursorCol := cursorCol max:1.
-	    ]
-	].
+        cursorCol >= startCol ifTrue:[
+            cursorCol >= endCol ifTrue:[
+                cursorCol := startCol.
+            ] ifFalse:[
+                cursorCol := cursorCol - (endCol - startCol + 1).
+                "/ self assert:(cursorCol >= 0).
+                cursorCol := cursorCol max:1.
+            ]
+        ].
     ].
 
     line := self listAt:lineNr.
@@ -4241,50 +4308,50 @@
     endCol > lineSize ifFalse:[ stop  := endCol ] ifTrue:[ stop  := lineSize ].
 
     stop >= start ifTrue:[
-	start ~~ 1 ifTrue:[ newLine := line copyFrom:1 to:(start-1) ]
-		  ifFalse:[ newLine := '' ].
-
-	stop == lineSize ifFalse:[
-	    line bitsPerCharacter > newLine bitsPerCharacter ifTrue:[
-		newLine := line string species fromString:newLine.
-	    ].
-	    newLine := newLine, (line copyFrom:(stop + 1) to:lineSize)
-	].
-
-	(trimBlankLines and:[newLine isBlank]) ifTrue:[
-	    newLine := nil
-	].
-
-	prevWidth := self widthOfLine:lineNr.
-
-	self basicListAt:lineNr put:newLine.
-
-	(prevWidth = widthOfWidestLine) ifTrue:[
-	    "/ remember old width of this line,
-	    "/ only clear widthOfWidestLine, if this lines
-	    "/ length was (one of) the longest.
-	    "/ avoids slow delete with huge texts.
-	    widthOfWidestLine := nil.   "i.e. unknown"
-
-	    "/ scroll left if reqiured
-	    viewOrigin x > 0 ifTrue:[
-		newWidth := self widthOfLine:lineNr.
-		newWidth < (viewOrigin x + width) ifTrue:[
-		    self scrollHorizontalTo:(newWidth
-					     - width
-					     + margin + margin
-					     + (gc font widthOf:'  '))
-		]
-	    ].
-	    self textChanged.
-	] ifFalse:[
-	    self textChanged "/ textChangedButNoSizeChange
-	].
-	gc font hasOverlappingCharacters ifTrue:[
-	    self invalidateLine:lineNr.
-	] ifFalse:[
-	    self redrawLine:lineNr from:start.
-	].
+        start ~~ 1 ifTrue:[ newLine := line copyFrom:1 to:(start-1) ]
+                  ifFalse:[ newLine := '' ].
+
+        stop == lineSize ifFalse:[
+            line bitsPerCharacter > newLine bitsPerCharacter ifTrue:[
+                newLine := line string species fromString:newLine.
+            ].
+            newLine := newLine, (line copyFrom:(stop + 1) to:lineSize)
+        ].
+
+        (trimBlankLines and:[newLine isBlank]) ifTrue:[
+            newLine := nil
+        ].
+
+        prevWidth := self widthOfLine:lineNr.
+
+        self basicListAt:lineNr put:newLine.
+
+        (prevWidth = widthOfWidestLine) ifTrue:[
+            "/ remember old width of this line,
+            "/ only clear widthOfWidestLine, if this lines
+            "/ length was (one of) the longest.
+            "/ avoids slow delete with huge texts.
+            widthOfWidestLine := nil.   "i.e. unknown"
+
+            "/ scroll left if reqiured
+            viewOrigin x > 0 ifTrue:[
+                newWidth := self widthOfLine:lineNr.
+                newWidth < (viewOrigin x + width) ifTrue:[
+                    self scrollHorizontalTo:(newWidth
+                                             - width
+                                             + margin + margin
+                                             + (gc font widthOf:'  '))
+                ]
+            ].
+            self textChanged.
+        ] ifFalse:[
+            self textChanged "/ textChangedButNoSizeChange
+        ].
+        gc font hasOverlappingCharacters ifTrue:[
+            self invalidateLine:lineNr.
+        ] ifFalse:[
+            self redrawLine:lineNr from:start.
+        ].
     ].
 
     "Modified: / 09-11-2010 / 13:42:45 / cg"
@@ -4303,7 +4370,7 @@
     "/ isnt this the same as:
     "/ self deleteLinesWithoutRedrawFrom:startLineNr to:endLineNr.
     startLineNr <= list size ifTrue:[
-	self basicListRemoveFromIndex:startLineNr toIndex:(endLineNr min:list size).
+        self basicListRemoveFromIndex:startLineNr toIndex:(endLineNr min:list size).
     ].
     "/ TODO: remember old maxwidth of linerange,
     "/ only clear widthOfWidestLine, if this max
@@ -4316,7 +4383,7 @@
 
     nLines := list size.
     (firstLineShown >= nLines) ifTrue:[
-	self makeLineVisible:nLines
+        self makeLineVisible:nLines
     ].
     wasOn ifTrue:[self showCursor].
 
@@ -4352,8 +4419,8 @@
     self checkModificationsAllowed ifFalse:[ ^ self].
 
     aCharacter == (Character cr) ifTrue:[
-	self splitLine:lineNr before:colNr.
-	^ self
+        self splitLine:lineNr before:colNr.
+        ^ self
     ].
 
     drawCharacterOnly := false.
@@ -4362,92 +4429,92 @@
     lineSize := line size.
 
     self st80EditMode ifFalse:[
-	(trimBlankLines
-	and:[colNr > lineSize
-	and:[aCharacter == Character space]]) ifTrue:[
-	    ^ self
-	]
+        (trimBlankLines
+        and:[colNr > lineSize
+        and:[aCharacter == Character space]]) ifTrue:[
+            ^ self
+        ]
     ].
 
     (lineSize == 0) ifTrue:[
-	newLine := aCharacter asString species new:colNr.
-	drawCharacterOnly := true
+        newLine := aCharacter asString species new:colNr.
+        drawCharacterOnly := true
     ] ifFalse: [
-	(colNr > lineSize) ifTrue: [
-	    colNr == (lineSize +1) ifTrue:[
-		attribute := line emphasisAt:lineSize
-	    ].
-	    newLine := line species new:colNr.
-	    newLine replaceFrom:1 to:lineSize with:line startingAt:1.
-	    drawCharacterOnly := true
-	] ifFalse: [
-	    attribute := line emphasisAt:colNr.
-	    newLine   := line species new:(lineSize + 1).
-
-	    newLine replaceFrom:1 to:(colNr - 1) with:line startingAt:1.
-	    newLine replaceFrom:(colNr + 1) to:(lineSize + 1) with:line startingAt:colNr
-	]
+        (colNr > lineSize) ifTrue: [
+            colNr == (lineSize +1) ifTrue:[
+                attribute := line emphasisAt:lineSize
+            ].
+            newLine := line species new:colNr.
+            newLine replaceFrom:1 to:lineSize with:line startingAt:1.
+            drawCharacterOnly := true
+        ] ifFalse: [
+            attribute := line emphasisAt:colNr.
+            newLine   := line species new:(lineSize + 1).
+
+            newLine replaceFrom:1 to:(colNr - 1) with:line startingAt:1.
+            newLine replaceFrom:(colNr + 1) to:(lineSize + 1) with:line startingAt:colNr
+        ]
     ].
 
     aCharacter asString bitsPerCharacter > newLine bitsPerCharacter ifTrue:[
-	newLine := aCharacter asString species fromString:newLine.
-	line isText ifTrue:[
-	    newLine := newLine asText
-	]
+        newLine := aCharacter asString species fromString:newLine.
+        line isText ifTrue:[
+            newLine := newLine asText
+        ]
     ].
     newLine at:colNr put:aCharacter.
 
     attribute notNil ifTrue:[
-	newLine emphasisAt:colNr put:attribute.
+        newLine emphasisAt:colNr put:attribute.
     ].
 
     aCharacter == (Character tab) ifTrue:[
-	newLine := self withTabsExpanded:newLine.
-	drawCharacterOnly := false
+        newLine := self withTabsExpanded:newLine.
+        drawCharacterOnly := false
     ].
 
     self basicListAt:lineNr put:(newLine ifNil:[newLine] ifNotNil:[newLine asSingleByteStringIfPossible]).
     widthOfWidestLine notNil ifTrue:[
-	widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
+        widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
     ].
     self textChanged.
     shown ifTrue:[
-	"/ care for italic text - in this case, we must also
-	"/ redraw the character before the insertion in order
-	"/ to fix the slanted piece of the character.
-	"/ (but we must clip, to avoid destoying the character before)
-	(newLine notNil and:[newLine isText]) ifTrue:[
-	    colNr > 1 ifTrue:[
-		cursorVisibleLine notNil ifTrue:[
-		    oldClip := self clippingRectangleOrNil.
-		    x := (self xOfCol:colNr-1 inVisibleLine:cursorVisibleLine) - viewOrigin x.
-		    y := self yOfVisibleLine:cursorVisibleLine.
-
-		    gc font hasOverlappingCharacters ifTrue:[
-			self invalidateLine:lineNr.
-		    ] ifFalse:[
-			drawCharacterOnly ifTrue:[
-			    self clippingRectangle:(x@y extent:((gc font width * 2) @ fontHeight)).
-			    self redrawLine:lineNr from:colNr-1 to:colNr
-			] ifFalse:[
-			    self clippingRectangle:(x@y extent:((width - x) @ fontHeight)).
-			    self redrawLine:lineNr from:colNr-1
-			].
-			self clippingRectangle:oldClip.
-		    ].
-		].
-		^ self.
-	    ].
-	].
-	gc font hasOverlappingCharacters ifTrue:[
-	    self invalidateLine:lineNr.
-	] ifFalse:[
-	    drawCharacterOnly ifTrue:[
-		self redrawLine:lineNr col:colNr
-	    ] ifFalse:[
-		self redrawLine:lineNr from:colNr
-	    ]
-	]
+        "/ care for italic text - in this case, we must also
+        "/ redraw the character before the insertion in order
+        "/ to fix the slanted piece of the character.
+        "/ (but we must clip, to avoid destoying the character before)
+        (newLine notNil and:[newLine isText]) ifTrue:[
+            colNr > 1 ifTrue:[
+                cursorVisibleLine notNil ifTrue:[
+                    oldClip := self clippingRectangleOrNil.
+                    x := (self xOfCol:colNr-1 inVisibleLine:cursorVisibleLine) - viewOrigin x.
+                    y := self yOfVisibleLine:cursorVisibleLine.
+
+                    gc font hasOverlappingCharacters ifTrue:[
+                        self invalidateLine:lineNr.
+                    ] ifFalse:[
+                        drawCharacterOnly ifTrue:[
+                            self clippingRectangle:(x@y extent:((gc font width * 2) @ fontHeight)).
+                            self redrawLine:lineNr from:colNr-1 to:colNr
+                        ] ifFalse:[
+                            self clippingRectangle:(x@y extent:((width - x) @ fontHeight)).
+                            self redrawLine:lineNr from:colNr-1
+                        ].
+                        self clippingRectangle:oldClip.
+                    ].
+                ].
+                ^ self.
+            ].
+        ].
+        gc font hasOverlappingCharacters ifTrue:[
+            self invalidateLine:lineNr.
+        ] ifFalse:[
+            drawCharacterOnly ifTrue:[
+                self redrawLine:lineNr col:colNr
+            ] ifFalse:[
+                self redrawLine:lineNr from:colNr
+            ]
+        ]
     ]
 
     "Modified: / 09-11-2010 / 13:43:18 / cg"
@@ -4471,36 +4538,36 @@
     |leftPart rightPart bothParts nextLineNr i|
 
     (list notNil and:[(list size) >= lineNr]) ifFalse:[
-	"/ empty list or beyond end of text
-	^ self
+        "/ empty list or beyond end of text
+        ^ self
     ].
     leftPart := self listAt:lineNr.
 
     leftPart isNil ifTrue:[
-	leftPart := ''.
-	autoIndent ifTrue:[
-	    (i := self leftIndentForLine:cursorLine) == 0 ifFalse:[
-		leftPart := String new:i
-	    ]
-	]
+        leftPart := ''.
+        autoIndent ifTrue:[
+            (i := self leftIndentForLine:cursorLine) == 0 ifFalse:[
+                leftPart := String new:i
+            ]
+        ]
     ].
     self cursorLine:lineNr col:((leftPart size) + 1).
     nextLineNr := self validateCursorLine:(lineNr + 1).
 
     nextLineNr > (list size) ifFalse:[
-	(rightPart := self listAt:nextLineNr) isNil ifTrue:[
-	    rightPart := ''
-	] ifFalse:[
-	    removeBlanks ifTrue:[
-		rightPart := rightPart withoutLeadingSeparators.
-	    ]
-	].
-
-	bothParts := leftPart , rightPart.
-	(trimBlankLines and:[bothParts isBlank]) ifTrue:[bothParts := nil].
-	self basicListAt:lineNr put:bothParts.
-	self redrawLine:lineNr.
-	self deleteLine:nextLineNr
+        (rightPart := self listAt:nextLineNr) isNil ifTrue:[
+            rightPart := ''
+        ] ifFalse:[
+            removeBlanks ifTrue:[
+                rightPart := rightPart withoutLeadingSeparators.
+            ]
+        ].
+
+        bothParts := leftPart , rightPart.
+        (trimBlankLines and:[bothParts isBlank]) ifTrue:[bothParts := nil].
+        self basicListAt:lineNr put:bothParts.
+        self redrawLine:lineNr.
+        self deleteLine:nextLineNr
     ]
 
     "Created: 9.9.1997 / 09:27:38 / cg"
@@ -4515,7 +4582,7 @@
     self checkModificationsAllowed ifFalse:[ ^ self].
 
     aCharacter == (Character cr) ifTrue:[
-	^ self
+        ^ self
     ].
 
     drawCharacterOnly := true.
@@ -4526,40 +4593,40 @@
     (trimBlankLines
     and:[colNr > lineSize
     and:[aCharacter == Character space]]) ifTrue:[
-	^ self
+        ^ self
     ].
 
     (lineSize == 0) ifTrue:[
-	newLine := aCharacter asString species new:colNr.
+        newLine := aCharacter asString species new:colNr.
     ] ifFalse: [
-	(aCharacter bitsPerCharacter > line bitsPerCharacter) ifTrue:[
-	    newLineSpecies := aCharacter stringSpecies
-	] ifFalse:[
-	    newLineSpecies := line species
-	].
-	newLine := newLineSpecies new:(colNr max:lineSize).
-	newLine replaceFrom:1 to:lineSize with:line startingAt:1.
+        (aCharacter bitsPerCharacter > line bitsPerCharacter) ifTrue:[ 
+            newLineSpecies := aCharacter stringSpecies
+        ] ifFalse:[
+            newLineSpecies := line species
+        ].
+        newLine := newLineSpecies new:(colNr max:lineSize).
+        newLine replaceFrom:1 to:lineSize with:line startingAt:1.
     ].
     newLine at:colNr put:aCharacter.
     aCharacter == (Character tab) ifTrue:[
-	newLine := self withTabsExpanded:newLine.
-	drawCharacterOnly := false
+        newLine := self withTabsExpanded:newLine.
+        drawCharacterOnly := false
     ].
     self basicListAt:lineNr put:(newLine ifNil:[newLine] ifNotNil:[newLine asSingleByteStringIfPossible]).
     widthOfWidestLine notNil ifTrue:[
-	widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
+        widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
     ].
     self textChanged.
     shown ifTrue:[
-	gc font hasOverlappingCharacters ifTrue:[
-	    self invalidateLine:lineNr.
-	] ifFalse:[
-	    drawCharacterOnly ifTrue:[
-		self redrawLine:lineNr col:colNr
-	    ] ifFalse:[
-		self redrawLine:lineNr from:colNr
-	    ]
-	]
+        gc font hasOverlappingCharacters ifTrue:[
+            self invalidateLine:lineNr.
+        ] ifFalse:[
+            drawCharacterOnly ifTrue:[
+                self redrawLine:lineNr col:colNr
+            ] ifFalse:[
+                self redrawLine:lineNr from:colNr
+            ]
+        ]
     ]
 
     "Created: / 06-03-1996 / 12:29:20 / cg"
@@ -4581,32 +4648,32 @@
 
     endCol := colNr + aString size - 1.
     (lineSize == 0) ifTrue:[
-	newLine := aString species new:endCol.
+        newLine := aString species new:endCol.
     ] ifFalse: [
-	(aString bitsPerCharacter > line bitsPerCharacter) ifTrue:[
-	    newLineSpecies := aString stringSpecies
-	] ifFalse:[
-	    newLineSpecies := line species
-	].
-
-	newLine := newLineSpecies new:(endCol max:lineSize).
-	newLine replaceFrom:1 to:lineSize with:line startingAt:1.
+        (aString bitsPerCharacter > line bitsPerCharacter) ifTrue:[ 
+            newLineSpecies := aString stringSpecies
+        ] ifFalse:[
+            newLineSpecies := line species
+        ].
+
+        newLine := newLineSpecies new:(endCol max:lineSize).
+        newLine replaceFrom:1 to:lineSize with:line startingAt:1.
     ].
     newLine replaceFrom:colNr with:aString.
     (aString includes:(Character tab)) ifTrue:[
-	newLine := self withTabsExpanded:newLine.
+        newLine := self withTabsExpanded:newLine.
     ].
     self basicListAt:lineNr put:(newLine ifNil:[newLine] ifNotNil:[newLine asSingleByteStringIfPossible]).
     widthOfWidestLine notNil ifTrue:[
-	widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
+        widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
     ].
     self textChanged.
     shown ifTrue:[
-	gc font hasOverlappingCharacters ifTrue:[
-	    self invalidateLine:lineNr.
-	] ifFalse:[
-	    self redrawLine:lineNr from:colNr
-	]
+        gc font hasOverlappingCharacters ifTrue:[
+            self invalidateLine:lineNr.
+        ] ifFalse:[
+            self redrawLine:lineNr from:colNr
+        ]
     ]
 
     "Created: / 11-06-1998 / 10:38:32 / cg"
@@ -4624,50 +4691,50 @@
     lineNr > (list size) ifTrue:[ ^ self ].
 
     (colNr == 1) ifTrue:[
-	self nonUndoableDo:[
-	    self insertLine:nil before:lineNr.
-	].
-	^ self
+        self nonUndoableDo:[
+            self insertLine:nil before:lineNr.
+        ].
+        ^ self
     ].
 
     line := list at:lineNr.
     line notNil ifTrue:[
-	lineSize := line size.
-	(colNr <= lineSize) ifTrue:[
-	    rightRest := line copyFrom:colNr to:lineSize.
-	    (colNr > 1) ifTrue:[
-		leftRest := line copyTo:(colNr - 1)
-	    ]
-	] ifFalse:[
-	    leftRest := line
-	]
+        lineSize := line size.
+        (colNr <= lineSize) ifTrue:[
+            rightRest := line copyFrom:colNr to:lineSize.
+            (colNr > 1) ifTrue:[
+                leftRest := line copyTo:(colNr - 1)
+            ]
+        ] ifFalse:[
+            leftRest := line
+        ]
     ].
     leftRest notNil ifTrue:[
-	(trimBlankLines and:[leftRest isBlank]) ifTrue:[leftRest := nil]
+        (trimBlankLines and:[leftRest isBlank]) ifTrue:[leftRest := nil]
     ].
     self basicListAt:lineNr put:leftRest.
     self nonUndoableDo:[
-	self withoutRedrawInsertLine:rightRest before:(lineNr + 1).
+        self withoutRedrawInsertLine:rightRest before:(lineNr + 1).
     ].
     visLine := self listLineToVisibleLine:(lineNr).
     visLine notNil ifTrue:[
-	w := self widthForScrollBetween:lineNr
-				    and:(firstLineShown + nLinesShown).
-	srcY := topMargin + (visLine * fontHeight).
-	h := ((nLinesShown - visLine - 1) * fontHeight).
-	(mustWait := (w > 0 and:[h > 0])) ifTrue:[
-	    self catchExpose.
-	    self
-		copyFrom:self
-		x:textStartLeft y:srcY
-		toX:textStartLeft y:(srcY + fontHeight)
-		width:w
-		height:((nLinesShown - visLine - 1) * fontHeight)
-		async:true.
-	].
-	self redrawLine:lineNr.
-	self redrawLine:(lineNr + 1).
-	mustWait ifTrue:[self waitForExpose]
+        w := self widthForScrollBetween:lineNr
+                                    and:(firstLineShown + nLinesShown).
+        srcY := topMargin + (visLine * fontHeight).
+        h := ((nLinesShown - visLine - 1) * fontHeight).
+        (mustWait := (w > 0 and:[h > 0])) ifTrue:[
+            self catchExpose.
+            self
+                copyFrom:self
+                x:textStartLeft y:srcY
+                toX:textStartLeft y:(srcY + fontHeight)
+                width:w
+                height:((nLinesShown - visLine - 1) * fontHeight)
+                async:true.
+        ].
+        self redrawLine:lineNr.
+        self redrawLine:(lineNr + 1).
+        mustWait ifTrue:[self waitForExpose]
     ].
     widthOfWidestLine := nil. "/ unknown
     self textChanged.
@@ -4685,24 +4752,24 @@
     nLines := end - start + 1.
     newLines := Array new:(lines size).
     start to:end do:[:index |
-	newLine := lines at:index.
-	newLine notNil ifTrue:[
-	    newLine isString ifTrue:[
-		newLine isBlank ifTrue:[
-		    newLine := nil
-		] ifFalse:[
-		    (newLine includes:(Character tab)) ifTrue:[
-			newLine := self withTabs:(ListView tab8Positions) expand:newLine
-		    ]
-		]
-	    ]
-	].
-	newLines at:index put:newLine
+        newLine := lines at:index.
+        newLine notNil ifTrue:[
+            newLine isString ifTrue:[
+                newLine isBlank ifTrue:[
+                    newLine := nil
+                ] ifFalse:[
+                    (newLine includes:(Character tab)) ifTrue:[
+                        newLine := self withTabs:(ListView tab8Positions) expand:newLine
+                    ]
+                ]
+            ]
+        ].
+        newLines at:index put:newLine
     ].
     list isNil ifTrue: [
-	list := StringCollection new:(lineNr + nLines + 1)
+        list := StringCollection new:(lineNr + nLines + 1)
     ] ifFalse: [
-	list grow:((list size + nLines) max:(lineNr + nLines - 1))
+        list grow:((list size + nLines) max:(lineNr + nLines - 1))
     ].
 
     "I have changed 'replaceFrom:to:with:startingAt:' to correctly handle
@@ -4710,9 +4777,9 @@
 "
     index := list size.
     [index > lineNr] whileTrue: [
-	pIndex := index - 1.
-	list at:index put:(list at:pIndex).
-	index := pIndex
+        pIndex := index - 1.
+        list at:index put:(list at:pIndex).
+        index := pIndex
     ].
 "
     list replaceFrom:(lineNr + nLines) to:(list size) with:list startingAt:lineNr.
@@ -4739,57 +4806,57 @@
     line       := list at:lineNr.
 
     line notNil ifTrue:[
-	lineSize := line size.
-	line isString ifFalse:[
-	    stringType := line species
-	] ifTrue:[
-	    lineCharWidth := line bitsPerCharacter.
-	    stringCharWidth := aString bitsPerCharacter.
-	    lineCharWidth > stringCharWidth ifTrue:[
-		stringType := line string species
-	    ] ifFalse:[
-		stringCharWidth > lineCharWidth ifTrue:[
-		    stringType := aString string species
-		]
-	    ].
-	    line isText ifTrue:[ isText := true ]
-	].
+        lineSize := line size.
+        line isString ifFalse:[
+            stringType := line species
+        ] ifTrue:[
+            lineCharWidth := line bitsPerCharacter.
+            stringCharWidth := aString bitsPerCharacter.
+            lineCharWidth > stringCharWidth ifTrue:[
+                stringType := line string species
+            ] ifFalse:[
+                stringCharWidth > lineCharWidth ifTrue:[
+                    stringType := aString string species
+                ]
+            ].
+            line isText ifTrue:[ isText := true ]
+        ].
     ] ifFalse:[
-	lineSize := 0
+        lineSize := 0
     ].
 
     ((colNr == 1) and:[lineSize == 0]) ifTrue: [
-	newLine := aString
+        newLine := aString
     ] ifFalse:[
-	(lineSize == 0 or:[colNr > lineSize]) ifTrue: [
-	    sz := colNr + strLen - 1
-	] ifFalse:[
-	    sz := lineSize + strLen
-	].
-
-	newLine := stringType new:sz.
-	isText ifTrue:[
-	    newLine := Text string:newLine
-	].
-
-	(lineSize ~~ 0) ifTrue: [
-	    (colNr > lineSize) ifTrue: [
-		newLine replaceFrom:1 to:lineSize with:line startingAt:1
-	    ] ifFalse: [
-		newLine replaceFrom:1 to:(colNr - 1) with:line startingAt:1.
-		newLine replaceFrom:(colNr + strLen) to:(lineSize + strLen) with:line startingAt:colNr
-	    ]
-	].
-	newLine replaceFrom:(colNr max:1) to:(colNr + strLen - 1) with:aString startingAt:1
+        (lineSize == 0 or:[colNr > lineSize]) ifTrue: [
+            sz := colNr + strLen - 1
+        ] ifFalse:[
+            sz := lineSize + strLen
+        ].
+
+        newLine := stringType new:sz.
+        isText ifTrue:[
+            newLine := Text string:newLine
+        ].
+
+        (lineSize ~~ 0) ifTrue: [
+            (colNr > lineSize) ifTrue: [
+                newLine replaceFrom:1 to:lineSize with:line startingAt:1
+            ] ifFalse: [
+                newLine replaceFrom:1 to:(colNr - 1) with:line startingAt:1.
+                newLine replaceFrom:(colNr + strLen) to:(lineSize + strLen) with:line startingAt:colNr
+            ]
+        ].
+        newLine replaceFrom:(colNr max:1) to:(colNr + strLen - 1) with:aString startingAt:1
     ].
 
     (aString includes:(Character tab)) ifTrue:[
-	newLine := self withTabs:(ListView tab8Positions) expand:newLine
+        newLine := self withTabs:(ListView tab8Positions) expand:newLine
     ].
 
     self basicListAt:lineNr put:(newLine ifNil:[newLine] ifNotNil:[newLine asSingleByteStringIfPossible]).
     widthOfWidestLine notNil ifTrue:[
-	widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
+        widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:newLine).
     ].
     self textChanged.
 
@@ -4804,27 +4871,27 @@
     hasKeyboardFocus := true.   "/ cg: why is this needed?
     dragIsActive := false.
 
-    completionSupport notNil ifTrue:[
-	"/ also give that guy a chance to close its popup view
-	completionSupport buttonPress:button x:x y:y
+    completionSupport notNil ifTrue:[ 
+        "/ also give that guy a chance to close its popup view
+        completionSupport buttonPress:button x:x y:y
     ].
 
     cursorShown ifTrue: [
-	self drawCursor
-    ].
-
-    "On X11, be nice and paste PRIMARY when middle click.
+        self drawCursor
+    ].
+
+    "On X11, be nice and paste PRIMARY when middle click. 
      Note, that middle button on X11 is translated to button
      128 in Smalltalk/X - see XWorkstation class>>initializeConstants"
     (button == #paste and:[device platformName == #X11]) ifTrue:[
-	self undoableDo:[
-	    self paste: (self getClipboardText:#selection).
-	].
-	^self.
+        self undoableDo:[
+            self paste: (self getClipboardText:#selection).
+        ].
+        ^self.
     ].
 
     (button == 1) ifTrue:[
-	self hideCursor
+        self hideCursor
     ].
 "/ some very old code from times, when a right-click was a paste in X11
 "/
@@ -4844,60 +4911,60 @@
     |x1 x2 x2_3 newCursorCol|
 
     (button == 1) ifTrue:[
-	typeOfSelection := nil.
-
-	dragIsActive ifTrue:[
-	    self unselect
-	].
-	selectionStartLine isNil ifTrue:[
-	    clickCol notNil ifTrue:[
-		self cursorMovementAllowed ifTrue:[
-		    newCursorCol := clickCol.
-
-		    cursorType ~~ #block ifTrue:[
-			clickPos notNil ifTrue:[
-			    "/ we do something special, if the text-cursor's type is not a block-cursor
-			    "/ (i.e. if its an ibeam).
-			    "/ adjust clickCol if the user clicked in the right third of a character.
-			    x1 := self xOfCol:clickCol inVisibleLine:clickLine.
-			    x2 := self xOfCol:clickCol+1 inVisibleLine:clickLine.
-			    x2_3 := x1 + ((x2-x1) * (2/3)).
-			    (clickPos x >= x2_3) ifTrue:[ newCursorCol := clickCol+1 ].
-			].
-		    ].
-		    "/ the following fixes the ugly select behavior when double clicking on
-		    "/ a partially visible last line (where the first click used to
-		    "/ scroll the text so that the second click was handled on another
-		    "/ line. An alternative (possibly better) solution would be to
-		    "/ remember the last click posision and adjust in the double click
-		    "/ event handling (i.e. subtract the number of scrolled lines in between)
-		    "/ Time will show, if this hack works.
-		    clickLine >= (self lastLineShown -1 ) ifTrue:[
-			self cursorLine:clickLine col:newCursorCol makeVisible:false.
-			Processor
-			    addTimedBlock:[self sensor pushUserEvent:#makeCursorVisible for:self]
-			    after:0.3 seconds.
-		    ] ifFalse:[
-			self cursorLine:clickLine col:newCursorCol.
-		    ].
-		].
-		true "self hadSelectionBeforeClick not" ifTrue:[
-		    list notEmptyOrNil ifTrue:[
-			UserPreferences current selectAllWhenClickingBeyondEnd ifTrue:[
-			    (clickLine >= list size) ifTrue:[
-				(clickLine > (self list size + 2)
-				or:[ clickCol > (list last size + 5) ]) ifTrue:[
-				    self selectAll
-				].
-			    ].
-			]
-		    ]
-		]
-	    ]
-	] ifFalse:[
-	    lastStringFromReplaceForNextSearch := nil.  "new selection invalidates remembered string"
-	].
-	self showCursor
+        typeOfSelection := nil.
+
+        dragIsActive ifTrue:[
+            self unselect
+        ].
+        selectionStartLine isNil ifTrue:[
+            clickCol notNil ifTrue:[
+                self cursorMovementAllowed ifTrue:[
+                    newCursorCol := clickCol.
+
+                    cursorType ~~ #block ifTrue:[
+                        clickPos notNil ifTrue:[
+                            "/ we do something special, if the text-cursor's type is not a block-cursor
+                            "/ (i.e. if its an ibeam).
+                            "/ adjust clickCol if the user clicked in the right third of a character.
+                            x1 := self xOfCol:clickCol inVisibleLine:clickLine.  
+                            x2 := self xOfCol:clickCol+1 inVisibleLine:clickLine.
+                            x2_3 := x1 + ((x2-x1) * (2/3)).
+                            (clickPos x >= x2_3) ifTrue:[ newCursorCol := clickCol+1 ].
+                        ].
+                    ].
+                    "/ the following fixes the ugly select behavior when double clicking on
+                    "/ a partially visible last line (where the first click used to
+                    "/ scroll the text so that the second click was handled on another
+                    "/ line. An alternative (possibly better) solution would be to
+                    "/ remember the last click posision and adjust in the double click
+                    "/ event handling (i.e. subtract the number of scrolled lines in between)
+                    "/ Time will show, if this hack works.
+                    clickLine >= (self lastLineShown -1 ) ifTrue:[
+                        self cursorLine:clickLine col:newCursorCol makeVisible:false.
+                        Processor 
+                            addTimedBlock:[self sensor pushUserEvent:#makeCursorVisible for:self]
+                            after:0.3 seconds.
+                    ] ifFalse:[
+                        self cursorLine:clickLine col:newCursorCol.
+                    ].
+                ].
+                true "self hadSelectionBeforeClick not" ifTrue:[
+                    list notEmptyOrNil ifTrue:[
+                        UserPreferences current selectAllWhenClickingBeyondEnd ifTrue:[
+                            (clickLine >= list size) ifTrue:[
+                                (clickLine > (self list size + 2) 
+                                or:[ clickCol > (list last size + 5) ]) ifTrue:[
+                                    self selectAll
+                                ].
+                            ].
+                        ]
+                    ]
+                ]
+            ]
+        ] ifFalse:[
+            lastStringFromReplaceForNextSearch := nil.  "new selection invalidates remembered string"
+        ].
+        self showCursor
     ].
     super buttonRelease:button x:x y:y
 
@@ -4907,179 +4974,224 @@
 cursorKeyPress:key shifted:shifted
     <resource: #keyboard (#CursorRight #CursorDown #CursorUp #CursorDown)>
 
-    |n|
+    | n oldTypeOfSelection |
+
+    oldTypeOfSelection := typeOfSelection.
 
     self changeTypeOfSelectionTo:nil.
 
     (key == #CursorRight) ifTrue:[
-	(shifted and:[selectionStartLine isNil]) ifTrue:[
-	    selectionStartLine := selectionEndLine := clickStartLine := cursorLine.
-	    selectionStartCol := selectionEndCol := clickStartCol := cursorCol.
-	    expandingTop := false.
-	    self validateNewSelection.
-	    self setPrimarySelection.
-	    self selectionChanged.
-	    self redrawLine:selectionStartLine.
-	    ^ self.
-	].
-
-	selectionStartLine notNil ifTrue:[
-	    self cursorMovementAllowed ifTrue:[
-		"/
-		"/ treat the whole selection as cursor
-		"/
-		self setCursorLine:(selectionEndLine ? selectionStartLine).
-		selectionEndCol == 0 ifTrue:[
-		    selectionEndCol := 1.
-		].
-		self setCursorCol:selectionEndCol.
-		shifted ifTrue:[
-		    self expandSelectionRight.
-		    ^ self
-		].
-		self unselect; makeCursorVisible.
-		cursorCol == 1 ifTrue:[^ self].
-	    ].
-	].
-	self cursorRight.
-	^ self
+        (shifted and:[selectionStartLine isNil]) ifTrue:[
+            selectionStartLine := selectionEndLine := clickStartLine := cursorLine.
+            selectionStartCol := selectionEndCol := clickStartCol := cursorCol.
+            cursorCol := cursorCol + 1.
+            expandingTop := false.
+            self validateNewSelection.
+            self setPrimarySelection.
+            self selectionChanged.
+            self redrawLine:selectionStartLine.
+            ^ self.
+        ].
+
+        self cursorMovementAllowed ifTrue:[
+            shifted ifTrue:[
+                self addToSelectionAfter:[ self cursorRight ]
+            ] ifFalse:[
+                "/ Compensate for Claus paste-cursordown-paste feature.
+                "/ Right after paste the cursor is at the beginning of the
+                "/ selection. But if immediately after paste user moves cursor right
+                "/ (but without shift!!!!!!), she probably wants to move past the 
+                "/ pasted text, not into it. This is how every other editor behaves.
+                oldTypeOfSelection == #paste ifTrue:[
+                    cursorLine := selectionEndLine.
+                    cursorCol := selectionEndCol + 1.
+                ].
+
+                "/ If there's selection, unselect and move cursor
+                "/ to the end of selection.
+                self hasSelection ifTrue:[ 
+                    self setCursorLine: selectionEndLine.
+                    self setCursorCol: selectionEndCol + 1.
+                    self unselect; makeCursorVisible.
+                    ^ self.
+                ].
+                self unselect; makeCursorVisible.
+                self cursorRight.
+            ].
+        ].
+        ^ self
     ].
     (key == #CursorDown) ifTrue:[
-	(shifted and:[selectionStartLine isNil]) ifTrue:[
-	    selectionStartLine := clickStartLine := cursorLine. selectionEndLine := cursorLine + 1.
-	    selectionStartCol := clickStartCol := selectionEndCol := cursorCol.
-	    selectionEndCol == 1 ifTrue:[
-		selectionEndCol := 0.
-	    ].
-	    self validateNewSelection.
-	    self selectionChanged.
-	    self redrawLine:selectionStartLine.
-	    expandingTop := false.
-	    self redrawLine:selectionEndLine.
-	    ^ self
-	].
-
-	selectionStartLine notNil ifTrue:[
-	    self cursorMovementAllowed ifTrue:[
-		"/
-		"/ treat the whole selection as cursor
-		"/
-		self setCursorLine:(selectionEndLine ? selectionStartLine).
-		self setCursorCol:selectionStartCol.
-		(cursorCol == 0 or:[selectionEndCol == 0]) ifTrue:[
-		    self setCursorCol:1.
-		    self setCursorLine:(cursorLine - 1).
-		].
-		self makeCursorVisible.
-
-		shifted ifTrue:[
-		    clickLine := cursorLine.
-		    clickCol := cursorCol.
-		    self expandSelectionDown.
-		    ^ self
-		].
-		self unselect.
-	    ].
-	].
-
-	n := 1 + (self sensor compressKeyPressEventsWithKey:#CursorDown).
-	self cursorDown:n.
-	"/
-	"/ flush keyboard to avoid runaway cursor
-	"/
-	self sensor flushKeyboardFor:self.
-	^ self
+        (shifted and:[selectionStartLine isNil]) ifTrue:[
+            selectionStartLine := clickStartLine := cursorLine. selectionEndLine := cursorLine + 1.
+            selectionStartCol := clickStartCol := cursorCol.
+            selectionEndCol := cursorCol - 1.
+"/            selectionEndCol == 1 ifTrue:[
+"/                selectionEndCol := 0.
+"/            ].
+            self setCursorLine: cursorLine + 1.
+            self validateNewSelection.
+            self selectionChanged.
+            self redrawLine:selectionStartLine.
+            expandingTop := false.
+            self redrawLine:selectionEndLine.
+            ^ self
+        ].
+
+        selectionStartLine notNil ifTrue:[
+            self cursorMovementAllowed ifTrue:[
+                "/
+                "/ treat the whole selection as cursor
+                "/
+"/                self setCursorLine:(selectionEndLine ? selectionStartLine).
+"/                self setCursorCol:selectionStartCol.
+"/                (cursorCol == 0 or:[selectionEndCol == 0]) ifTrue:[
+"/                    self setCursorCol:1.
+"/                    self setCursorLine:(cursorLine - 1).
+"/                ].
+"/                self makeCursorVisible.
+"/
+"/                shifted ifTrue:[
+"/                    clickLine := cursorLine.
+"/                    clickCol := cursorCol.
+"/                    self setCursorLine: cursorLine + 1.
+"/                    self expandSelectionDown.
+"/                    ^ self
+"/                ].
+"/                self unselect.
+            ].
+        ].
+        self cursorMovementAllowed ifTrue:[
+            n := 1 + (self sensor compressKeyPressEventsWithKey:#CursorDown).
+            shifted ifTrue:[
+                self addToSelectionAfter:[ self cursorDown:n ]
+            ] ifFalse:[
+                "/ If there's selection, unselect and move cursor
+                "/ one line below last selection line but at the
+                "/ selectionStartCol column. This behavior is
+                "/ useful when pasting...
+                self hasSelection ifTrue:[ 
+                    self setCursorLine: selectionEndLine.
+                    self setCursorCol: selectionStartCol.
+                ].    
+                self unselect; makeCursorVisible.
+                self cursorDown:n.
+            ].  
+            "/
+            "/ flush keyboard to avoid runaway cursor
+            "/
+            self sensor flushKeyboardFor:self.
+        ].
+        ^ self
     ].
     (key == #CursorLeft or:[key == #CursorUp]) ifTrue:[
-	(shifted and:[selectionStartLine isNil]) ifTrue:[
-	    expandingTop := true.
-	    key == #CursorLeft ifTrue:[
-		cursorCol > 1 ifTrue:[
-		    selectionStartLine := selectionEndLine := clickStartLine := cursorLine.
-		    selectionEndCol := clickStartCol := cursorCol-1.
-		    selectionStartCol := cursorCol-1.
-		    self validateNewSelection.
-		    self selectionChanged.
-		    self redrawLine:selectionStartLine.
-		    ^ self
-		]
-	    ] ifFalse:[
-		cursorLine > 1 ifTrue:[
-		    selectionEndLine := clickStartLine := cursorLine.
-		    selectionEndCol := selectionStartCol := clickStartCol := cursorCol.
-		    selectionStartLine := cursorLine - 1.
-		    selectionEndCol == 1 ifTrue:[
-			selectionEndCol := 0.
-		    ].
-		    self validateNewSelection.
-		    self selectionChanged.
-		    self redrawFromLine:selectionStartLine to:cursorLine.
-		    ^ self
-		]
-	    ]
-	].
-
-	selectionStartLine notNil ifTrue:[
-	    self cursorMovementAllowed ifTrue:[
-		"/
-		"/ treat the whole selection as cursor
-		"/
-		self setCursorLine:selectionStartLine.
-		self setCursorCol:selectionStartCol.
-		(key == #CursorLeft) ifTrue:[
-		    self setCursorCol:(cursorCol+1).  "/ compensate for followup crsr-left
-		].
-		self makeCursorVisible.
-
-		shifted ifTrue:[
-		    (key == #CursorUp) ifTrue:[
-			clickLine := cursorLine.
-			self expandSelectionUp.
-		    ] ifFalse:[
-			self expandSelectionLeft.
-		    ].
-		    ^ self
-		].
-		self unselect.
-	    ].
-	].
-	(key == #CursorLeft) ifTrue:[
-	    self cursorLeft. ^self
-	].
-	(key == #CursorUp)        ifTrue:[
-	    n := 1 + (self sensor compressKeyPressEventsWithKey:#CursorUp).
-	    self cursorUp:n.
-	    "/
-	    "/ flush keyboard to avoid runaway cursor
-	    "/
-	    self sensor flushKeyboardFor:self.
-	    ^ self
-	].
-    ].
-
-    "Modified: / 17-04-2012 / 21:01:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+        (shifted and:[selectionStartLine isNil]) ifTrue:[
+            expandingTop := true.
+            key == #CursorLeft ifTrue:[
+                cursorCol > 1 ifTrue:[
+                    selectionStartLine := selectionEndLine := clickStartLine := cursorLine.
+                    selectionEndCol := clickStartCol := cursorCol-1.
+                    selectionStartCol := cursorCol-1.
+                    self setCursorCol: cursorCol-1.
+                    self validateNewSelection.
+                    self selectionChanged.
+                    self redrawLine:selectionStartLine.
+                    ^ self
+                ]
+            ] ifFalse:[
+                cursorLine > 1 ifTrue:[
+                    selectionEndLine := clickStartLine := cursorLine.
+                    selectionStartCol := clickStartCol := cursorCol.
+                    selectionEndCol := cursorCol - 1.
+                    selectionStartLine := cursorLine - 1.
+                    selectionEndCol == 1 ifTrue:[
+                        selectionEndCol := 0.
+                    ].
+                    self validateNewSelection.
+                    self selectionChanged.
+                    self redrawFromLine:selectionStartLine to:cursorLine.
+                    self setCursorLine: cursorLine - 1.  
+                    ^ self
+                ]
+            ]
+        ].
+
+        self hasSelection ifTrue:[
+            self cursorMovementAllowed ifTrue:[
+                "/
+                "/ treat the whole selection as cursor
+                "/
+"/                self setCursorLine:selectionStartLine.
+"/                self setCursorCol:selectionStartCol.
+"/                self makeCursorVisible.
+"/
+"/                shifted ifFalse:[
+"/                    self unselect.
+"/                ]
+            ].
+        ].
+        (key == #CursorLeft) ifTrue:[
+            shifted ifTrue:[
+                self addToSelectionAfter:[self cursorLeft].
+            ] ifFalse:[
+                "/ If there's selection, unselect and move cursor
+                "/ to the end of selection.   
+                self hasSelection ifTrue:[ 
+                    self setCursorLine:selectionStartLine.
+                    self setCursorCol:selectionStartCol.
+                    self unselect; makeCursorVisible.                    
+                    ^ self.
+                ].
+                self unselect; makeCursorVisible.
+                self cursorLeft. 
+            ].
+            ^self
+        ].
+        (key == #CursorUp)        ifTrue:[
+            n := 1 + (self sensor compressKeyPressEventsWithKey:#CursorUp).
+            shifted ifTrue:[
+                self addToSelectionAfter: [ self cursorUp:n ]
+            ] ifFalse:[
+                "/ If there's selection, unselect and move cursor
+                "/ to the beggining of selection.   
+                self hasSelection ifTrue:[ 
+                    self setCursorLine:selectionStartLine.
+                    self setCursorCol:selectionStartCol.
+                ].    
+                self unselect; makeCursorVisible.
+                self cursorUp:n.
+            ].
+            "/
+            "/ flush keyboard to avoid runaway cursor
+            "/
+            self sensor flushKeyboardFor:self.
+            ^ self
+        ].
+    ].
+
+    "Modified: / 28-03-2014 / 12:32:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doKeyPress:key x:x y:y
     "handle keyboard input"
 
     <resource: #keyboard (#Paste #Insert #PasteFromHistory #Cut #Again #AgainForAll
-			  #Replace #Undo #Redo #Accept
-			  #Delete #BasicDelete #BackSpace #BasicBackspace
-			  #DeleteSpaces #Join
-			  #SearchMatchingParent #SelectMatchingParents
-			  #SelectWord #ExpandSelectionByWord
-			  #SelectToEnd #SelectFromBeginning
-			  #SelectLine #ExpandSelectionByLine
-			  #BeginOfLine #EndOfLine #NextWord #PreviousWord
-			  #CursorRight #CursorDown #CursorLeft #CursorUp
-			  #Return #Tab #BackTab #NonInsertingTab #Escape
-			  #GotoLine #BeginOfText #EndOfText
-			  #InsertLine #DeleteLine
-			  #SelectLineFromBeginning
-			  #LearnKeyboardMacro #ExecuteKeyboardMacro #ToggleInsertMode
-			  #OpenSpecialCharacterWindow #InsertUUID
-			  #'F*' #'f*')>
+                          #Replace #Undo #Redo #Accept
+                          #Delete #BasicDelete #BackSpace #BasicBackspace
+                          #DeleteSpaces #Join
+                          #SearchMatchingParent #SelectMatchingParents
+                          #SelectWord #ExpandSelectionByWord
+                          #SelectToEnd #SelectFromBeginning
+                          #SelectLine #ExpandSelectionByLine
+                          #BeginOfLine #EndOfLine #NextWord #PreviousWord
+                          #CursorRight #CursorDown #CursorLeft #CursorUp
+                          #Return #Tab #BackTab #NonInsertingTab #Escape
+                          #GotoLine #BeginOfText #EndOfText
+                          #InsertLine #DeleteLine
+                          #SelectLineFromBeginning
+                          #LearnKeyboardMacro #ExecuteKeyboardMacro #ToggleInsertMode
+                          #OpenSpecialCharacterWindow #InsertUUID
+                          #'F*' #'f*')>
 
     |fKeyMacros shiftPressed ctrlPressed i event macroName
      immediateCompletion currentUserPrefs rawKey|
@@ -5088,154 +5200,154 @@
 
     "/ experimental
     immediateCompletion := currentUserPrefs immediateCodeCompletion.
-    (immediateCompletion
+    (immediateCompletion 
     or:[currentUserPrefs codeCompletionOnControlKey
     or:[currentUserPrefs codeCompletionOnTabKey]]) ifTrue:[
-	completionSupport isNil ifTrue:[
-	    self initializeCompletionSupport.
-	].
-    ].
-
+        completionSupport isNil ifTrue:[
+            self initializeCompletionSupport.
+        ].
+    ].
+    
     "/ JV: why setting it to nil here?
 "/    ifFalse:[
 "/        completionService := nil
 "/    ].
     completionSupport notNil ifTrue:[
-	completionSupport stopCompletionProcess.
-	(completionSupport handleKeyPress:key x:x y:y) ifTrue:["eaten" ^ self].
+        completionSupport stopCompletionProcess.
+        (completionSupport handleKeyPress:key x:x y:y) ifTrue:["eaten" ^ self].
     ].
 
     key isSymbol ifTrue:[
-	(device modifierKeys includes:key) ifFalse:[
-	    lastReplacementInfo stillCollectingInput:false.
-	]
+        (device modifierKeys includes:key) ifFalse:[
+            lastReplacementInfo stillCollectingInput:false.
+        ]
     ].
     (key == #LearnKeyboardMacro) ifTrue:[
-	lastReplacementInfo stillCollectingInput:false.
-	self toggleLearnMode.
-	^ self
+        lastReplacementInfo stillCollectingInput:false.
+        self toggleLearnMode.
+        ^ self
     ].
     (key == #ExecuteKeyboardMacro) ifTrue:[
-	lastReplacementInfo stillCollectingInput:false.
-	self executeLearnedKeyboardMacro.
-	^ self.
+        lastReplacementInfo stillCollectingInput:false.
+        self executeLearnedKeyboardMacro.
+        ^ self.
     ].
     (key == #Undo) ifTrue:[self undo. ^self].
     (key == #Redo) ifTrue:[self redo. ^self].
 
     self learnMode ifTrue:[
-	event := WindowGroup lastEventQuerySignal query.
-	learnedMacro add:event.
+        event := WindowGroup lastEventQuerySignal query.
+        learnedMacro add:event.
     ].
 
     (self executekeyboardMacroNamed:key) ifTrue:[
-	"the macro named key exists"
-	^ self
+        "the macro named key exists"
+        ^ self
     ].
 
     key isSymbol ifFalse:[
-	"the usual case: key is a character, but maybe a string also (in X11)"
-	self handleNonCommandKey:key.
-	^ self
+        "the usual case: key is a character, but maybe a string also (in X11)"
+        self handleNonCommandKey:key.
+        ^ self
     ].
 
     event isNil ifTrue:[
-	event := WindowGroup lastEventQuerySignal query.
+        event := WindowGroup lastEventQuerySignal query.
     ].
     shiftPressed := event hasShift.
     ctrlPressed := event hasCtrl and:[(event rawKey asString startsWith:'Ctrl') not].
     rawKey := event rawKey.
 
     key == #InsertUUID ifTrue:[
-	self insertUUID.
-	^ self.
+        self insertUUID.
+        ^ self.
     ].
 
     (key == #DeleteWordBeforeCursor) ifTrue:[
-	self deleteWordBeforeCursor.
-	^ self.
+        self deleteWordBeforeCursor.
+        ^ self.
     ].
 
     (rawKey == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
-	selectionStartLine notNil ifTrue:[
-	    ((key == #BasicBackspace)
-	    or:[ currentUserPrefs deleteSetsClipboardText not ])
-	    ifTrue:[
-		self deleteSelection.
-	    ] ifFalse: [
-		self copyAndDeleteSelection.
-	    ].
-	] ifFalse:[
-	    self makeCursorVisible.
+        selectionStartLine notNil ifTrue:[
+            ((key == #BasicBackspace)
+            or:[ currentUserPrefs deleteSetsClipboardText not ])
+            ifTrue:[
+                self deleteSelection.
+            ] ifFalse: [
+                self copyAndDeleteSelection.
+            ].
+        ] ifFalse:[
+            self makeCursorVisible.
 "/          (shiftPressed and:[ ctrlPressed ]) ifTrue:[
 "/            self deleteWordBeforeCursor.
 "/          ] ifFalse:[
-	    self deleteCharBeforeCursor.
+            self deleteCharBeforeCursor.
 "/          ].
-	].
-	true "immediateCompletion" ifTrue:[
-	    completionSupport notNil ifTrue:[
-		completionSupport postKeyPress:key
-	    ].
-	].
-	^ self
+        ].
+        true "immediateCompletion" ifTrue:[ 
+            completionSupport notNil ifTrue:[ 
+                completionSupport postKeyPress:key
+            ].
+        ].
+        ^ self
     ].
 
     (key == #ToggleAutoIndent) ifTrue:[
-	self autoIndent:(autoIndent not).
-	^ self.
+        self autoIndent:(autoIndent not).
+        ^ self.
     ].
 
     key == #ToggleInsertMode ifTrue:[
-	self insertMode:(editMode value == EditMode insertMode) not.
-	^ self.
+        self insertMode:(editMode value == EditMode insertMode) not.
+        ^ self.
     ].
 
     key == #OpenSpecialCharacterWindow ifTrue:[
-	CharacterSetView notNil ifTrue:[
-	    self specialCharacters.
-	    ^ self.
-	]
+        CharacterSetView notNil ifTrue:[
+            self specialCharacters.
+            ^ self.
+        ]        
     ].
 
     replacing := false.
 
     "
      Fn      pastes a key-sequence (but only if not overlayed with
-	     another function in the keyboard map)
+             another function in the keyboard map)
 
      see TextView>>:x:y
     "
     (key at:1) asLowercase == $f ifTrue:[
-	(('[fF][0-9]' match:key)
-	or:['[fF][0-9][0-9]' match:key]) ifTrue:[
-	    shiftPressed ifFalse:[
-		fKeyMacros := currentUserPrefs functionKeySequences.
-		fKeyMacros notNil ifTrue:[
-		    (fKeyMacros includesKey:key) ifTrue:[
-			self pasteOrReplace:(fKeyMacros at:key) asStringCollection.
-			^ self
-		    ]
-		]
-	    ]
-	].
+        (('[fF][0-9]' match:key)
+        or:['[fF][0-9][0-9]' match:key]) ifTrue:[
+            shiftPressed ifFalse:[
+                fKeyMacros := currentUserPrefs functionKeySequences.
+                fKeyMacros notNil ifTrue:[
+                    (fKeyMacros includesKey:key) ifTrue:[
+                        self pasteOrReplace:(fKeyMacros at:key) asStringCollection.
+                        ^ self
+                    ]
+                ]
+            ]
+        ].
     ].
 
     (key == #'Ctrl8' or:[key == #'Ctrl9']) ifTrue:[
-	self parenthizeSelectionWith:$( and:$).
-	^ self.
+        self parenthizeSelectionWith:$( and:$).
+        ^ self.
     ].
     (key == #'Ctrl2') ifTrue:[
-	self parenthizeSelectionWith:$" and:$".
-	^ self.
+        self parenthizeSelectionWith:$" and:$".
+        ^ self.
     ].
     (key == #'Ctrl#') ifTrue:[
-	self parenthizeSelectionWith:$' and:$'.
-	^ self.
+        self parenthizeSelectionWith:$' and:$'.
+        ^ self.
     ].
     (key == #'ConvertSelectionToLowercaseOrUppercaseOrUppercaseFirst') ifTrue:[
-	self convertSelectionToLowercaseOrUppercaseOrUppercaseFirst.
-	^ self.
+        self convertSelectionToLowercaseOrUppercaseOrUppercaseFirst.
+        ^ self.
     ].
 
     (key == #Accept)  ifTrue:[^ self accept].
@@ -5248,14 +5360,14 @@
     (key == #Join) ifTrue:[self joinLines. ^self].
     (key == #Replace) ifTrue:[self replace. ^self].
     (key == #ExpandSelectionByWord) ifTrue:[
-	self makeCursorVisible.
-	self findNextWordAfterSelectionAndAddToSelection.
-	^ self
+        self makeCursorVisible.
+        self findNextWordAfterSelectionAndAddToSelection.
+        ^ self
     ].
     (key == #SelectWord) ifTrue:[
-	self makeCursorVisible.
-	self selectWordUnderCursor.
-	^ self
+        self makeCursorVisible.
+        self selectWordUnderCursor.
+        ^ self
     ].
 
     (key == #SearchMatchingParent) ifTrue:[self searchForMatchingParenthesis. ^ self].
@@ -5273,294 +5385,345 @@
 "
 
     (key == #BeginOfLine) ifTrue:[
-	"/ cg: this is complete rubbish - you have to define a mapping from
-	"/ some shifted key to selectFromBeginOfLine
-	"/ (otherwise, no shifted key could ever be mapped to BegnOfLine)
-	"/ see code below.
-	false "shiftPressed" ifTrue: [
-	    "/ "Original St/X code - now use Ctrl modifier"
-	    "/ self unselect.
-	    "/ self cursorHome.
-	    "Jan's modification"
-	    "/ self addToSelectionAfter:[ self cursorToBeginOfLine ].
-	    "/ Jan's modification modified by his own request ;-))
-	    self selectFromBeginOfLine.
-	] ifFalse: [
-	    self unselect.
-	    ctrlPressed ifTrue:[
-		self cursorHome.
-	    ] ifFalse:[
-		self cursorToBeginOfLine.
-	    ]
-	].
-	^ self
-    ].
-    (key == #BSelectFromeginOfLine) ifTrue:[
-	self selectFromBeginOfLine.
-	^ self
-    ].
-
+        shiftPressed ifTrue: [
+            "/ "Original St/X code - now use Ctrl modifier"
+            "/ self unselect.
+            "/ self cursorHome.
+            "Jan's modification"
+            self addToSelectionAfter:[ self cursorToBeginOfLine ].
+            "/ Jan's modification modified by his own request ;-))
+            "/ JV: Well, does not work correctly. Better to fix addToSelectionAfter: 
+            "/ self selectFromBeginOfLine.
+        ] ifFalse: [
+            self unselect.
+            ctrlPressed ifTrue:[
+                self cursorHome.
+            ] ifFalse:[
+                self cursorToBeginOfLine.
+            ]
+        ].
+        ^ self
+    ].
     (key == #EndOfLine) ifTrue:[
-	"/ cg: this is complete rubbish - you have to define a mapping from
-	"/ some shifted key to selectFromBeginOfLine
-	"/ (otherwise, no shifted key could ever be mapped to BegnOfLine)
-	"/ see code below.
-	false "shiftPressed" ifTrue:[
-	    "/ "Original St/X code - now use Ctrl modifier"
-	    "/ self unselect.
-	    "/ self cursorToBottom
-	    " Jan's modification"
-	    "/ self addToSelectionAfter:[ self cursorToEndOfLine ] .
-	    "/ Jan's modification modified by his own request ;-))
-	    self selectToEndOfLine.
-	] ifFalse:[
-	    self unselect.
-	    ctrlPressed ifTrue:[
-		self cursorToBottom
-	    ] ifFalse:[
-		self cursorToEndOfLine.
-	    ]
-	].
-	^ self
-    ].
-
-    (key == #SelectToEndOfLine) ifTrue:[
-	self selectToEndOfLine.
-	^ self
-    ].
-
-    (key == #NextWord) ifTrue:[self cursorToNextWord. ^self].
+        shiftPressed ifTrue:[
+            "/ "Original St/X code - now use Ctrl modifier"
+            "/ self unselect.
+            "/ self cursorToBottom
+            " Jan's modification"
+            self addToSelectionAfter:[ self cursorToEndOfLine ] .
+            "/ Jan's modification modified by his own request ;-))
+            "/ JV: Well, does not work correctly. Better to fix addToSelectionAfter:
+            "/  self selectToEndOfLine.
+        ] ifFalse:[
+            self unselect.
+            ctrlPressed ifTrue:[
+                self cursorToBottom
+            ] ifFalse:[
+                self cursorToEndOfLine.
+            ]
+        ].
+        ^ self
+    ].
+    (key == #NextWord) ifTrue:[
+        shiftPressed ifTrue:[
+            self addToSelectionAfter:[  
+                self cursorToNextWord. 
+            ]
+        ] ifFalse:[ 
+            self cursorToNextWord
+        ].
+        ^self
+    ].
     (key == #EndOfWord) ifTrue:[self cursorToEndOfWord. ^self].
-    (key == #PreviousWord) ifTrue:[self cursorToPreviousWord. ^self].
+    (key == #PreviousWord) ifTrue:[
+        shiftPressed ifTrue:[
+            self addToSelectionAfter:[      
+                self cursorToPreviousWord. 
+            ]
+        ] ifFalse:[ 
+            self cursorToPreviousWord.                                
+        ].
+        ^self
+    ].
     (key == #GotoLine) ifTrue:[self gotoLine. ^self].
 
     (rawKey == #CursorRight
     or:[rawKey == #CursorDown
     or:[rawKey == #CursorLeft
     or:[rawKey == #CursorUp]]]) ifTrue:[
-	self cursorKeyPress:rawKey shifted:shiftPressed.
-	^ self.
+        self cursorKeyPress:rawKey shifted:shiftPressed.
+        ^ self.
     ].
 
     (key == #ShiftReturn or:[key == #NonInsertingReturn]) ifTrue:[
-	self unselect. self cursorReturn.
-	^ self
+        self unselect. self cursorReturn.
+        ^ self
     ].
 
     (key == #Return) ifTrue:[
-	shiftPressed ifTrue:[
-	    self unselect. self cursorReturn.
-	    ^ self
-	].
-
-	self isReadOnly ifTrue:[
-	    self unselect; makeCursorVisible.
-	    self cursorReturn
-	] ifFalse:[
-	    self isInInsertMode ifFalse:[
-		self cursorReturn:true.
-		autoIndent == true ifTrue:[
-		    i := self leftIndentForLine:(cursorLine + 1).
-		    (self listAt:cursorLine) isEmptyOrNil ifTrue:[
-			self cursorCol:(i+1 max:1)
-		    ]
-		]
-	    ] ifTrue:[
-		|left right oldIndent|
-
-		"/ old version just unselected ...
-		"/ self unselect; makeCursorVisible.
-
-		"/ new version deletes ...
-		typeOfSelection == #paste ifTrue:[
-		    self unselect; makeCursorVisible.
-		] ifFalse:[
-		    self copyAndDeleteSelection.
-		].
-		left := (self listAt:cursorLine to:cursorCol-1) ? ''.
-		right := (self listAt:cursorLine from:cursorCol) ? ''.
-		self insertCharAtCursor:(Character cr).
-
-		autoIndent == true ifTrue:[
-		    (right isEmpty and:[cursorCol ~~ 1]) ifTrue:[
-			"/ nothing to do.
-		    ] ifFalse:[
-			((self listAt:cursorLine) isEmptyOrNil
-			or:[ false "cursorCol == 1" ]) ifTrue:[
-			    i := (self leftIndentForLine:cursorLine).
-			    left := left withoutSeparators.
-			    right := right withoutSeparators.
-			    (left endsWith:'[') ifTrue:[
+        shiftPressed ifTrue:[
+            self unselect. self cursorReturn.
+            ^ self
+        ].
+
+        self isReadOnly ifTrue:[
+            self unselect; makeCursorVisible.
+            self cursorReturn
+        ] ifFalse:[
+            self isInInsertMode ifFalse:[
+                self cursorReturn:true.
+                autoIndent == true ifTrue:[
+                    i := self leftIndentForLine:(cursorLine + 1).
+                    (self listAt:cursorLine) isEmptyOrNil ifTrue:[
+                        self cursorCol:(i+1 max:1)
+                    ]
+                ]
+            ] ifTrue:[
+                |left right oldIndent|
+
+                "/ old version just unselected ...
+                "/ self unselect; makeCursorVisible.
+
+                "/ new version deletes ...
+                typeOfSelection == #paste ifTrue:[
+                    self unselect; makeCursorVisible.
+                ] ifFalse:[
+                    self copyAndDeleteSelection.
+                ].
+                left := (self listAt:cursorLine to:cursorCol-1) ? ''.
+                right := (self listAt:cursorLine from:cursorCol) ? ''.
+                self insertCharAtCursor:(Character cr).
+
+                autoIndent == true ifTrue:[
+                    (right isEmpty and:[cursorCol ~~ 1]) ifTrue:[
+                        "/ nothing to do.
+                    ] ifFalse:[
+                        ((self listAt:cursorLine) isEmptyOrNil 
+                        or:[ false "cursorCol == 1" ]) ifTrue:[
+                            i := (self leftIndentForLine:cursorLine).
+                            left := left withoutSeparators.
+                            right := right withoutSeparators.
+                            (left endsWith:'[') ifTrue:[
 "/                                i := i + 4.
-			    ] ifFalse:[
-				(false "(left endsWith:']')" or:[(right startsWith:']')]) ifTrue:[
-				    i := i - 4.
-				].
-			    ].
-			    oldIndent := self leftIndentOfLine:cursorLine.
-			    self indentFromLine:cursorLine toLine:cursorLine by:(i-oldIndent).
-			    self st80EditMode ifTrue:[
-				(self listAt:cursorLine) size < i ifTrue:[
-				    self insertStringAtCursor:(String new:((i-oldIndent) max:0)).
-				].
-			    ].
-			    self cursorCol:(i+1 max:1)
-			].
-		    ]
-		].
-	    ].
-	].
-	^ self
+                            ] ifFalse:[
+                                (false "(left endsWith:']')" or:[(right startsWith:']')]) ifTrue:[
+                                    i := i - 4.
+                                ].
+                            ].
+                            oldIndent := self leftIndentOfLine:cursorLine.
+                            self indentFromLine:cursorLine toLine:cursorLine by:(i-oldIndent).
+                            self st80EditMode ifTrue:[
+                                (self listAt:cursorLine) size < i ifTrue:[
+                                    self insertStringAtCursor:(String new:((i-oldIndent) max:0)).
+                                ].
+                            ].
+                            self cursorCol:(i+1 max:1)
+                        ].
+                    ]
+                ].
+            ].
+        ].
+        ^ self
     ].
 
     (key == #NonInsertingTab) ifTrue:[
-	self unselect. self cursorTab.
-	^ self
+        self unselect. self cursorTab.
+        ^ self
     ].
     ((key == #BackTab) or:[(key == #Tab)]) ifTrue:[
-	self tabMeansNextField ifTrue:[^ super keyPress:key x:x y:y].
-
-	self hasSelection ifTrue:[
-	    selectStyle == #line ifTrue:[
-		((key == #Tab) and:[shiftPressed not]) ifTrue:[
-		    macroName := #IndentBy4.
-		] ifFalse:[
-		    macroName := #UndentBy4.
-		].
-		macroName notNil ifTrue:[
-		    self executekeyboardMacroNamed:macroName.
-		].
-	    ]
-	].
-
-	self unselect.
-	(key == #Tab) ifTrue:[
-	    (shiftPressed or:[self isInInsertMode not]) ifTrue:[
-		self cursorTab.
-		^ self
-	    ].
-	    self insertTabAtCursor.
-	    ^ self
-	].
-	self cursorBacktab.
-	^ self
+        self tabMeansNextField ifTrue:[^ super keyPress:key x:x y:y].
+
+        self hasSelection ifTrue:[
+            selectStyle == #line ifTrue:[
+                ((key == #Tab) and:[shiftPressed not]) ifTrue:[
+                    macroName := #IndentBy4.
+                ] ifFalse:[
+                    macroName := #UndentBy4.
+                ].
+                macroName notNil ifTrue:[
+                    self executekeyboardMacroNamed:macroName.
+                ].
+            ]
+        ].
+
+        self unselect.
+        (key == #Tab) ifTrue:[
+            (shiftPressed or:[self isInInsertMode not]) ifTrue:[
+                self cursorTab.
+                ^ self
+            ].
+            self insertTabAtCursor.
+            ^ self
+        ].
+        self cursorBacktab.
+        ^ self
     ].
 
     "/ key == #DeleteSpaces ifTrue:[
     (rawKey == #Delete) ifTrue:[
-	shiftPressed ifTrue:[
-	    [(cursorCol <= (self listAt:cursorLine) size)
-	     and:[self characterUnderCursor isSeparator]] whileTrue:[
-	     self makeCursorVisible.
-		self deleteCharAtCursor.
-	    ].
-	    ^ self
-	]
+        shiftPressed ifTrue:[
+            [(cursorCol <= (self listAt:cursorLine) size)
+             and:[self characterUnderCursor isSeparator]] whileTrue:[
+             self makeCursorVisible.
+                self deleteCharAtCursor.
+            ].
+            ^ self
+        ]
     ].
 
     (rawKey == #Delete
      or:[key == #BasicDelete]) ifTrue:[
-	selectionStartLine notNil ifTrue:[
+        selectionStartLine notNil ifTrue:[  
 "/          Again function is not supporting Delete action (on purpose, to avoid replacing the next search string)
 "/          To remove text repetetively, use Cut instead.
 "/            self setLastStringToReplace: self selection asStringWithoutFinalCR.
 "/            lastReplacementInfo lastReplacement: nil.
-	    ((key == #BasicDelete)
-	    or:[currentUserPrefs deleteSetsClipboardText not]) ifTrue:[
-		self deleteSelection.
-	    ] ifFalse:[
-		self copyAndDeleteSelection.
-	    ].
-	    ^ self
-	].
-	self makeCursorVisible.
-	self deleteCharAtCursor.
-	^ self
+            ((key == #BasicDelete)
+            or:[currentUserPrefs deleteSetsClipboardText not]) ifTrue:[
+                self deleteSelection.
+            ] ifFalse:[
+                self copyAndDeleteSelection.
+            ].
+            ^ self
+        ].
+        self makeCursorVisible.
+        self deleteCharAtCursor.
+        ^ self
     ].
 
     (key == #BeginOfText) ifTrue:[     "i.e. HOME"
-	self unselect.
-	cursorVisibleLine == 1 ifTrue:[
-	    self cursorHome.
-	] ifFalse:[
-	    self cursorToFirstVisibleLine
-	].
-	^ self
+        self unselect.
+        cursorVisibleLine == 1 ifTrue:[
+            self cursorHome.
+        ] ifFalse:[
+            self cursorToFirstVisibleLine
+        ].
+        ^ self
     ].
     (key == #EndOfText) ifTrue:[       "i.e. END"
-	self unselect.
-	cursorVisibleLine == nFullLinesShown ifTrue:[
-	    self cursorToBottom.
-	] ifFalse:[
-	    self cursorToLastVisibleLine
-	].
-	^ self
+        self unselect.
+        cursorVisibleLine == nFullLinesShown ifTrue:[
+            self cursorToBottom.
+        ] ifFalse:[
+            self cursorToLastVisibleLine
+        ].
+        ^ self
     ].
     ((key == #Escape)
     or:[key == #SelectLineFromBeginning]) ifTrue:[
-	self makeCursorVisible.
-	self unselect. self selectCursorLineFromBeginning.
-	^ self
+        self makeCursorVisible.
+        self unselect. self selectCursorLineFromBeginning.
+        ^ self
     ].
     (key == #SelectLine) ifTrue:[
-	self makeCursorVisible.
-	self unselect. self selectCursorLine.
-	^ self
+        self makeCursorVisible.
+        self unselect. self selectCursorLine.
+        ^ self
     ].
     (key == #ExpandSelectionByLine) ifTrue:[
-	"/ self makeCursorVisible.
-	self selectExpandCursorLine.
-	^ self
+        "/ self makeCursorVisible.
+        self selectExpandCursorLine.
+        ^ self
     ].
     (key == #DeleteLine) ifTrue:[
-	self makeCursorVisible.
-	self unselect. self deleteCursorLine.
-	^ self
+        self makeCursorVisible.
+        self unselect. self deleteCursorLine.
+        ^ self
     ].
     (key == #InsertLine) ifTrue:[
-	self makeCursorVisible.
-	self unselect. self insertLine:nil before:cursorLine.
-	^ self
+        self makeCursorVisible.
+        self unselect. self insertLine:nil before:cursorLine.
+        ^ self
     ].
 
     super keyPress:key x:x y:y
 
     "Modified: / 06-02-1998 / 11:59:59 / stefan"
     "Modified: / 14-07-2011 / 12:08:28 / cg"
-    "Modified: / 26-09-2013 / 17:52:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-03-2014 / 16:27:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 executeKeyboardMacro:cmdMacro
     Error handle:[:ex |
-	self warn:'Error in keyboard macro: ' , ex description.
-	ex return.
+        self warn:'Error in keyboard macro: ' , ex description.
+        ex return.
     ] do:[
-	AbortOperationRequest handle:[:ex |
-	    self warn:'Keyboard macro aborted'.
-	    ex return.
-	] do:[
-	    Parser
-		evaluate:cmdMacro asString
-		receiver:self
-		notifying:nil
-		compile:false.
-	].
-    ].
+        AbortOperationRequest handle:[:ex |
+            self warn:'Keyboard macro aborted'.
+            ex return.
+        ] do:[
+            Parser
+                evaluate:cmdMacro asString
+                receiver:self
+                notifying:nil
+                compile:false.
+        ].
+    ].
+!
+
+extendSelectionToX:x y:y setPrimarySelection:aBoolean
+    | movedVisibleLine movedLine movedCol movedUp |
+
+    movedVisibleLine := self visibleLineOfY:y.
+    movedLine := self visibleLineToAbsoluteLine:movedVisibleLine.
+
+    (x < leftMargin) ifTrue:[
+        movedCol := 0
+    ] ifFalse:[
+        movedCol := self colOfX:x inVisibleLine:movedVisibleLine
+    ].
+
+    "find out if we are before or after initial click"
+    movedUp := false.
+    (movedLine < (clickStartLine ? movedLine)) ifTrue:[
+        movedUp := true
+    ] ifFalse:[
+        (movedLine == (clickStartLine ? movedLine)) ifTrue:[
+            (movedCol < (clickStartCol ? movedCol)) ifTrue:[
+                movedUp := true
+            ]
+        ]
+    ].
+
+    self hasSelection ifTrue:[ 
+        movedUp ifTrue:[
+            "/ Set cursor to selection start
+            self setCursorLine: selectionStartLine col: selectionStartCol
+        ] ifFalse:[ 
+            "/ Set cursor to selection end
+            self setCursorLine: selectionEndLine col: selectionEndCol + 1
+        ].
+    ].
+
+
+
+    super extendSelectionToX:x y:y setPrimarySelection:aBoolean.
+
+    "Created: / 02-05-2015 / 07:33:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 handleNonCommandKey:keyArg
     |selStartLineBefore selStartColBefore selEndLineBefore selEndColBefore key|
 
     self isReadOnly ifTrue:[
-	self flashReadOnly.
-	^ self.
+        self flashReadOnly.
+        ^ self.
     ].
 
     key := keyArg.
 
     typeOfSelection == #paste ifTrue:[
-	"pasted selection will NOT be replaced by keystroke"
-	self unselect
+        "Pasted selection will NOT be replaced by keystroke (non-standard, St/X feature)"
+
+        "/ After paste, the cursor is at the beginning to support
+        "/ paste-cursordown-paste. Compensate for this here - we want
+        "/ to continue editing after the end of the selection.
+        "/ This is
+        cursorLine := selectionEndLine.
+        cursorCol := selectionEndCol + 1.
+
+        "/ Cursor position set, we can unselect.
+        self unselect.
     ].
 
     selStartLineBefore := selectionStartLine.
@@ -5569,11 +5732,11 @@
     selEndColBefore := self selectionEndCol.
 
     (gc characterEncoding ? #'iso10646-1') ~~ #'iso10646-1' ifTrue:[
-	key isCharacter ifTrue:[
-	    key := CharacterEncoder encode:key from:#'iso10646-1' into:gc characterEncoding.
-	] ifFalse:[
-	    key := CharacterEncoder encodeString:key from:#'iso10646-1' into:gc characterEncoding.
-	].
+        key isCharacter ifTrue:[
+            key := CharacterEncoder encode:key from:#'iso10646-1' into:gc characterEncoding.
+        ] ifFalse:[
+            key := CharacterEncoder encodeString:key from:#'iso10646-1' into:gc characterEncoding.
+        ].
     ].
 
     "replace selection by what is typed in -
@@ -5581,64 +5744,64 @@
      if there was no selection, the key's character is inserted"
 
     editMode value isInsertAndSelectMode ifTrue:[
-	selectionStartLine := selectionStartCol := selectionEndLine := selectionEndCol := nil.
+        selectionStartLine := selectionStartCol := selectionEndLine := selectionEndCol := nil.
     ].
 
     (selectStyle == #wordLeft) ifTrue:[
-	self replaceSelectionBy:(' ' , key asString)
+        self replaceSelectionBy:(' ' , key asString)
     ] ifFalse:[
-	(selectStyle == #wordRight) ifTrue:[
-	    self replaceSelectionBy:(key asString , ' ').
-	    self cursorLeft
-	] ifFalse:[
-	    self replaceSelectionBy:key
-	]
+        (selectStyle == #wordRight) ifTrue:[
+            self replaceSelectionBy:(key asString , ' ').
+            self cursorLeft
+        ] ifFalse:[
+            self replaceSelectionBy:key
+        ]
     ].
     selectStyle := nil.
 
     editMode value isInsertAndSelectMode ifTrue:[
-	selectionStartLine := selStartLineBefore.
-	selectionStartCol := selStartColBefore.
-	selectionEndLine := selEndLineBefore.
-	selectionEndCol := selEndColBefore.
+        selectionStartLine := selStartLineBefore.
+        selectionStartCol := selStartColBefore.
+        selectionEndLine := selEndLineBefore.
+        selectionEndCol := selEndColBefore.
     ].
 
     showMatchingParenthesis ifTrue:[
-	"emacs style parenthesis shower"
+        "emacs style parenthesis shower"
       (ExecutingMacroQuery query ? false) ifFalse:[
-	"claus: only do it for closing parenthesis -
-		otherwise its too anoying.
-	"
+        "claus: only do it for closing parenthesis -
+                otherwise its too anoying.
+        "
 "
-	('()[]{}' includes:key) ifTrue:[
+        ('()[]{}' includes:key) ifTrue:[
 "
-	(')]}' includes:key) ifTrue:[
-	self
-	    searchForMatchingParenthesisFromLine:cursorLine col:(cursorCol - 1)
-	    ifFound:[:line :col |
-			 |savLine savCol sensor|
-
-			 self withCursor:Cursor eye do:[
-			     savLine := cursorLine.
-			     savCol := cursorCol.
-			     self cursorLine:line col:col.
-			     self flush.
-
-			     "/ want to wait 200ms, but not if another keyPress
-			     "/ arrives in the meantime ...
-
-			     sensor := self sensor.
-			     5 timesRepeat:[
-				 (sensor hasKeyPressEventFor:self) ifFalse:[
-				     Processor activeProcess millisecondDelay:40.
-				 ]
-			     ].
-			     self cursorLine:savLine col:savCol
-			 ]
-		    ]
-	    ifNotFound:[self showNotFound]
-	    onError:[self beep]
-	].
+        (')]}' includes:key) ifTrue:[
+        self
+            searchForMatchingParenthesisFromLine:cursorLine col:(cursorCol - 1)
+            ifFound:[:line :col |
+                         |savLine savCol sensor|
+
+                         self withCursor:Cursor eye do:[
+                             savLine := cursorLine.
+                             savCol := cursorCol.
+                             self cursorLine:line col:col.
+                             self flush.
+
+                             "/ want to wait 200ms, but not if another keyPress
+                             "/ arrives in the meantime ...
+
+                             sensor := self sensor.
+                             5 timesRepeat:[
+                                 (sensor hasKeyPressEventFor:self) ifFalse:[
+                                     Processor activeProcess millisecondDelay:40.
+                                 ]
+                             ].
+                             self cursorLine:savLine col:savCol
+                         ]
+                    ]
+            ifNotFound:[self showNotFound]
+            onError:[self beep]
+        ].
       ]
     ].
 
@@ -5652,15 +5815,16 @@
 "/        ].
 "/    ].
     editMode value isInsertAndSelectMode ifTrue:[
-	selectionStartLine isNil ifTrue:[
-	    self selectFromLine:cursorLine col:cursorCol-1 toLine:cursorLine col:cursorCol-1.
-	] ifFalse:[
-	    self selectFromLine:selectionStartLine col:selectionStartCol toLine:cursorLine col:cursorCol-1.
-	].
+        selectionStartLine isNil ifTrue:[
+            self selectFromLine:cursorLine col:cursorCol-1 toLine:cursorLine col:cursorCol-1.
+        ] ifFalse:[
+            self selectFromLine:selectionStartLine col:selectionStartCol toLine:cursorLine col:cursorCol-1.
+        ].
     ].
     completionSupport notNil ifTrue:[ completionSupport postKeyPress:keyArg ].
 
     "Modified (comment): / 25-01-2012 / 00:30:11 / cg"
+    "Modified: / 30-08-2013 / 20:10:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 keyPress:key x:x y:y
@@ -5670,18 +5834,18 @@
 
     wasOn := cursorShown.
 
-    NoModificationError
-	handle:[:ex |
-	    self flashReadOnly.
-	    (cursorShown not and:[wasOn]) ifTrue:[
-		self makeCursorVisibleAndShowCursor:wasOn.
-	    ].
-	]
-	do:[
-	    self undoableDo:[
-		self doKeyPress:key x:x y:y
-	    ].
-	].
+    NoModificationError 
+        handle:[:ex |
+            self flashReadOnly.
+            (cursorShown not and:[wasOn]) ifTrue:[
+                self makeCursorVisibleAndShowCursor:wasOn.
+            ].
+        ] 
+        do:[
+            self undoableDo:[
+                self doKeyPress:key x:x y:y
+            ].
+        ].
 
     self repairDamage
 
@@ -5702,8 +5866,8 @@
      Any widget may suppress the ok/cancel, by returning false."
 
     acceptEnabled == false ifTrue:[
-	"/ nope -
-	^ false
+        "/ nope -
+        ^ false
     ].
     "/ cg: only do this if modified.
     "/ otherwise, users would have to make sure that the contents is
@@ -5711,7 +5875,7 @@
     "/ please check the expecco file-save or file-reimport dialog,
     "/ which has a problem with that behavior.
     self modified ifTrue:[
-	self accept.
+        self accept.
     ].
     ^ true.
 !
@@ -5724,7 +5888,7 @@
     cv := cursorVisibleLine.
     super sizeChanged:how.
     cv notNil ifTrue:[
-	self makeLineVisible:cursorLine
+        self makeLineVisible:cursorLine
     ]
 !
 
@@ -5732,7 +5896,7 @@
     super unmapped.
 
     completionSupport notNil ifTrue:[
-	completionSupport release.
+        completionSupport release.
     ].
 ! !
 
@@ -5742,7 +5906,7 @@
     super focusOut.
 
     completionSupport notNil ifTrue:[
-	completionSupport release.
+        completionSupport release.
     ].
 !
 
@@ -5755,19 +5919,19 @@
     (cursorShown
     and:[self enabled
     and:[self isReadOnly not]]) ifTrue:[
-	self drawCursor
+        self drawCursor
     ].
 
     hasKeyboardFocus ifFalse:[
-	completionSupport notNil ifTrue:[
-	    "/ this is a hack for Windows:
-	    "/ on windows, an activate:false event is first sent to my textView,
-	    "/ then an activate is sent to the completion popup.
-	    "/ this is done BEFORE the buttonPress event is delivered.
-	    "/ therefore, allow for the activate of the completionMenu and it's button event to be processed.
-	    "/ before forcing it to be closed...
-	    completionSupport startTimeoutForEditViewLostFocus.
-	].
+        completionSupport notNil ifTrue:[
+            "/ this is a hack for Windows:
+            "/ on windows, an activate:false event is first sent to my textView,
+            "/ then an activate is sent to the completion popup.
+            "/ this is done BEFORE the buttonPress event is delivered.
+            "/ therefore, allow for the activate of the completionMenu and it's button event to be processed.
+            "/ before forcing it to be closed...
+            completionSupport startTimeoutForEditViewLostFocus.
+        ].
     ].
 
     "Modified (format): / 06-11-2013 / 15:37:31 / cg"
@@ -5785,7 +5949,7 @@
 !
 
 showNoFocus:explicit
-    "the view lost the keyboard focus
+    "the view lost the keyboard focus 
      (either explicit, via tabbing; or implicit, by pointer movement)
       - change any display attributes as req'd."
 
@@ -5796,9 +5960,9 @@
     "/ the completion-menu is clicked on), and we don't want to kill the
     "/ completer. Otherwise, completion does not work when clocking into the list.
     explicit ifTrue:[
-	completionSupport notNil ifTrue:[
-	    completionSupport release.
-	].
+        completionSupport notNil ifTrue:[
+            completionSupport release.
+        ].
     ].
 !
 
@@ -5811,7 +5975,7 @@
      and:[self enabled
      and:[true "self isReadOnly not"]]]
     ) ifTrue:[
-	^ true
+        ^ true
     ].
 
     ^ false
@@ -5820,26 +5984,26 @@
 !EditTextView methodsFor:'formatting'!
 
 executekeyboardMacroNamed:macroName
-    "try to execute the keyboard macro;
+    "try to execute the keyboard macro; 
      return true if that worked, false otherwise"
 
     |cmdMacro|
 
     cmdMacro := UserPreferences current functionKeySequences at:macroName ifAbsent:[^ false].
     self
-	undoableDo:[ self executeKeyboardMacro:cmdMacro ]
-	info: macroName.
+        undoableDo:[ self executeKeyboardMacro:cmdMacro ]
+        info: macroName.
     ^ true
 
     "
       EditTextView open
-		contents:'bla';
-		selectAll;
-		executekeyboardMacroNamed:#IndentBy4.
+                contents:'bla';
+                selectAll;
+                executekeyboardMacroNamed:#IndentBy4.
       EditTextView open
-		contents:'bla';
-		selectAll;
-		executekeyboardMacroNamed:#blabla.
+                contents:'bla';
+                selectAll;
+                executekeyboardMacroNamed:#blabla.
     "
 
     "Modified: / 14-02-2012 / 11:17:27 / cg"
@@ -5857,12 +6021,12 @@
     start := selectionStartLine.
     end := selectionEndLine.
     (selectionEndCol == 0) ifTrue:[
-	end := end - 1
+        end := end - 1
     ].
     self unselect.
     self
-	undoableDo:[self indentFromLine:start toLine:end]
-	info:'Indent'
+        undoableDo:[self indentFromLine:start toLine:end]
+        info:'Indent'
 !
 
 indentBy4
@@ -5890,8 +6054,8 @@
     ] ifFalse:[
         line2 notNil ifTrue:[
             self selectionEndCol == 0 ifTrue:[ line2 := line2 - 1 ].
-        ].
-    ].
+        ].                
+    ].                
     line1 notNil ifTrue:[
         self indentFromLine:line1 toLine:line2 by:n.
     ]
@@ -5925,36 +6089,36 @@
 
     (delta == 0) ifTrue:[^ self].
     (delta > 0) ifTrue:[
-	spaces := String new:delta
+        spaces := String new:delta
     ].
 
     anyChange := false.
     start to:end do:[:lineNr |
-	line := self listAt:lineNr.
-	line notNil ifTrue:[
-	    line isBlank ifTrue:[
-		self basicListAt:lineNr put:nil
-	    ] ifFalse:[
-		(delta > 0) ifTrue:[
-		    line := spaces , line.
-		    widthOfWidestLine notNil ifTrue:[
-			widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:line).
-		    ]
-		] ifFalse:[
-		    "check if deletion is ok"
-		    d := delta negated + 1.
-
-		    line size > d ifTrue:[
-			(line copyTo:(d - 1)) withoutSeparators isEmpty ifTrue:[
-			    line := line copyFrom:d
-			]
-		    ].
-		    widthOfWidestLine := nil
-		].
-		self replaceLine:lineNr with:line.
-		anyChange := true.
-	    ]
-	]
+        line := self listAt:lineNr.
+        line notNil ifTrue:[
+            line isBlank ifTrue:[
+                self basicListAt:lineNr put:nil
+            ] ifFalse:[
+                (delta > 0) ifTrue:[
+                    line := spaces , line.
+                    widthOfWidestLine notNil ifTrue:[
+                        widthOfWidestLine := widthOfWidestLine max:(self widthOfLineString:line).
+                    ]
+                ] ifFalse:[
+                    "check if deletion is ok"
+                    d := delta negated + 1.
+
+                    line size > d ifTrue:[
+                        (line copyTo:(d - 1)) withoutSeparators isEmpty ifTrue:[
+                            line := line copyFrom:d
+                        ]
+                    ].
+                    widthOfWidestLine := nil
+                ].
+                self replaceLine:lineNr with:line.
+                anyChange := true.
+            ]
+        ]
     ].
 
     anyChange ifTrue:[ self textChanged ].
@@ -5978,18 +6142,18 @@
 
     "/ [lnr ~~ 1] whileTrue:[
     (lnr ~~ 1) ifTrue:[
-	lnr  := lnr - 1.
-	line := self listAt:lnr.
-
-	line notNil ifTrue:[
-	    indent := line indexOfNonSeparatorStartingAt:1.
-	    indent ~~ 0 ifTrue:[
-		(line endsWith:$[) ifTrue:[
-		    ^ indent + 4 - 1
-		].
-		^ indent - 1
-	    ]
-	]
+        lnr  := lnr - 1.
+        line := self listAt:lnr.
+
+        line notNil ifTrue:[
+            indent := line indexOfNonSeparatorStartingAt:1.
+            indent ~~ 0 ifTrue:[
+                (line endsWith:$[) ifTrue:[
+                    ^ indent + 4 - 1
+                ].
+                ^ indent - 1
+            ]
+        ]
     ].
     ^ 0
 
@@ -6051,18 +6215,18 @@
     cursorBgColor isNil ifTrue:[cursorBgColor := fgColor].
     cursorType isNil ifTrue:[cursorType := DefaultCursorType].
     cursorTypeNoFocus isNil ifTrue:[
-	cursorTypeNoFocus := cursorType.
-	DefaultCursorTypeNoFocus notNil ifTrue:[
-	    cursorTypeNoFocus := DefaultCursorTypeNoFocus.
-	]
+        cursorTypeNoFocus := cursorType.
+        DefaultCursorTypeNoFocus notNil ifTrue:[
+            cursorTypeNoFocus := DefaultCursorTypeNoFocus.
+        ]
     ].
     cursorNoFocusFgColor := DefaultCursorNoFocusForegroundColor.
     cursorNoFocusFgColor isNil ifTrue:[
-	cursorType ~~ #block ifTrue:[
-	    cursorNoFocusFgColor := cursorBgColor
-	] ifFalse:[
-	    cursorNoFocusFgColor := cursorFgColor
-	]
+        cursorType ~~ #block ifTrue:[
+            cursorNoFocusFgColor := cursorBgColor
+        ] ifFalse:[
+            cursorNoFocusFgColor := cursorFgColor
+        ]
     ].
 
     "Modified: / 15.12.1999 / 22:27:45 / cg"
@@ -6111,9 +6275,9 @@
     |supportClass|
 
     completionSupport isNil ifTrue:[
-	(supportClass := self completionSupportClass) notNil ifTrue:[
-	    completionSupport := supportClass for:self.
-	].
+        (supportClass := self completionSupportClass) notNil ifTrue:[
+            completionSupport := supportClass for:self.            
+        ].
     ].
 
     "Created: / 26-09-2013 / 17:51:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -6121,7 +6285,7 @@
 
 release
     completionSupport notNil ifTrue:[
-	completionSupport release
+        completionSupport release
     ].
     super release
 ! !
@@ -6132,21 +6296,21 @@
     "replay the characters as learned previously"
 
     (self learnMode not and:[learnedMacro size > 0]) ifTrue:[
-	ExecutingMacroQuery
-	    answer:true
-	    do:[
-		learnedMacro do:[:event |
-			    WindowGroup lastEventQuerySignal answer:event
-			    do:[
-				self
-				    dispatchEvent:event
-				    withFocusOn:nil
-				    delegate:false
-			    ]
-		]
-	    ].
+        ExecutingMacroQuery 
+            answer:true
+            do:[
+                learnedMacro do:[:event |
+                            WindowGroup lastEventQuerySignal answer:event
+                            do:[
+                                self
+                                    dispatchEvent:event
+                                    withFocusOn:nil
+                                    delegate:false
+                            ]
+                ]
+            ].
     ] ifFalse:[
-	self flash:'no macro'.
+        self flash:'no macro'.
     ].
 !
 
@@ -6178,14 +6342,14 @@
     "a holder returning true, if in learn mode"
 
     learnMode isNil ifTrue:[
-	learnMode := ValueHolder with:false
+        learnMode := ValueHolder with:false
     ].
     ^ learnMode
 !
 
 rememberLearnedMacroAs: nameString
     Macros isNil ifTrue:[
-	Macros := Dictionary new.
+        Macros := Dictionary new.
     ].
     Macros at:nameString put:learnedMacro
 !
@@ -6207,19 +6371,19 @@
     original size == 0 ifTrue:[^ self].
 
     self withWaitCursorDo:[
-	(HostNameLookupError , SOAP::SoapImplError) handle:[:ex |
-	    Dialog warn:('Translation failed - WEB Service error:\\%1.' bindWith:ex description allBold) withCRs
-	] do:[
-	    translated := SOAP::BabelFishClient new translate:original mode:fromToModeString.
-	]
+        (HostNameLookupError , SOAP::SoapImplError) handle:[:ex |
+            Dialog warn:('Translation failed - WEB Service error:\\%1.' bindWith:ex description allBold) withCRs
+        ] do:[
+            translated := SOAP::BabelFishClient new translate:original mode:fromToModeString.
+        ]
     ].
 
     "/ v pasteOrReplace:translated
     self cursorLine:(self selectionEndLine) col:(self selectionEndCol + 1).
     self unselect.
-    self
-	undoablePaste:translated
-	info:'Translate'
+    self 
+        undoablePaste:translated 
+        info:'Translate'
 
     "Modified: / 28-07-2007 / 13:27:21 / cg"
 !
@@ -6231,24 +6395,24 @@
 
     t2 := self getClipboardText.
     t2 isEmptyOrNil ifTrue:[
-	Dialog information:'Clipboard is empty.'.
-	^ self.
+        Dialog information:'Clipboard is empty.'.
+        ^ self.
     ].
 
     self hasSelection ifTrue:[
-	t1 := self selectionAsString.
+        t1 := self selectionAsString.
     ] ifFalse:[
-	t1 := self contents asString
+        t1 := self contents asString
     ].
     t1 := t1 string.
 
     t1 = t2 ifTrue:[
-	Dialog information:'Strings are equal.'.
-	^ self.
+        Dialog information:'Strings are equal.'.
+        ^ self.
     ].
     DiffTextView
-	openOn:t1 label:'Editor'
-	and:t2 label:'Clipboard'
+        openOn:t1 label:'Editor'
+        and:t2 label:'Clipboard'
 !
 
 compareWithFile
@@ -6286,7 +6450,7 @@
      Redefined to move the (currently hidden cursor) to the selection's end"
 
     self hasSelection ifTrue:[
-	self setCursorLine:selectionEndLine col:selectionEndCol+1
+        self setCursorLine:selectionEndLine col:selectionEndCol+1
     ].
     super copySelection.
 
@@ -6303,7 +6467,7 @@
     "return a default value to show in the gotoLine box"
 
     cursorLine notNil ifTrue:[
-	^ cursorLine
+        ^ cursorLine
     ].
     ^ super defaultForGotoLine
 !
@@ -6314,49 +6478,49 @@
     |line col history sel |
 
     (self checkModificationsAllowed) ifFalse:[
-	self flashReadOnly.
-	^ self
+        self flashReadOnly.
+        ^ self
     ].
 
     sel := self selection.
     sel notNil ifTrue:[
-	self setLastStringToReplace: sel.
-
-	line := selectionStartLine.
-	col := selectionStartCol.
-
-	toClipboard ifTrue:[
-	    "
-	     remember in CopyBuffer
-	    "
-	    self setClipboardText:sel. "/ lastString.
-	].
-
-	"
-	 append to DeleteHistory (if there is one)
-	"
-	history := Smalltalk at:#DeleteHistory.
-	history notNil ifTrue:[
-	    history addAll:(sel asStringCollection).
-	    history size > 1000 ifTrue:[
-		history := history copyFrom:(history size - 1000)
-	    ].
-	].
-
-	"
-	 now, delete it
-	"
-	self
-	    undoableDo:[self deleteSelection]
-	    info:'Delete'.
-	lastReplacementInfo lastReplacement: nil
+        self setLastStringToReplace: sel.
+
+        line := selectionStartLine.
+        col := selectionStartCol.
+
+        toClipboard ifTrue:[
+            "
+             remember in CopyBuffer
+            "
+            self setClipboardText:sel. "/ lastString.
+        ].
+
+        "
+         append to DeleteHistory (if there is one)
+        "
+        history := Smalltalk at:#DeleteHistory.
+        history notNil ifTrue:[
+            history addAll:(sel asStringCollection).
+            history size > 1000 ifTrue:[
+                history := history copyFrom:(history size - 1000)
+            ].
+        ].
+
+        "
+         now, delete it
+        "
+        self 
+            undoableDo:[self deleteSelection] 
+            info:'Delete'.
+        lastReplacementInfo lastReplacement: nil
     ] ifFalse:[
-	"
-	 a cut without selection will search&cut again
-	"
-	self undoableDo:[
-	    self again
-	]
+        "
+         a cut without selection will search&cut again
+        "
+        self undoableDo:[
+            self again
+        ]
     ]
 
     "Modified: / 5.4.1998 / 16:51:53 / cg"
@@ -6365,10 +6529,10 @@
 editMenu
     "return the views middleButtonMenu"
 
-    <resource: #keyboard (#Again #AgainForAll #Copy #Cut #Paste #Accept
+    <resource: #keyboard (#Again #AgainForAll #Copy #Cut #Paste #Accept 
                           #Find #GotoLine #SaveAs #Print
-                          #PasteFromHistory #Join #Wrap #Undo #Redo
-                          #ToggleAutoIndent #ToggleInsertMode
+                          #PasteFromHistory #Join #Wrap #Undo #Redo 
+                          #ToggleAutoIndent #ToggleInsertMode 
                           #LearnKeyboardMacro #ExecuteKeyboardMacro )>
     <resource: #programMenu>
 
@@ -6431,7 +6595,7 @@
 "/                    ('Font...'                  changeFont              )
 "/"/                    ('Encoding...'      changeEncoding          )
 "/                ).
-"/    ].
+"/    ]. 
 
     translateItems := #(
                     ('English -> German'      (babelFishTranslate: 'en_de')   )
@@ -6555,7 +6719,7 @@
                        cut indent autoIndent: insertMode:
                        insertFile insertFileAsStringLiteral insertURL
                        babelFishTranslate googleSpellingSuggestion sort
-                       convertSelectionToLowercaseOrUppercaseOrUppercaseFirst
+                       convertSelectionToLowercaseOrUppercaseOrUppercaseFirst 
                        joinLines wrapLines insertUUID insertDateAndTime pasteAsStringLiteral
                        insertUnicode specialCharacters)
     ].
@@ -6563,7 +6727,7 @@
         m disable:#copySelection.
     ].
     self hasSelection ifFalse:[
-        m disableAll:#(cut googleSpellingSuggestion babelFishTranslate openFileBrowserOnIt
+        m disableAll:#(cut googleSpellingSuggestion babelFishTranslate openFileBrowserOnIt 
                        openWorkspaceWithIt sort indent splitLinesAtCharacterOrString inspectSelectedString).
     ] ifTrue:[
         (Error handle:[:ex |
@@ -6607,22 +6771,22 @@
 
     history := device getCopyBufferHistory copy.
     list := history collect:[:entry |
-		|text shown|
-
-		text := entry asString string asCollectionOfLines.
-		shown := text detect:[:line| line notEmptyOrNil] ifNone:['      '].
-		text size > 1 ifTrue:[
-		    shown := shown,(resources string:' ... [%1 lines]' with:text size).
-		].
-		shown
-	    ].
+                |text shown|
+
+                text := entry asString string asCollectionOfLines.
+                shown := text detect:[:line| line notEmptyOrNil] ifNone:['      '].
+                text size > 1 ifTrue:[
+                    shown := shown,(resources string:' ... [%1 lines]' with:text size).
+                ].
+                shown
+            ].
 
     box := ListSelectionBox
-		title:(resources string:'Clipboard History')
-		okText:(resources string:'Paste')
-		abortText:(resources string:'Cancel')
-		list:list
-		action:[:idx | idx notNil ifTrue:[sel := history at:idx]].
+                title:(resources string:'Clipboard History')
+                okText:(resources string:'Paste')
+                abortText:(resources string:'Cancel')
+                list:list
+                action:[:idx | idx notNil ifTrue:[sel := history at:idx]].
     box label:(resources string:'Select Previous Copybuffer String').
     box useIndex:true.
     box show.
@@ -6634,7 +6798,7 @@
 getTextSelectionOrTextSelectionFromHistory
 
     self sensor shiftDown ifTrue:[
-	^ self getTextSelectionFromHistory
+        ^ self getTextSelectionFromHistory
     ].
 
     "/ return either the (xterm-) selection or the clipBoard depending on
@@ -6659,26 +6823,26 @@
     |text suggestion|
 
     self withWaitCursorDo:[
-	text := self selection asString string withoutSeparators.
-	text size == 0 ifTrue:[^ self].
-
-	"/ the 'Smalltalk at:' code is here to
-	"/ avoid making the SOAP package a prerequisite for this package (libwidg)
-	(Smalltalk at:#'SOAP::SoapImplError') handle:[:ex |
-	    Dialog warn:('Spelling correction failed - WEB Service error:\\%1.' bindWith:ex description allBold) withCRs.
-	    ^ self.
-	] do:[
-	    suggestion := (Smalltalk at:#'SOAP::GoogleClient') new spellingSuggestionOf:text.
-	].
-	suggestion size == 0 ifTrue:[
-	    self information:('No spelling suggestion from Google for: ' , text).
-	    Transcript showCR:('No spelling suggestion from Google for: ' , text).
-	    ^ self.
-	].
-    ].
-    self
-	undoablePaste:suggestion
-	info:'Spelling Suggestion'.
+        text := self selection asString string withoutSeparators.
+        text size == 0 ifTrue:[^ self].
+
+        "/ the 'Smalltalk at:' code is here to
+        "/ avoid making the SOAP package a prerequisite for this package (libwidg)
+        (Smalltalk at:#'SOAP::SoapImplError') handle:[:ex |
+            Dialog warn:('Spelling correction failed - WEB Service error:\\%1.' bindWith:ex description allBold) withCRs.
+            ^ self.
+        ] do:[
+            suggestion := (Smalltalk at:#'SOAP::GoogleClient') new spellingSuggestionOf:text.
+        ].
+        suggestion size == 0 ifTrue:[
+            self information:('No spelling suggestion from Google for: ' , text).
+            Transcript showCR:('No spelling suggestion from Google for: ' , text).
+            ^ self.
+        ].
+    ].
+    self 
+        undoablePaste:suggestion 
+        info:'Spelling Suggestion'.
 
     "Modified: / 28-07-2007 / 13:25:10 / cg"
 !
@@ -6688,8 +6852,8 @@
 
     typeOfSelection := nil.
     self
-	undoableDo:[ self pasteOrReplace:(Timestamp now printStringRFC1123Format)]
-	info:'Paste Date and Time'
+        undoableDo:[ self pasteOrReplace:(Timestamp now printStringRFC1123Format)]
+        info:'Paste Date and Time'
 !
 
 insertFile
@@ -6717,41 +6881,41 @@
     and:[ (selFn := sel asFilename) exists
     and:[ selFn isRegularFile ]])
     ifTrue:[
-	initial := selFn pathName.
+        initial := selFn pathName.
     ].
 
     [
-	|why|
-
-	file := Dialog
-	    requestFileName:(resources string:'Insert Contents Of:')
-	    default:initial
-	    ok:(resources string:'Insert')
-	    abort:(resources string:'Cancel')
-	    pattern:nil
-	    fromDirectory:directoryForFileDialog.
-	file isNil ifTrue:[
-	    "cancel"
-	    ^ self.
-	].
-	file := file asFilename.
-	directoryForFileDialog := file.
-
-	ok := file isReadable and:[file isDirectory not].
-	ok ifFalse:[
-	    file isReadable ifFalse:[
-		why := '%1 is unreadable.\\Please try again.'
-	    ] ifTrue:[
-		why := '%1 is a directory.\\Please try again.'
-	    ].
-	    Dialog warn:(resources stringWithCRs:why with:file pathName).
-	].
+        |why|
+
+        file := Dialog
+            requestFileName:(resources string:'Insert Contents Of:')
+            default:initial
+            ok:(resources string:'Insert')
+            abort:(resources string:'Cancel')
+            pattern:nil
+            fromDirectory:directoryForFileDialog.
+        file isNil ifTrue:[
+            "cancel"
+            ^ self.
+        ].
+        file := file asFilename.
+        directoryForFileDialog := file.
+
+        ok := file isReadable and:[file isDirectory not].
+        ok ifFalse:[
+            file isReadable ifFalse:[
+                why := '%1 is unreadable.\\Please try again.'
+            ] ifTrue:[
+                why := '%1 is a directory.\\Please try again.'
+            ].
+            Dialog warn:(resources stringWithCRs:why with:file pathName).
+        ].
     ] doUntil:[ok].
 
     text := file contentsAsString.
     self
-	undoableDo:[ self paste:(asStringLiteral ifTrue:[text storeString] ifFalse:[text]) ]
-	info:'Paste File'
+        undoableDo:[ self paste:(asStringLiteral ifTrue:[text storeString] ifFalse:[text]) ]
+        info:'Paste File'
 
     "Modified: / 28-07-2007 / 13:23:32 / cg"
 !
@@ -6771,30 +6935,30 @@
 
     (sel := self selectionAsString) notEmptyOrNil
     ifTrue:[
-	initial := sel.
+        initial := sel.
     ].
 
     url := Dialog
-	request:(resources string:'Insert Contents of URL:')
-	initialAnswer:initial
-	okLabel:(resources string:'Insert')
-	title:(resources string:'URL').
+        request:(resources string:'Insert Contents of URL:')
+        initialAnswer:initial
+        okLabel:(resources string:'Insert')
+        title:(resources string:'URL').
     url isNil ifTrue:[
-	"cancel"
-	^ self.
+        "cancel"
+        ^ self.
     ].
     response := HTTPInterface get:url.
     response isErrorResponse ifTrue:[
-	Dialog warn:(resources string:'Could not fetch the document: %1' with:url).
-	^ self.
+        Dialog warn:(resources string:'Could not fetch the document: %1' with:url).
+        ^ self.
     ].
     text := response data asString.
 
     self
-	undoableDo:[
-	    self paste:(asStringLiteral ifTrue:[text storeString] ifFalse:[text])
-	]
-	info:'Insert Contents of URL'
+        undoableDo:[ 
+            self paste:(asStringLiteral ifTrue:[text storeString] ifFalse:[text]) 
+        ]
+        info:'Insert Contents of URL'
 !
 
 insertUUID
@@ -6802,8 +6966,8 @@
 
     typeOfSelection := nil.
     self
-	undoableDo:[ self pasteOrReplace:(UUID genUUID printString)]
-	info:'Paste New UUID'
+        undoableDo:[ self pasteOrReplace:(UUID genUUID printString)]
+        info:'Paste New UUID'
 
     "Created: / 28-07-2007 / 13:01:16 / cg"
 !
@@ -6815,14 +6979,14 @@
 
     unicodeString := Dialog request:'Enter unicode (U+01FF or decimal number):'.
     unicodeString size < 2 ifTrue:[
-	^ self.
+        ^ self.
     ].
     (unicodeString second = $+ and:['Uu' includes:unicodeString first]) ifTrue:[
-	unicodePoint := Integer readFrom:(unicodeString copyFrom:3) radix:16 onError:[^ self].
+        unicodePoint := Integer readFrom:(unicodeString copyFrom:3) radix:16 onError:[^ self].
     ] ifFalse:[
-	unicodePoint := Integer readFrom:unicodeString onError:[^ self].
-    ].
-
+        unicodePoint := Integer readFrom:unicodeString onError:[^ self].
+    ].
+        
     unicodeChar := Character value:unicodePoint.
     self keyPress:unicodeChar x:0 y:0.
     self keyRelease:unicodeChar x:0 y:0.
@@ -6841,21 +7005,21 @@
     |text suggestions best|
 
     self withWaitCursorDo:[
-	text := self selection asString string withoutSeparators.
-	text size == 0 ifTrue:[^ self].
-
-	suggestions := RBSpellChecker default bestMatchesFor:text.
-	suggestions size == 0 ifTrue:[
-	    self information:('No spelling suggestion from builtin checker for: ' , text).
-	    Transcript showCR:('No spelling suggestion from builtin checker for: ' , text).
-	    ^ self.
-	].
-	Transcript showCR:suggestions.
-	best := suggestions first.
-    ].
-    self
-	undoablePaste:best
-	info:'Spelling Suggestion'.
+        text := self selection asString string withoutSeparators.
+        text size == 0 ifTrue:[^ self].
+
+        suggestions := RBSpellChecker default bestMatchesFor:text.
+        suggestions size == 0 ifTrue:[
+            self information:('No spelling suggestion from builtin checker for: ' , text).
+            Transcript showCR:('No spelling suggestion from builtin checker for: ' , text).
+            ^ self.
+        ].
+        Transcript showCR:suggestions.
+        best := suggestions first.
+    ].
+    self 
+        undoablePaste:best 
+        info:'Spelling Suggestion'.
 !
 
 openFileBrowserOnFileNamed:fileNameString
@@ -6865,13 +7029,13 @@
 
     fn := fileNameString asFilename.
     fn exists ifFalse:[
-	fn := fileNameString withoutSeparators withoutQuotes asFilename.
-	fn exists ifFalse:[
-	    ^ self warn:(resources
-			    string:'Sorry - file "%1" was not found in directory "%2"'
-			    with:fn baseName allBold
-			    with:fn directory baseName allBold).
-	].
+        fn := fileNameString withoutSeparators withoutQuotes asFilename.
+        fn exists ifFalse:[
+            ^ self warn:(resources 
+                            string:'Sorry - file "%1" was not found in directory "%2"' 
+                            with:fn baseName allBold
+                            with:fn directory baseName allBold).
+        ].
     ].
     UserPreferences fileBrowserClass openOn:fn
 
@@ -6905,10 +7069,10 @@
      Then paste at cursor position."
 
     self checkModificationsAllowed ifTrue:[
-	self withSelfAndTextForPasteDo:[:me :text |
-	    me unselect.
-	    me undoablePaste:text
-	]
+        self withSelfAndTextForPasteDo:[:me :text |
+            me unselect.
+            me undoablePaste:text
+        ]
     ]
 !
 
@@ -6929,42 +7093,42 @@
     s := someText.
     codingErrorReported := false.
     CharacterEncoderError handle:[:ex |
-	|code msg|
-
-	code := ex parameter.
-	codingErrorReported ifFalse:[
-	    msg := 'Cannot represent pasted string in this Views encoding (',gc characterEncoding,').'.
-	    code notNil ifTrue:[
-		msg := msg , '\\Reason: No representation for ' , (code radixPrintStringRadix:16).
-	    ].
-	    Dialog warn:(resources stringWithCRs:msg).
-	    codingErrorReported := true.
-	].
-	ex proceedWith:ex defaultValue
+        |code msg|
+
+        code := ex parameter.
+        codingErrorReported ifFalse:[
+            msg := 'Cannot represent pasted string in this Views encoding (',gc characterEncoding,').'.
+            code notNil ifTrue:[
+                msg := msg , '\\Reason: No representation for ' , (code radixPrintStringRadix:16).
+            ].
+            Dialog warn:(resources stringWithCRs:msg).
+            codingErrorReported := true.
+        ].
+        ex proceedWith:ex defaultValue
     ] do:[
-	s isString ifTrue:[
-	    s encoding ~~ gc characterEncoding ifTrue:[
-		s := s encodeFrom:(s encoding) into:gc characterEncoding.
-	    ].
-
-	    s := s asStringCollection.
-	    (someText endsWith:Character cr) ifTrue:[
-		"/ s := s copyWith:nil.
-		s := s copyWith:'' "/ an empty line at the end
-
-	    ]
-	] ifFalse:[
-	    s isStringCollection ifTrue:[
-		s := s encodeFrom:(s encoding) into:gc characterEncoding.
-	    ] ifFalse:[
-		(self
-		    confirm:(resources
-			stringWithCRs:'Selection (%1) is not convertable to Text.\\Paste storeString ?'
-			with:s class name)) ifFalse:[^ self].
-		s := StringCollection with:s storeString .
-		"/ ^ self
-	    ].
-	].
+        s isString ifTrue:[
+            s encoding ~~ gc characterEncoding ifTrue:[
+                s := s encodeFrom:(s encoding) into:gc characterEncoding.
+            ].
+
+            s := s asStringCollection.
+            (someText endsWith:Character cr) ifTrue:[
+                "/ s := s copyWith:nil.
+                s := s copyWith:'' "/ an empty line at the end
+
+            ]
+        ] ifFalse:[
+            s isStringCollection ifTrue:[
+                s := s encodeFrom:(s encoding) into:gc characterEncoding.
+            ] ifFalse:[
+                (self
+                    confirm:(resources
+                        stringWithCRs:'Selection (%1) is not convertable to Text.\\Paste storeString ?'
+                        with:s class name)) ifFalse:[^ self].
+                s := StringCollection with:s storeString .
+                "/ ^ self
+            ].
+        ].
     ].
 
     (nLines := s size) == 0 ifTrue:[^ self].
@@ -6975,23 +7139,29 @@
     startLine := l1 := cursorLine.
     startCol := c1 := cursorCol.
 
-    "do not autoindent here.
-     It does make things very ugly, in the inspector
+    "do not autoindent here. 
+     It does make things very ugly, in the inspector 
      (try inspecting a multiline string)..."
     self withAutoIndent:false do:[
-	"do not expand tabs into spaces here -
-	 they get expanded in basicWithoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr.
-	 Some Subviews want to paste with unexpanded tabs!!"
-
-	self insertLines:s withCR:withCR.
+        "do not expand tabs into spaces here -
+         they get expanded in basicWithoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr.
+         Some Subviews want to paste with unexpanded tabs!!"
+
+        self insertLines:s withCR:withCR.
     ].
     l2 := cursorLine.
     c2 := (cursorCol - 1).
     self selectFromLine:l1 col:c1 toLine:l2 col:c2.
     typeOfSelection := #paste. "/ sigh - cleared by #selectFromLine:
+    "/ For Claus to support paste-cursordown-paste :-)
+    "/ Move cursor the the beggining of the selection so subsequent
+    "/ cursor move will start there.
+    self setCursorLine: l1.
+    self setCursorCol: c1.
 
     "Modified: / 14-02-1996 / 11:14:14 / stefan"
     "Modified: / 25-01-2012 / 00:31:30 / cg"
+    "Modified: / 30-08-2013 / 00:09:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 pasteAsStringLiteral
@@ -7001,8 +7171,8 @@
 
     typeOfSelection := nil.
     self
-	undoableDo:[ self pasteOrReplace:(self getClipboardText asString string storeString) ]
-	info:'Paste as String Literal'
+        undoableDo:[ self pasteOrReplace:(self getClipboardText asString string storeString) ]
+        info:'Paste as String Literal'
 !
 
 pasteOrReplace
@@ -7023,11 +7193,11 @@
     self checkModificationsAllowed ifFalse:[^ self].
 
     self undoableDo:[
-	((self hasSelection == true) and:[typeOfSelection ~~ #paste]) ifTrue:[
-	    self replace:someText
-	] ifFalse:[
-	    self paste:someText.
-	]
+        ((self hasSelection == true) and:[typeOfSelection ~~ #paste]) ifTrue:[
+            self replace:someText
+        ] ifFalse:[
+            self paste:someText.
+        ]
     ] info:'Paste/Replace'.
 
     "Modified: / 30.1.2000 / 02:33:00 / cg"
@@ -7040,12 +7210,12 @@
     |text|
 
     self checkModificationsAllowed ifFalse:[
-	self flashReadOnly.
-	^ self
+        self flashReadOnly.
+        ^ self
     ].
     text := self getClipboardText:#clipboard.
     text notNil ifTrue:[
-	self pasteOrReplace:text
+        self pasteOrReplace:text
     ]
 !
 
@@ -7056,12 +7226,12 @@
     |text|
 
     self checkModificationsAllowed ifFalse:[
-	self flashReadOnly.
-	^ self
+        self flashReadOnly.
+        ^ self
     ].
     text := self getTextSelectionFromHistory.
     text notNil ifTrue:[
-	self pasteOrReplace:text
+        self pasteOrReplace:text
     ]
 !
 
@@ -7072,8 +7242,8 @@
     self checkModificationsAllowed ifFalse:[^ self].
 
     self withSelfAndTextForPasteDo:[:me :text |
-	me undoableDo:[ me replace:text ]
-	info:'Replace'
+        me undoableDo:[ me replace:text ]
+        info:'Replace'
     ]
 !
 
@@ -7086,75 +7256,75 @@
     self checkModificationsAllowed ifFalse:[^ self].
 
     self undoableDo:[
-	selected := self selection.
-	selected isNil ifTrue:[
-	    ^ self paste:someText
-	].
-
-	self deleteSelection.
-
-	"take care, if we replace a selection without space by a word selected
-	 with one - in this case we usually do not want the space.
-	 But, if we replace a word-selected selection by something without a
-	 space, we DO want the space added."
-
-	selected size == 1 ifTrue:[
-	    selectedString := selected at:1.
-	].
-
-	someText size == 1 ifTrue:[
-	    |cutOffSpace addSpace replacement replacementString|
-
-	    cutOffSpace := false.
-	    addSpace := false.
-	    replacement := someText copyFrom:1.
-
-	    selectedString notNil ifTrue:[
-		((selectedString startsWith:' ') or:[selectedString endsWith:' ']) ifFalse:[
-		   "selection has no space"
-
-		    ((selectStyle == #wordleft) or:[selectStyle == #wordRight]) ifTrue:[
-			cutOffSpace := true
-		    ]
-		] ifTrue:[
-		    addSpace := true
-		]
-	    ].
-	    replacementString := replacement at:1.
-	    cutOffSpace ifTrue:[
-		(replacementString startsWith:' ') ifTrue:[
-		    replacementString := replacementString withoutSpaces
-		].
-	    ] ifFalse:[
-		selectStyle == #wordLeft ifTrue:[
-		    "want a space at left"
-		    (replacementString startsWith:' ') ifFalse:[
-			replacementString := replacementString withoutSpaces.
-			replacementString := ' ' , replacementString
-		    ]
-		].
-		selectStyle == #wordRight ifTrue:[
-		    "want a space at right"
-
-		    (replacementString endsWith:' ') ifFalse:[
-			replacementString := replacementString withoutSpaces.
-			replacementString := replacementString , ' '
-		    ]
-		].
-	    ].
-	    replacement at:1 put: replacementString.
-	    self paste:replacement.
-	] ifFalse:[
-	    self paste:someText
-	].
-	self setLastStringToReplace: selectedString.
-
-	lastReplacementInfo lastReplacement: someText.
-
-	selStartLine := selectionStartLine.
-	selStartCol := self selectionStartCol.
-	selEndLine := selectionEndLine.
-	selEndCol := self selectionEndCol.
+        selected := self selection.
+        selected isNil ifTrue:[
+            ^ self paste:someText
+        ].
+
+        self deleteSelection.
+
+        "take care, if we replace a selection without space by a word selected
+         with one - in this case we usually do not want the space.
+         But, if we replace a word-selected selection by something without a
+         space, we DO want the space added."
+
+        selected size == 1 ifTrue:[
+            selectedString := selected at:1.
+        ].
+
+        someText size == 1 ifTrue:[
+            |cutOffSpace addSpace replacement replacementString|
+
+            cutOffSpace := false.
+            addSpace := false.
+            replacement := someText copyFrom:1.
+
+            selectedString notNil ifTrue:[
+                ((selectedString startsWith:' ') or:[selectedString endsWith:' ']) ifFalse:[
+                   "selection has no space"
+
+                    ((selectStyle == #wordleft) or:[selectStyle == #wordRight]) ifTrue:[
+                        cutOffSpace := true
+                    ]
+                ] ifTrue:[
+                    addSpace := true
+                ]
+            ].
+            replacementString := replacement at:1.
+            cutOffSpace ifTrue:[
+                (replacementString startsWith:' ') ifTrue:[
+                    replacementString := replacementString withoutSpaces
+                ].
+            ] ifFalse:[
+                selectStyle == #wordLeft ifTrue:[
+                    "want a space at left"
+                    (replacementString startsWith:' ') ifFalse:[
+                        replacementString := replacementString withoutSpaces.
+                        replacementString := ' ' , replacementString
+                    ]
+                ].
+                selectStyle == #wordRight ifTrue:[
+                    "want a space at right"
+
+                    (replacementString endsWith:' ') ifFalse:[
+                        replacementString := replacementString withoutSpaces.
+                        replacementString := replacementString , ' '
+                    ]
+                ].
+            ].
+            replacement at:1 put: replacementString.
+            self paste:replacement.
+        ] ifFalse:[
+            self paste:someText
+        ].
+        self setLastStringToReplace: selectedString.
+
+        lastReplacementInfo lastReplacement: someText.
+
+        selStartLine := selectionStartLine.
+        selStartCol := self selectionStartCol.
+        selEndLine := selectionEndLine.
+        selEndCol := self selectionEndCol.
     ]
     info:'Replace'
 
@@ -7176,75 +7346,75 @@
     patternHolder := ValueHolder with:''.
     replacePatternHolder := ValueHolder with:''.
     lastSearchPattern notNil ifTrue:[
-	initialString := lastSearchPattern
+        initialString := lastSearchPattern
     ].
     self hasSelectionWithinSingleLine ifTrue:[
-	initialString := self selectionAsString
+        initialString := self selectionAsString
     ].
     initialString isNil ifTrue:[
-	LastSearchPatterns size > 0 ifTrue:[
-	    initialString := LastSearchPatterns first
-	]
+        LastSearchPatterns size > 0 ifTrue:[
+            initialString := LastSearchPatterns first
+        ]
     ].
     initialString notNil ifTrue:[
-	patternHolder value:initialString.
-	replacePatternHolder value:initialString.
+        patternHolder value:initialString.
+        replacePatternHolder value:initialString.
     ].
     flag := true.
     search := [:fwd |
-	    self
-		search:patternHolder value
-		ignoreCase:caseHolder value
-		forward:fwd.
-	].
+            self
+                search:patternHolder value
+                ignoreCase:caseHolder value
+                forward:fwd.
+        ].
     replace := [:all |
-	    self
-		replace:patternHolder value
-		by:replacePatternHolder value
-		all:all
-		ignoreCase:caseHolder value
-	].
+            self
+                replace:patternHolder value
+                by:replacePatternHolder value
+                all:all
+                ignoreCase:caseHolder value
+        ].
     bindings := IdentityDictionary new.
     bindings at:#searchPattern put:patternHolder.
     bindings at:#replacePattern put:replacePatternHolder.
     modal ifTrue:[
-	bindings at:#nextAction
-	    put:[
-		flag := true.
-		action := search.
-		searchBox doAccept.
-	    ].
-	bindings at:#prevAction
-	    put:[
-		flag := false.
-		action := search.
-		searchBox doAccept.
-	    ].
-	bindings at:#replaceAction
-	    put:[
-		flag := false.
-		action := replace.
-		searchBox doAccept.
-	    ].
-	bindings at:#replaceAllAction
-	    put:[
-		flag := true.
-		action := replace.
-		searchBox doAccept.
-	    ].
+        bindings at:#nextAction
+            put:[
+                flag := true.
+                action := search.
+                searchBox doAccept.
+            ].
+        bindings at:#prevAction
+            put:[
+                flag := false.
+                action := search.
+                searchBox doAccept.
+            ].
+        bindings at:#replaceAction
+            put:[
+                flag := false.
+                action := replace.
+                searchBox doAccept.
+            ].
+        bindings at:#replaceAllAction
+            put:[
+                flag := true.
+                action := replace.
+                searchBox doAccept.
+            ].
     ] ifFalse:[
-	bindings at:#nextAction put:[ search value:true. ].
-	bindings at:#prevAction put:[ search value:false. ].
-	bindings at:#replaceAction put:[ replace value:false. ].
-	bindings at:#replaceAllAction put:[ replace value:true. ].
+        bindings at:#nextAction put:[ search value:true. ].
+        bindings at:#prevAction put:[ search value:false. ].
+        bindings at:#replaceAction put:[ replace value:false. ].
+        bindings at:#replaceAllAction put:[ replace value:true. ].
     ].
     bindings at:#ignoreCase put:caseHolder.
     bindings at:#patternList put:LastSearchPatterns.
     modal ifTrue:[
-	searchBox := SimpleDialog new.
+        searchBox := SimpleDialog new.
     ] ifFalse:[
-	searchBox := ApplicationModel new.
-	searchBox createBuilder.
+        searchBox := ApplicationModel new.
+        searchBox createBuilder.
     ].
     searchBox resources:(self resources).
     bldr := searchBox builder.
@@ -7254,26 +7424,26 @@
     (bldr componentAt:#prevButton) cursor:(Cursor thumbsUp).
     (bldr componentAt:#cancelButton) cursor:(Cursor thumbsDown).
     modal ifTrue:[
-	searchBox openDialog.
-	searchBox accepted ifTrue:[
-	    action value:flag
-	].
+        searchBox openDialog.
+        searchBox accepted ifTrue:[
+            action value:flag
+        ].
     ] ifFalse:[
-	(bldr componentAt:#nextButton) isReturnButton:false.
-	(bldr componentAt:#cancelButton)
-	    label:(resources string:'Close');
-	    action:[ searchBox closeRequest ].
-
-	"/ searchBox masterApplication:self application.
-
-	self topView beMaster.
-	(searchBox window)
-	    beSlave;
-	    openInGroup:(self windowGroup).
-
-	"/ searchBox window open.
-
-	searchBox window assignKeyboardFocusToFirstKeyboardConsumer.
+        (bldr componentAt:#nextButton) isReturnButton:false.
+        (bldr componentAt:#cancelButton)
+            label:(resources string:'Close');
+            action:[ searchBox closeRequest ].
+
+        "/ searchBox masterApplication:self application.
+
+        self topView beMaster.
+        (searchBox window)
+            beSlave;
+            openInGroup:(self windowGroup).
+
+        "/ searchBox window open.
+
+        searchBox window assignKeyboardFocusToFirstKeyboardConsumer.
     ]
 
     "Modified: / 11-07-2006 / 11:20:06 / fm"
@@ -7292,14 +7462,14 @@
 sort:how ignoreCase:ignoreCase fromLine:start toLine:end
     "sort/reorder the selected lines.
      how:
-	#lines
-	#linesByFirstWord
-	#linesByNthWord
-	#linesByNthNumber
-	#linesByNthHexNumber
-	#words
-	#linesByLength
-	#reverse
+        #lines
+        #linesByFirstWord
+        #linesByNthWord
+        #linesByNthNumber
+        #linesByNthHexNumber
+        #words
+        #linesByLength
+        #reverse
     "
 
     |lines extractor innerExtractor fetcher operation lineWise nStr n s words|
@@ -7307,75 +7477,75 @@
     lineWise := true.
 
     how == #reverse ifTrue:[
-	operation := [:lines | lines reverse].
+        operation := [:lines | lines reverse].
     ] ifFalse:[
-	operation := [:linesOrWords |
-			linesOrWords sort:[:item1 :item2 | (fetcher value:item1) < (fetcher value:item2)]
-		     ].
-
-	how == #linesByLength ifTrue:[
-	    fetcher := [:l | l size].
-	] ifFalse:[
-	    how == #lines ifTrue:[
-		extractor := [:l | l withoutLeadingSeparators].
-	    ] ifFalse:[
-		how == #linesByFirstWord ifTrue:[
-		    extractor := [:l | ((l asCollectionOfWords select:[:w | w isEmpty or:[w first isLetterOrDigit]]) at:1 ifAbsent:'')].
-		] ifFalse:[
-		    ((how == #linesByNthWord) or:[ how == #linesByNthNumber  or:[ how == #linesByNthHexNumber]]) ifTrue:[
-			nStr := Dialog request:'Word/Column (1..)' initialAnswer:(LastColumnNumberForSort ? 2).
-			nStr isEmptyOrNil ifTrue:[^ self].
-			n := Integer readFrom:nStr onError:[^ self].
-			LastColumnNumberForSort := n.
-			extractor := [:l | ((l string asCollectionOfWords) at:n ifAbsent:'')].
-			how == #linesByNthNumber ifTrue:[
-			    innerExtractor := extractor.
-			    extractor := [:l | Integer readFrom:(innerExtractor value:l) onError:0]
-			] ifFalse:[
-			    how == #linesByNthHexNumber ifTrue:[
-				innerExtractor := extractor.
-				extractor := [:l |
-				    |s|
-				    s := innerExtractor value:l.
-				    (s startsWith:'16r') ifTrue:[
-					(Integer readSmalltalkSyntaxFrom:s) ? 0
-				    ] ifFalse:[
-					Integer readFrom:s radix:16 onError:[ 0 ]
-				    ]
-				]
-			    ]
-			].
-		    ] ifFalse:[
-			how == #words ifTrue:[
-			    lineWise := false.
-			    extractor := [:w | w].
-			] ifFalse:[
-			    self error:'unknown sort criteria: ', how printString.
-			]
-		    ]
-		]
-	    ].
-	    ignoreCase ifTrue:[
-		fetcher := [:l | (extractor value:l) asLowercase].
-	    ] ifFalse:[
-		fetcher := extractor.
-	    ].
-	].
+        operation := [:linesOrWords |
+                        linesOrWords sort:[:item1 :item2 | (fetcher value:item1) < (fetcher value:item2)]
+                     ].
+
+        how == #linesByLength ifTrue:[
+            fetcher := [:l | l size].
+        ] ifFalse:[
+            how == #lines ifTrue:[
+                extractor := [:l | l withoutLeadingSeparators].
+            ] ifFalse:[ 
+                how == #linesByFirstWord ifTrue:[
+                    extractor := [:l | ((l asCollectionOfWords select:[:w | w isEmpty or:[w first isLetterOrDigit]]) at:1 ifAbsent:'')].
+                ] ifFalse:[ 
+                    ((how == #linesByNthWord) or:[ how == #linesByNthNumber  or:[ how == #linesByNthHexNumber]]) ifTrue:[
+                        nStr := Dialog request:'Word/Column (1..)' initialAnswer:(LastColumnNumberForSort ? 2).
+                        nStr isEmptyOrNil ifTrue:[^ self].
+                        n := Integer readFrom:nStr onError:[^ self].
+                        LastColumnNumberForSort := n.
+                        extractor := [:l | ((l string asCollectionOfWords) at:n ifAbsent:'')].
+                        how == #linesByNthNumber ifTrue:[
+                            innerExtractor := extractor.
+                            extractor := [:l | Integer readFrom:(innerExtractor value:l) onError:0]
+                        ] ifFalse:[
+                            how == #linesByNthHexNumber ifTrue:[
+                                innerExtractor := extractor.
+                                extractor := [:l | 
+                                    |s|                                 
+                                    s := innerExtractor value:l.
+                                    (s startsWith:'16r') ifTrue:[
+                                        (Integer readSmalltalkSyntaxFrom:s) ? 0
+                                    ] ifFalse:[
+                                        Integer readFrom:s radix:16 onError:[ 0 ]
+                                    ]
+                                ]
+                            ]
+                        ].
+                    ] ifFalse:[ 
+                        how == #words ifTrue:[
+                            lineWise := false.
+                            extractor := [:w | w].
+                        ] ifFalse:[
+                            self error:'unknown sort criteria: ', how printString.
+                        ]
+                    ]
+                ]
+            ].
+            ignoreCase ifTrue:[
+                fetcher := [:l | (extractor value:l) asLowercase].
+            ] ifFalse:[
+                fetcher := extractor.
+            ].
+        ].
     ].
 
     lineWise ifTrue:[
-	"process the lines of the selection (aka a collection of lines)"
-	start == end ifTrue:[^ self ].
-	lines := (start to:end) collect:[:lineNr | (self listAt:lineNr) ? ''].
-	lines := operation value:lines.
-	(start to:end) with:lines do:[:lineNr :line | self replaceLine:lineNr with:line].
+        "process the lines of the selection (aka a collection of lines)"
+        start == end ifTrue:[^ self ].
+        lines := (start to:end) collect:[:lineNr | (self listAt:lineNr) ? ''].
+        lines := operation value:lines.
+        (start to:end) with:lines do:[:lineNr :line | self replaceLine:lineNr with:line].
     ] ifFalse:[
-	"process the whole selection as a string"
-	s := self selectionAsString.
-	words := s asCollectionOfWords.
-	words := operation value:words.
-	s := words asStringCollection asStringWith:Character space.
-	self replace:s.
+        "process the whole selection as a string"
+        s := self selectionAsString.
+        words := s asCollectionOfWords.
+        words := operation value:words.
+        s := words asStringCollection asStringWith:Character space.
+        self replace:s.
     ].
     self textChanged.
 
@@ -7392,23 +7562,23 @@
     start := selectionStartLine.
     end := selectionEndLine.
     (selectionEndCol == 0) ifTrue:[
-	end := end - 1
+        end := end - 1
     ].
 
     self
-	undoableDo:[
-	    self sort:how ignoreCase:ignoreCase fromLine:start toLine:end
-	]
-	info:'Sort'
+        undoableDo:[ 
+            self sort:how ignoreCase:ignoreCase fromLine:start toLine:end 
+        ]
+        info:'Sort'
 
     "Modified (format): / 15-02-2012 / 16:52:53 / cg"
 !
 
 specialCharacters
     CharacterSetView
-	openAsInputFor:self
-	label:'Special Character Input'
-	clickLabel:'Click to Insert Character'.
+        openAsInputFor:self
+        label:'Special Character Input'
+        clickLabel:'Click to Insert Character'.
 !
 
 splitLinesAtCharacterOrString
@@ -7425,14 +7595,14 @@
     in := sel readStream.
     out := CharacterWriteStream on:(String new).
     [in atEnd] whileFalse:[
-	record := in throughAll:separator.
-	out nextPutLine:record.
+        record := in throughAll:separator.
+        out nextPutLine:record.
     ].
     self
-	undoableDo:[
-	    self replaceSelectionBy:(out contents).
-	]
-	info:'Split Selection'
+        undoableDo:[ 
+            self replaceSelectionBy:(out contents).
+        ]
+        info:'Split Selection'
 !
 
 undoablePaste:someText
@@ -7443,31 +7613,31 @@
 
 undoablePaste:someText info:infoOrNil
     self
-	undoableDo:[
-	    self paste:someText.
-	]
-	info:infoOrNil
+        undoableDo:[
+            self paste:someText.
+        ]
+        info:infoOrNil
 
     "Created: / 28-07-2007 / 13:25:30 / cg"
 !
 
 undoablePasteOrReplace:someText info:infoOrNil
     self
-	undoableDo:[
-	    self pasteOrReplace:someText.
-	]
-	info:infoOrNil
+        undoableDo:[
+            self pasteOrReplace:someText.
+        ]
+        info:infoOrNil
 
     "Created: / 28-07-2007 / 13:26:16 / cg"
 !
 
 undoablePasteReplacingAll:someText info:infoOrNil
     self
-	undoableDo:[
-	    self selectAll.
-	    self pasteOrReplace:someText.
-	]
-	info:infoOrNil
+        undoableDo:[
+            self selectAll.
+            self pasteOrReplace:someText.
+        ]
+        info:infoOrNil
 
     "Created: / 28-07-2007 / 13:25:30 / cg"
 !
@@ -7478,13 +7648,13 @@
     |sel|
 
     self checkModificationsAllowed ifFalse:[
-	self flashReadOnly.
-	^ self
+        self flashReadOnly.
+        ^ self
     ].
 
     sel := self getTextSelectionOrTextSelectionFromHistory.
     sel notNil ifTrue:[
-	aBlock value:self value:sel.
+        aBlock value:self value:sel.
     ]
 ! !
 
@@ -7493,8 +7663,8 @@
 beep
     "output an audible beep or bell on my screen device"
 
-    UserPreferences current beepInEditor ifTrue:[
-	super beep
+    UserPreferences current beepInEditor ifTrue:[                
+        super beep
     ]
 !
 
@@ -7505,13 +7675,13 @@
      and may show a warnBox or whatever."
 
     self isReadOnly ifTrue: [
-	exceptionBlock isNil ifTrue:[
-	    ^ false
-	].
-
-	(exceptionBlock value:'Text may not be modified') ~~ true ifTrue:[
-	    ^ false
-	]
+        exceptionBlock isNil ifTrue:[
+            ^ false
+        ].
+
+        (exceptionBlock value:'Text may not be modified') ~~ true ifTrue:[
+            ^ false
+        ]
     ].
     ^ true
 
@@ -7520,9 +7690,9 @@
 
 currentSelectionBgColor
     typeOfSelection == #paste ifTrue:[
-	^ DefaultAlternativeSelectionBackgroundColor ? selectionBgColor
-    ].
-    "/ hasKeyboardFocus ifFalse:[^ Color lightGrey].
+        ^ DefaultAlternativeSelectionBackgroundColor ? selectionBgColor
+    ].
+    "/ hasKeyboardFocus ifFalse:[^ Color lightGrey]. 
     ^ super currentSelectionBgColor
 
     "
@@ -7532,7 +7702,7 @@
 
 currentSelectionFgColor
     typeOfSelection == #paste ifTrue:[
-	^ DefaultAlternativeSelectionForegroundColor ? selectionFgColor
+        ^ DefaultAlternativeSelectionForegroundColor ? selectionFgColor
     ].
     ^ super currentSelectionFgColor
 !
@@ -7561,9 +7731,9 @@
     lastStringFromReplaceForNextSearch := aString.
 
     "If the replace came after a search, the next replace will have the ignored case from that search action"
-    lastReplaceIgnoredCase := (typeOfSelection == #search)
-				ifTrue: [lastSearchIgnoredCase]
-				ifFalse: [nil].
+    lastReplaceIgnoredCase := (typeOfSelection == #search) 
+                                ifTrue: [lastSearchIgnoredCase] 
+                                ifFalse: [nil].
     lastReplacementInfo lastReplaceIgnoredCase: lastReplaceIgnoredCase.
 !
 
@@ -7586,7 +7756,7 @@
      contentsChanged, which is triggered when the size has changed, and
      is used to notify scrollers, other views etc.).
 
-     As some authors of this code have been very sloppy in tha past
+     As some authors of this code have been very sloppy in tha past 
      (not sending contentsChanged, but textChanged),
      we do it here despite what is written above, to ensure that scrollers update correctly."
 
@@ -7687,8 +7857,8 @@
 
     w := super widthOfContents.
     (dev := device ) isNil ifTrue:[
-	"/ really don't know ...
-	dev := Screen current
+        "/ really don't know ...
+        dev := Screen current
     ].
     ^ w + (gc font widthOn:dev)
 
@@ -7716,11 +7886,11 @@
     "redraw the cursor, if it sits in a line range"
 
     cursorShown ifTrue:[
-	cursorVisibleLine notNil ifTrue:[
-	    (cursorVisibleLine between:startVisLine and:endVisLine) ifTrue:[
-		self drawCursorCharacter
-	    ]
-	]
+        cursorVisibleLine notNil ifTrue:[
+            (cursorVisibleLine between:startVisLine and:endVisLine) ifTrue:[
+                self drawCursorCharacter
+            ]
+        ]
     ]
 !
 
@@ -7728,9 +7898,9 @@
     "redraw the cursor, if it sits in visible line"
 
     cursorShown ifTrue:[
-	(visLine == cursorVisibleLine) ifTrue:[
-	    self drawCursorCharacter
-	]
+        (visLine == cursorVisibleLine) ifTrue:[
+            self drawCursorCharacter
+        ]
     ]
 !
 
@@ -7753,12 +7923,12 @@
 
     super redrawVisibleLine:visLine col:colNr.
     cursorShown ifTrue:[
-	(visLine == cursorVisibleLine) ifTrue:[
-	    (colNr == cursorCol) ifTrue:[
-		self drawCursorCharacter.
-		^ self
-	    ]
-	]
+        (visLine == cursorVisibleLine) ifTrue:[
+            (colNr == cursorCol) ifTrue:[
+                self drawCursorCharacter.
+                ^ self
+            ]
+        ]
     ].
 
     "Modified: / 05-11-2007 / 17:35:53 / cg"
@@ -7769,7 +7939,7 @@
 
     super redrawVisibleLine:visLine from:startCol.
     cursorShown ifTrue:[
-	self redrawCursorIfInVisibleLine:visLine
+        self redrawCursorIfInVisibleLine:visLine
     ]
 !
 
@@ -7823,7 +7993,7 @@
     "
     self updateCursorVisibleLine.
     prevCursorState ifTrue:[
-	self showCursor
+        self showCursor
     ]
 
     "Modified: / 17.6.1998 / 16:13:24 / cg"
@@ -7835,7 +8005,7 @@
     prevCursorState := cursorShown.
     "/ cursorShown := false.
     cursorShown ifTrue:[
-	self hideCursor
+        self hideCursor
     ]
 
     "Modified: / 6.7.1998 / 13:07:23 / cg"
@@ -7884,17 +8054,17 @@
     cursorLine isNil ifTrue:[^ self].
 
     self
-	searchBackwardFor:pattern
-	ignoreCase:ign
-	startingAtLine:startLine col:startCol
-	ifFound:[:line :col :endColOrNil |
-	    self cursorMovementAllowed ifTrue:[
-		self cursorLine:line col:col.
-	    ].
-	    self showMatch:pattern isMatch:false atLine:line col:col endCol:endColOrNil.
+        searchBackwardFor:pattern
+        ignoreCase:ign
+        startingAtLine:startLine col:startCol
+        ifFound:[:line :col :endColOrNil |
+            self cursorMovementAllowed ifTrue:[
+                self cursorLine:line col:col.
+            ].
+            self showMatch:pattern isMatch:false atLine:line col:col endCol:endColOrNil.
 "/            self makeLineVisible:cursorLine
-	    typeOfSelection := #search]
-	ifAbsent:aBlock
+            typeOfSelection := #search]
+        ifAbsent:aBlock
 
     "Modified: 9.10.1997 / 13:02:13 / cg"
 !
@@ -7914,10 +8084,10 @@
     self cursorMovementAllowed ifFalse:[^ self].
 
     self
-	searchForMatchingParenthesisFromLine:cursorLine col:cursorCol
-	ifFound:[:line :col | self cursorLine:line col:col]
-	ifNotFound:[self showNotFound]
-	onError:[self beep]
+        searchForMatchingParenthesisFromLine:cursorLine col:cursorCol
+        ifFound:[:line :col | self cursorLine:line col:col]
+        ifNotFound:[self showNotFound]
+        onError:[self beep]
 
     "Modified: 9.10.1997 / 12:56:30 / cg"
 !
@@ -7926,20 +8096,20 @@
     "do a forward search"
 
     cursorLine isNil ifTrue:[^ self].
-    self
-	searchForwardFor:pattern
-	ignoreCase:ign
-	match: match
-	startingAtLine:startLine col:startCol
-	ifFound:[:line :col :endColOrNil|
-	    self cursorMovementAllowed ifTrue:[
-		self cursorLine:line col:col.
-	    ].
-	    self showMatch:pattern isMatch:match atLine:line col:col endCol:endColOrNil.
+    self 
+        searchForwardFor:pattern 
+        ignoreCase:ign
+        match: match
+        startingAtLine:startLine col:startCol
+        ifFound:[:line :col :endColOrNil|
+            self cursorMovementAllowed ifTrue:[
+                self cursorLine:line col:col.
+            ].
+            self showMatch:pattern isMatch:match atLine:line col:col endCol:endColOrNil.
 "/            self makeLineVisible:cursorLine
-	    typeOfSelection := #search
-	]
-	ifAbsent:aBlock
+            typeOfSelection := #search
+        ]
+        ifAbsent:aBlock
 
     "Modified: 9.10.1997 / 12:57:47 / cg"
     "Created: 9.10.1997 / 13:01:12 / cg"
@@ -7964,9 +8134,9 @@
     |searchPattern|
 
     searchPattern := self searchPatternFromUserSelectionOrReplace.
-    searchPattern isNil
-	ifTrue: [searchPattern := lastSearchPattern]
-	ifFalse: [lastSearchPattern := searchPattern].
+    searchPattern isNil 
+        ifTrue: [searchPattern := lastSearchPattern]
+        ifFalse: [lastSearchPattern := searchPattern].
     ^ searchPattern
 !
 
@@ -8000,13 +8170,13 @@
     "/
     sel := self selection.
     sel notNil ifTrue:[
-	(lastSearchPattern isNil
-	or:[typeOfSelection ~~ #paste and:[typeOfSelection ~~ #search]]
-	) ifTrue:[
-	    self cursorLine:selectionStartLine col:selectionStartCol.
-	    lastSearchPattern := sel asStringWithoutFinalCR.
-	    match ifTrue:[lastSearchPattern := lastSearchPattern withMatchEscapes].
-	]
+        (lastSearchPattern isNil
+        or:[typeOfSelection ~~ #paste and:[typeOfSelection ~~ #search]]
+        ) ifTrue:[
+            self cursorLine:selectionStartLine col:selectionStartCol.
+            lastSearchPattern := sel asStringWithoutFinalCR.
+            match ifTrue:[lastSearchPattern := lastSearchPattern withMatchEscapes].
+        ]
     ]
 
     "Modified: / 07-05-2011 / 17:25:59 / cg"
@@ -8025,16 +8195,16 @@
     |startLine startCol|
 
     selectionStartLine notNil ifTrue:[
-	startLine := selectionStartLine.
-	startCol := selectionStartCol
+        startLine := selectionStartLine.
+        startCol := selectionStartCol
     ] ifFalse:[
-	cursorLine isNil ifTrue:[
-	    startLine := list size.
-	    startCol := self listAt:startLine size.
-	] ifFalse:[
-	    startLine := cursorLine min:list size.
-	    startCol := cursorCol
-	]
+        cursorLine isNil ifTrue:[
+            startLine := list size.
+            startCol := self listAt:startLine size.
+        ] ifFalse:[
+            startLine := cursorLine min:list size.
+            startCol := cursorCol
+        ]
     ].
 
     ^ startCol @ cursorLine
@@ -8051,12 +8221,12 @@
     "/ assume its the first search and do not skip the very first match
     startCol := cursorCol.
     self hasSelection ifTrue:[
-	^ selectionEndCol @ selectionEndLine.
+        ^ selectionEndCol @ selectionEndLine.
     ] ifFalse:[
-	(cursorLine == 1 and:[cursorCol == 1]) ifTrue:[
-	    startCol := 0
-	].
-	startCol := startCol min:(self at:cursorLine) size
+        (cursorLine == 1 and:[cursorCol == 1]) ifTrue:[
+            startCol := 0
+        ].
+        startCol := startCol min:(self at:cursorLine) size
     ].
 
     ^ startCol @ cursorLine
@@ -8066,39 +8236,96 @@
 
 !EditTextView methodsFor:'selections'!
 
-addToSelectionAfter:aBlock
-    <resource: #obsolete>
-
-    "evaluate aBlock while unselected.
-     Restore the previous selection afterwards.
-     CG: I am not sure, if this is a leftover and is still used at all.
-	 It is therefore temporarily marked as obsolete. Please check
-	 and let me know."
-
-    |startLine startCol endLine endCol |
+addToSelectionAfter:aBlock 
+    "Extends the selection accroding to cursor position
+     after evaluation of `aBlock`. Used to implement
+     Shift-Up/Down/Left/Right, Shift-Home & Shift-End."
+
+    "/ Following comment is in czech and thus now very useful.
+    "/ However I (JV) kept it here as this is one of the very
+    "/ first fix/hack we made to Smalltalk/X ages ago, if not
+    "/ the very first one. Actually, this method and comment was 
+    "/ written by Martin Dvorak. Yeah, being bit nostalgic...
+
+    "Pokud existuje selekce, upravi ji
+     podle aktualni pozice kurzoru a pozice
+     po provedeni blocku.
+     Urceno k implementaci Shift-Home a Shift-End
+     Nejak nevim, jak to presneji popsat :-)"
+
+    | startLine startCol endLine endCol curLine curCol cursorAtTheBeginning cursorAtTheEnd cursorWasShown flip extModeStandard |
+
+    curLine := cursorLine.
+    curCol := cursorCol.
 
     self hasSelection ifTrue: [
-	startLine := selectionStartLine .
-	startCol := selectionStartCol .
-	endLine := selectionEndLine .
-	endCol := selectionEndCol .
-    ] ifFalse: [
-	startLine := endLine :=  cursorLine .
-	startCol := endCol := cursorCol .
-    ].
-
-    "deselectim a provedu presun kurzoru..."
-    self unselect .
-    aBlock value .
-
-    "funguje dost mizerne, jen na jednom radku..."
-    (startCol - cursorCol) abs <= (endCol - cursorCol) abs
-	ifTrue: [
-	    startCol := cursorCol.
-	] ifFalse: [
-	    endCol := cursorCol - 1.
-	].
+        startLine := selectionStartLine.
+        startCol := selectionStartCol.
+        endLine := selectionEndLine.
+        endCol := selectionEndCol.
+    ] ifFalse:[
+        startLine := endLine := curLine.
+        startCol := curCol.
+        endCol := curCol - 1.
+    ].
+
+    cursorAtTheBeginning := (startLine == curLine) and:[startCol == curCol].
+    cursorAtTheEnd := (endLine == curLine) and:[endCol == (curCol - 1)]. 
+    self assert: cursorAtTheBeginning | cursorAtTheEnd.
+
+
+    cursorWasShown := self hideCursor.
+    aBlock value.
+
+    cursorAtTheBeginning ifTrue:[
+        (cursorCol == (endCol + 1) and:[cursorLine == endLine]) ifTrue:[
+                self unselect; showCursor.
+                ^self
+        ].
+
+        flip := cursorLine == endLine and:[cursorCol > endCol].
+        flip ifTrue:[ 
+            extModeStandard := UserPreferences current selectionExtensionMode == #standard.
+        ].
+        (cursorLine > endLine or:[flip]) ifTrue:[
+            (flip and:[ extModeStandard ]) ifTrue:[
+                startLine := endLine.
+                startCol := endCol + 1.
+            ].
+            endLine := cursorLine.
+            endCol := cursorCol - 1
+        ] ifFalse:[
+            startLine := cursorLine.
+            startCol := cursorCol.
+        ]
+    ] ifFalse:[
+        cursorAtTheEnd ifTrue:[
+            (cursorCol == startCol and:[cursorLine == startLine]) ifTrue:[
+                self unselect; showCursor.
+                ^self
+            ].
+            flip := cursorLine == startLine and:[cursorCol < startCol].
+            flip ifTrue:[ 
+                extModeStandard := UserPreferences current selectionExtensionMode == #standard.
+            ].  
+            (cursorLine < startLine or:[flip]) ifTrue:[
+                (flip and:[ extModeStandard ]) ifTrue:[
+                    endLine := startLine.
+                    endCol := startCol - 1.
+                ].
+                startLine := cursorLine.
+                startCol := cursorCol
+            ] ifFalse:[
+                endLine := cursorLine.
+                endCol := cursorCol - 1.
+            ]
+        ].
+    ].
     self selectFromLine:startLine col:startCol toLine: endLine col:endCol .
+    cursorWasShown ifTrue:[self showCursor].
+
+    "Modified: / 27-03-2014 / 10:05:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 25-03-2014 / 17:18:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 autoMoveCursorToEndOfSelection
@@ -8112,12 +8339,12 @@
 
 changeTypeOfSelectionTo:newType
     typeOfSelection ~~ newType ifTrue:[
-	typeOfSelection := newType.
-	selectionStartLine notNil ifTrue:[
-	    self
-		redrawFromLine:selectionStartLine col:selectionStartCol
-		toLine:selectionEndLine col:selectionEndCol
-	].
+        typeOfSelection := newType.
+        selectionStartLine notNil ifTrue:[
+            self
+                redrawFromLine:selectionStartLine col:selectionStartCol
+                toLine:selectionEndLine col:selectionEndCol
+        ].
     ].
 !
 
@@ -8125,8 +8352,8 @@
     |selStartCol selStartLine selEndCol selEndLine|
 
     selectionStartCol isNil ifTrue:[
-	self selectWordUnderCursor.
-	^ self
+        self selectWordUnderCursor.
+        ^ self
     ].
 
     selStartCol := selectionStartCol.
@@ -8150,12 +8377,12 @@
     "/
     (lastStringFromReplaceForNextSearch notNil
      and:[typeOfSelection ~~ #search]) ifTrue:[
-	lastStringFromReplaceForNextSearch isString ifTrue:[
-	    searchPattern := lastStringFromReplaceForNextSearch.
-	] ifFalse:[
-	    searchPattern := lastStringFromReplaceForNextSearch asStringWithoutFinalCR.
-	].
-	^ searchPattern
+        lastStringFromReplaceForNextSearch isString ifTrue:[
+            searchPattern := lastStringFromReplaceForNextSearch.
+        ] ifFalse:[
+            searchPattern := lastStringFromReplaceForNextSearch asStringWithoutFinalCR.
+        ].
+        ^ searchPattern
     ].
 
     "/
@@ -8167,12 +8394,12 @@
     "/
     sel := self selection.
     sel notNil ifTrue:[
-	typeOfSelection ~~ #search ifTrue:[
-	    typeOfSelection ~~ #paste ifTrue:[
-		self cursorLine:selectionStartLine col:selectionStartCol.
-		searchPattern := sel asStringWithoutFinalCR.
-	    ]
-	].
+        typeOfSelection ~~ #search ifTrue:[
+            typeOfSelection ~~ #paste ifTrue:[
+                self cursorLine:selectionStartLine col:selectionStartCol.
+                searchPattern := sel asStringWithoutFinalCR.
+            ]
+        ].
     ].
 
     ^ searchPattern
@@ -8184,10 +8411,10 @@
      cursor to be moved in this case."
 
     list isNil ifTrue:[
-	self unselect
+        self unselect
     ] ifFalse:[
-	super selectFromLine:1 col:1 toLine:(list size + 1) col:0.
-	typeOfSelection := nil
+        super selectFromLine:1 col:1 toLine:(list size + 1) col:0.
+        typeOfSelection := nil
     ]
 
     "Modified: 28.2.1997 / 19:14:54 / cg"
@@ -8212,8 +8439,8 @@
     "select cursorline up to cursor position"
 
     cursorCol > 1 ifTrue:[
-	self selectFromLine:cursorLine col:1
-		     toLine:cursorLine col:(cursorCol-1)
+        self selectFromLine:cursorLine col:1
+                     toLine:cursorLine col:(cursorCol-1)
     ]
 
     "Modified: 16.8.1996 / 19:14:14 / cg"
@@ -8223,11 +8450,11 @@
     "expand selection by one line or select cursorline"
 
     selectionStartLine isNil ifTrue:[
-	self selectCursorLine
+        self selectCursorLine
     ] ifFalse:[
-	self selectFromLine:selectionStartLine col:selectionStartCol
-		     toLine:cursorLine+1 col:0.
-	self makeLineVisible:selectionEndLine
+        self selectFromLine:selectionStartLine col:selectionStartCol
+                     toLine:cursorLine+1 col:0.
+        self makeLineVisible:selectionEndLine
     ]
 !
 
@@ -8237,15 +8464,15 @@
     | newCursorCol ln |
 
     list isNil ifTrue:[
-	self unselect
+        self unselect
     ] ifFalse:[
-	cursorCol > 1 ifTrue:[
-	    ln := list at: cursorLine.
-	    newCursorCol := ln notEmptyOrNil ifTrue:[ln indexOfNonSeparator] ifFalse:[1].
-	    self selectFromLine:cursorLine col:newCursorCol toLine:cursorLine col:cursorCol-1.
-	    cursorCol := newCursorCol.
-	    typeOfSelection := nil
-	]
+        cursorCol > 1 ifTrue:[
+            ln := list at: cursorLine.
+            newCursorCol := ln notEmptyOrNil ifTrue:[ln indexOfNonSeparator] ifFalse:[1].
+            self selectFromLine:cursorLine col:newCursorCol toLine:cursorLine col:cursorCol-1.
+            cursorCol := newCursorCol.
+            typeOfSelection := nil
+        ]
     ]
 
     "Created: / 28-06-2011 / 22:47:04 / cg"
@@ -8258,27 +8485,31 @@
     |col|
 
     list isNil ifTrue:[
-	self unselect
+        self unselect
     ] ifFalse:[
-	cursorCol == 0 ifTrue:[
-	    col := 0
-	] ifFalse:[
-	    col := cursorCol - 1
-	].
-	super selectFromLine:1 col:1 toLine:cursorLine col:col.
-	typeOfSelection := nil
+        cursorCol == 0 ifTrue:[
+            col := 0
+        ] ifFalse:[
+            col := cursorCol - 1
+        ].
+        super selectFromLine:1 col:1 toLine:cursorLine col:col.
+        typeOfSelection := nil
     ]
 !
 
 selectFromLine:startLine col:startCol toLine:endLine col:endCol
-    "when a range is selected, position the cursor behind the selection
-     for easier editing. Also typeOfSelection is nilled here."
 
     super selectFromLine:startLine col:startCol toLine:endLine col:endCol.
-    (selectionEndLine notNil and:[self autoMoveCursorToEndOfSelection]) ifTrue:[
-	self cursorLine:selectionEndLine col:(selectionEndCol + 1).
-    ].
+    "JV: That's actually rubbish as then you loose the original positon
+     and if user wants to extend/shring the selection further, you don't know
+     from which end to do it!!"
+"/    (selectionEndLine notNil and:[self autoMoveCursorToEndOfSelection]) ifTrue:[
+"/        self cursorLine:selectionEndLine col:(selectionEndCol + 1).
+"/    ].
     typeOfSelection := nil
+
+    "Modified: / 27-08-2013 / 13:28:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 27-08-2013 / 15:58:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 selectToEndOfLine
@@ -8287,18 +8518,18 @@
     | newCursorCol line |
 
     list isNil ifTrue:[
-	self unselect
+        self unselect
     ] ifFalse:[
-	cursorCol >= 1 ifTrue:[
-	    line := list at: cursorLine.
-	    newCursorCol := line size.
-	    [ newCursorCol > 1 and:[(line at:newCursorCol) isSeparator] ]
-		whileTrue:[newCursorCol := newCursorCol - 1].
-
-	    self selectFromLine:cursorLine col:cursorCol toLine:cursorLine col: newCursorCol.
-	    cursorCol := newCursorCol.
-	    typeOfSelection := nil
-	]
+        cursorCol >= 1 ifTrue:[
+            line := list at: cursorLine.
+            newCursorCol := line size.
+            [ newCursorCol > 1 and:[(line at:newCursorCol) isSeparator] ]      
+                whileTrue:[newCursorCol := newCursorCol - 1].
+
+            self selectFromLine:cursorLine col:cursorCol toLine:cursorLine col: newCursorCol.
+            cursorCol := newCursorCol.
+            typeOfSelection := nil
+        ]
     ]
 
     "Created: / 28-06-2011 / 23:07:07 / cg"
@@ -8309,10 +8540,10 @@
     "select the text from the current cursor position to the end."
 
     list isNil ifTrue:[
-	self unselect
+        self unselect
     ] ifFalse:[
-	super selectFromLine:cursorLine col:cursorCol toLine:(list size + 1) col:0.
-	typeOfSelection := nil
+        super selectFromLine:cursorLine col:cursorCol toLine:(list size + 1) col:0.
+        typeOfSelection := nil
     ]
 !
 
@@ -8344,89 +8575,89 @@
      If current selection is not last string, search forward to
      next occurrence of it before repeating the last operation."
 
-    |s l c sel savedSelectStyle startColForSearch
+    |s l c sel savedSelectStyle startColForSearch 
      lastStringToReplace lastReplaceIgnoredCase lastReplaceWasMatch|
 
     lastStringToReplace := lastReplacementInfo lastStringToReplace.
     lastStringToReplace isNil ifTrue:[
-	^ false
+        ^ false
     ].
     lastReplaceIgnoredCase := lastReplacementInfo lastReplaceIgnoredCase.
     lastReplaceWasMatch := lastReplacementInfo lastReplaceWasMatch.
 
     self undoableDo:[
-	s := lastStringToReplace asString.
-	"remove final cr"
-	(s endsWith:Character cr) ifTrue:[s := s copyButLast:1].
+        s := lastStringToReplace asString.
+        "remove final cr"
+        (s endsWith:Character cr) ifTrue:[s := s copyButLast:1].
     "/        s := s withoutSpaces.        "XXX - replacing text with spaces ..."
 
-	"set lastStringToReplace as the next search string
-	 and set lastReplaceIgnoredCase as the next search ignored case flag"
-	lastStringFromReplaceForNextSearch := s.
-	lastSearchIgnoredCase := lastReplaceIgnoredCase.
-
-	savedSelectStyle := selectStyle.
-	selectStyle := nil.
-
-	sel := self selection.
-
-	"if we are already there (after a find), ommit search"
-
-	(sel notNil and:[sel asString withoutSeparators = s]) ifTrue:[
-	    l := selectionStartLine "cursorLine".
-	    c := selectionStartCol "cursorCol".
-	    self deleteSelection.
-	    lastReplacementInfo lastReplacement notNil ifTrue:[
-		self insertLines:lastReplacementInfo lastReplacement asStringCollection withCR:false.
-		self selectFromLine:l col:c toLine:cursorLine col:(cursorCol - 1).
-		typeOfSelection := #paste
-	    ].
-	    selectStyle := savedSelectStyle.
-	    ^ true
-	].
-
-	sel isEmptyOrNil ifTrue:[
-	    startColForSearch := cursorCol - 1
-	] ifFalse:[
-	    startColForSearch := selectionEndCol ? (cursorCol - 1)
-	].
-	self
-	    searchForwardFor:s
-	    ignoreCase: lastReplaceIgnoredCase
-	    match: lastReplaceWasMatch
-	    startingAtLine:cursorLine col:startColForSearch
-	    ifFound:
-		[
-		    :line :col |
-
-		    |repl|
-
-		    self selectFromLine:line col:col
-				 toLine:line col:(col + s size - 1).
-		    self makeLineVisible:line.
-
-		    self deleteSelection.
-		    lastReplacementInfo lastReplacement notNil ifTrue:[
-			lastReplacementInfo lastReplacement isString ifFalse:[
-			    repl := lastReplacementInfo lastReplacement asString "withoutSpaces"
-			] ifTrue:[
-			    repl := lastReplacementInfo lastReplacement "withoutSpaces".
-			].
-			self insertLines:repl asStringCollection withCR:false.
-			self selectFromLine:line col:col toLine:cursorLine col:(cursorCol - 1).
-			undoSupport actionInfo:'replace'.
-		    ].
-		    selectStyle := savedSelectStyle.
-		    typeOfSelection := #paste.
-		    ^ true
-		]
-	    ifAbsent:
-		[
-		    self sensor compressKeyPressEventsWithKey:#Again.
-		    self showNotFound.
-		    selectStyle := savedSelectStyle.
-		    ^ false
-		].
+        "set lastStringToReplace as the next search string 
+         and set lastReplaceIgnoredCase as the next search ignored case flag"
+        lastStringFromReplaceForNextSearch := s.
+        lastSearchIgnoredCase := lastReplaceIgnoredCase.
+
+        savedSelectStyle := selectStyle.
+        selectStyle := nil.
+
+        sel := self selection.
+
+        "if we are already there (after a find), ommit search"
+
+        (sel notNil and:[sel asString withoutSeparators = s]) ifTrue:[
+            l := selectionStartLine "cursorLine".
+            c := selectionStartCol "cursorCol".
+            self deleteSelection.
+            lastReplacementInfo lastReplacement notNil ifTrue:[
+                self insertLines:lastReplacementInfo lastReplacement asStringCollection withCR:false.
+                self selectFromLine:l col:c toLine:cursorLine col:(cursorCol - 1).
+                typeOfSelection := #paste
+            ].
+            selectStyle := savedSelectStyle.
+            ^ true
+        ].
+
+        sel isEmptyOrNil ifTrue:[
+            startColForSearch := cursorCol - 1
+        ] ifFalse:[
+            startColForSearch := selectionEndCol ? (cursorCol - 1)
+        ].
+        self 
+            searchForwardFor:s
+            ignoreCase: lastReplaceIgnoredCase 
+            match: lastReplaceWasMatch 
+            startingAtLine:cursorLine col:startColForSearch
+            ifFound:
+                [
+                    :line :col |
+
+                    |repl|
+
+                    self selectFromLine:line col:col
+                                 toLine:line col:(col + s size - 1).
+                    self makeLineVisible:line.
+
+                    self deleteSelection.
+                    lastReplacementInfo lastReplacement notNil ifTrue:[
+                        lastReplacementInfo lastReplacement isString ifFalse:[
+                            repl := lastReplacementInfo lastReplacement asString "withoutSpaces"
+                        ] ifTrue:[
+                            repl := lastReplacementInfo lastReplacement "withoutSpaces".
+                        ].
+                        self insertLines:repl asStringCollection withCR:false.
+                        self selectFromLine:line col:col toLine:cursorLine col:(cursorCol - 1).
+                        undoSupport actionInfo:'replace'.
+                    ].
+                    selectStyle := savedSelectStyle.
+                    typeOfSelection := #paste.
+                    ^ true
+                ]
+            ifAbsent:
+                [
+                    self sensor compressKeyPressEventsWithKey:#Again.
+                    self showNotFound.
+                    selectStyle := savedSelectStyle.
+                    ^ false
+                ].
     ].
 
     ^ true.
@@ -8456,9 +8687,9 @@
     "undo the last undo"
 
     undoSupport hasRedoAction ifFalse:[
-	self beep
+        self beep
     ] ifTrue:[
-	undoSupport redo.
+        undoSupport redo.
     ]
 !
 
@@ -8484,26 +8715,26 @@
     |selectionRestore|
 
     self checkModificationsAllowed ifFalse:[
-	"/ will trigger an error-dialog there (no need for undo-carekeeping)
-	aBlock value.
+        "/ will trigger an error-dialog there (no need for undo-carekeeping)
+        aBlock value.
     ] ifTrue:[
-	undoSupport isInTransaction ifFalse:[
-	    selectionRestore := RestoreSelectionAndCursor new
-				    cursorLine:cursorLine cursorCol:cursorCol
-				    selectionStartLine:selectionStartLine selectionStartCol:selectionStartCol
-				    selectionEndLine:selectionEndLine selectionEndCol:selectionEndCol
-				    info:nil.
-	].
-	undoSupport
-	    undoableDo:[
-		aBlock value.
-		selectionRestore notNil ifTrue:[
-		    undoSupport transactionNotEmpty ifTrue:[
-			undoSupport addUndoFirst:selectionRestore
-		    ].
-		].
-	    ]
-	    info:aString.
+        undoSupport isInTransaction ifFalse:[
+            selectionRestore := RestoreSelectionAndCursor new 
+                                    cursorLine:cursorLine cursorCol:cursorCol
+                                    selectionStartLine:selectionStartLine selectionStartCol:selectionStartCol
+                                    selectionEndLine:selectionEndLine selectionEndCol:selectionEndCol
+                                    info:nil.
+        ].
+        undoSupport 
+            undoableDo:[
+                aBlock value.
+                selectionRestore notNil ifTrue:[
+                    undoSupport transactionNotEmpty ifTrue:[
+                        undoSupport addUndoFirst:selectionRestore 
+                    ].
+                ].
+            ]
+            info:aString.
     ].
 
     "Modified: / 30-04-2016 / 21:08:30 / cg"
@@ -8600,10 +8831,10 @@
 executeIn:editor
     editor unselect.
     editor
-	deleteFromLine:line1
-	col:col1
-	toLine:line2
-	col:col2.
+        deleteFromLine:line1
+        col:col1
+        toLine:line2
+        col:col2.
     editor cursorLine:line1 col:col1.
 ! !
 
@@ -8654,9 +8885,9 @@
      (i.e. single-character typing)"
 
     previousDeleteAction line == line ifTrue:[
-	previousDeleteAction col2 == (col1-1) ifTrue:[
-	    ^ true
-	].
+        previousDeleteAction col2 == (col1-1) ifTrue:[
+            ^ true
+        ].
     ].
 
     ^ false
@@ -8675,10 +8906,10 @@
 executeIn:editor
     editor unselect.
     editor
-	deleteFromLine:line
-	col:col1
-	toLine:line
-	col:col2.
+        deleteFromLine:line
+        col:col1
+        toLine:line
+        col:col2.
     editor cursorLine:line col:col1.
 ! !
 
@@ -8802,14 +9033,14 @@
     oldString := lastStringToReplace.
     newString := lastReplacement.
     (oldString notEmptyOrNil and:[newString notEmptyOrNil]) ifTrue:[
-	previousReplacements isNil ifTrue:[
-	    previousReplacements := OrderedCollection new.
-	].
-	previousReplacements := previousReplacements reject:[:entry | entry key = oldString].
-	previousReplacements addFirst:(oldString -> newString).
-	previousReplacements size > 20 ifTrue:[
-	    previousReplacements removeLast.
-	]
+        previousReplacements isNil ifTrue:[
+            previousReplacements := OrderedCollection new.
+        ].
+        previousReplacements := previousReplacements reject:[:entry | entry key = oldString].
+        previousReplacements addFirst:(oldString -> newString).
+        previousReplacements size > 20 ifTrue:[
+            previousReplacements removeLast.
+        ]
     ].
 ! !
 
@@ -8874,9 +9105,9 @@
      (i.e. single-character deletes)"
 
     previousPasteAction line == line ifTrue:[
-	previousPasteAction col == (self col2+1) ifTrue:[
-	    ^ true
-	].
+        previousPasteAction col == (self col2+1) ifTrue:[
+            ^ true
+        ].
     ].
 
     ^ false
@@ -8908,7 +9139,7 @@
     editor cursorLine:line col:col.
     editor paste:string.
     selected ~~ true ifTrue:[
-	editor unselect
+        editor unselect
     ].
 ! !
 
@@ -8940,9 +9171,9 @@
 
 executeIn:editor
     editor
-	replace:character
-	atLine:line
-	col:col.
+        replace:character
+        atLine:line
+        col:col.
     editor cursorLine:line col:col.
 ! !
 
@@ -8989,9 +9220,9 @@
      (i.e. single-character typing)"
 
     previousReplaceAction line == line ifTrue:[
-	previousReplaceAction col2 == (col1-1) ifTrue:[
-	    ^ true
-	].
+        previousReplaceAction col2 == (col1-1) ifTrue:[
+            ^ true
+        ].
     ].
 
     ^ false
@@ -9010,9 +9241,9 @@
 
 executeIn:editor
     editor
-	replaceString:characters
-	atLine:line
-	col:col1.
+        replaceString:characters
+        atLine:line
+        col:col1.
     editor cursorLine:line col:col1.
 ! !
 
@@ -9058,9 +9289,9 @@
 
     lnr := line.
     text do:[:eachLine |
-	editor list at:lnr put:eachLine.
-	editor invalidateLine:lnr.
-	lnr := lnr + 1.
+        editor list at:lnr put:eachLine.
+        editor invalidateLine:lnr.
+        lnr := lnr + 1.
     ].
 
     "Modified: / 09-10-2006 / 10:39:16 / cg"
@@ -9068,7 +9299,7 @@
 
 !EditTextView::RestoreSelectionAndCursor methodsFor:'accessing'!
 
-cursorLine:cursorLineArg cursorCol:cursorColArg selectionStartLine:selectionStartLineArg selectionStartCol:selectionStartColArg selectionEndLine:selectionEndLineArg selectionEndCol:selectionEndColArg
+cursorLine:cursorLineArg cursorCol:cursorColArg selectionStartLine:selectionStartLineArg selectionStartCol:selectionStartColArg selectionEndLine:selectionEndLineArg selectionEndCol:selectionEndColArg 
     cursorLine := cursorLineArg.
     cursorCol := cursorColArg.
     selectionStartLine := selectionStartLineArg.
@@ -9077,10 +9308,10 @@
     selectionEndCol := selectionEndColArg.
 !
 
-cursorLine:cursorLineArg cursorCol:cursorColArg
-	selectionStartLine:selectionStartLineArg selectionStartCol:selectionStartColArg
-	selectionEndLine:selectionEndLineArg selectionEndCol:selectionEndColArg
-	info:info
+cursorLine:cursorLineArg cursorCol:cursorColArg 
+        selectionStartLine:selectionStartLineArg selectionStartCol:selectionStartColArg 
+        selectionEndLine:selectionEndLineArg selectionEndCol:selectionEndColArg
+        info:info
 
     cursorLine := cursorLineArg.
     cursorCol := cursorColArg.
@@ -9098,10 +9329,10 @@
 executeIn:editor
     (selectionStartLine notNil and:[selectionEndLine notNil
     and:[selectionStartCol notNil and:[selectionEndCol notNil]]]) ifTrue:[
-	editor setCursorLine:cursorLine col:cursorCol.
-	editor selectFromLine:selectionStartLine col:selectionStartCol toLine:selectionEndLine col:selectionEndCol
+        editor setCursorLine:cursorLine col:cursorCol.
+        editor selectFromLine:selectionStartLine col:selectionStartCol toLine:selectionEndLine col:selectionEndCol
     ] ifFalse:[
-	editor cursorLine:cursorLine col:cursorCol.
+        editor cursorLine:cursorLine col:cursorCol.
     ].
 
     "Created: / 30-04-2016 / 20:14:55 / cg"
@@ -9121,5 +9352,10 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !
 
--- a/FontPanel.st	Thu Sep 01 12:31:56 2016 +0200
+++ b/FontPanel.st	Fri Sep 02 17:42:50 2016 +0100
@@ -886,7 +886,7 @@
 "/    
 "/    fontShown notNil ifTrue:[^ fontShown].
 "/
-"/    allFonts := self graphicsDevice 
+"/    allFonts := device 
 "/                    fontsInFamily:(currentFamily ? '*')
 "/                    face:(currentFace ? '*')
 "/                    style:(currentStyle ? '*')
@@ -933,7 +933,7 @@
             fntDescr face.
         ]
 
-"/    ^ self graphicsDevice facesInFamily:aFamilyName filtering:filter.
+"/    ^ device facesInFamily:aFamilyName filtering:filter.
 !
 
 getFamilyList 
@@ -968,7 +968,7 @@
     fontsPerFamily := d.
     ^ d keys asOrderedCollection sort
 "/
-"/    ^ self graphicsDevice fontFamiliesFiltering:combinedFilter.
+"/    ^ device fontFamiliesFiltering:combinedFilter.
 !
 
 getSizesInFamily:aFamilyName face:face style:style filtering:filter
@@ -1017,13 +1017,13 @@
     ^ sizes asOrderedCollection sort.
 
 "/    sizeUnit == #px ifTrue:[
-"/        ^ self graphicsDevice 
+"/        ^ device 
 "/             pixelSizesInFamily:(currentFamily ? '*')
 "/             face:(currentFace ? '*')
 "/             style:(currentStyle ? '*')
 "/             filtering:filter.
 "/    ] ifFalse:[
-"/        ^ self graphicsDevice 
+"/        ^ device 
 "/             sizesInFamily:(currentFamily ? '*')
 "/             face:(currentFace ? '*')
 "/             style:(currentStyle ? '*')
@@ -1048,7 +1048,7 @@
             fntDescr style.
         ]
 
-"/    ^ self graphicsDevice stylesInFamily:aFamilyName face:aFace filtering:filter.
+"/    ^ device stylesInFamily:aFamilyName face:aFace filtering:filter.
 !
 
 showPreview
--- a/ListView.st	Thu Sep 01 12:31:56 2016 +0200
+++ b/ListView.st	Fri Sep 02 17:42:50 2016 +0100
@@ -441,6 +441,23 @@
 "
 ! !
 
+!ListView class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    "/ please change as required (and remove this comment)
+
+    "/ DefaultForegroundColor := nil.
+    "/ DefaultBackgroundColor := nil.
+    DefaultTabPositions := self tab4Positions.
+    "/ UserDefaultTabPositions := nil.
+    "/ DefaultLeftMargin := nil.
+    "/ DefaultTopMargin := nil.
+
+    "Modified: / 22-04-2016 / 20:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ListView class methodsFor:'accessing private classes'!
 
 searchSpec
@@ -1791,7 +1808,7 @@
 !
 
 model:aModel
-    "define the receiver's model, from which the text is
+    "define the receivers model, from which the text is
      to be acquired via list- or aspect-messages, whenever its aspect
      changes."
 
@@ -2029,34 +2046,34 @@
     self paint:bg.
 
     (lineString notNil and:[lineString isString not]) ifTrue:[
-	w := lineString widthFrom:col to:(col min:len) on:self.
-	w <= 0 ifTrue:[
+        w := lineString widthFrom:col to:(col min:len) on:self.
+        w <= 0 ifTrue:[
 	    w := gc font width.
-	    self fillRectangleX:x y:yf width:w height:fontHeight.
-	    self paint:fg
-	].
-	self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[
-	    self drawVisibleLine:visLineNr with:fg and:bg
-	].
-	^ self
+            self fillRectangleX:x y:yf width:w height:fontHeight.
+            self paint:fg
+        ].
+        self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[
+            self drawVisibleLine:visLineNr with:fg and:bg
+        ].
+        ^ self
     ].
 
     (lineString isNil or:[col > len]) ifTrue:[
 	self fillRectangleX:x y:yf width:(gc font width) height:fontHeight.
-	self paint:fg
+        self paint:fg
     ] ifFalse:[
-	characterString := lineString copyFrom:col to:col.
-
-	"/ remove lines color emphasis, to enforce color.
-	"/ otherwise blue text is not visible if selection-bg is blue
-	characterString := self withoutColorEmphasis:characterString ifFg:fg andBg:bg.
-	w := characterString widthOn:self.
-
-	self fillRectangleX:x y:yf width:w height:fontHeight.
-	self paint:fg.
-	self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[
-	    self displayString:characterString x:x y:(y + fontAscent)
-	]
+        characterString := lineString copyFrom:col to:col.
+
+        "/ remove lines color emphasis, to enforce color.
+        "/ otherwise blue text is not visible if selection-bg is blue
+        characterString := self withoutColorEmphasis:characterString ifFg:fg andBg:bg.
+        w := characterString widthOn:self.
+
+        self fillRectangleX:x y:yf width:w height:fontHeight.
+        self paint:fg.
+        self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[
+            self displayString:characterString x:x y:(y + fontAscent)
+        ]
     ]
 
     "Modified: / 15.12.1999 / 23:21:12 / cg"
@@ -2139,16 +2156,16 @@
                               height:fontHeight.
             ].
             self paint:fg on:bg.
-            w notNil ifTrue:[
-                "/ clip req'd for VISTAs new font rendering (which seems to shoot over the compute
-                self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[
-                    "/ self displayOpaqueString:lineString from:sCol to:eCol x:x y:(y + fontAscent)
-                    self displayString:lineString from:sCol to:eCol x:x y:(y + fontAscent)
-                ]
-            ] ifFalse:[
+"/            w notNil ifTrue:[
+"/                "/ clip req'd for VISTAs new font rendering (which seems to shoot over the compute
+"/                self clippedTo:(Rectangle left:x top:yf width:w height:fontHeight) do:[
+"/                    "/ self displayOpaqueString:lineString from:sCol to:eCol x:x y:(y + fontAscent)
+"/                    self displayString:lineString from:sCol to:eCol x:x y:(y + fontAscent)
+"/                ]
+"/            ] ifFalse:[
                 "/ self displayOpaqueString:lineString from:sCol to:eCol x:x y:(y + fontAscent)
                 self displayString:lineString from:sCol to:eCol x:x y:(y + fontAscent) opaque:false maxWidth:self width
-            ].
+"/            ].
         ]
     ]
 
@@ -2901,7 +2918,6 @@
 
 	msg notNil ifTrue:[
 	    doCompareIfUnchanged := compareModelOnUpdate.
-
 	    newText := model perform:msg.
 	    "/ cg: this makes many optimizations (virtualArray) useless;
 	    "/ I do not think that this is a good idea:
@@ -3635,6 +3651,7 @@
     ].
 
     font := gc deviceFont.
+    
     checkedLinesForWidthOfContentsComputation isNil ifTrue:[
         start := 1.
         stop := list size
@@ -4191,20 +4208,20 @@
     leftOffset := viewOrigin x.
 
     aColNr == 1 ifTrue:[
-	leftOffset ~~ 0 ifTrue:[
-	    self scrollLeft:leftOffset.
-	].
-	^ self
+        leftOffset ~~ 0 ifTrue:[
+            self scrollLeft:leftOffset.
+        ].
+        ^ self
     ].
 
     pxlOffset := gc font width * (aColNr - 1).
 
     pxlOffset < leftOffset ifTrue:[
-	self scrollLeft:(leftOffset - pxlOffset)
+        self scrollLeft:(leftOffset - pxlOffset)
     ] ifFalse:[
-	pxlOffset > leftOffset ifTrue:[
-	    self scrollRight:(pxlOffset - leftOffset)
-	]
+        pxlOffset > leftOffset ifTrue:[
+            self scrollRight:(pxlOffset - leftOffset)
+        ]
     ]
 !
 
@@ -5414,5 +5431,12 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !
 
+
+ListView initialize!
--- a/Make.proto	Thu Sep 01 12:31:56 2016 +0200
+++ b/Make.proto	Fri Sep 02 17:42:50 2016 +0100
@@ -70,6 +70,13 @@
 
 
 
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
+stx_libwidg.$(O): $(shell hg root)/.hg/dirstate
+endif
+
 
 
 
--- a/TextView.st	Thu Sep 01 12:31:56 2016 +0200
+++ b/TextView.st	Fri Sep 02 17:42:50 2016 +0100
@@ -390,56 +390,56 @@
        name: searchDialogSpec
        window:
       (WindowSpec
-         label: 'String search'
-         name: 'String search'
-         min: (Point 10 10)
-         max: (Point 1280 1024)
+	 label: 'String search'
+	 name: 'String search'
+	 min: (Point 10 10)
+	 max: (Point 1280 1024)
          bounds: (Rectangle 0 0 475 376)
        )
        component:
       (SpecCollection
-         collection: (
-          (LabelSpec
-             label: 'SearchPattern:'
-             name: 'label'
-             layout: (LayoutFrame 1 0.0 3 0 -1 1.0 20 0)
-             level: 0
-             translateLabel: true
-             adjust: left
-           )
-          (ComboBoxSpec
-             name: 'patternComboBox'
-             layout: (LayoutFrame 2 0.0 26 0 -2 1.0 48 0)
-             activeHelpKey: searchPattern
-             tabable: true
-             model: searchPattern
-             immediateAccept: false
-             acceptOnLeave: true
-             acceptOnReturn: true
-             acceptOnTab: true
-             acceptOnLostFocus: true
-             acceptOnPointerLeave: false
-             autoSelectInitialText: true
-             comboList: patternList
-           )
-          (VerticalPanelViewSpec
-             name: 'VerticalPanel1'
+	 collection: (
+	  (LabelSpec
+	     label: 'SearchPattern:'
+	     name: 'label'
+	     layout: (LayoutFrame 1 0.0 3 0 -1 1.0 20 0)
+	     level: 0
+	     translateLabel: true
+	     adjust: left
+	   )
+	  (ComboBoxSpec
+	     name: 'patternComboBox'
+	     layout: (LayoutFrame 2 0.0 26 0 -2 1.0 48 0)
+	     activeHelpKey: searchPattern
+	     tabable: true
+	     model: searchPattern
+	     immediateAccept: false
+	     acceptOnLeave: true
+	     acceptOnReturn: true
+	     acceptOnTab: true
+	     acceptOnLostFocus: true
+	     acceptOnPointerLeave: false
+	     autoSelectInitialText: true
+	     comboList: patternList
+	   )
+	  (VerticalPanelViewSpec
+	     name: 'VerticalPanel1'
              layout: (LayoutFrame 0 0.0 52 0 0 1.0 -32 1)
-             horizontalLayout: fit
-             verticalLayout: top
-             component:
-            (SpecCollection
-               collection: (
-                (CheckBoxSpec
-                   label: 'Case Sensitive'
-                   name: 'ignoreCaseCheckBox'
-                   activeHelpKey: searchCaseSensitive
-                   level: 0
-                   tabable: true
-                   model: caseSensitive
-                   translateLabel: true
+	     horizontalLayout: fit
+	     verticalLayout: top
+	     component:
+	    (SpecCollection
+	       collection: (
+		(CheckBoxSpec
+		   label: 'Case Sensitive'
+		   name: 'ignoreCaseCheckBox'
+		   activeHelpKey: searchCaseSensitive
+		   level: 0
+		   tabable: true
+		   model: caseSensitive
+		   translateLabel: true
                    extent: (Point 475 24)
-                 )
+		 )
                 (ViewSpec
                    name: 'MatchBox'
                    component:
@@ -468,16 +468,16 @@
 
                    )
                    extent: (Point 475 24)
-                 )
-                (CheckBoxSpec
-                   label: 'Search Full Words'
-                   name: 'CheckBox2'
-                   activeHelpKey: searchFullWord
-                   level: 0
-                   enableChannel: searchFullWordEnabled
-                   tabable: true
-                   model: searchFullWord
-                   translateLabel: true
+		 )
+		(CheckBoxSpec
+		   label: 'Search Full Words'
+		   name: 'CheckBox2'
+		   activeHelpKey: searchFullWord
+		   level: 0
+		   enableChannel: searchFullWordEnabled
+		   tabable: true
+		   model: searchFullWord
+		   translateLabel: true
                    extent: (Point 475 24)
                  )
                 (CheckBoxSpec
@@ -489,31 +489,31 @@
                    model: searchAtBeginOfLineOnly
                    translateLabel: true
                    extent: (Point 475 24)
-                 )
-                (CheckBoxSpec
-                   label: 'Variable Only'
-                   name: 'CheckBox1'
-                   activeHelpKey: searchVariable
-                   level: 0
-                   visibilityChannel: searchVariableVisible
-                   enableChannel: searchVariableEnabled
-                   tabable: true
-                   model: searchVariable
-                   translateLabel: true
-                   labelChannel: stringWithVariableUnderCursorHolder
+		 )
+		(CheckBoxSpec
+		   label: 'Variable Only'
+		   name: 'CheckBox1'
+		   activeHelpKey: searchVariable
+		   level: 0
+		   visibilityChannel: searchVariableVisible
+		   enableChannel: searchVariableEnabled
+		   tabable: true
+		   model: searchVariable
+		   translateLabel: true
+		   labelChannel: stringWithVariableUnderCursorHolder
                    extent: (Point 475 24)
-                 )
-                (CheckBoxSpec
-                   label: 'Select Lines'
-                   name: 'CheckBox3'
-                   activeHelpKey: selectLines
-                   level: 0
-                   initiallyInvisible: true
-                   tabable: true
+		 )
+		(CheckBoxSpec
+		   label: 'Select Lines'
+		   name: 'CheckBox3'
+		   activeHelpKey: selectLines
+		   level: 0
+		   initiallyInvisible: true
+		   tabable: true
                    model: selectLinesHolder
-                   translateLabel: true
+		   translateLabel: true
                    extent: (Point 429 24)
-                 )
+		 )
                 (CheckBoxSpec
                    label: 'Wrap at End of Text (forward only)'
                    name: 'CheckBox7'
@@ -534,35 +534,35 @@
                    verticalLayout: fit
                    ignoreInvisibleComponents: false
                    elementsChangeSize: true
-                   component:
-                  (SpecCollection
-                     collection: (
-                      (CheckBoxSpec
+		   component:
+		  (SpecCollection
+		     collection: (
+		      (CheckBoxSpec
                          label: 'Replace By:'
-                         name: 'CheckBox4'
-                         activeHelpKey: replaceText
-                         level: 0
-                         enableChannel: replaceEnabled
-                         tabable: true
-                         model: replaceBoolean
-                         translateLabel: true
+			 name: 'CheckBox4'
+			 activeHelpKey: replaceText
+			 level: 0
+			 enableChannel: replaceEnabled
+			 tabable: true
+			 model: replaceBoolean
+			 translateLabel: true
                          resizeForLabel: true
                          useDefaultExtent: true
-                       )
-                      (InputFieldSpec
-                         name: 'ReplaceEntryField'
-                         activeHelpKey: replaceText
-                         visibilityChannel: replaceBoolean
-                         enableChannel: replaceBoolean
-                         model: replaceTextHolder
-                         acceptOnReturn: true
-                         acceptOnTab: true
-                         acceptOnPointerLeave: true
+		       )
+		      (InputFieldSpec
+			 name: 'ReplaceEntryField'
+			 activeHelpKey: replaceText
+			 visibilityChannel: replaceBoolean
+			 enableChannel: replaceBoolean
+			 model: replaceTextHolder
+			 acceptOnReturn: true
+			 acceptOnTab: true
+			 acceptOnPointerLeave: true
                          extent: (Point 297 24)
-                       )
-                      )
-
-                   )
+		       )
+		      )
+
+		   )
                    extent: (Point 475 24)
                  )
                 (CheckBoxSpec
@@ -586,59 +586,59 @@
                    model: replacePreserveCaseBoolean
                    translateLabel: true
                    extent: (Point 475 24)
-                 )
-                )
-
-             )
-           )
-          (HorizontalPanelViewSpec
-             name: 'horizontalPanelView'
+		 )
+		)
+
+	     )
+	   )
+	  (HorizontalPanelViewSpec
+	     name: 'horizontalPanelView'
              layout: (LayoutFrame 0 0.0 -32 1.0 -16 1.0 0 1.0)
-             level: 0
-             horizontalLayout: fitSpace
-             verticalLayout: center
-             horizontalSpace: 3
-             verticalSpace: 3
-             ignoreInvisibleComponents: true
-             reverseOrderIfOKAtLeft: true
-             component:
-            (SpecCollection
-               collection: (
-                (ActionButtonSpec
-                   label: 'Cancel'
-                   name: 'cancelButton'
-                   level: 2
-                   translateLabel: true
-                   tabable: true
-                   model: cancel
+	     level: 0
+	     horizontalLayout: fitSpace
+	     verticalLayout: center
+	     horizontalSpace: 3
+	     verticalSpace: 3
+	     ignoreInvisibleComponents: true
+	     reverseOrderIfOKAtLeft: true
+	     component:
+	    (SpecCollection
+	       collection: (
+		(ActionButtonSpec
+		   label: 'Cancel'
+		   name: 'cancelButton'
+		   level: 2
+		   translateLabel: true
+		   tabable: true
+		   model: cancel
                    useDefaultExtent: true
-                 )
-                (ActionButtonSpec
-                   label: 'Prev'
-                   name: 'prevButton'
-                   level: 2
-                   translateLabel: true
-                   tabable: true
-                   model: prevAction
+		 )
+		(ActionButtonSpec
+		   label: 'Prev'
+		   name: 'prevButton'
+		   level: 2
+		   translateLabel: true
+		   tabable: true
+		   model: prevAction
                    useDefaultExtent: true
-                 )
-                (ActionButtonSpec
-                   label: 'Next'
-                   name: 'nextButton'
-                   level: 2
-                   borderWidth: 1
-                   translateLabel: true
-                   tabable: true
-                   model: nextAction
-                   isDefault: true
+		 )
+		(ActionButtonSpec
+		   label: 'Next'
+		   name: 'nextButton'
+		   level: 2
+		   borderWidth: 1
+		   translateLabel: true
+		   tabable: true
+		   model: nextAction
+		   isDefault: true
                    useDefaultExtent: true
-                 )
-                )
-
-             )
-             keepSpaceForOSXResizeHandleH: true
-           )
-          )
+		 )
+		)
+
+	     )
+	     keepSpaceForOSXResizeHandleH: true
+	   )
+	  )
 
        )
      )
@@ -1286,6 +1286,10 @@
 
     device flushListOfAvailableFonts.
     matchingFonts := device listOfAvailableFonts select:filter.
+    matchingFamilyFonts := matchingFonts select:[:f | f family = gc font family].
+    matchingFamilyFaceFonts := matchingFamilyFonts select:[:f | f face = gc font face].
+    matchingFamilyFaceStyleFonts := matchingFamilyFaceFonts select:[:f | f style = gc font style].
+    matchingFamilyFaceStyleSizeFonts := matchingFamilyFaceStyleFonts select:[:f | f size = gc font size].
     matchingFamilyFonts := matchingFonts select:[:f | f family = font family].
     matchingFamilyFaceFonts := matchingFamilyFonts select:[:f | f face = font face].
     matchingFamilyFaceStyleFonts := matchingFamilyFaceFonts select:[:f | f style = font style].
@@ -1343,27 +1347,27 @@
     "mouse-move while button was pressed - handle selection changes"
 
     (clickLine isNil or:[clickPos isNil]) ifTrue:[
-        dragIsActive := false.
-        ^ self
+	dragIsActive := false.
+	^ self
     ].
 
     dragIsActive ifTrue:[
-        (clickPos dist:(x@y)) >= 5.0 ifTrue:[
-            dragIsActive := false.
-
-            self hasSelection ifTrue:[
-                dropSource startDragIn:self at:(x@y)
-            ]
-        ].
-        ^ self
+	(clickPos dist:(x@y)) >= 5.0 ifTrue:[
+	    dragIsActive := false.
+
+	    self hasSelection ifTrue:[
+		dropSource startDragIn:self at:(x@y)
+	    ]
+	].
+	^ self
     ].
 
     "is it the select or 1-button ?"
     buttonState == 0 ifTrue:[^ self].
     self sensor leftButtonPressed ifFalse:[
-        "/ self setPrimarySelection.
-        "/ self selectionChanged.
-        ^ self
+	"/ self setPrimarySelection.
+	"/ self selectionChanged.
+	^ self
     ].
 "/    (device buttonMotionMask:buttonState includesButton:#select) ifFalse:[
 "/        (device buttonMotionMask:buttonState includesButton:1) ifFalse:[
@@ -1374,25 +1378,25 @@
     "if moved outside of view, start autoscroll"
 
     ((y < 0) and:[firstLineShown ~~ 0]) ifTrue:[
-        self compressMotionEvents:false.
+	self compressMotionEvents:false.
         (self startAutoScrollUp:y negated) ifTrue:[
             ^ self
         ].
     ].
     (y > height) ifTrue:[
-        self compressMotionEvents:false.
+	self compressMotionEvents:false.
         (self startAutoScrollDown:(y - height)) ifTrue:[
             ^ self
         ].
     ].
     ((x < 0) and:[viewOrigin x ~~ 0]) ifTrue:[
-        self compressMotionEvents:false.
+	self compressMotionEvents:false.
         (self startAutoScrollLeft:x) ifTrue:[
             ^ self
         ].
     ].
     (x > width) ifTrue:[
-        self compressMotionEvents:false.
+	self compressMotionEvents:false.
         (self startAutoScrollRight:(x - width)) ifTrue:[
             ^ self
         ].
@@ -1400,7 +1404,7 @@
 
     "move inside - stop autoscroll if any"
     autoScrollBlock notNil ifTrue:[
-        self stopScrollSelect
+	self stopScrollSelect
     ].
 
     self extendSelectionToX:x y:y setPrimarySelection:false.
@@ -1480,20 +1484,20 @@
     "mouse- button release - turn off autoScroll if any"
 
     (button == 1) ifTrue:[
-        self hasSelection ifTrue:[
-            self setPrimarySelection.
-            self selectionChanged.
-        ].
-
-        autoScrollBlock notNil ifTrue:[
-            self stopScrollSelect
-        ].
-        dragIsActive ifTrue:[
-            self unselect
-        ].
-        clickPos := nil.
+	self hasSelection ifTrue:[
+	    self setPrimarySelection.
+	    self selectionChanged.
+	].
+
+	autoScrollBlock notNil ifTrue:[
+	    self stopScrollSelect
+	].
+	dragIsActive ifTrue:[
+	    self unselect
+	].
+	clickPos := nil.
     ] ifFalse:[
-        super buttonRelease:button x:x y:y
+	super buttonRelease:button x:x y:y
     ].
     dragIsActive := false.
 
@@ -1515,153 +1519,153 @@
     "
     ((sel := self selection) size == 1
     and:[(sel := sel at:1) size == 1]) ifTrue:[
-        ch := sel at:1.
-
-        ((self isOpeningParenthesis:ch)
-        or:[ (self isClosingParenthesis:ch) ]) ifTrue:[
-            self
-                searchForMatchingParenthesisFromLine:selectionStartLine col:selectionStartCol
-                ifFound:[:line :col |
-                              |prevLine prevCol moveBack pos1|
-
-                              prevLine := firstLineShown.
-                              prevCol := viewOrigin x.
-                              self selectFromLine:selectionStartLine col:selectionStartCol
-                                           toLine:line col:col.
-
-                              self sensor ctrlDown ifFalse:[
-                                  "/ undo scroll operation ...
-                                  self withCursor:Cursor eye do:[
-                                      |delayCount|
-
-                                      moveBack := false.
-                                      (self isClosingParenthesis:ch) ifTrue:[
-                                           (firstLineShown ~~ prevLine or:[prevCol ~~ viewOrigin x]) ifTrue:[
-                                               moveBack := true
-                                           ]
-                                      ] ifFalse:[
-                                           selectionEndLine > (firstLineShown + nFullLinesShown) ifTrue:[
-                                               self makeLineVisible:selectionEndLine.
-                                               moveBack := true
-                                           ]
-                                      ].
-                                      moveBack ifTrue:[
-                                           delayCount  := 0.
-                                           pos1 := x@y.
-                                           self invalidateRepairNow:true.
-                                           Delay waitForSeconds:MatchDelayTime.
-                                           delayCount := delayCount + MatchDelayTime.
-                                           [self sensor hasUserEventFor:self] whileFalse:[
-                                                Delay waitForSeconds:MatchDelayTime / 2.
-                                                delayCount := delayCount + (MatchDelayTime / 2).
-                                                delayCount > 2 ifTrue:[
-                                                    self cursor:Cursor eyeClosed.
-                                                ].
-                                                delayCount >= 2.3 ifTrue:[
-                                                    self cursor:Cursor eye.
-                                                    delayCount := 0.
-                                                ]
-                                           ].
-                                           self scrollToLine:prevLine; scrollToCol:prevCol.
-                                      ].
-                                  ]
-                              ].
-                              ^ self.
-                          ]
-                ifNotFound:[self showNotFound]
-                onError:[self beep]
-                openingCharacters:((parenthesisSpecification at:#open) ", '([{'")
-                closingCharacters:((parenthesisSpecification at:#close) ", ')]}'").
-            selectStyle := nil
-        ]
+	ch := sel at:1.
+
+	((self isOpeningParenthesis:ch)
+	or:[ (self isClosingParenthesis:ch) ]) ifTrue:[
+	    self
+		searchForMatchingParenthesisFromLine:selectionStartLine col:selectionStartCol
+		ifFound:[:line :col |
+			      |prevLine prevCol moveBack pos1|
+
+			      prevLine := firstLineShown.
+			      prevCol := viewOrigin x.
+			      self selectFromLine:selectionStartLine col:selectionStartCol
+					   toLine:line col:col.
+
+			      self sensor ctrlDown ifFalse:[
+				  "/ undo scroll operation ...
+				  self withCursor:Cursor eye do:[
+				      |delayCount|
+
+				      moveBack := false.
+				      (self isClosingParenthesis:ch) ifTrue:[
+					   (firstLineShown ~~ prevLine or:[prevCol ~~ viewOrigin x]) ifTrue:[
+					       moveBack := true
+					   ]
+				      ] ifFalse:[
+					   selectionEndLine > (firstLineShown + nFullLinesShown) ifTrue:[
+					       self makeLineVisible:selectionEndLine.
+					       moveBack := true
+					   ]
+				      ].
+				      moveBack ifTrue:[
+					   delayCount  := 0.
+					   pos1 := x@y.
+					   self invalidateRepairNow:true.
+					   Delay waitForSeconds:MatchDelayTime.
+					   delayCount := delayCount + MatchDelayTime.
+					   [self sensor hasUserEventFor:self] whileFalse:[
+						Delay waitForSeconds:MatchDelayTime / 2.
+						delayCount := delayCount + (MatchDelayTime / 2).
+						delayCount > 2 ifTrue:[
+						    self cursor:Cursor eyeClosed.
+						].
+						delayCount >= 2.3 ifTrue:[
+						    self cursor:Cursor eye.
+						    delayCount := 0.
+						]
+					   ].
+					   self scrollToLine:prevLine; scrollToCol:prevCol.
+				      ].
+				  ]
+			      ].
+			      ^ self.
+			  ]
+		ifNotFound:[self showNotFound]
+		onError:[self beep]
+		openingCharacters:((parenthesisSpecification at:#open) ", '([{'")
+		closingCharacters:((parenthesisSpecification at:#close) ", ')]}'").
+	    selectStyle := nil
+	]
     ].
 
     (self st80SelectMode or:[ self sensor ctrlDown]) ifTrue:[
-        "/ st80 selects:
-        "/   - if clicked right after a parenthesis -> select to matching parenthesis
-        "/   - if clicked right after a quote -> select to matching quote (unless escaped ;-)
-        "/   - if clicked at beginning of the line  -> select that line
-        "/   - if clicked at the top of the text    -> select all
-        "/ however, do none of the above, if clicked on a parenthesis
-        clickCol == 1 ifTrue:[
-            clickLine == 1 ifTrue:[
-                self selectAll.
-                ^ self.
-            ].
-            self selectLineAtY:y.
-            selectStyle := #line.
-            ^ self
-        ].
-
-        matchCol := nil.
-        "/ see what is to the left of that character ...
-        clickCol > 1 ifTrue:[
-            ch := self characterAtLine:clickLine col:clickCol-1.
-            (self isOpeningParenthesis:ch) ifTrue:[
-                matchCol := clickCol - 1
-            ] ifFalse:[
-                ('"''|' includes:ch) ifTrue:[
-                    scanCol := clickCol - 1.
-                    fwdScan := true.
-                    scanCh := ch.
-                ]
-            ]
-        ].
-        fwdSelect := true.
-        (matchCol isNil and:[scanCol isNil]) ifTrue:[
-            clickCol < (self listAt:clickLine) size ifTrue:[
-                ch := self characterAtLine:clickLine col:clickCol+1.
-                (self isClosingParenthesis:ch) ifTrue:[
-                    matchCol := clickCol + 1.
-                    fwdSelect := false.
-                ] ifFalse:[
-                    ('"''|' includes:ch) ifTrue:[
-                        scanCol := clickCol + 1.
-                        fwdScan := false.
-                        scanCh := ch.
-                    ]
-                ]
-            ].
-        ].
-        matchCol notNil ifTrue:[
-            self
-                searchForMatchingParenthesisFromLine:clickLine col:matchCol
-                ifFound:[:line :col |
-                          self selectFromLine:clickLine col:matchCol+(fwdSelect ifTrue:1 ifFalse:-1)
-                                       toLine:line col:col-(fwdSelect ifTrue:1 ifFalse:-1)]
-                ifNotFound:[self showNotFound]
-                onError:[self beep]
-                openingCharacters:((parenthesisSpecification at:#open) , '([{')
-                closingCharacters:((parenthesisSpecification at:#close) , ')]}').
-            ^ self
-        ].
-        scanCol notNil ifTrue:[
-            "/ if its an EOL comment, do it differently
-            ch := self characterAtLine:clickLine col:clickCol.
-            ch == $/ ifTrue:[
-                self selectFromLine:clickLine col:clickCol+1 toLine:clickLine+1 col:0.
-                ^ self
-            ].
-
-            self
-                scanFor:scanCh fromLine:clickLine col:scanCol forward:fwdScan
-                ifFound:[:line :col |
-                            |selStart selEnd|
-
-                            fwdScan ifTrue:[
-                                selStart := scanCol+1.
-                                selEnd := col-1.
-                            ] ifFalse:[
-                                selStart := scanCol-1.
-                                selEnd := col+1.
-                            ].
-                            self selectFromLine:clickLine col:selStart
-                                 toLine:line col:selEnd.
-                            ^ self
-                           ]
-                ifNotFound:[self showNotFound].
-            ^ self
-        ]
+	"/ st80 selects:
+	"/   - if clicked right after a parenthesis -> select to matching parenthesis
+	"/   - if clicked right after a quote -> select to matching quote (unless escaped ;-)
+	"/   - if clicked at beginning of the line  -> select that line
+	"/   - if clicked at the top of the text    -> select all
+	"/ however, do none of the above, if clicked on a parenthesis
+	clickCol == 1 ifTrue:[
+	    clickLine == 1 ifTrue:[
+		self selectAll.
+		^ self.
+	    ].
+	    self selectLineAtY:y.
+	    selectStyle := #line.
+	    ^ self
+	].
+
+	matchCol := nil.
+	"/ see what is to the left of that character ...
+	clickCol > 1 ifTrue:[
+	    ch := self characterAtLine:clickLine col:clickCol-1.
+	    (self isOpeningParenthesis:ch) ifTrue:[
+		matchCol := clickCol - 1
+	    ] ifFalse:[
+		('"''|' includes:ch) ifTrue:[
+		    scanCol := clickCol - 1.
+		    fwdScan := true.
+		    scanCh := ch.
+		]
+	    ]
+	].
+	fwdSelect := true.
+	(matchCol isNil and:[scanCol isNil]) ifTrue:[
+	    clickCol < (self listAt:clickLine) size ifTrue:[
+		ch := self characterAtLine:clickLine col:clickCol+1.
+		(self isClosingParenthesis:ch) ifTrue:[
+		    matchCol := clickCol + 1.
+		    fwdSelect := false.
+		] ifFalse:[
+		    ('"''|' includes:ch) ifTrue:[
+			scanCol := clickCol + 1.
+			fwdScan := false.
+			scanCh := ch.
+		    ]
+		]
+	    ].
+	].
+	matchCol notNil ifTrue:[
+	    self
+		searchForMatchingParenthesisFromLine:clickLine col:matchCol
+		ifFound:[:line :col |
+			  self selectFromLine:clickLine col:matchCol+(fwdSelect ifTrue:1 ifFalse:-1)
+				       toLine:line col:col-(fwdSelect ifTrue:1 ifFalse:-1)]
+		ifNotFound:[self showNotFound]
+		onError:[self beep]
+		openingCharacters:((parenthesisSpecification at:#open) , '([{')
+		closingCharacters:((parenthesisSpecification at:#close) , ')]}').
+	    ^ self
+	].
+	scanCol notNil ifTrue:[
+	    "/ if its an EOL comment, do it differently
+	    ch := self characterAtLine:clickLine col:clickCol.
+	    ch == $/ ifTrue:[
+		self selectFromLine:clickLine col:clickCol+1 toLine:clickLine+1 col:0.
+		^ self
+	    ].
+
+	    self
+		scanFor:scanCh fromLine:clickLine col:scanCol forward:fwdScan
+		ifFound:[:line :col |
+			    |selStart selEnd|
+
+			    fwdScan ifTrue:[
+				selStart := scanCol+1.
+				selEnd := col-1.
+			    ] ifFalse:[
+				selStart := scanCol-1.
+				selEnd := col+1.
+			    ].
+			    self selectFromLine:clickLine col:selStart
+				 toLine:line col:selEnd.
+			    ^ self
+			   ]
+		ifNotFound:[self showNotFound].
+	    ^ self
+	]
     ].
 
     "
@@ -1670,14 +1674,14 @@
     wordStartLine := selectionStartLine.
     wordEndLine := selectionEndLine.
     selectStyle == #wordLeft ifTrue:[
-        wordStartCol := selectionStartCol + 1
+	wordStartCol := selectionStartCol + 1
     ] ifFalse:[
-        wordStartCol := selectionStartCol.
+	wordStartCol := selectionStartCol.
     ].
     selectStyle == #wordRight ifTrue:[
-        wordEndCol := selectionEndCol - 1
+	wordEndCol := selectionEndCol - 1
     ] ifFalse:[
-        wordEndCol := selectionEndCol
+	wordEndCol := selectionEndCol
     ]
 
     "Created: / 11-09-1997 / 04:12:55 / cg"
@@ -1701,156 +1705,156 @@
     movedLine := self visibleLineToAbsoluteLine:movedVisibleLine.
 
     (x < leftMargin) ifTrue:[
-        movedCol := 0
+	movedCol := 0
     ] ifFalse:[
-        movedCol := self colOfX:x inVisibleLine:movedVisibleLine
+	movedCol := self colOfX:x inVisibleLine:movedVisibleLine
     ].
     y < 0 ifTrue:[
-        movedCol := 0
+	movedCol := 0
     ].
     ((movedLine == clickLine) and:[movedCol == clickCol]) ifTrue:[
-        selectionStartLine notNil ifTrue:[
-            ^ self
-        ].
-        (clickPos isNil
-        or:[(clickPos x - x) abs < 3
-            and:[(clickPos y - y) abs < 3]]) ifTrue:[
-            ^ self
-        ].
-        selectionStartLine := clickLine.
-        selectionStartCol := clickCol.
-        selectionEndLine := selectionStartLine.
-        selectionEndCol := selectionStartCol.
-
-        oldStartLine := selectionStartLine.
-        oldEndLine := selectionEndLine.
-        oldStartCol := selectionStartCol.
-        oldEndCol := selectionEndCol-1.
+	selectionStartLine notNil ifTrue:[
+	    ^ self
+	].
+	(clickPos isNil
+	or:[(clickPos x - x) abs < 3
+	    and:[(clickPos y - y) abs < 3]]) ifTrue:[
+	    ^ self
+	].
+	selectionStartLine := clickLine.
+	selectionStartCol := clickCol.
+	selectionEndLine := selectionStartLine.
+	selectionEndCol := selectionStartCol.
+
+	oldStartLine := selectionStartLine.
+	oldEndLine := selectionEndLine.
+	oldStartCol := selectionStartCol.
+	oldEndCol := selectionEndCol-1.
     ] ifFalse:[
-        selectionStartLine isNil ifTrue:[
-            selectionStartLine := selectionEndLine := clickLine.
-            selectionStartCol := selectionEndCol := clickCol.
-        ].
-        oldStartLine := selectionStartLine.
-        oldEndLine := selectionEndLine.
-        oldStartCol := selectionStartCol.
-        oldEndCol := selectionEndCol.
+	selectionStartLine isNil ifTrue:[
+	    selectionStartLine := selectionEndLine := clickLine.
+	    selectionStartCol := selectionEndCol := clickCol.
+	].
+	oldStartLine := selectionStartLine.
+	oldEndLine := selectionEndLine.
+	oldStartCol := selectionStartCol.
+	oldEndCol := selectionEndCol.
     ].
     oldEndLine isNil ifTrue:[
-        oldEndLine := selectionEndLine ? clickLine ? movedLine.
+	oldEndLine := selectionEndLine ? clickLine ? movedLine.
     ].
     oldEndCol isNil ifTrue:[
-        oldEndCol := selectionEndCol ? clickCol.
+	oldEndCol := selectionEndCol ? clickCol.
     ].
 
     "find out if we are before or after initial click"
     movedUp := false.
     clickStartLine isNil ifTrue:[
-        clickStartLine := movedLine.
+	clickStartLine := movedLine.
     ].
     clickStartCol isNil ifTrue:[
-        clickStartCol := movedCol.
+	clickStartCol := movedCol.
     ].
 
     (movedLine < clickStartLine) ifTrue:[
-        movedUp := true
+	movedUp := true
     ] ifFalse:[
-        (movedLine == clickStartLine) ifTrue:[
-            (movedCol < clickStartCol) ifTrue:[
-                movedUp := true
-            ]
-        ]
+	(movedLine == clickStartLine) ifTrue:[
+	    (movedCol < clickStartCol) ifTrue:[
+		movedUp := true
+	    ]
+	]
     ].
 
     movedUp ifTrue:[
-        "change selectionStart"
-        selectionStartCol := movedCol.
-        selectionStartLine := movedLine.
-        selectionEndCol := clickStartCol.
-        selectionEndLine := clickStartLine.
-        selectStyle notNil ifTrue:[
-            selectionEndCol := wordEndCol.
-            selectionEndLine := wordEndLine.
-        ]
+	"change selectionStart"
+	selectionStartCol := movedCol.
+	selectionStartLine := movedLine.
+	selectionEndCol := clickStartCol.
+	selectionEndLine := clickStartLine.
+	selectStyle notNil ifTrue:[
+	    selectionEndCol := wordEndCol.
+	    selectionEndLine := wordEndLine.
+	]
     ] ifFalse:[
-        "change selectionEnd"
-        selectionEndCol := movedCol.
-        selectionEndLine := movedLine.
-        selectionStartCol := clickStartCol.
-        selectionStartLine := clickStartLine.
-        selectStyle notNil ifTrue:[
-            selectionStartCol := wordStartCol.
-            selectionStartLine := wordStartLine.
-        ]
+	"change selectionEnd"
+	selectionEndCol := movedCol.
+	selectionEndLine := movedLine.
+	selectionStartCol := clickStartCol.
+	selectionStartLine := clickStartLine.
+	selectStyle notNil ifTrue:[
+	    selectionStartCol := wordStartCol.
+	    selectionStartLine := wordStartLine.
+	]
     ].
 
     selectionStartLine isNil ifTrue:[^ self].
 
     (selectionStartCol == 0) ifTrue:[
-        selectionStartCol := 1
+	selectionStartCol := 1
     ].
 
     "
      if in word-select, just catch the rest of the word
     "
     (selectStyle notNil and:[selectStyle startsWith:'word']) ifTrue:[
-        movedUp ifTrue:[
-            selectionStartCol := self findBeginOfWordAtLine:selectionStartLine col:selectionStartCol
-        ] ifFalse:[
-            selectionEndCol := self findEndOfWordAtLine:selectionEndLine col:selectionEndCol.
-            selectionEndCol == 0 ifTrue:[
-                selectionEndLine := selectionEndLine + 1
-            ]
-        ].
+	movedUp ifTrue:[
+	    selectionStartCol := self findBeginOfWordAtLine:selectionStartLine col:selectionStartCol
+	] ifFalse:[
+	    selectionEndCol := self findEndOfWordAtLine:selectionEndLine col:selectionEndCol.
+	    selectionEndCol == 0 ifTrue:[
+		selectionEndLine := selectionEndLine + 1
+	    ]
+	].
     ].
 
     selectStyle == #line ifTrue:[
-        movedUp ifTrue:[
-            selectionStartCol := 1.
-        ] ifFalse:[
-            selectionEndCol := 0.
-            selectionEndLine := selectionEndLine + 1
-        ]
+	movedUp ifTrue:[
+	    selectionStartCol := 1.
+	] ifFalse:[
+	    selectionEndCol := 0.
+	    selectionEndLine := selectionEndLine + 1
+	]
     ].
 
     self validateNewSelection.
     aBoolean ifTrue:[
-        self setPrimarySelection.
-        self selectionChanged.
+	self setPrimarySelection.
+	self selectionChanged.
     ].
 
     "/ The searchAction is mantained until a cut/replace or a search with a user selection is done
 "/    self clearSearchAction.
 
     (oldStartLine == selectionStartLine) ifTrue:[
-        (oldStartCol ~~ selectionStartCol) ifTrue:[
-            self
-                redrawLine:oldStartLine
-                      from:((selectionStartCol min:oldStartCol) max:1)
-                        to:((selectionStartCol max:oldStartCol) max:1)
-        ]
+	(oldStartCol ~~ selectionStartCol) ifTrue:[
+	    self
+		redrawLine:oldStartLine
+		      from:((selectionStartCol min:oldStartCol) max:1)
+			to:((selectionStartCol max:oldStartCol) max:1)
+	]
     ] ifFalse:[
-        self
-            redrawFromLine:(oldStartLine?selectionStartLine min:selectionStartLine)
-                        to:(oldStartLine?selectionStartLine max:selectionStartLine)
+	self
+	    redrawFromLine:(oldStartLine?selectionStartLine min:selectionStartLine)
+			to:(oldStartLine?selectionStartLine max:selectionStartLine)
     ].
 
     (oldEndLine == selectionEndLine) ifTrue:[
-        (oldEndCol notNil and:[oldEndCol ~~ selectionEndCol]) ifTrue:[
-            self redrawLine:oldEndLine
-                       from:((selectionEndCol min:oldEndCol) max:1)
-                         to:((selectionEndCol max:oldEndCol) max:1)
-        ]
+	(oldEndCol notNil and:[oldEndCol ~~ selectionEndCol]) ifTrue:[
+	    self redrawLine:oldEndLine
+		       from:((selectionEndCol min:oldEndCol) max:1)
+			 to:((selectionEndCol max:oldEndCol) max:1)
+	]
     ] ifFalse:[
-        selectionEndLine isNil ifTrue:[
-            selectionStartLine := nil.
-            self redraw.
-        ] ifFalse:[
-            (selectionStartLine notNil) ifTrue:[
-                self redrawFromLine:(oldEndLine min:selectionEndLine)
-                                 to:(oldEndLine max:selectionEndLine)
-            ]
-        ]
+	selectionEndLine isNil ifTrue:[
+	    selectionStartLine := nil.
+	    self redraw.
+	] ifFalse:[
+	    (selectionStartLine notNil) ifTrue:[
+		self redrawFromLine:(oldEndLine min:selectionEndLine)
+				 to:(oldEndLine max:selectionEndLine)
+	    ]
+	]
     ].
     clickLine := movedLine.
     clickCol := movedCol
@@ -1950,13 +1954,13 @@
     selectionFgColor isNil ifTrue:[selectionFgColor := bgColor].
     selectionBgColor := DefaultSelectionBackgroundColor.
     selectionBgColor isNil ifTrue:[
-        device hasColors ifTrue:[
+	device hasColors ifTrue:[
             DefaultSelectionForegroundColor isNil ifTrue:[
                 selectionFgColor := fgColor
             ].
             selectionBgColor := Color green
         ] ifFalse:[
-            device hasGrayscales ifTrue:[
+	    device hasGrayscales ifTrue:[
                 DefaultSelectionForegroundColor isNil ifTrue:[
                     selectionFgColor := fgColor
                 ].
@@ -1980,7 +1984,7 @@
     lastSearchIgnoredCase := true.
 
     parenthesisSpecification isNil ifTrue:[
-        parenthesisSpecification := DefaultParenthesisSpecification.
+	parenthesisSpecification := DefaultParenthesisSpecification.
     ].
 
     "I handle menus myself"
@@ -2036,7 +2040,7 @@
         newFont := fp fontFromUserInitial:gc font.
     ].
     newFont notNil ifTrue:[
-        self font:newFont.
+	self font:newFont.
         fp changeFontInAllViews ifTrue:[
             "/ user checked this box - change the defaults,
             "/ and update all other textviews now.
@@ -2226,9 +2230,9 @@
      searchAtBeginOfLineOnlyHolder updateReturnKeyBehavior|
 
     searchBarActionBlock notNil ifTrue:[
-        self resetVariablesBeforeNewSearch.
-        searchBarActionBlock value:#search value:self.
-        ^ self
+	self resetVariablesBeforeNewSearch.
+	searchBarActionBlock value:#search value:self.
+	^ self
     ].
 
     modal := (UserPreferences current searchDialogIsModal).   "/ that's experimental
@@ -2268,49 +2272,49 @@
     self setSearchPatternWithMatchEscapes: match.
 
     lastSearchPattern notNil ifTrue:[
-        initialString := lastSearchPattern.
+	initialString := lastSearchPattern.
     ].
 "/  No longer force the current selection to be the initialString
 "/    self hasSelectionWithinSingleLine ifTrue:[
 "/        initialString := self selection asString.
 "/    ].
     initialString isNil ifTrue:[
-        LastSearchPatterns size > 0 ifTrue:[
-            initialString := LastSearchPatterns first.
-        ]
+	LastSearchPatterns size > 0 ifTrue:[
+	    initialString := LastSearchPatterns first.
+	]
     ].
 
     initialString notNil ifTrue:[
-        patternHolder value:initialString.
+	patternHolder value:initialString.
     ].
 
     fwd := true.
 
     doSearch := [:fwd |
-        |isVariableSearch pattern searchAction|
-
-        self resetVariablesBeforeNewSearch.
-
-        isVariableSearch := self searchVariableVisible
-                                and:[searchVariableHolder value
-                                and:[selectedVariable notNil]].
-
-        isVariableSearch ifTrue:[
+	|isVariableSearch pattern searchAction|
+
+	self resetVariablesBeforeNewSearch.
+
+	isVariableSearch := self searchVariableVisible
+				and:[searchVariableHolder value
+				and:[selectedVariable notNil]].
+
+	isVariableSearch ifTrue:[
             searchAction :=
                 [
                     self searchVariableWithSyntaxElement:selectedVariable forward:fwd
                 ].
-        ] ifFalse:[
-            lastSearchWasVariableSearch := false.
-            LastSearchIgnoredCase := lastSearchIgnoredCase := (caseHolder value not).
-            LastSearchWasMatch := lastSearchWasMatch := matchHolder value.
+	] ifFalse:[
+	    lastSearchWasVariableSearch := false.
+	    LastSearchIgnoredCase := lastSearchIgnoredCase := (caseHolder value not).
+	    LastSearchWasMatch := lastSearchWasMatch := matchHolder value.
             LastSearchWasMatchWithRegex := matchWithRegexHolder value.
             LastSearchWasWrapAtEndOfText := wrapAtEndHolder value.
             LastSearchWasReplace :=replaceBooleanHolder value.
             LastSearchReplacedString := replaceTextHolder value.
 
-            pattern := patternHolder value.
-            pattern notEmptyOrNil ifTrue:[
+	    pattern := patternHolder value.
+	    pattern notEmptyOrNil ifTrue:[
                 searchAction :=
                     [
                         self searchUsingSpec:(
@@ -2325,20 +2329,20 @@
                                 atBeginOfLineOnly:searchAtBeginOfLineOnlyHolder value
                                 wrapAtEnd:wrapAtEndHolder value).
                     ]
-            ]
-        ].
-
-        replaceBooleanHolder value ifTrue:[
+	    ]
+	].
+
+	replaceBooleanHolder value ifTrue:[
             |selStart replacement replaceAction|
 
             replacement := replaceTextHolder value.
-            isVariableSearch ifTrue:[
-                "/ must replace from the end towards beginning,
-                "/ because syntax-elements do not update their position, when
-                "/ the text is changed (in replace).
-
-                selectedVariable := selectedVariable lastElementInChain.
-                self selectFromCharacterPosition:selectedVariable start to:selectedVariable stop.
+	    isVariableSearch ifTrue:[
+		"/ must replace from the end towards beginning,
+		"/ because syntax-elements do not update their position, when
+		"/ the text is changed (in replace).
+
+		selectedVariable := selectedVariable lastElementInChain.
+		self selectFromCharacterPosition:selectedVariable start to:selectedVariable stop.
                 searchAction :=
                     [
                         selectedVariable := selectedVariable previousElement.
@@ -2347,7 +2351,7 @@
                         ].
                         "/ self searchVariableWithSyntaxElement:selectedVariable forward:false
                     ].
-            ].
+	    ].
 
             replaceAction := [ self replace:replacement ]. "/ not implemented here, but in subclasses
             replacePreserveCaseBooleanHolder value ifTrue:[
@@ -2360,10 +2364,10 @@
                 ].
             ].
 
-            selStart := self characterPositionOfSelection.
+	    selStart := self characterPositionOfSelection.
 
             replaceAction value.
-            searchAction value.
+	    searchAction value.
 
             replaceAllBooleanHolder value ifTrue:[
                 [self characterPositionOfSelection ~= selStart] whileTrue:[
@@ -2372,9 +2376,9 @@
                     searchAction value.
                 ]
             ]
-        ] ifFalse:[
-            searchAction value.
-        ].
+	] ifFalse:[
+	    searchAction value.
+	].
     ].
 
     bindings := IdentityDictionary new.
@@ -2413,21 +2417,21 @@
     bindings at:#patternList put:LastSearchPatterns.
 
     self supportsSyntaxElements ifFalse:[
-        bindings at:#searchVariableVisible put:false.
+	bindings at:#searchVariableVisible put:false.
     ] ifTrue:[
-        bindings at:#searchVariableVisible put:true.
-        selectedVariable := self syntaxElementForSelectedVariable.
-        bindings at:#searchVariableEnabled put:(selectedVariable notNil).
-        selectedVariable notNil ifTrue:[
-            bindings
-                at:#stringWithVariableUnderCursorHolder
+	bindings at:#searchVariableVisible put:true.
+	selectedVariable := self syntaxElementForSelectedVariable.
+	bindings at:#searchVariableEnabled put:(selectedVariable notNil).
+	selectedVariable notNil ifTrue:[
+	    bindings
+		at:#stringWithVariableUnderCursorHolder
                 put:(resources string:'Variable ("%1")' with:selectedVariable name).
             "/ searchVariableHolder value:true.
-        ] ifFalse:[
-            bindings
-                at:#stringWithVariableUnderCursorHolder
+	] ifFalse:[
+	    bindings
+		at:#stringWithVariableUnderCursorHolder
                 put:(resources string:'Variable (none selected)').
-        ].
+	].
     ].
     bindings at:#searchVariable put:searchVariableHolder.
 
@@ -2462,20 +2466,20 @@
         ].
 
     replaceBooleanHolder onChangeEvaluate:
-        [
-            replaceBooleanHolder value ifTrue:[
-                (bldr componentAt:#ReplaceEntryField) requestFocus
-            ] ifFalse:[
-                (bldr componentAt:#patternComboBox) requestFocus
-            ].
+	[
+	    replaceBooleanHolder value ifTrue:[
+		(bldr componentAt:#ReplaceEntryField) requestFocus
+	    ] ifFalse:[
+		(bldr componentAt:#patternComboBox) requestFocus
+	    ].
             updateReturnKeyBehavior value.
-        ].
+	].
 
     modal ifTrue:[
-        searchBox := SimpleDialog new.
+	searchBox := SimpleDialog new.
     ] ifFalse:[
-        searchBox := ApplicationModel new.
-        searchBox createBuilder.
+	searchBox := ApplicationModel new.
+	searchBox createBuilder.
         bindings at:#cancel put:[ searchBox closeRequest ].
     ].
     searchBox resources:(self resources).
@@ -2492,16 +2496,16 @@
     modal ifTrue:[
         updateReturnKeyBehavior value.
         searchBox openDialogAtPointer.
-        searchBox accepted ifTrue:[ doSearch value:fwd ].
+	searchBox accepted ifTrue:[ doSearch value:fwd ].
     ] ifFalse:[
-        (bldr componentAt:#nextButton) isReturnButton:false.
-        (bldr componentAt:#cancelButton)
-                label:(resources string:'Close');
-                action:[searchBox closeRequest].
-        "/ searchBox masterApplication:self application.
-        self topView beMaster.
-        searchBox window
-                beSlave;
+	(bldr componentAt:#nextButton) isReturnButton:false.
+	(bldr componentAt:#cancelButton)
+		label:(resources string:'Close');
+		action:[searchBox closeRequest].
+	"/ searchBox masterApplication:self application.
+	self topView beMaster.
+	searchBox window
+		beSlave;
                 openInGroup:(self windowGroup);
                 waitUntilVisible;
                 assignKeyboardFocusToFirstKeyboardConsumer.
@@ -2567,40 +2571,40 @@
     filename := aFilename asFilename.
 
     self withWriteCursorDo:[
-        |aStream|
-
-        (FileStream userInitiatedFileSaveQuerySignal queryWith:filename) ifFalse:[
-            msg := resources
-                        stringWithCRs:'Refused to write file ''%1'' !!\(ST/X internal permission check)'
-                        with:filename name.
-        ] ifTrue:[
-            [
-                doAppend ifTrue:[
-                    aStream := filename appendingWriteStream.
-                ] ifFalse:[
+	|aStream|
+
+	(FileStream userInitiatedFileSaveQuerySignal queryWith:filename) ifFalse:[
+	    msg := resources
+			stringWithCRs:'Refused to write file ''%1'' !!\(ST/X internal permission check)'
+			with:filename name.
+	] ifTrue:[
+	    [
+		doAppend ifTrue:[
+		    aStream := filename appendingWriteStream.
+		] ifFalse:[
                     UserPreferences current generateBackupFileWhenSaving ifTrue:[
                         filename exists ifTrue:[
                             filename moveTo:(filename pathName,'.bak') asFilename
                         ].
                     ].
-                    aStream := filename newReadWriteStream.
-                ].
+		    aStream := filename newReadWriteStream.
+		].
                 aStream eolMode:eolMode.
-                self fileOutContentsOn:aStream compressTabs:compressTabs encoding:externalEncoding.
-                aStream syncData; close.
-                contentsWasSaved := true.
-                defaultFileNameForFileDialog := filename.
-            ] on:FileStream openErrorSignal do:[:ex|
-                msg := resources stringWithCRs:'Cannot write file ''%1'' !!\(%2)'
-                                with:filename name
-                                with:FileStream lastErrorString.
-            ].
-        ].
+		self fileOutContentsOn:aStream compressTabs:compressTabs encoding:externalEncoding.
+		aStream syncData; close.
+		contentsWasSaved := true.
+		defaultFileNameForFileDialog := filename.
+	    ] on:FileStream openErrorSignal do:[:ex|
+		msg := resources stringWithCRs:'Cannot write file ''%1'' !!\(%2)'
+				with:filename name
+				with:FileStream lastErrorString.
+	    ].
+	].
     ].
 
     msg notNil ifTrue:[
-        Dialog warn:msg.
-        ^ false
+	Dialog warn:msg.
+	^ false
     ].
     ^ true
 
@@ -2769,28 +2773,28 @@
     "/ so the following line should be changed to encoderToEncodeFrom:unicode to:xxx.
     encoder := CharacterEncoder encoderToEncodeFrom:gc characterEncoding into:encodingSymOrNil.
     encoder isNullEncoder ifTrue:[
-        (list contains:[:lineOrNil|
-                            |s|
-                            lineOrNil notNil
-                            and:[(s := lineOrNil string string) isWideString
-                            and:[s asSingleByteStringIfPossible isWideString]]
-                       ]
-        ) ifTrue:[
-            (Dialog confirm:'The text contains non-8bit characters. Encode as UTF8?') ifFalse:[
-                ^ self
-            ]
-        ].
-        encoder := CharacterEncoder encoderToEncodeFrom:#unicode into:#utf8
+	(list contains:[:lineOrNil|
+			    |s|
+			    lineOrNil notNil
+			    and:[(s := lineOrNil string string) isWideString
+			    and:[s asSingleByteStringIfPossible isWideString]]
+		       ]
+	) ifTrue:[
+	    (Dialog confirm:'The text contains non-8bit characters. Encode as UTF8?') ifFalse:[
+		^ self
+	    ]
+	].
+	encoder := CharacterEncoder encoderToEncodeFrom:#unicode into:#utf8
     ].
 
     aStream isFileStream ifTrue:[
-        "on some systems, writing linewise is very slow (via NFS)
-         therefore we convert to a string and write it in big chunks.
-         To avoid creating huge strings, we do it in blocks of 1000 lines,
-         limiting temporary string creation to about 50-80k.
-        "
-        startNr := 1.
-        nLines := list size.
+	"on some systems, writing linewise is very slow (via NFS)
+	 therefore we convert to a string and write it in big chunks.
+	 To avoid creating huge strings, we do it in blocks of 1000 lines,
+	 limiting temporary string creation to about 50-80k.
+	"
+	startNr := 1.
+	nLines := list size.
         (aStream eolMode notNil
         and:[aStream eolMode ~= #nl]) ifTrue:[
             "/ must do it lineWise ...
@@ -2834,8 +2838,8 @@
     "/ do we really need this info now?
     "/ on unix, it seems to work with the next two lines commented;
     "/ should probably check on windows too
-    italicFont := font asItalic onDevice:device.
-    boldFont := font asBold onDevice:device.
+    italicFont := font asItalic onDevice:self device.
+    boldFont := font asBold onDevice:self device.
 
     fontHeight := font height.
     fontAscent := font ascent.
@@ -2855,8 +2859,8 @@
     ].
 
     includesNonStrings == true ifTrue:[
-        "/ for now, we do not support variable height entries ...
-        fontHeight := fontHeight max:(list first heightOn:self).
+	"/ for now, we do not support variable height entries ...
+	fontHeight := fontHeight max:(list first heightOn:self).
     ].
     fontHeight := fontHeight + lineSpacing.
 
@@ -3078,13 +3082,13 @@
     "if there is a margin, clear it - a helper for selection drawing"
 
     (leftMargin ~~ 0) ifTrue:[
-        viewOrigin x <= margin ifTrue:[
-            self paint:color.
-            self fillRectangleX:margin-viewOrigin x
-                              y:(self yOfVisibleLine:visLine)- (lineSpacing//2)
-                          width:leftMargin
-                         height:fontHeight
-        ]
+	viewOrigin x <= margin ifTrue:[
+	    self paint:color.
+	    self fillRectangleX:margin-viewOrigin x
+			      y:(self yOfVisibleLine:visLine)- (lineSpacing//2)
+			  width:leftMargin
+			 height:fontHeight
+	]
     ]
 
     "Created: 6.3.1996 / 14:22:55 / cg"
@@ -3221,50 +3225,50 @@
 
     (selectionStartLine notNil and:[selectionEndLine notNil
     and:[ selectionStartCol notNil and:[selectionEndCol notNil]]]) ifTrue:[
-        line := self visibleLineToAbsoluteLine:visLineNr.
-        (line between:selectionStartLine and:selectionEndLine) ifTrue:[
-            (line == selectionStartLine) ifTrue:[
-                (line == selectionEndLine) ifTrue:[
-                    "it's part-of-single-line selection"
-                    self clearMarginOfVisibleLine:visLineNr with:bgColor.
-                    (selectionStartCol > 1) ifTrue:[
-                        super redrawVisibleLine:visLineNr from:1 to:(selectionStartCol - 1)
-                    ].
-                    self drawVisibleLineSelected:visLineNr from:selectionStartCol to:selectionEndCol.
-                    super redrawVisibleLine:visLineNr from:(selectionEndCol + 1).
-                    ^ self
-                ].
-
-                "it's the first line of a multi-line selection"
-                (selectionStartCol ~~ 1) ifTrue:[
-                    self clearMarginOfVisibleLine:visLineNr with:bgColor.
-                    super redrawVisibleLine:visLineNr from:1 to:(selectionStartCol - 1)
-                ] ifFalse:[
-                    viewOrigin x == 0 ifTrue:[
-                        self clearMarginOfVisibleLine:visLineNr with:self currentSelectionBgColor.
-                    ]
-                ].
-                self drawVisibleLineSelected:visLineNr from:selectionStartCol.
-                ^ self
-            ].
-
-            (line == selectionEndLine) ifTrue:[
-                "it's the last line of a multi-line selection"
-                (selectionEndCol == 0) ifTrue:[
-                    ^ super redrawVisibleLine:visLineNr
-                ].
-
-                self clearMarginOfVisibleLine:visLineNr with:self currentSelectionBgColor.
-                self drawVisibleLineSelected:visLineNr from:1 to:selectionEndCol.
-                super redrawVisibleLine:visLineNr from:(selectionEndCol + 1).
-                ^ self
-            ].
-
-            "it's a full line in a multi-line selection"
-            self clearMarginOfVisibleLine:visLineNr with:self currentSelectionBgColor.
-            self drawVisibleLineSelected:visLineNr.
-            ^ self
-        ]
+	line := self visibleLineToAbsoluteLine:visLineNr.
+	(line between:selectionStartLine and:selectionEndLine) ifTrue:[
+	    (line == selectionStartLine) ifTrue:[
+		(line == selectionEndLine) ifTrue:[
+		    "it's part-of-single-line selection"
+		    self clearMarginOfVisibleLine:visLineNr with:bgColor.
+		    (selectionStartCol > 1) ifTrue:[
+			super redrawVisibleLine:visLineNr from:1 to:(selectionStartCol - 1)
+		    ].
+		    self drawVisibleLineSelected:visLineNr from:selectionStartCol to:selectionEndCol.
+		    super redrawVisibleLine:visLineNr from:(selectionEndCol + 1).
+		    ^ self
+		].
+
+		"it's the first line of a multi-line selection"
+		(selectionStartCol ~~ 1) ifTrue:[
+		    self clearMarginOfVisibleLine:visLineNr with:bgColor.
+		    super redrawVisibleLine:visLineNr from:1 to:(selectionStartCol - 1)
+		] ifFalse:[
+		    viewOrigin x == 0 ifTrue:[
+			self clearMarginOfVisibleLine:visLineNr with:self currentSelectionBgColor.
+		    ]
+		].
+		self drawVisibleLineSelected:visLineNr from:selectionStartCol.
+		^ self
+	    ].
+
+	    (line == selectionEndLine) ifTrue:[
+		"it's the last line of a multi-line selection"
+		(selectionEndCol == 0) ifTrue:[
+		    ^ super redrawVisibleLine:visLineNr
+		].
+
+		self clearMarginOfVisibleLine:visLineNr with:self currentSelectionBgColor.
+		self drawVisibleLineSelected:visLineNr from:1 to:selectionEndCol.
+		super redrawVisibleLine:visLineNr from:(selectionEndCol + 1).
+		^ self
+	    ].
+
+	    "it's a full line in a multi-line selection"
+	    self clearMarginOfVisibleLine:visLineNr with:self currentSelectionBgColor.
+	    self drawVisibleLineSelected:visLineNr.
+	    ^ self
+	]
     ].
     super redrawVisibleLine:visLineNr
 
@@ -3281,18 +3285,18 @@
     "/
     (selectionStartLine notNil and:[selectionEndLine notNil
     and:[ selectionStartCol notNil and:[selectionEndCol notNil]]]) ifTrue:[
-        line := self visibleLineToAbsoluteLine:visLine.
-        (line between:selectionStartLine and:selectionEndLine) ifTrue:[
-            ((line == selectionStartLine)
-            and: [col < selectionStartCol]) ifFalse:[
-                ((line == selectionEndLine)
-                and: [col > selectionEndCol]) ifFalse:[
-                    "its in the selection"
-                    self drawVisibleLineSelected:visLine col:col.
-                    ^ self.
-                ]
-            ]
-        ]
+	line := self visibleLineToAbsoluteLine:visLine.
+	(line between:selectionStartLine and:selectionEndLine) ifTrue:[
+	    ((line == selectionStartLine)
+	    and: [col < selectionStartCol]) ifFalse:[
+		((line == selectionEndLine)
+		and: [col > selectionEndCol]) ifFalse:[
+		    "its in the selection"
+		    self drawVisibleLineSelected:visLine col:col.
+		    ^ self.
+		]
+	    ]
+	]
     ].
     self drawVisibleLine:visLine col:col with:fgColor and:bgColor
 
@@ -3339,75 +3343,75 @@
     allOut := false.
     (selectionStartLine isNil or:[selectionEndLine isNil
     or:[selectionStartCol isNil or:[selectionEndCol isNil]]]) ifTrue:[
-        allOut := true
+	allOut := true
     ] ifFalse:[
-        (line between:selectionStartLine and:selectionEndLine) ifFalse:[
-            allOut := true
-        ] ifTrue:[
-            (selectionStartLine == selectionEndLine) ifTrue:[
-                ((endCol < selectionStartCol)
-                or:[startCol > selectionEndCol]) ifTrue:[
-                    allOut := true
-                ] ifFalse:[
-                    ((startCol >= selectionStartCol)
-                    and:[endCol <= selectionEndCol]) ifTrue:[
-                        allIn := true
-                    ]
-                ]
-            ] ifFalse:[
-                (line == selectionStartLine) ifTrue:[
-                    (endCol < selectionStartCol) ifTrue:[
-                        allOut := true
-                    ] ifFalse:[
-                        (startCol >= selectionStartCol) ifTrue:[
-                            allIn := true
-                        ]
-                    ]
-                ] ifFalse:[
-                    (line == selectionEndLine) ifTrue:[
-                        (startCol > selectionEndCol) ifTrue:[
-                            allOut := true
-                        ] ifFalse:[
-                            (endCol <= selectionEndCol) ifTrue:[
-                                allIn := true
-                            ]
-                        ]
-                    ] ifFalse:[
-                        allIn := true
-                    ]
-                ]
-            ]
-        ]
+	(line between:selectionStartLine and:selectionEndLine) ifFalse:[
+	    allOut := true
+	] ifTrue:[
+	    (selectionStartLine == selectionEndLine) ifTrue:[
+		((endCol < selectionStartCol)
+		or:[startCol > selectionEndCol]) ifTrue:[
+		    allOut := true
+		] ifFalse:[
+		    ((startCol >= selectionStartCol)
+		    and:[endCol <= selectionEndCol]) ifTrue:[
+			allIn := true
+		    ]
+		]
+	    ] ifFalse:[
+		(line == selectionStartLine) ifTrue:[
+		    (endCol < selectionStartCol) ifTrue:[
+			allOut := true
+		    ] ifFalse:[
+			(startCol >= selectionStartCol) ifTrue:[
+			    allIn := true
+			]
+		    ]
+		] ifFalse:[
+		    (line == selectionEndLine) ifTrue:[
+			(startCol > selectionEndCol) ifTrue:[
+			    allOut := true
+			] ifFalse:[
+			    (endCol <= selectionEndCol) ifTrue:[
+				allIn := true
+			    ]
+			]
+		    ] ifFalse:[
+			allIn := true
+		    ]
+		]
+	    ]
+	]
     ].
     allOut ifTrue:[
-        super redrawVisibleLine:visLine from:startCol to:endCol.
-        ^ self
+	super redrawVisibleLine:visLine from:startCol to:endCol.
+	^ self
     ].
 
     allIn ifTrue:[
-        self drawVisibleLineSelected:visLine from:startCol to:endCol
+	self drawVisibleLineSelected:visLine from:startCol to:endCol
     ] ifFalse:[
-        "redraw part before selection"
-        ((line == selectionStartLine)
-         and:[startCol <= selectionStartCol]) ifTrue:[
-            super redrawVisibleLine:visLine from:startCol
-                                              to:(selectionStartCol - 1).
-            leftCol := selectionStartCol
-        ] ifFalse:[
-            leftCol := startCol
-        ].
-        "redraw selected part"
-        (selectionEndLine > line) ifTrue:[
-            rightCol := endCol
-        ] ifFalse:[
-            rightCol := selectionEndCol min:endCol
-        ].
-        self drawVisibleLineSelected:visLine from:leftCol to:rightCol.
-
-        "redraw part after selection"
-        (rightCol < endCol) ifTrue:[
-            super redrawVisibleLine:visLine from:(rightCol + 1) to:endCol
-        ]
+	"redraw part before selection"
+	((line == selectionStartLine)
+	 and:[startCol <= selectionStartCol]) ifTrue:[
+	    super redrawVisibleLine:visLine from:startCol
+					      to:(selectionStartCol - 1).
+	    leftCol := selectionStartCol
+	] ifFalse:[
+	    leftCol := startCol
+	].
+	"redraw selected part"
+	(selectionEndLine > line) ifTrue:[
+	    rightCol := endCol
+	] ifFalse:[
+	    rightCol := selectionEndCol min:endCol
+	].
+	self drawVisibleLineSelected:visLine from:leftCol to:rightCol.
+
+	"redraw part after selection"
+	(rightCol < endCol) ifTrue:[
+	    super redrawVisibleLine:visLine from:(rightCol + 1) to:endCol
+	]
     ].
 
     "special care for first and last line of selection:
@@ -3417,14 +3421,14 @@
     and:[(startCol == 1)
     and:[selectionStartLine < selectionEndLine]])
     ifTrue:[
-        self clearMarginOfVisibleLine:visLine with:self currentSelectionBgColor.
+	self clearMarginOfVisibleLine:visLine with:self currentSelectionBgColor.
     ].
 
     ((line == selectionStartLine)
     and:[(startCol == 1)
     and:[selectionStartLine < selectionEndLine]])
     ifTrue:[
-        self clearMarginOfVisibleLine:visLine with:bgColor.
+	self clearMarginOfVisibleLine:visLine with:bgColor.
     ].
 
     ((line > selectionStartLine)
@@ -3432,7 +3436,7 @@
     and:[selectionStartLine < selectionEndLine
     and:[line < selectionEndLine]]])
     ifTrue:[
-        self clearMarginOfVisibleLine:visLine with:self currentSelectionBgColor.
+	self clearMarginOfVisibleLine:visLine with:self currentSelectionBgColor.
     ]
 
     "Modified: 6.3.1996 / 14:23:26 / cg"
@@ -4624,31 +4628,31 @@
     |l t|
 
     selectionStartLine notNil ifTrue:[
-        expandingTop == true ifTrue:[
-            l := selectionStartLine.
-            selectionStartLine := selectionStartLine + 1.
-            (selectionStartLine > clickLine
-            or:[selectionStartLine == clickLine and:[selectionStartCol > clickCol]])
-            ifTrue:[
-                t := selectionStartLine.
-                selectionStartLine := selectionEndLine.
-                selectionEndLine := t.
-                t := selectionStartCol.
-                selectionStartCol := selectionEndCol.
-                selectionEndCol := t.
-                expandingTop := false
-            ].
-        ] ifFalse:[
-            l := selectionEndLine.
-            selectionEndLine := selectionEndLine + 1.
-        ].
+	expandingTop == true ifTrue:[
+	    l := selectionStartLine.
+	    selectionStartLine := selectionStartLine + 1.
+	    (selectionStartLine > clickLine
+	    or:[selectionStartLine == clickLine and:[selectionStartCol > clickCol]])
+	    ifTrue:[
+		t := selectionStartLine.
+		selectionStartLine := selectionEndLine.
+		selectionEndLine := t.
+		t := selectionStartCol.
+		selectionStartCol := selectionEndCol.
+		selectionEndCol := t.
+		expandingTop := false
+	    ].
+	] ifFalse:[
+	    l := selectionEndLine.
+	    selectionEndLine := selectionEndLine + 1.
+	].
 "/        self redrawLine:l.
 "/        self redrawLine:l+1.
-        self validateNewSelection.
-        self setPrimarySelection.
-        self selectionChanged.
-        self redrawFromLine:l to:l+1.
-        self makeSelectionVisible.
+	self validateNewSelection.
+	self setPrimarySelection.
+	self selectionChanged.
+	self redrawFromLine:l to:l+1.
+	self makeSelectionVisible.
     ].
 
     "Created: / 01-03-1996 / 23:35:08 / cg"
@@ -4660,34 +4664,34 @@
     |c l t c1 c2|
 
     selectionStartLine notNil ifTrue:[
-        expandingTop == true ifTrue:[
-            selectionStartCol == 0 ifTrue:[^ self].
-            l := selectionStartLine.
-            selectionStartCol := (selectionStartCol - 1) max:1.
-            c := selectionStartCol.
-        ] ifFalse:[
-            l := selectionEndLine.
-            selectionEndCol := (selectionEndCol - 1) max:0.
-            c := selectionEndCol.
-            selectionEndLine == selectionStartLine ifTrue:[
-                selectionEndCol <= selectionStartCol ifTrue:[
-                    t := selectionStartCol. selectionStartCol := selectionEndCol.
-                    selectionEndCol := t.
-                    expandingTop := true.
-                    c := selectionStartCol.
-                ]
-            ].
-        ].
-        c1 := c.
-        c2 := c1 + 1.
-        c1 == 0 ifTrue:[
-            c1 := 1
-        ].
-        self validateNewSelection.
-        self setPrimarySelection.
-        self selectionChanged.
-        self redrawLine:l from:c1 to:c2.
-        self makeSelectionVisible.
+	expandingTop == true ifTrue:[
+	    selectionStartCol == 0 ifTrue:[^ self].
+	    l := selectionStartLine.
+	    selectionStartCol := (selectionStartCol - 1) max:1.
+	    c := selectionStartCol.
+	] ifFalse:[
+	    l := selectionEndLine.
+	    selectionEndCol := (selectionEndCol - 1) max:0.
+	    c := selectionEndCol.
+	    selectionEndLine == selectionStartLine ifTrue:[
+		selectionEndCol <= selectionStartCol ifTrue:[
+		    t := selectionStartCol. selectionStartCol := selectionEndCol.
+		    selectionEndCol := t.
+		    expandingTop := true.
+		    c := selectionStartCol.
+		]
+	    ].
+	].
+	c1 := c.
+	c2 := c1 + 1.
+	c1 == 0 ifTrue:[
+	    c1 := 1
+	].
+	self validateNewSelection.
+	self setPrimarySelection.
+	self selectionChanged.
+	self redrawLine:l from:c1 to:c2.
+	self makeSelectionVisible.
     ].
 
     "Modified: / 18-03-1996 / 17:05:46 / cg"
@@ -4698,29 +4702,29 @@
     |l c t|
 
     selectionStartLine notNil ifTrue:[
-        expandingTop == true ifTrue:[
-            l := selectionStartLine.
-            c := selectionStartCol.
-            selectionStartCol := selectionStartCol + 1.
-            l == selectionEndLine ifTrue:[
-                c >= selectionEndCol ifTrue:[
-                    expandingTop := false.
-                    t := selectionStartCol. selectionStartCol := selectionEndCol.
-                    selectionEndCol := t.
-                    c := selectionStartCol.
-                ]
-            ]
-        ] ifFalse:[
-            l := selectionEndLine.
-            c := selectionEndCol.
-            selectionEndCol := selectionEndCol + 1.
-        ].
-
-        self validateNewSelection.
-        self setPrimarySelection.
-        self selectionChanged.
-        self redrawLine:l from:(c max:1) to:c+1.
-        self makeSelectionVisible.
+	expandingTop == true ifTrue:[
+	    l := selectionStartLine.
+	    c := selectionStartCol.
+	    selectionStartCol := selectionStartCol + 1.
+	    l == selectionEndLine ifTrue:[
+		c >= selectionEndCol ifTrue:[
+		    expandingTop := false.
+		    t := selectionStartCol. selectionStartCol := selectionEndCol.
+		    selectionEndCol := t.
+		    c := selectionStartCol.
+		]
+	    ]
+	] ifFalse:[
+	    l := selectionEndLine.
+	    c := selectionEndCol.
+	    selectionEndCol := selectionEndCol + 1.
+	].
+
+	self validateNewSelection.
+	self setPrimarySelection.
+	self selectionChanged.
+	self redrawLine:l from:(c max:1) to:c+1.
+	self makeSelectionVisible.
     ].
 
     "Created: / 01-03-1996 / 23:33:17 / cg"
@@ -4732,33 +4736,33 @@
     |l t|
 
     selectionStartLine notNil ifTrue:[
-        expandingTop == true ifTrue:[
-            selectionStartLine := (selectionStartLine - 1) max:1.
-            l := selectionStartLine.
-        ] ifFalse:[
-            selectionEndLine := (selectionEndLine - 1) max:0.
-
-            l := selectionEndLine.
-            (selectionEndLine < clickLine
-            or:[(selectionEndLine == clickLine and:[selectionEndCol < clickCol])])
-            ifTrue:[
-                t := selectionStartLine.
-                selectionStartLine := selectionEndLine.
-                selectionEndLine := t.
-                t := selectionStartCol.
-                selectionStartCol := selectionEndCol.
-                selectionEndCol := t.
-                l := selectionStartLine.
-                expandingTop := true
-            ].
-        ].
-        self validateNewSelection.
-        self setPrimarySelection.
-        self selectionChanged.
-        "/ self redrawLine:l.
-        "/ self redrawLine:l+1.
-        self redrawFromLine:l to:l+1.
-        self makeSelectionVisible.
+	expandingTop == true ifTrue:[
+	    selectionStartLine := (selectionStartLine - 1) max:1.
+	    l := selectionStartLine.
+	] ifFalse:[
+	    selectionEndLine := (selectionEndLine - 1) max:0.
+
+	    l := selectionEndLine.
+	    (selectionEndLine < clickLine
+	    or:[(selectionEndLine == clickLine and:[selectionEndCol < clickCol])])
+	    ifTrue:[
+		t := selectionStartLine.
+		selectionStartLine := selectionEndLine.
+		selectionEndLine := t.
+		t := selectionStartCol.
+		selectionStartCol := selectionEndCol.
+		selectionEndCol := t.
+		l := selectionStartLine.
+		expandingTop := true
+	    ].
+	].
+	self validateNewSelection.
+	self setPrimarySelection.
+	self selectionChanged.
+	"/ self redrawLine:l.
+	"/ self redrawLine:l+1.
+	self redrawFromLine:l to:l+1.
+	self makeSelectionVisible.
     ].
 
     "Modified: / 06-03-1996 / 14:12:06 / cg"
@@ -4861,7 +4865,7 @@
     |line1 col1 line2 col2|
 
     pos1 > pos2 ifTrue:[
-        ^ self unselect
+	^ self unselect
     ].
     line1 := self lineOfCharacterPosition:pos1.
     col1 := pos1 - (self characterPositionOfLine:line1 col:1) + 1.
@@ -4876,44 +4880,51 @@
 selectFromLine:startLine col:startCol toLine:endLine col:endCol
     "select a piece of text and redraw that area"
 
-    ((selectionStartLine = startLine)
-      and:[ (selectionStartCol = startCol)
-      and:[ (selectionEndLine = endLine)
-      and:[ (selectionEndCol = endCol) ]]]) ifTrue:[^ self ].
-
-    self unselect.
+    | oldStartCol oldEndCol oldStartLine oldEndLine |
+
+    oldStartCol := selectionStartCol ? startCol.
+    oldStartLine := selectionStartLine ? startLine.
+    oldEndCol := selectionEndCol ? endCol.
+    oldEndLine := selectionEndLine ? endLine.  
+
+    self unselectWithoutRedraw.
     startLine notNil ifTrue:[
-        "new:"
-        endLine < startLine ifTrue:[
-            ^ self selectFromLine:endLine col:endCol toLine:startLine col:startCol
-        ].
-        (endLine == startLine and:[endCol < startCol]) ifTrue:[
-            endCol ~~ 0 ifTrue:[
-                self selectFromLine:endLine col:endCol toLine:startLine col:startCol.
-            ].
-            ^ self
-        ].
-
-" old:
-        endLine < startLine ifTrue:[^ self].
-        (startLine == endLine and:[endCol < startCol]) ifTrue:[^ self].
-"
-        selectionStartLine := startLine.
-        selectionStartCol := startCol.
-        selectionEndLine := endLine.
-        selectionEndCol := endCol.
-        self validateNewSelection.
-        self setPrimarySelection.
-        self selectionChanged.
-
-        (selectionStartLine == selectionEndLine) ifTrue:[
-            self redrawLine:selectionStartLine from:selectionStartCol to:selectionEndCol
-        ] ifFalse:[
-            selectionStartLine to:selectionEndLine do:[:lineNr |
-                self redrawLine:lineNr
-            ]
-        ].
-        selectStyle := nil.
+	"new:"
+	endLine < startLine ifTrue:[
+	    ^ self selectFromLine:endLine col:endCol toLine:startLine col:startCol
+	].
+	(endLine == startLine and:[endCol < startCol]) ifTrue:[
+	    endCol ~~ 0 ifTrue:[
+		self selectFromLine:endLine col:endCol toLine:startLine col:startCol.
+	    ].
+	    ^ self
+	].
+
+        " old:
+	endLine < startLine ifTrue:[^ self].
+	(startLine == endLine and:[endCol < startCol]) ifTrue:[^ self].
+        "
+
+	selectionStartLine := startLine.
+	selectionStartCol := startCol.
+	selectionEndLine := endLine.
+	selectionEndCol := endCol.
+	self validateNewSelection.
+	self setPrimarySelection.
+	self selectionChanged.
+
+        (selectionStartLine == selectionEndLine 
+            and:[oldStartLine == selectionStartLine 
+                and:[oldEndLine == selectionEndLine]]) ifTrue:[
+                    self redrawLine:selectionStartLine 
+                               from:(selectionStartCol min: oldStartCol) 
+                                 to:(selectionEndCol max: oldEndCol)
+                ] ifFalse:[
+                    (selectionStartLine min: oldStartLine) to: (selectionEndLine max: oldEndLine) do:[:lineNr |
+                        self redrawLine:lineNr
+                    ]
+                ].
+	selectStyle := nil.
     ]
 
     "
@@ -4929,7 +4940,7 @@
     "
 
     "Modified: / 02-01-1997 / 13:32:25 / cg"
-    "Modified: / 17-04-2012 / 21:00:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 28-08-2013 / 01:16:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 selectFromLine:startLine toLine:endLine
@@ -5204,6 +5215,11 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !
 
 
--- a/stx_libwidg.st	Thu Sep 01 12:31:56 2016 +0200
+++ b/stx_libwidg.st	Fri Sep 02 17:42:50 2016 +0100
@@ -49,6 +49,52 @@
 "
 ! !
 
+!stx_libwidg class methodsFor:'accessing - hg - settings'!
+
+hgEnsureCopyrightMethod
+    "If true, then #copyright method is automatically compiled in each class
+     (but iff project definition defines it)
+
+     Default is true (compile such method) but if the repository is mirror of CVS and
+     you want to merge back to CVS at some point, you may want to not compile them
+     to keep changes against CVS minimal"
+
+    ^false
+
+    "Created: / 09-10-2013 / 15:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hgEnsureVersion_HGMethod
+    "If true, then #version_HG method is automatically compiled in each class.
+
+     Default is true (compile such method) but if the repository is mirror of CVS and
+     you want to merge back to CVS at some point, you may want to not compile them
+     to keep changes against CVS minimal. 
+
+     If false, version_HG is compiled only in classes that has been modified
+     and commited.
+
+     Note that Mercurial can live without them
+     just fine"
+
+    ^false
+
+    "Created: / 09-10-2013 / 15:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hgRemoveContainesForDeletedClasses
+    "If true, then containers for removed classes are __AUTOMATICALLY__ removed from the
+     repositoru. If false, obsolete containes are kept.
+
+     Default is true (remove obsolete containers) but if the repository is mirror of CVS and
+     you want to merge back to CVS at some point, you may want to return false to avoid deletions
+     of obsolete files. Usefull when branching off an old CVS repo with loads of mess."
+
+    ^false
+
+    "Created: / 09-10-2013 / 15:39:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !stx_libwidg class methodsFor:'description'!
 
 excludedFromPreRequisites
@@ -254,5 +300,9 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+    ^ '$Changeset: <not expanded> $'
 ! !
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/EditTextViewTests.st	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,56 @@
+"{ Package: 'stx:libwidg/tests' }"
+
+"{ NameSpace: Smalltalk }"
+
+TestCase subclass:#EditTextViewTests
+	instanceVariableNames:'textView textViewInteractor'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Views-Text-Tests'
+!
+
+!EditTextViewTests methodsFor:'running'!
+
+setUp
+    | topView |
+
+    Smalltalk loadPackage: 'stx:goodies/sunitext/ui'.
+
+    topView := StandardSystemView new.
+    topView extent: 320 @ 200.
+    topView label: self printString.
+    textView := EditTextView origin: 0.0@0.0 extent: 1.0@1.0 in: topView.
+    textViewInteractor := textView interactor.
+
+
+    topView open.
+    topView waitUntilVisible.
+
+    "Created: / 23-07-2014 / 07:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-02-2015 / 08:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+tearDown
+    textView topView destroy.
+
+    "Created: / 23-07-2014 / 07:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-02-2015 / 08:17:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!EditTextViewTests methodsFor:'tests'!
+
+test_01
+    textView contents: 'Hello, here is Smalltalk X'.
+    textView setCursorCol: 14.
+
+    textViewInteractor type: #SelectWord.
+    self assert: textView selectionAsString = 'is'.
+
+    textViewInteractor type: #CtrlShiftCursorRight.
+    textViewInteractor type: #CtrlShiftCursorRight.
+
+    self assert: textView selectionAsString = 'is Smalltalk'.
+
+    "Created: / 24-02-2015 / 08:21:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/Make.proto	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,144 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libwidg_tests.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# The Makefile as generated by this Make.proto supports the following targets:
+#    make         - compile all st-files to a classLib
+#    make clean   - clean all temp files
+#    make clobber - clean all
+#
+# This file contains definitions for Unix based platforms.
+# It shares common definitions with the win32-make in Make.spec.
+
+#
+# position (of this package) in directory hierarchy:
+# (must point to ST/X top directory, for tools and includes)
+TOP=../..
+INCLUDE_TOP=$(TOP)/..
+
+# subdirectories where targets are to be made:
+SUBDIRS=
+
+
+# subdirectories where Makefiles are to be made:
+# (only define if different from SUBDIRS)
+# ALLSUBDIRS=
+
+REQUIRED_SUPPORT_DIRS=
+
+# if your embedded C code requires any system includes,
+# add the path(es) here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALINCLUDES=-Ifoo -Ibar
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/smallsense -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg
+
+
+# if you need any additional defines for embedded C code,
+# add them here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
+LOCALDEFINES=
+
+LIBNAME=libstx_libwidg_tests
+STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=.  -varPrefix=$(LIBNAME)
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C-libraries that should be pre-linked with the class-objects
+LD_OBJ_LIBS=
+LOCAL_SHARED_LIBS=
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C targets or libraries should be added below
+LOCAL_EXTRA_TARGETS=
+
+OBJS= $(COMMON_OBJS) $(UNIX_OBJS)
+
+
+
+all:: preMake classLibRule postMake
+
+pre_objs::  
+
+
+
+
+
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
+stx_libwidg_tests.$(O): $(shell hg root)/.hg/dirstate
+endif
+
+
+
+
+# run default testsuite for this package
+test: $(TOP)/goodies/builder/reports
+	$(MAKE) -C $(TOP)/goodies/builder/reports -f Makefile.init
+	$(TOP)/goodies/builder/reports/report-runner.sh -D . -r Builder::TestReport -p $(PACKAGE)
+
+
+
+# add more install actions here
+install::
+
+# add more install actions for aux-files (resources) here
+installAux::
+
+# add more preMake actions here
+preMake::
+
+# add more postMake actions here
+postMake:: cleanjunk
+
+# build all mandatory prerequisite packages (containing superclasses) for this package
+prereq:
+	cd ../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/refactoryBrowser/helpers && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/regex && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/refactoryBrowser/browser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/refactoryBrowser/lint && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libhtml && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libwidg2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libtool && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/smallsense && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+# build all packages containing referenced classes for this package
+# they are not needed to compile the package (but later, to load it)
+references:
+
+
+cleanjunk::
+	-rm -f *.s *.s2
+
+clean::
+	-rm -f *.o *.H
+
+clobber:: clean
+	-rm -f *.so *.dll
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)stx_libwidg_tests.$(O) stx_libwidg_tests.$(H): stx_libwidg_tests.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/Make.spec	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,63 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libwidg_tests.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains specifications which are common to all platforms.
+#
+
+# Do NOT CHANGE THESE DEFINITIONS
+# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
+#  to find the source code of a class and to find the library for a package)
+MODULE=stx
+MODULE_DIR=libwidg/tests
+PACKAGE=$(MODULE):$(MODULE_DIR)
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -headerDir=. : create header files locally
+#                (if removed, they will be created as common
+#  -Pxxx       : defines the package
+#  -Zxxx       : a prefix for variables within the classLib
+#  -Dxxx       : defines passed to to CC for inline C-code
+#  -Ixxx       : include path passed to CC for inline C-code
+#  +optspace   : optimized for space
+#  +optspace2  : optimized more for space
+#  +optspace3  : optimized even more for space
+#  +optinline  : generate inline code for some ST constructs
+#  +inlineNew  : additionally inline new
+#  +inlineMath : additionally inline some floatPnt math stuff
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
+# STCLOCALOPTIMIZATIONS=+optspace3
+STCLOCALOPTIMIZATIONS=+optspace3
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -warn            : no warnings
+#  -warnNonStandard : no warnings about ST/X extensions
+#  -warnEOLComments : no warnings about EOL comment extension
+#  -warnPrivacy     : no warnings about privateClass extension
+#  -warnUnused      : no warnings about unused variables
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCWARNINGS=-warn
+# STCWARNINGS=-warnNonStandard
+# STCWARNINGS=-warnEOLComments
+STCWARNINGS=-warnNonStandard
+
+COMMON_CLASSES= \
+	stx_libwidg_tests \
+
+
+
+
+COMMON_OBJS= \
+    $(OUTDIR_SLASH)stx_libwidg_tests.$(O) \
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/Makefile.init	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,27 @@
+#
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
+#
+# MACOSX caveat:
+#   as filenames are not case sensitive (in a default setup),
+#   we cannot use the above trick. Therefore, this file is now named
+#   "Makefile.init", and you have to execute "make -f Makefile.init" to
+#   get the initial makefile.  This is now also done by the toplevel CONFIG
+#   script.
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile: mf
+
+mf:
+	$(TOP)/rules/stmkmf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/abbrev.stc	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,5 @@
+# automagically generated by the project definition
+# this file is needed for stc to be able to compile modules independently.
+# it provides information about a classes filename, category and especially namespace.
+EditTextViewTests EditTextViewTests stx:libwidg/tests 'Views-Text-Tests' 1
+stx_libwidg_tests stx_libwidg_tests stx:libwidg/tests '* Projects & Packages *' 3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/bc.mak	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,99 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libwidg_tests.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# Notice, that the name bc.mak is historical (from times, when only borland c was supported).
+# This file contains make rules for the win32 platform using either borland-bcc or visual-c.
+# It shares common definitions with the unix-make in Make.spec.
+# The bc.mak supports the following targets:
+#    bmake         - compile all st-files to a classLib (dll)
+#    bmake clean   - clean all temp files
+#    bmake clobber - clean all
+#
+# Historic Note:
+#  this used to contain only rules to make with borland
+#    (called via bmake, by "make.exe -f bc.mak")
+#  this has changed; it is now also possible to build using microsoft visual c
+#    (called via vcmake, by "make.exe -f bc.mak -DUSEVC")
+#
+TOP=..\..
+INCLUDE_TOP=$(TOP)\..
+
+
+
+!INCLUDE $(TOP)\rules\stdHeader_bc
+
+!INCLUDE Make.spec
+
+LIBNAME=libstx_libwidg_tests
+MODULE_PATH=libwidg\tests
+RESFILES=tests.$(RES)
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\smallsense -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg
+LOCALDEFINES=
+
+STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
+LOCALLIBS=
+
+OBJS= $(COMMON_OBJS) $(WIN32_OBJS)
+
+ALL::  classLibRule
+
+classLibRule: $(OUTDIR) $(OUTDIR)$(LIBNAME).dll
+
+!INCLUDE $(TOP)\rules\stdRules_bc
+
+# build all mandatory prerequisite packages (containing superclasses) for this package
+prereq:
+	pushd ..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\refactoryBrowser\helpers & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\regex & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\refactoryBrowser\browser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\refactoryBrowser\lint & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libhtml & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\smallsense & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+
+
+
+test: $(TOP)\goodies\builder\reports\NUL
+	pushd $(TOP)\goodies\builder\reports & $(MAKE_BAT)
+	$(TOP)\goodies\builder\reports\report-runner.bat -D . -r Builder::TestReport -p $(PACKAGE)
+        
+clean::
+	del *.$(CSUFFIX)
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)stx_libwidg_tests.$(O) stx_libwidg_tests.$(H): stx_libwidg_tests.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
+# **Must be at end**
+
+# Enforce recompilation of package definition class if Mercurial working
+# copy state changes. Together with --guessVersion it ensures that package
+# definition class always contains correct binary revision string.
+!IFDEF HGROOT
+$(OUTDIR)stx_libwidg_tests.$(O): $(HGROOT)\.hg\dirstate
+!ENDIF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/bmake.bat	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,12 @@
+@REM -------
+@REM make using Borland bcc32
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+make.exe -N -f bc.mak  %DEFINES% %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lccmake.bat	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lccmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak -DUSELCC=1 %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/libInit.cc	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,34 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_libwidg_tests.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_libwidg_tests_Init() INIT_TEXT_SECTION;
+DLL_EXPORT void _libstx_libwidg_tests_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+void _libstx_libwidg_tests_InitDefinition(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_libwidg_tests__DFN", _libstx_libwidg_tests_InitDefinition, "stx:libwidg/tests");
+_stx_137libwidg_137tests_Init(pass,__pRT__,snd);
+
+__END_PACKAGE__();
+}
+
+void _libstx_libwidg_tests_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_libwidg_tests", _libstx_libwidg_tests_Init, "stx:libwidg/tests");
+_stx_137libwidg_137tests_Init(pass,__pRT__,snd);
+
+
+__END_PACKAGE__();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mingwmake.bat	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,16 @@
+@REM -------
+@REM make using mingw gnu compiler
+@REM type mingwmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+
+@pushd ..\..\rules
+@call find_mingw.bat
+@popd
+make.exe -N -f bc.mak %DEFINES% %USEMINGW_ARG% %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/stx_libwidg_tests.st	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,123 @@
+"{ Package: 'stx:libwidg/tests' }"
+
+"{ NameSpace: Smalltalk }"
+
+LibraryDefinition subclass:#stx_libwidg_tests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'* Projects & Packages *'
+!
+
+
+!stx_libwidg_tests class methodsFor:'description'!
+
+excludedFromPreRequisites
+    "list packages which are to be explicitely excluded from the automatic constructed
+     prerequisites list. If empty, everything that is found along the inheritance of any of
+     my classes is considered to be a prerequisite package."
+
+    ^ #(
+    )
+!
+
+mandatoryPreRequisites
+    "list packages which are mandatory as a prerequisite.
+     This are packages containing superclasses of my classes and classes which
+     are extended by myself.
+     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
+     This method is generated automatically,
+     by searching along the inheritance chain of all of my classes."
+
+    ^ #(
+        #'stx:goodies/smallsense'    "SmallSense::AbstractTestCase - superclass of EditTextViewTests"
+        #'stx:goodies/sunit'    "TestAsserter - superclass of EditTextViewTests"
+        #'stx:libbasic'    "LibraryDefinition - superclass of stx_libwidg_tests"
+    )
+!
+
+referencedPreRequisites
+    "list packages which are a prerequisite, because they contain
+     classes which are referenced by my classes.
+     We do not need these packages as a prerequisite for compiling or loading,
+     however, a class from it may be referenced during execution and having it
+     unloaded then may lead to a runtime doesNotUnderstand error, unless the caller
+     includes explicit checks for the package being present.
+     This method is generated automatically,
+     by searching all classes (and their packages) which are referenced by my classes."
+
+    ^ #(
+        #'stx:libview'    "StandardSystemView - referenced by EditTextViewTests>>setUp"
+        #'stx:libwidg'    "EditTextView - referenced by EditTextViewTests>>setUp"
+    )
+!
+
+subProjects
+    "list packages which are known as subprojects.
+     The generated makefile will enter those and make there as well.
+     However: they are not forced to be loaded when a package is loaded;
+     for those, redefine requiredPrerequisites."
+
+    ^ #(
+    )
+! !
+
+!stx_libwidg_tests class methodsFor:'description - contents'!
+
+classNamesAndAttributes
+    "lists the classes which are to be included in the project.
+     Each entry in the list may be: a single class-name (symbol),
+     or an array-literal consisting of class name and attributes.
+     Attributes are: #autoload or #<os> where os is one of win32, unix,..."
+
+    ^ #(
+        "<className> or (<className> attributes...) in load order"
+        (EditTextViewTests autoload)
+        #'stx_libwidg_tests'
+    )
+!
+
+extensionMethodNames
+    "list class/selector pairs of extensions.
+     A correponding method with real names must be present in my concrete subclasses"
+
+    ^ #(
+    )
+! !
+
+!stx_libwidg_tests class methodsFor:'description - project information'!
+
+companyName
+    "Returns a company string which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info"
+
+    ^ 'eXept Software AG'
+!
+
+description
+    "Returns a description string which will appear in nt.def / bc.def"
+
+    ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+    "Returns a copyright string which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info"
+
+    ^ 'Copyright Claus Gittinger 1988-2015\nCopyright eXept Software AG 1998-2015'
+!
+
+productName
+    "Returns a product name which will appear in <lib>.rc.
+     Under win32, this is placed into the dlls file-info.
+     This method is usually redefined in a concrete application definition"
+
+    ^ 'Smalltalk/X'
+! !
+
+!stx_libwidg_tests class methodsFor:'documentation'!
+
+version_HG
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/vcmake.bat	Fri Sep 02 17:42:50 2016 +0100
@@ -0,0 +1,20 @@
+@REM -------
+@REM make using Microsoft Visual C compiler
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+
+@if not defined VSINSTALLDIR (
+    pushd ..\..\rules
+    call vcsetup.bat
+    popd
+)
+@SET DEFINES=
+@REM Kludge got Mercurial, cannot be implemented in Borland make
+@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
+@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
+make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %*
+
+
+
+