Skip to content
Snippets Groups Projects
Commit 6a6429c1 authored by chris's avatar chris
Browse files

move backwards in progress

parent 6353a2af
No related branches found
No related tags found
1 merge request!231Connect funcionality
...@@ -240,16 +240,34 @@ const FindComponent = ({ close, expand, setPreviousSearcValue }) => { ...@@ -240,16 +240,34 @@ const FindComponent = ({ close, expand, setPreviousSearcValue }) => {
resultsFrom[lastActiveViewId], resultsFrom[lastActiveViewId],
false, false,
); );
let position = resultsFrom[lastActiveViewId].indexOf(found); const position = resultsFrom[lastActiveViewId].indexOf(found);
if (lastSelection.from <= found && position !== 0) position -= 1; /* User selection lesser than found */
if (lastSelection.from > found) {
helpers.moveToMatch(view, lastActiveViewId, results, position);
}
if (lastSelection.from === found && position === 0) { if (lastSelection.from <= found && position !== 0) {
view.main.focus(); helpers.moveToMatch(view, lastActiveViewId, results, position - 1);
console.log('first in view');
} }
helpers.moveToMatch(view, lastActiveViewId, results, position); if (lastSelection.from === found && position === 0) {
if (lastActiveViewId === 'main') {
for (let i = notesIds.length - 1; i >= 0; i--) {
if (
results[notesIds[i]].length > 0 &&
notesIds[i] !== lastActiveViewId
) {
helpers.moveToMatch(
view,
notesIds[i],
results,
results[notesIds[i]].length - 1,
);
}
}
}
}
}; };
return ( return (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment