Commits

Herbert Breunung committed 982f6c8

consistent api-indicating the adding of preliminary id-part with sigil +

  • Participants
  • Parent commits e77c55f

Comments (0)

Files changed (6)

File lib/Kephra/App/Bar/Document.pm

 Kephra::CommandList::register_cmd_namespace('document');
 Kephra::CommandList::register_switch_var('Kephra::API::docbar');
 Kephra::CommandList::register_cmd({
- '-select-left'     =>{sub=>'$_->select_page_left',     label=>'Previous Tab',  keys=>'ctrl+pageup'},
- '-select-right'    =>{sub=>'$_->select_page_right',    label=>'Next Tab',      keys=>'ctrl+pagedown'},
- '-select-leftmost' =>{sub=>'$_->select_page_leftmost', label=>'First Tab',     keys=>'ctrl+shift+pageup'},
- '-select-rightmost'=>{sub=>'$_->select_page_rightmost',label=>'Last Tab',      keys=>'ctrl+shift+pagedown'},
- '-move-left'       =>{sub=>'$_->move_page_left',       label=>'Move Left',     keys=>'alt+pageup'},
- '-move-right'      =>{sub=>'$_->move_page_right',      label=>'Move Right',    keys=>'alt+pagedown'},
- '-move-leftmost'   =>{sub=>'$_->move_page_leftmost',   label=>'Move Leftmost', keys=>'alt+shift+pageup'},
- '-move-rightmost'  =>{sub=>'$_->move_page_rightmost',  label=>'Move Rightmost',keys=>'alt+shift+pagedown'},
+ '+-select-left'     =>{sub=>'$_->select_page_left',     label=>'Previous Tab',  keys=>'ctrl+pageup'},
+ '+-select-right'    =>{sub=>'$_->select_page_right',    label=>'Next Tab',      keys=>'ctrl+pagedown'},
+ '+-select-leftmost' =>{sub=>'$_->select_page_leftmost', label=>'First Tab',     keys=>'ctrl+shift+pageup'},
+ '+-select-rightmost'=>{sub=>'$_->select_page_rightmost',label=>'Last Tab',      keys=>'ctrl+shift+pagedown'},
+ '+-move-left'       =>{sub=>'$_->move_page_left',       label=>'Move Left',     keys=>'alt+pageup'},
+ '+-move-right'      =>{sub=>'$_->move_page_right',      label=>'Move Right',    keys=>'alt+pagedown'},
+ '+-move-leftmost'   =>{sub=>'$_->move_page_leftmost',   label=>'Move Leftmost', keys=>'alt+shift+pageup'},
+ '+-move-rightmost'  =>{sub=>'$_->move_page_rightmost',  label=>'Move Rightmost',keys=>'alt+shift+pagedown'},
 });
 
 

File lib/Kephra/App/Dialog/Keymap.pm

 		Kephra::App::Dialog::_parent(shift), -1,
 		$Kephra::NAME . ' '.$Kephra::VERSION .' Keymap Settings'
 	);
+	
+	#Kephra::CommandList
 	$dialog;
 }
 

File lib/Kephra/App/Panel/IOUnit.pm

 our $_ref;
 
 Kephra::CommandList::register_cmd_namespace('iounit');
-Kephra::CommandList::register_cmd({
- '-focus'=>{sub=>'focus_on_input', label => ' ', keys => 'esc'},
-});
-Kephra::KeyMap::register_map({
- 'iounit'=>{'esc' => 1, 'window-fullscreen-toggle' => ''
- }
-});
+Kephra::CommandList::register_cmd({'+-focus'=>{sub=>'focus_on_input', label => ' ', keys => 'esc'},});
+Kephra::KeyMap::register_map({'iounit'=>{'esc' => 1, 'window-fullscreen-toggle' => '' } });
 
 
 sub new {

File lib/Kephra/CommandList.pm

 		return Kephra::Log::error("need a sub name string or of a var => sub hash");
 	}
 }
+
 sub register_cmd_namespace {
 	my $name = shift;
 	my $calling_module = (caller)[0];
 	return Kephra::Log::error("called without value from $calling_module") unless $name;
 	$namespace{ $calling_module } = $name;
 }
+
 sub register_cmd {
 	my $cmd = shift;
 	return Kephra::Log::error( '"$cmd" has to be a hash ref') unless ref $cmd eq ref {};
 	my $calling_module = (caller)[0];
 	my $cmd_namespace = $namespace{ $calling_module }; 
 	for my $ID (keys %$cmd) {
-		my $fullID = (substr($ID,0,1) eq '-' and $cmd_namespace)
-			? $cmd_namespace . $ID 
+		my $fullID = (substr($ID,0,1) eq '+' and $cmd_namespace)
+			? $cmd_namespace . substr $ID, 1
 			: $ID ;
 		Kephra::Log::warning("$cmd lacks command namespace to prefix"), next
 				if $fullID ne $ID and not $cmd_namespace;
 
 __END__
 
+=head1 Command Definition
+
 cmd_ID => {
 	coderef   => compiled from sub, source and option, saves state
 	sub       => 'Kephra::File::new',

File lib/Kephra/Edit.pm

 package Kephra::App::Editor;
 Kephra::CommandList::register_cmd_namespace('edit');
 Kephra::CommandList::register_cmd({
-	'-undo'             =>{sub=>'$ed->Undo',             label=>'Undo',          keys=> 'ctrl+z'},
-	'-redo'             =>{sub=>'$ed->Redo',             label=>'Redo',          keys=> 'ctrl+shift+z'},
-	'-copy'             =>{sub=>'$ed->Copy',             label=>'Copy',          keys=> 'ctrl+c' },
-	'-copy-line'        =>{sub=>'$ed->LineCopy',         label=>'Copy Line',     keys=> 'ctrl+shift+c'},
-	'-cut'              =>{sub=>'$ed->Cut',              label=>'Cut',           keys=> 'ctrl+x'},
-	'-delete'           =>{sub=>'$ed->Clear',            label=>'Delete',        keys=> 'delete'},
-	'-delete-back'      =>{sub=>'$ed->DeleteBack',       label=>'Del Back',      keys=> 'back'},
-	'-delete-word-left' =>{sub=>'$ed->DelWordLeft',      label=>'Del Word Left', keys=> 'ctrl+back'},
-	'-delete-word-right'=>{sub=>'$ed->DelWordRight',     label=>'Del Word Right',keys=> 'ctrl+delete'},
-	'-delete-line'      =>{sub=>'$ed->LineDelete',       label=>'Del Line',      keys=> 'ctrl+shift+delete'},
-	'-insert'           =>{sub=>'$ed->Paste',            label=>'Insert',        keys=> 'ctrl+v'}, # thats what sometimes called paste
-	'-insert-newline'   =>{sub=>'$ed->NewLine',          label=>'Newline',       keys=> 'enter'},
-	'-replace'          =>{sub=>'$ed->replace',          label=>'Replace',       keys=> 'ctrl+shift+v'},
-	'-double'           =>{sub=>'$ed->SelectionDuplicate',label=>'Double',       keys=> 'ctrl+d'},
-	'-select-form'      =>{sub=>'$ed->select_form',      label=>'Form',          keys=> 'ctrl+y'},
-	'-select-content'   =>{sub=>'$ed->select_content',   label=>'Content',       keys=> 'ctrl+shift+y'},
+	'+-undo'             =>{sub=>'$ed->Undo',             label=>'Undo',          keys=> 'ctrl+z'},
+	'+-redo'             =>{sub=>'$ed->Redo',             label=>'Redo',          keys=> 'ctrl+shift+z'},
+	'+-copy'             =>{sub=>'$ed->Copy',             label=>'Copy',          keys=> 'ctrl+c' },
+	'+-copy-line'        =>{sub=>'$ed->LineCopy',         label=>'Copy Line',     keys=> 'ctrl+shift+c'},
+	'+-cut'              =>{sub=>'$ed->Cut',              label=>'Cut',           keys=> 'ctrl+x'},
+	'+-delete'           =>{sub=>'$ed->Clear',            label=>'Delete',        keys=> 'delete'},
+	'+-delete-back'      =>{sub=>'$ed->DeleteBack',       label=>'Del Back',      keys=> 'back'},
+	'+-delete-word-left' =>{sub=>'$ed->DelWordLeft',      label=>'Del Word Left', keys=> 'ctrl+back'},
+	'+-delete-word-right'=>{sub=>'$ed->DelWordRight',     label=>'Del Word Right',keys=> 'ctrl+delete'},
+	'+-delete-line'      =>{sub=>'$ed->LineDelete',       label=>'Del Line',      keys=> 'ctrl+shift+delete'},
+	'+-insert'           =>{sub=>'$ed->Paste',            label=>'Insert',        keys=> 'ctrl+v'}, # thats what sometimes called paste
+	'+-insert-newline'   =>{sub=>'$ed->NewLine',          label=>'Newline',       keys=> 'enter'},
+	'+-replace'          =>{sub=>'$ed->replace',          label=>'Replace',       keys=> 'ctrl+shift+v'},
+	'+-double'           =>{sub=>'$ed->SelectionDuplicate',label=>'Double',       keys=> 'ctrl+d'},
+	'+-select-form'      =>{sub=>'$ed->select_form',      label=>'Form',          keys=> 'ctrl+y'},
+	'+-select-content'   =>{sub=>'$ed->select_content',   label=>'Content',       keys=> 'ctrl+shift+y'},
 });
 
 sub get_clipboard_text {

File lib/Kephra/File.pm

 
 Kephra::CommandList::register_cmd_namespace('file');
 Kephra::CommandList::register_cmd({
- '-new' => { sub => 'new',         label => 'New',   keys => 'ctrl+n'},
- '-open'=> { sub => 'open',        label => 'Open',  keys => 'ctrl+o'},
- '-save'=> { sub => 'save_active', label => 'Save',  keys => 'ctrl+s'},
- '-close'=>{ sub => 'close_active',label => 'Close', keys => 'ctrl+q'},
+ '+-new' => { sub => 'new',         label => 'New',   keys => 'ctrl+n'},
+ '+-open'=> { sub => 'open',        label => 'Open',  keys => 'ctrl+o'},
+ '+-save'=> { sub => 'save_active', label => 'Save',  keys => 'ctrl+s'},
+ '+-close'=>{ sub => 'close_active',label => 'Close', keys => 'ctrl+q'},
 });
 
 sub normalize_name {