! LSE$EVE_EDT.TPU ! !************************************************************************* ! * ! © Copyright 2005 Hewlett-Packard Development Company, L.P. * ! * ! Confidential computer software. Valid license from HP required for * ! possession, use or copying. Consistent with FAR 12.211 and 12.212, * ! Commercial Computer Software, Computer Software Documentation, and * ! Technical Data for Commercial Items are licensed to the U.S. * ! Government under vendor's standard commercial license. * ! * !************************************************************************* ! !++ ! FACILITY: ! VAX Language-Sensitive Editor ! ! ABSTRACT: ! This file contains superceded EVE procedures that are located in the ! file EVE$EDT.TPU. ! ! ENVIRONMENT: ! VAX/VMS ! ! CREATION DATE: 21-DEC-1989 ! ! MODIFIED BY: ! ! X3.1-1 DAS 21-Dec-89 First pass. ! X4.0-1 DAS 15-Nov-91 Empty module init ! ! X4.3-1 RKB 07-Dec-94 Add support for UNDO ! X4.3-2 RKB 17-Jan-95 Save any inserted text before changing case !- procedure lse$eve_edt_module_ident return "4.7-3"; endprocedure; ! EVE$EDT.TPU Page 2 procedure eve$edt_chngcase ! EDT style change case !+ ! EDT -- Change case !- ! Modified to allow cursor to move either forward or reverse direction after ! changing case. local saved_mark, target, old_str, old_range, result_range, lf; ! check for active select on_error [OTHERWISE]: endon_error; if not eve$declare_intention (eve$k_action_change_case) then return (FALSE); endif; ! This is implemented from EVE's EVE$EDT_CHNGCASE ! and is re-written by LSE. This will allow cursor to ! to move either forward or reverse direction after ! changing case. !+ ! If use lse$create_select_range (instead of eve$selection) to allow it to ! create a search range if no selection is made, then it will have the ! the same behavior as LSE V2.0 and LSE V1.0 ! ! target := lse$select_range; !- lf := 10; target := eve$selection (FALSE); if target <> 0 then ! ! *** LSE change : check for overview records if NOT lse$source_only(target) then MESSAGE('Attempt to modify an overview line'); eve$learn_abort; RETURN(false); endif; ! ! Save any text that has been inserted between last command and this one ! lse$$save_inserted_text; ! old_str := STR (target, ASCII(lf)); result_range := change_case (target, INVERT); ! ! Store original string for CHANGE CASE ! lse$$start_substitute ( STR (result_range, ASCII (lf)) ); ! ! Store changed range ! lse$$add_substitute_entry ( old_str, beginning_of(target),'' ); ! ! Adding CHANGE CASE command ! lse$$end_substitute(); ! eve$clear_message; return (TRUE); endif; saved_mark := mark (NONE); if saved_mark = end_of (current_buffer) then if current_direction = FORWARD then position (saved_mark); eve$learn_abort; return (FALSE); endif; else ! change case of current character (if non-null) if (current_character <> "") then ! *** LSE change ! if lse$is_overview() ! use cursor as default marker then MESSAGE('Attempt to modify an overview line'); position (saved_mark); eve$learn_abort; RETURN(false); endif; old_range := create_range (mark (NONE), mark (NONE), NONE); old_str := STR (old_range, ASCII(lf)); result_range := change_case (create_range (mark (NONE), mark (NONE), NONE), INVERT); ! ! Store original string for CHANGE CASE ! lse$$start_substitute ( STR (result_range, ASCII (lf)) ); ! ! Store changed range ! lse$$add_substitute_entry ( old_str, beginning_of(old_range),'' ); ! ! Adding CHANGE CASE command ! lse$$end_substitute(); ! endif; endif; if current_direction = FORWARD then move_horizontal (1); return (TRUE); else if saved_mark <> beginning_of (current_buffer) then move_horizontal (-1); return (TRUE); else position (saved_mark); eve$learn_abort; return (FALSE); endif; endif; endprocedure;