mirror of https://github.com/laurent22/joplin.git
parent
46438a5888
commit
b98e64c881
|
@ -64,7 +64,7 @@ export default function useEditorSearch(CodeMirror: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
if (scrollTo) cm.scrollIntoView(match);
|
if (scrollTo) cm.setSelection(match.from, match.to);
|
||||||
return cm.markText(match.from, match.to, { className: 'cm-search-marker-selected' });
|
return cm.markText(match.from, match.to, { className: 'cm-search-marker-selected' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { useState, useCallback } from 'react';
|
import { useState, useCallback } from 'react';
|
||||||
import Logger from '@joplin/lib/Logger';
|
import Logger from '@joplin/lib/Logger';
|
||||||
import { SearchMarkers } from './useSearchMarkers';
|
import { SearchMarkers } from './useSearchMarkers';
|
||||||
|
const CommandService = require('@joplin/lib/services/CommandService').default;
|
||||||
|
|
||||||
const logger = Logger.create('useNoteSearchBar');
|
const logger = Logger.create('useNoteSearchBar');
|
||||||
|
|
||||||
|
@ -70,6 +71,7 @@ export default function useNoteSearchBar() {
|
||||||
const onClose = useCallback(() => {
|
const onClose = useCallback(() => {
|
||||||
setShowLocalSearch(false);
|
setShowLocalSearch(false);
|
||||||
setLocalSearch(defaultLocalSearch());
|
setLocalSearch(defaultLocalSearch());
|
||||||
|
void CommandService.instance().execute('focusElementNoteBody');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const setResultCount = useCallback((count: number) => {
|
const setResultCount = useCallback((count: number) => {
|
||||||
|
|
Loading…
Reference in New Issue