ソースを参照

Add files via upload

Capitan Cloud 1 年間 前
コミット
f12204dcd5
4 ファイル変更207 行追加113 行削除
  1. 83 27
      edit.tcl
  2. 12 24
      menu.tcl
  3. 6 2
      radxide.tcl
  4. 106 60
      win.tcl

+ 83 - 27
edit.tcl

@@ -76,13 +76,11 @@ namespace eval edit {
 # ________________________ Indent _________________________ #
 
 
-	proc Indent {} {
+	proc Indent {{from "event"}} {
 		# Indent selected lines of text.
 
 		namespace upvar ::radxide dan dan
 
-		#tk_messageBox -title $dan(TITLE) -icon info -message "Indent start"   
-
 		set indent $dan(TAB_IN_SPACE)
 		set len [string length $dan(TAB_IN_SPACE)]
 		set sels [SelectedLines]
@@ -111,8 +109,9 @@ namespace eval edit {
 		
 		focus $dan(TEXT)
 		
-		#tk_messageBox -title $dan(TITLE) -icon info -message "Indent end"   
-		
+		if {$from eq "event"} {
+		  return -code break
+		}  
 	}
 
 # ________________________ leadingSpaces _________________________ #
@@ -129,7 +128,7 @@ namespace eval edit {
 # ________________________ makeCopy _________________________ #
 
 
-	proc makeCopy {} {
+	proc makeCopy {{from "event"}} {
     # Copy from the editor to the clipboard
     #clipboard clear
     #clipboard append $txt
@@ -139,11 +138,15 @@ namespace eval edit {
     set t $dan(TEXT)
     
     tk_textCopy $t
+    
+    if {$from eq "event"} {
+		  return -code break
+		}  
 	}
 
 #_________________________ makeCut ________________________ #
 
-	proc makeCut {} {
+	proc makeCut {{from "event"}} {
     # Cut from the editor to the clipboard
     #set canvas %W
     #eval [clipboard get -type TkCanvasItem]
@@ -154,14 +157,56 @@ namespace eval edit {
     
     tk_textCut $t
     
-    after 200 [::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223"]
-    $dan(TEXT) yview [$dan(TEXT) index insert] 
-    $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+    after 1000 "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223"
+    #$dan(TEXT) yview [$dan(TEXT) index insert] 
+    #$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+    
+    if {$from eq "event"} {
+		  return -code break
+		}  
 	}
+
+# ________________________ makeNewLine _________________________ #
+
+
+  proc makeNewLine {} {
+  
+    namespace upvar ::radxide dan dan
+  
+    set wt $dan(TEXT)
+
+    # getting previous line
+    set idx1 [$wt index {insert linestart}]
+    set idx2 [$wt index {insert lineend}]
+    set line [$wt get $idx1 $idx2]
+    
+    # erasing tabs, replacing them with spaces..
+    set line [string map {\t $dan(TAB_IN_SPACE)} $line]
+
+    # calculating identation..
+    set orilength [string length $line]
+    set newlength [string length [string trimleft $line]]   
+        
+    set nspacesofindent [expr $orilength - $newlength] 
+      
+    # inserintg correct identation..
+	  $wt insert [$wt index {insert}] \n[string repeat " " $nspacesofindent]  
+
+	  set idx3 [$wt index insert]
+	  set idx4 [$wt index "$idx3 +1 line"]
+	  ::tk::TextSetCursor $wt $idx3
+		  
+    ::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223"
+    #$dan(TEXT) yview [$dan(TEXT) index insert] 
+    #$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1]             
+
+    return -code break
+
+  }
 	
 #_________________________ makePaste ________________________ #
 
-	proc makePaste {} {
+	proc makePaste {{from "event"}} {
     # Paste from the clipboard to the editor
     #set canvas %W
     #eval [clipboard get -type TkCanvasItem]
@@ -172,16 +217,20 @@ namespace eval edit {
     
     tk_textPaste $t    
     
-    after 1000 [::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223"] 
-    $dan(TEXT) yview [$dan(TEXT) index insert] 
-    $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+    after 1000 "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223" 
+    #$dan(TEXT) yview [$dan(TEXT) index insert] 
+    #$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+
+    if {$from eq "event"} {
+		  return -code break
+		}  
 
 	}
 
 #_________________________ makeRedo ________________________ #
 
 
-	proc makeRedo {} {
+	proc makeRedo {{from "event"}} {
     # Paste from the clipboard to the editor
     #set canvas %W
     #eval [clipboard get -type TkCanvasItem]
@@ -192,16 +241,19 @@ namespace eval edit {
     
     catch {$t edit redo}
     
-    after idle [::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223"] 
-    $dan(TEXT) yview [$dan(TEXT) index insert] 
-    $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+    after idle "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223" 
+    #$dan(TEXT) yview [$dan(TEXT) index insert] 
+    #$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
 
+    if {$from eq "event"} {
+		  return -code break
+		}  
 	}
 
 #_________________________ makeUndo ________________________ #
 
 
-	proc makeUndo {} {
+	proc makeUndo {{from "event"}} {
     # Paste from the clipboard to the editor
     #set canvas %W
     #eval [clipboard get -type TkCanvasItem]
@@ -212,9 +264,13 @@ namespace eval edit {
     
     catch {$t edit undo}   
     
-    after idle [::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223"]
-    $dan(TEXT) yview [$dan(TEXT) index insert] 
-    $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+    after idle "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223"
+    #$dan(TEXT) yview [$dan(TEXT) index insert] 
+    #$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] 
+    
+    if {$from eq "event"} {
+		  return -code break
+		}  
 
 	}
 
@@ -261,19 +317,17 @@ namespace eval edit {
     
     namespace upvar ::radxide dan dan
     
-    tk_messageBox -title $dan(TITLE) -icon info -message "Please check 'radxide.tcl' for any variable to customize."   
+    tk_messageBox -title $dan(TITLE) -icon info -message "Please check 'radxide.tcl' to customize any variable."   
 	}
 
 # ________________________ UnIndent _________________________ #
 
 
-	proc UnIndent {} {
+	proc UnIndent {{from "event"}} {
 		# Unindent selected lines of text.
 
 		namespace upvar ::radxide dan dan
 
-    #tk_messageBox -title $dan(TITLE) -icon info -message "start UnIndent"   
-
 		set len [string length $dan(TAB_IN_SPACE)]
 		set spaces [list { } \t]
 		set sels [SelectedLines]
@@ -297,7 +351,9 @@ namespace eval edit {
 		
 		focus $dan(TEXT)
 		
-    #tk_messageBox -title $dan(TITLE) -icon info -message "end UnIndent"   
+		if {$from eq "event"} {
+		  return -code break
+		}  
 	}
 
 #_______________________

+ 12 - 24
menu.tcl

@@ -29,19 +29,6 @@ namespace eval menu {
     global version
     global os
 
-	  set aboutTEXT ""	
-	  #set aboutTEXT "MIT Licence.\n\n\n" 
-	  #set aboutTEXT "${aboutTEXT}Copyrights 5 Mode\n\n"
-	  #set aboutTEXT "${aboutTEXT}http://5mode.com\n\n\n"
-	  #set aboutTEXT "${aboutTEXT}Most of code here presented and distributed contain excerpts"
-    #set aboutTEXT "${aboutTEXT}from Alited (https://github.com/aplsimple/alited"
-    #set aboutTEXT "${aboutTEXT}by Alex Plotnikov and contributors to the project."
-    #set aboutTEXT "${aboutTEXT}The original code of these excerpts could be" 
-    #set aboutTEXT "${aboutTEXT}borrowed from other sources which the author"
-    #set aboutTEXT "${aboutTEXT}and the contributors to this RadXIDE have no"
-    #set aboutTEXT "${aboutTEXT}knowledge about.\n\n\n"
-    #set aboutTEXT "${aboutTEXT}For other rights and copyright see each file header."
-	
 		# menu
 		set menu(ROOT) [set m [menu .mb]]
 		$m add cascade -label File -menu $m.file
@@ -62,15 +49,15 @@ namespace eval menu {
 		set m2 [menu $m.edit -tearoff 0]
 		set menu(EDIT) $m2
 		$m add cascade -label Help -menu $m.help
-		$m2 add command -label Undo -command { ::radxide::menu::edit::makeUndo } -accelerator Ctrl+Z -state disabled
-		$m2 add command -label Redo -command { ::radxide::menu::edit::makeRedo } -accelerator Ctrl+Shift+Z -state disabled
+		$m2 add command -label Undo -command { ::radxide::menu::edit::makeUndo "menu" } -accelerator Ctrl+Z -state disabled
+		$m2 add command -label Redo -command { ::radxide::menu::edit::makeRedo "menu" } -accelerator Ctrl+Shift+Z -state disabled
   	$m2 add separator
-		$m2 add command -label Copy -command { ::radxide::menu::edit::makeCopy }  -accelerator Ctrl+C -state disabled
-		$m2 add command -label Paste -command { ::radxide::menu::edit::makePaste } -accelerator Ctrl+P -state disabled
-		$m2 add command -label Cut -command { ::radxide::menu::edit::makeCut } -accelerator Ctrl+X -state disabled
+		$m2 add command -label Copy -command { ::radxide::menu::edit::makeCopy "menu"}  -accelerator Ctrl+C -state disabled
+		$m2 add command -label Paste -command { ::radxide::menu::edit::makePaste "menu"} -accelerator Ctrl+P -state disabled
+		$m2 add command -label Cut -command { ::radxide::menu::edit::makeCut "menu"} -accelerator Ctrl+X -state disabled
 		$m2 add separator
-		$m2 add command -label Indent -command { ::radxide::menu::edit::Indent } -accelerator Ctrl+T -state disabled
-		$m2 add command -label UnIndent -command { ::radxide::menu::edit::UnIndent } -accelerator Alt+T -state disabled
+		$m2 add command -label Indent -command { ::radxide::menu::edit::Indent "menu" } -accelerator Tab -state disabled
+		$m2 add command -label UnIndent -command { ::radxide::menu::edit::UnIndent "menu"} -accelerator Shift+Tab -state disabled
 		$m2 add separator
 		$m2 add command -label Find -command { ::radxide::menu::edit::find } -accelerator Ctrl+F -state disabled
 		$m2 add command -label "Go to Line" -command { ::radxide::menu::edit::GotoLine } -accelerator Ctrl+G -state disabled
@@ -92,16 +79,17 @@ namespace eval menu {
  	  bind $ctrl "<Control-s>" { ::radxide::menu::file::saveFile }
  	  bind $ctrl "<Control-Alt-x>" { ::radxide::menu::file::closeProject }
  	  bind $ctrl "<Control-q>" { ::radxide::menu::file::quit }
- 		bind $ctrl "<Control-t>" { ::radxide::menu::edit::Indent }
- 		bind $ctrl "<Alt-t>" { ::radxide::menu::edit::UnIndent } 		
+ 		#bind $ctrl "<Tab>" { ::radxide::menu::edit::Indent }
+ 		#bind $ctrl "<ISO_Left_Tab>" { ::radxide::menu::edit::UnIndent } 		
+ 		#bind $ctrl "<ISO_Right_Tab>" { ::radxide::menu::edit::UnIndent } 		
     bind $ctrl "<Control-z>" "::radxide::menu::edit::makeUndo"
     bind $ctrl "<Control-Shift-z>" "::radxide::menu::edit::makeRedo"    
  	  bind $ctrl "<Control-c>" "::radxide::menu::edit::makeCopy"
- 	  bind $ctrl "<Control-p>" "::radxide::menu::edit::makePaste"
+ 	  bind $ctrl "<Control-v>" "::radxide::menu::edit::makePaste"
  	  bind $ctrl "<Control-x>" "::radxide::menu::edit::makeCut"
  	  bind $ctrl "<Control-f>" "::radxide::menu::edit::find"
 		bind $ctrl "<Control-g>" "::radxide::menu::edit::GotoLine"
-		bind $ctrl "<Return>" "::radxide::win::setNewLineWithIndent" 
+		bind $ctrl "<Return>" "::radxide::menu::edit::makeNewLine" 
 		#bind $ctrl "<Tab>" "::radxide::win::insertTab"
 		
 	}	

+ 6 - 2
radxide.tcl

@@ -28,7 +28,7 @@
 #
 ###########################################################
 
-set version "1.3.6" 
+set version "1.3.8" 
 set os "$::tcl_platform(os) $::tcl_platform(osVersion)"
 
 package provide radxide $version
@@ -87,8 +87,12 @@ namespace eval radxide {
   set dan(TEXTBG) "#222223"
   set dan(TEXTFG) "#55ff55"
   set dan(TEXTSELFG) "red"
+  set dan(TEXTFONT) "Monospace Semi-Condensed"
+  set dan(TEXTFONTSIZE) "10"
   set dan(CURSORCOLOR) "red"
-  set dan(CURSORWIDTH) "4"
+  set dan(CURSORWIDTH) "5"
+  set dan(TOTLINES) 1
+  set dan(CUR_FILE_MAX_YVIEW) 1.0
   set dan(prjdirignore) {.git nbproject} ;# ignored subdirectories of project
   
   set project(NAME) ""              ;# project default name

+ 106 - 60
win.tcl

@@ -882,6 +882,7 @@ namespace eval win {
     set i 1
     set gcont [list]
     set totlines [expr [$txt count -lines 0.0 end]]
+    set dan(TOTLINES) $totlines
     while true {
       if {$i > $totlines} break
       #set dline [$txt dlineinfo $i] ;# xxx
@@ -905,9 +906,25 @@ namespace eval win {
       $canvas insert [expr {$y}].0 $linenum
     }
 
+    set oldval [$dan(GUTTEXT) yview]
+    $dan(GUTTEXT) yview $dan(TOTLINES).0
+    set dan(CUR_FILE_MAX_YVIEW) [lindex [$dan(GUTTEXT) yview] 0]
+    #$dan(GUTTEXT) yview [lindex $oldval 1]
+    $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 0] 
+
+    #$dan(TEXT) yview 1.0
+    #set ww [list .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText]
+    #.danwin.fra.pan.fra2.yscroll2 set {*}[.danwin.fra.pan.fra2.yscroll1 get]
+    #catch {list $dan(GUTTEXT) yview moveto [string range [lindex [$dan(TEXT) yview] 0] 0 2]}
+    #list ::radxide::win::Yview $ww yes {*}[.danwin.fra.pan.fra2.yscroll1 get]
+    
     $canvas configure -state disabled
+
+    catch {
+      return -code break
+    }
     
-    #return 2
+    #return 0
   }
 
 
@@ -1883,6 +1900,8 @@ namespace eval win {
   # Scrollbars amenities
   proc Yset {widgets master sb args} {
    
+    namespace upvar ::radxide dan dan
+   
     if {$master eq "master"} {
       #list $sb set [expr [lindex $args 0]] [expr [lindex $args 1]]
       
@@ -1899,7 +1918,14 @@ namespace eval win {
     
     #::radxide::win::Yview $myw moveto [lindex $args 0]
     #::radxide::win::Yview [lrange $widgets 0 0] moveto [lindex $args 0]
-    ::radxide::win::Yview $widgets no moveto [lindex $args 0]
+
+ 		#.danwin.fra.pan.fra3.body.text delete 1.0 end
+		#.danwin.fra.pan.fra3.body.text insert end [expr [lindex $args 0]]
+    if {[expr [lindex $args 0]] > [expr $dan(CUR_FILE_MAX_YVIEW) - 0.01]} {
+      ::radxide::win::Yview $widgets no moveto [lindex $args 1]
+    } else {
+      ::radxide::win::Yview $widgets no moveto [lindex $args 0]
+    }
 
   }
   
@@ -1912,7 +1938,8 @@ namespace eval win {
     }
     
     if ($callfromsbmaster) {
-      catch {list $w2.gutText yview moveto [lindex [$dan(TEXT) yview] 1]}
+      #catch {list $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 0]}
+      #catch {list $dan(GUTTEXT) yview moveto [string range [lindex [$dan(TEXT) yview] 0] 0 2]}
     }  
   } 
   
@@ -1950,16 +1977,26 @@ namespace eval win {
 		  # main pane (panR)
 		  pack [set w2 [ttk::panedwindow $pan.fra2 -orient horizontal]] -side left -fill both -expand 1
 		  set panR [$pan add $pan.fra2]
-		  text $w2.gutText -background "lightgray" -foreground "#222223" -font "Monospace 10" -width 5
-		  text $w2.text -font "monospace 10" -bd 0 -padx 13 -spacing1 0 -spacing2 0 -spacing3 0 -exportselection yes -width 115 -wrap none -undo yes
+		  if {[string first " " $dan(TEXTFONT)]} {
+		    set myfont "\"$dan(TEXTFONT)\""
+		  } else {
+		    set myfont $dan(TEXTFONT)
+		  }
+		  set myfontsize $dan(TEXTFONTSIZE)
+		  text $w2.gutText -background "lightgray" -foreground "#222223" -font "$myfont $myfontsize" -width 5
+		  text $w2.text -font "$myfont $myfontsize" -bd 0 -padx 13 -spacing1 0 -spacing2 0 -spacing3 0 -exportselection yes -width 115 -wrap none -undo yes
 		  set ww [list .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText]
 		  $w2.text configure -xscrollcommand [list $w2.xscroll set]
 		  scrollbar $w2.xscroll -orient horizontal \
 		    -command [list $w2.text xview]
+		    
+		  #scrollbar $w2.yscroll1 -orient vertical \
+		  #  -command [list ::radxide::win::Yview $ww yes]
 		  scrollbar $w2.yscroll1 -orient vertical \
-		    -command [list ::radxide::win::Yview $ww yes]
+		    -command [list $w2.text yview]
 		  scrollbar $w2.yscroll2 -orient vertical \
-		    -command [list $w2.gutText yview]		    
+		    -command [list $w2.gutText yview]		   
+		     
 		  set ssbb [list .danwin.fra.pan.fra2.yscroll1 .danwin.fra.pan.fra2.yscroll2]  
 		  $w2.text configure -yscrollcommand [list ::radxide::win::Yset $ww master $ssbb]
 		  $w2.gutText configure -yscrollcommand [list .danwin.fra.pan.fra2.yscroll2 set]		    
@@ -1977,7 +2014,12 @@ namespace eval win {
 		  # set colors
 		  $dan(TEXT) configure -background $dan(TEXTBG) -foreground $dan(TEXTFG)
 		  $dan(TEXT) configure -selectforeground $dan(TEXTSELFG)
- 		  $dan(TEXT) configure -insertbackground $dan(CURSORCOLOR) -insertwidth $dan(CURSORWIDTH);
+ 		  $dan(TEXT) configure -insertbackground $dan(CURSORCOLOR) 
+ 		  if {$dan(CURSORWIDTH) > 4} {
+   		  $dan(TEXT) configure -blockcursor true
+   		} else {  
+  		  $dan(TEXT) configure -insertwidth $dan(CURSORWIDTH);
+  		}  
  		  	  
 		  # code library
 		  pack [set w3 [frame $pan.fra3 -background $bg]] -side left -fill y -expand 1;
@@ -1985,12 +2027,64 @@ namespace eval win {
 		  ::radxide::eglib::create $w3
 		  
 		  # update gutter, key bindings     
-      bind $dan(TEXT) "<Return>" {::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223" ;$dan(TEXT) yview [$dan(TEXT) index insert] ;$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] }
-      bind $dan(TEXT) "<BackSpace>" {::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223" ;$dan(TEXT) yview [$dan(TEXT) index insert] ;$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] }
-      bind $dan(TEXT) "<Delete>" {::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223" ;$dan(TEXT) yview [$dan(TEXT) index insert] ;$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1] }
+      #bind $dan(TEXT) "<Enter>" "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223 ;$dan(TEXT) yview [$dan(TEXT) index insert] ;$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1]"
+      #bind $dan(TEXT) "<BackSpace>" "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223 ;$dan(TEXT) yview [$dan(TEXT) index insert] ;$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1]"
+      #bind $dan(TEXT) "<Delete>" "::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223 ;$dan(TEXT) yview [$dan(TEXT) index insert] ;$dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1]"
       bind $tree "<ButtonPress>" {after idle {::radxide::tree::buttonPress %b %x %y %X %Y}}
       bind $tree "<ButtonRelease>" {after idle {::radxide::tree::buttonRelease %b %s %x %y %X %Y}}      
-      
+      bind $dan(TEXT) "<KeyPress>" {
+        switch %K {
+          #KP_Enter {
+          #  ::radxide::menu::edit::makeNewLine
+          #}
+          #Return {
+          #  ::radxide::menu::edit::makeNewLine
+          #}
+          Tab {
+            ::radxide::menu::edit::Indent 
+          }
+          Shift_L-Tab {
+            ::radxide::menu::edit::UnIndent
+          }
+          ISO_Left_Tab {
+            ::radxide::menu::edit::UnIndent
+          }
+          ISO_Right_Tab {
+            ::radxide::menu::edit::UnIndent
+          }          
+          #Shift_L {
+          #}
+          #Shift_R {
+          #}
+          #default {
+          #  tk_messageBox -title radxide -icon info -message %K
+          #}
+        }  
+      }
+   	  bind $dan(TEXT) "<KeyRelease>" {
+        switch %K {
+          #KP_Enter {
+          #  ::radxide::menu::edit::makeNewLine
+          #}
+          #Return {
+          #  ::radxide::menu::edit::makeNewLine
+          #}
+          BackSpace {
+            ::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223
+          }
+          Delete {
+            ::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223
+          }
+          Cancel {
+            ::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 #FFFFFF #222223
+          }
+          Tab {
+          }
+          #default {
+          #  tk_messageBox -title radxide -icon info -message %K
+          #}          
+        }  
+      }
    	}
 		#wm title $wtop ttl  
  	  
@@ -3219,54 +3313,6 @@ namespace eval win {
     #   w - path to the text
 
   }
-
-# ________________________ setNewLineWithIndent _________________________ #
-
-  proc setNewLineWithIndent {} {
-  
-    namespace upvar ::radxide dan dan
-  
-    set wt $dan(TEXT)
-
-    # getting previous line
-    set idx1 [$wt index {insert linestart}]
-    set idx2 [$wt index {insert lineend}]
-    set line [$wt get $idx1 $idx2]
-    
-    # erasing tabs, replacing them with spaces..
-    set line [string map {\t $dan(TAB_IN_SPACE)} $line]
-
-    # calculating identation..
-    set orilength [string length $line]
-    set newlength [string length [string trimleft $line]]   
-    if {$newlength <= 0} {
-      # case previous line is only spaces..
-      
-      set $newlength 0
-      set nindent 0   
-      
-      ::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223" ;
-      $dan(TEXT) yview [$dan(TEXT) index insert] 
-      $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1]             
-      
-      return 0
-    } else {
-    
-      set nspacesofindent [expr $orilength - $newlength] 
-      
-      # inserintg correct identation..
-		  $wt insert [$wt index {insert}] \n[string repeat " " $nspacesofindent]  
-		  set idx3 [$wt index insert]
-		  set idx4 [$wt index "$idx3 +1 line"]
-		  ::tk::TextSetCursor $wt $idx3
-		  
-      ::radxide::win::fillGutter .danwin.fra.pan.fra2.text .danwin.fra.pan.fra2.gutText 5 1 "#FFFFFF" "#222223" ;
-      $dan(TEXT) yview [$dan(TEXT) index insert] 
-      $dan(GUTTEXT) yview moveto [lindex [$dan(TEXT) yview] 1]             
-		  
-      return -code break
-    }      
-  }
   
 # ________________________ setTextBinds _________________________ #