Changeset 3734
- Timestamp:
- Dec 7, 2019, 2:43:57 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/netlabs/macros/locate.e ¶
r3649 r3734 264 264 fOnlyDirectionChanged = 0 265 265 do once = 1 to 1 266 -- Remove FR+- from LastOpts and NextOpts for comparison266 -- Remove FR+-D from LastOpts and NextOpts for comparison 267 267 -- with LastSearchOptions and SearchOptions 268 268 LastOpts = LastSearchOptions 269 269 do forever 270 pv = verify( LastOpts, 'FR+- ', 'M')270 pv = verify( LastOpts, 'FR+-D', 'M') 271 271 if pv = 0 then 272 272 leave … … 276 276 NextOpts = SearchOptions 277 277 do forever 278 pv = verify( NextOpts, 'FR+- ', 'M')278 pv = verify( NextOpts, 'FR+-D', 'M') 279 279 if pv = 0 then 280 280 leave … … 484 484 485 485 if not fSearch then 486 return - 486 return -1 487 487 else 488 488 return FilteredSearchOptions … … 572 572 573 573 ; --------------------------------------------------------------------------- 574 defproc GetLastSearchDialogOptions 575 KeyPath = '\NEPMD\Var\Search\LastSearchDialogOptions' 576 LastSearchDialogOptions = QueryConfigKey( KeyPath) 577 --dprintf( 'GetLastSearchDialogOptions: LastSearchDialogOptions = 'LastSearchDialogOptions) 578 return LastSearchDialogOptions 579 580 ; --------------------------------------------------------------------------- 574 581 defproc SetLastSearchArgs 575 582 KeyPath = '\NEPMD\Var\Search\LastSearchArgs' … … 584 591 LastChangeArgs = arg( 1) 585 592 call WriteConfigKey( KeyPath, LastChangeArgs) 593 return 594 595 ; --------------------------------------------------------------------------- 596 defproc SetLastSearchDialogOptions 597 KeyPath = '\NEPMD\Var\Search\LastSearchDialogOptions' 598 LastSearchDialogOptions = arg( 1) 599 call WriteConfigKey( KeyPath, LastSearchDialogOptions) 600 --dprintf( 'SetLastSearchDialogOptions: LastSearchDialogOptions = 'LastSearchDialogOptions) 586 601 return 587 602 … … 617 632 LastSearchArgs = GetLastSearchArgs() 618 633 LastChangeArgs = GetLastChangeArgs() 634 LastSearchDialogOptions = GetLastSearchDialogOptions() 619 635 620 636 args = strip( arg( 1), 'L') 637 638 -- Filter out 'D' arg from search dialog for RepeatFind 639 fDialogRepeat = 0 640 if args = \1\1\1\1'D' then 641 fDialogRepeat = 1 642 args = '' 643 endif 644 645 -- Handle RepeatFind 621 646 if args = '' then -- If no args, query args 622 args = LastSearchArgs 647 SearchArgs = LastSearchArgs 648 649 tmpdelim = substr( SearchArgs, 1, 1) -- get 1st delimiter 650 parse value SearchArgs with (tmpdelim)SearchString(tmpdelim)SearchOptions 651 next = SearchOptions 652 653 -- Ensure that option D is removed if not coming from the search dialog 654 if not fDialogRepeat then 655 do forever 656 Dpos = pos( 'D', next) 657 if Dpos = 0 then 658 leave 659 endif 660 next = delstr( next, Dpos, 1) 661 enddo 662 endif 663 -- Ensure that last options from the dialog are used, not from elsewhere 664 if fDialogRepeat then 665 next = LastSearchDialogOptions 666 endif 667 668 -- Rebuild SearchArgs 669 SearchOptions = next 670 SearchArgs = tmpdelim''SearchString''tmpdelim''SearchOptions 671 672 args = SearchArgs 623 673 -- Process the parsing of args again to recognize a possible change of 624 674 -- default_search_options in the meantime. … … 628 678 parse value args with (delim)SearchString(delim)UserOptions 629 679 UserOptions = strip( UserOptions, 'T', delim) 680 630 681 AddSearchChangeOptions = GetAddSearchChangeOptions() 631 682 UserOptions = UserOptions''AddSearchChangeOptions … … 649 700 SearchArgs = delim''SearchString''delim''SearchOptions 650 701 --dprintf( overlay( ' Locate ', copies( '-', 60), 4)) 651 --dprintf( '--- SearchArgs = 'SearchArgs', arg( 1) = 'arg( 1) )652 --dprintf( 'LastSearchArgs = 'LastSearchArgs )702 --dprintf( '--- SearchArgs = 'SearchArgs', arg( 1) = 'arg( 1)', fDialogRepeat = 'fDialogRepeat) 703 --dprintf( 'LastSearchArgs = 'LastSearchArgs', LastSearchDialogOptions = 'LastSearchDialogOptions) 653 704 654 705 parse value lastsearchpos with LastLine LastCol LastFid LastSearchLen LastSearchMode LastSearchRc … … 676 727 -- Save last and cur args 677 728 call SetLastSearchArgs( SearchArgs) 729 if pos( 'D', SearchOptions) then 730 call SetLastSearchDialogOptions( SearchOptions) 731 endif 678 732 679 733 if SearchString = cSearchString then … … 778 832 LastSearchArgs = GetLastSearchArgs() 779 833 LastChangeArgs = GetLastChangeArgs() 834 LastSearchDialogOptions = GetLastSearchDialogOptions() 780 835 781 836 args = strip( arg( 1), 'L') 837 838 -- Filter out 'D' arg from search dialog for RepeatChange 839 fDialogRepeat = 0 840 if args = \1\1\1\1'D' then 841 fDialogRepeat = 1 842 args = '' 843 endif 844 845 -- Handle RepeatChange 782 846 if args = '' then -- If no args, query lastchangeargs 783 args = LastChangeArgs 847 ChangeArgs = LastChangeArgs 848 849 tmpdelim = substr( ChangeArgs, 1, 1) -- get 1st delimiter 850 parse value ChangeArgs with (tmpdelim)SearchString(tmpdelim)ReplaceString(tmpdelim)SearchOptions 851 next = SearchOptions 852 853 -- Ensure that option D is removed if not coming from the search dialog 854 if not fDialogRepeat then 855 do forever 856 Dpos = pos( 'D', next) 857 if Dpos = 0 then 858 leave 859 endif 860 next = delstr( next, Dpos, 1) 861 enddo 862 endif 863 -- Ensure that last options from the dialog are used, not from elsewhere 864 if fDialogRepeat then 865 next = LastSearchDialogOptions 866 endif 867 868 -- Rebuild LastChangeArgs 869 SearchOptions = next 870 ChangeArgs = tmpdelim''SearchString''tmpdelim''ReplaceString''tmpdelim''SearchOptions 871 872 args = ChangeArgs 784 873 -- Process the parsing of args again to recognize a possible change of 785 874 -- default_search_options in the meantime. … … 799 888 parse value args with (delim)SearchString(delim)ReplaceString(delim)UserOptions 800 889 UserOptions = strip( UserOptions, 'T', delim) 890 801 891 AddSearchChangeOptions = GetAddSearchChangeOptions() 802 892 UserOptions = UserOptions''AddSearchChangeOptions … … 826 916 SearchArgs = delim''SearchString''delim''SearchOptions 827 917 --dprintf( overlay( ' Change ', copies( '-', 60), 4)) 828 --dprintf( '--- ChangeArgs = 'ChangeArgs', arg( 1) = 'arg( 1) )918 --dprintf( '--- ChangeArgs = 'ChangeArgs', arg( 1) = 'arg( 1)', fDialogRepeat = 'fDialogRepeat) 829 919 --dprintf( '--- SearchArgs = 'SearchArgs', arg( 1) = 'arg( 1)) 830 --dprintf( 'LastChangeArgs = 'LastChangeArgs', LastSearchArgs = 'LastSearchArgs )920 --dprintf( 'LastChangeArgs = 'LastChangeArgs', LastSearchArgs = 'LastSearchArgs', LastSearchDialogOptions = 'LastSearchDialogOptions) 831 921 832 922 -- Save last args 833 923 call SetLastChangeArgs( ChangeArgs) 834 924 call SetLastSearchArgs( SearchArgs) 925 if pos( 'D', SearchOptions) then 926 call SetLastSearchDialogOptions( SearchOptions) 927 endif 835 928 836 929 SearchMode = 'c' … … 1175 1268 1176 1269 if uparg = 'C' then 1177 'RepeatChange '1270 'RepeatChange '\1\1\1\1'D' 1178 1271 elseif uparg = 'F' then 1179 'RepeatFind '1272 'RepeatFind '\1\1\1\1'D' 1180 1273 1181 1274 else
Note:
See TracChangeset
for help on using the changeset viewer.