Fossil SCM

Enable the search in the built-in help text even without a repository.

tsbg 2025-04-02 11:55 trunk
Commit 21c54d5db0ab93f2f103da5a8aaa3c9f40a55051589f3fff37ba0bcfb107c270
1 file changed +3 -2
+3 -2
--- src/search.c
+++ src/search.c
@@ -618,10 +618,11 @@
618618
int bDebug = find_option("debug",0,0)!=0; /* Undocumented */
619619
int nLimit = zLimit ? atoi(zLimit) : -1000;
620620
int width;
621621
int nTty = 0; /* VT100 highlight color for matching text */
622622
const char *zHighlight = 0;
623
+ int bFlags = 0; /* DB open flags */
623624
624625
nTty = terminal_is_vt100();
625626
626627
/* Undocumented option to change highlight color */
627628
zHighlight = find_option("highlight",0,1);
@@ -666,12 +667,12 @@
666667
if( find_option("wiki",0,0) ){ srchFlags |= SRCH_WIKI; bFts = 1; }
667668
668669
/* If no search objects are specified, default to "check-in comments" */
669670
if( srchFlags==0 ) srchFlags = SRCH_CKIN;
670671
671
-
672
- db_find_and_open_repository(0, 0);
672
+ if( srchFlags==SRCH_HELP ) bFlags = OPEN_OK_NOT_FOUND|OPEN_SUBSTITUTE;
673
+ db_find_and_open_repository(bFlags, 0);
673674
verify_all_options();
674675
if( g.argc<3 ) return;
675676
login_set_capabilities("s", 0);
676677
if( search_restrict(srchFlags)==0 && (srchFlags & SRCH_HELP)==0 ){
677678
const char *zC1 = 0, *zPlural = "s";
678679
--- src/search.c
+++ src/search.c
@@ -618,10 +618,11 @@
618 int bDebug = find_option("debug",0,0)!=0; /* Undocumented */
619 int nLimit = zLimit ? atoi(zLimit) : -1000;
620 int width;
621 int nTty = 0; /* VT100 highlight color for matching text */
622 const char *zHighlight = 0;
 
623
624 nTty = terminal_is_vt100();
625
626 /* Undocumented option to change highlight color */
627 zHighlight = find_option("highlight",0,1);
@@ -666,12 +667,12 @@
666 if( find_option("wiki",0,0) ){ srchFlags |= SRCH_WIKI; bFts = 1; }
667
668 /* If no search objects are specified, default to "check-in comments" */
669 if( srchFlags==0 ) srchFlags = SRCH_CKIN;
670
671
672 db_find_and_open_repository(0, 0);
673 verify_all_options();
674 if( g.argc<3 ) return;
675 login_set_capabilities("s", 0);
676 if( search_restrict(srchFlags)==0 && (srchFlags & SRCH_HELP)==0 ){
677 const char *zC1 = 0, *zPlural = "s";
678
--- src/search.c
+++ src/search.c
@@ -618,10 +618,11 @@
618 int bDebug = find_option("debug",0,0)!=0; /* Undocumented */
619 int nLimit = zLimit ? atoi(zLimit) : -1000;
620 int width;
621 int nTty = 0; /* VT100 highlight color for matching text */
622 const char *zHighlight = 0;
623 int bFlags = 0; /* DB open flags */
624
625 nTty = terminal_is_vt100();
626
627 /* Undocumented option to change highlight color */
628 zHighlight = find_option("highlight",0,1);
@@ -666,12 +667,12 @@
667 if( find_option("wiki",0,0) ){ srchFlags |= SRCH_WIKI; bFts = 1; }
668
669 /* If no search objects are specified, default to "check-in comments" */
670 if( srchFlags==0 ) srchFlags = SRCH_CKIN;
671
672 if( srchFlags==SRCH_HELP ) bFlags = OPEN_OK_NOT_FOUND|OPEN_SUBSTITUTE;
673 db_find_and_open_repository(bFlags, 0);
674 verify_all_options();
675 if( g.argc<3 ) return;
676 login_set_capabilities("s", 0);
677 if( search_restrict(srchFlags)==0 && (srchFlags & SRCH_HELP)==0 ){
678 const char *zC1 = 0, *zPlural = "s";
679

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button