Skip to content

Commit

Permalink
Fix issues found in review
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Feb 27, 2025
1 parent 97ecf08 commit bdee89c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
18 changes: 15 additions & 3 deletions packages/app-desktop/plugins/GotoAnything.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ interface GotoAnythingSearchResult {
}

// GotoAnything supports several modes:
//
// - Default: Search in note title, body. Can search for folders, tags, etc. This is the full
// featured GotoAnything.
// - TitleOnly; Search in note titles only. These different mode can be set from the `gotoAnything`
// command.
//
// - TitleOnly: Search in note titles only.
//
// These different modes can be set from the `gotoAnything` command.

export enum Mode {
Default = 0,
TitleOnly,
Expand Down Expand Up @@ -708,6 +712,14 @@ class DialogComponent extends React.PureComponent<Props, State> {
);
}

private helpText() {
if (this.mode_ === Mode.TitleOnly) {
return _('Type a note title to search for it.');
} else {
return _('Type a note title or part of its content to jump to it. Or type # followed by a tag name, or @ followed by a notebook name. Or type : to search for commands.');
}
}

public render() {
const style = this.style();
const helpTextId = 'goto-anything-help-text';
Expand All @@ -718,7 +730,7 @@ class DialogComponent extends React.PureComponent<Props, State> {
id={helpTextId}
style={style.help}
hidden={!this.state.showHelp}
>{_('Type a note title or part of its content to jump to it. Or type # followed by a tag name, or @ followed by a notebook name. Or type : to search for commands.')}</div>
>{this.helpText()}</div>
);

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/services/KeymapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const defaultKeymapItems = {
{ accelerator: 'Option+Cmd+Backspace', command: 'permanentlyDeleteNote' },
{ accelerator: 'Option+Cmd+N', command: 'openNoteInNewWindow' },
{ accelerator: 'Ctrl+M', command: 'toggleTabMovesFocus' },
{ accelerator: 'Ctrl+L', command: 'linkToNote' },
{ accelerator: 'Shift+Option+L', command: 'linkToNote' },
],
default: [
{ accelerator: 'Ctrl+N', command: 'newNote' },
Expand Down Expand Up @@ -115,7 +115,7 @@ const defaultKeymapItems = {
{ accelerator: 'Ctrl+Alt+3', command: 'switchProfile3' },
{ accelerator: 'Ctrl+Alt+N', command: 'openNoteInNewWindow' },
{ accelerator: 'Ctrl+M', command: 'toggleTabMovesFocus' },
{ accelerator: 'Ctrl+L', command: 'linkToNote' },
{ accelerator: 'Shift+Alt+L', command: 'linkToNote' },
],
};

Expand Down
2 changes: 1 addition & 1 deletion readme/apps/link_to_note.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Simply create the link in Markdown, as described in the [Markdown guide](https:/

## Use the "Link to note" dialog

An easier way is to use the "Link to note" dialog - to do so press `Ctrl+L` (by default) or open the dialog from **Tools => Link to note...**. Then type the note you would like to link to and press Enter when done.
An easier way is to use the "Link to note" dialog - to do so open the dialog from **Tools => Link to note...**. Then type the note you would like to link to and press <kbd>Enter</kbd> when done.

This will create a new link and insert it into your current note.

0 comments on commit bdee89c

Please sign in to comment.