Commits

Herbert Breunung  committed 5ee02cc

warn when attempt to override keymapping

  • Participants
  • Parent commits af514a9

Comments (0)

Files changed (2)

File lib/Kephra/Internals.pod

 
 =head2  What Part Of Perl We Use
 
+=head2  Principles
+
+=over 4
+
+=item * full intospection
+
+=item * parts serve metapurposes and work together
+
+=back
+
 =head2  Interdependency Of Core Modules
 
 =head2  Modules vs Objects

File lib/Kephra/KeyMap.pm

 	$map = $main_map unless defined $map;
 	for my $cmd (keys %$keys) {
 		$definition{$map}{ $cmd } = $keys->{$cmd};
-		$code{$map}{ code_from_definition( $keys->{$cmd} ) } = $cmd;
+		my $code = code_from_definition( $keys->{$cmd} );
+		unless (exists $code{$map}{ $code }) { $code{$map}{ $code } = $cmd }
+		else {
+			Kephra::Log::warning
+				("register_code: $cmd tried to register the already taken keycode $code");
+		}
 	}
 }