Commits

Herbert Breunung committed d1e5067

added right edge margin aka LLI

Comments (0)

Files changed (2)

lib/Kephra/App/Editor.pm

 	#Wx::Event::EVT_MENU( $self, 1000, sub { $_[1]->Skip; } );
 	#Wx::Event::EVT_STC_SAVEPOINTREACHED($self, -1, \&Kephra::File::savepoint_reached);
 	#Wx::Event::EVT_STC_SAVEPOINTLEFT($self, -1, \&Kephra::File::savepoint_left);
-	#Wx::Event::EVT_STC_CHANGE       ($self, -1, sub {&$trigger('document.text.change')} );
+	#Wx::Event::EVT_STC_CHANGE       ($self, -1, sub { my ($ed, $event) = @_; $event->Skip; } );
 	Wx::Event::EVT_KEY_DOWN ($self, sub {
 		my ($ed, $event) = @_;
 		my $key = Kephra::App::Util::keycode_from_event($event);
 		elsif ($key ==      ord('Q')    + 2000){Kephra::File::close_active() }
 		elsif ($key ==      ord('Q')    + 4000){Kephra::API::app()->close_save }
 		else {$event->Skip}
-		#print " $key- \n";
 	});
-	#Wx::Event::EVT_STC_STYLENEEDED(id, sub{}) 
+	#Wx::Event::EVT_STC_STYLENEEDED($self, sub{}) 
 	#Wx::Event::EVT_STC_CHARADDED($self, sub {});
-	#Wx::Event::EVT_STC_ROMODIFYATTEMPT(id, sub{}) 
-	#Wx::Event::EVT_STC_KEY(id, sub{}) 
-	#Wx::Event::EVT_STC_DOUBLECLICK(id, sub{}) 
-	#Wx::Event::EVT_STC_UPDATEUI(id, sub{}) 
+	#Wx::Event::EVT_STC_ROMODIFYATTEMPT($self, sub{}) 
+	#Wx::Event::EVT_STC_KEY($self, sub{}) 
+	#Wx::Event::EVT_STC_DOUBLECLICK($self, sub{}) 
+	Wx::Event::EVT_STC_UPDATEUI($self, -1, sub { 
+		#my ($ed, $event) = @_; $event->Skip; print "change \n"; 
+	});
 	#Wx::Event::EVT_STC_MODIFIED($self, sub {});
-	#Wx::Event::EVT_STC_MACRORECORD(id, sub{}) 
-	#Wx::Event::EVT_STC_MARGINCLICK(id, sub{}) 
+	#Wx::Event::EVT_STC_MACRORECORD($self, sub{}) 
+	#Wx::Event::EVT_STC_MARGINCLICK($self, sub{}) 
 	#Wx::Event::EVT_STC_NEEDSHOWN($self, sub {});
-	#Wx::Event::EVT_STC_PAINTED(id, sub{}) 
-	#Wx::Event::EVT_STC_USERLISTSELECTION(id, sub{}) 
-	#Wx::Event::EVT_STC_URIDROPPED($self, sub {});
-	#Wx::Event::EVT_STC_DWELLSTART(id, sub{}) 
-	#Wx::Event::EVT_STC_DWELLEND(id, sub{}) 
-	#Wx::Event::EVT_STC_START_DRAG(id, sub{}) 
-	#Wx::Event::EVT_STC_DRAG_OVER(id, sub{}) 
+	#Wx::Event::EVT_STC_PAINTED($self, sub{}) 
+	#Wx::Event::EVT_STC_USERLISTSELECTION($self, sub{}) 
+	#Wx::Event::EVT_STC_UR$selfROPPED($self, sub {});
+	#Wx::Event::EVT_STC_DWELLSTART($self, sub{}) 
+	#Wx::Event::EVT_STC_DWELLEND($self, sub{}) 
+	#Wx::Event::EVT_STC_START_DRAG($self, sub{}) 
+	#Wx::Event::EVT_STC_DRAG_OVER($self, sub{}) 
 	#Wx::Event::EVT_STC_DO_DROP($self, sub {});
-	#Wx::Event::EVT_STC_ZOOM(id, sub{}) 
-	#Wx::Event::EVT_STC_HOTSPOT_CLICK(id, sub{}) 
-	#Wx::Event::EVT_STC_HOTSPOT_DCLICK(id, sub{}) 
-	#Wx::Event::EVT_STC_CALLTIP_CLICK(id, sub{}) 
-	#Wx::Event::EVT_STC_AUTOCOMP_SELECTION(id, sub{})
+	#Wx::Event::EVT_STC_ZOOM($self, sub{}) 
+	#Wx::Event::EVT_STC_HOTSPOT_CLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_HOTSPOT_DCLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_CALLTIP_CLICK($self, sub{}) 
+	#Wx::Event::EVT_STC_AUTOCOMP_SELECTION($self, sub{})
 }
 
 sub set_margin {
 	}
 	elsif ( $style eq 'no' ) {
 	}
-	
 }
 
 sub insert_text {
 	$self->SetSelBackground( 1, $mk_color->(0, 17, 119) );
 	$self->SetWhitespaceForeground( 1, $mk_color->(204, 204, 153) );
 	$self->SetViewWhiteSpace(1);
+
+	$self->SetEdgeColour( $mk_color->(200,200,255) );
+	$self->SetEdgeColumn( 80 );
+	$self->SetEdgeMode( &Wx::wxSTC_EDGE_LINE );
 }
 
 sub load_font {

lib/Kephra/Edit.pm

 	return if $end == $self->GetLength and $movement > 0;
 	my $move_wordwise;
 	$self->BeginUndoAction;
-	if ($start == $end) {
+	if ($start == $end) { # select the current word
 		my $pos = $start;
 		$start = $self->WordStartPosition($pos, 1);
 		$end = $self->WordEndPosition($pos, 1);
 		$self->SetSelection($start, $end);
 		$move_wordwise = 1;
-	} else { # check if word is selected
+	} else {              # check if word is already is selected
 		$move_wordwise = 1 if $start == $self->WordStartPosition($start, 1)
-							and $end == $self->WordEndPosition($end, 1);
+		                   and  $end == $self->WordEndPosition ($end, 1);
 	}
 	my $selection = $self->GetSelectedText;
 	$self->ReplaceSelection('');