|
@@ -37,6 +37,7 @@ enum _IsolateCommand {
|
|
|
updateSearchPattern,
|
|
updateSearchPattern,
|
|
|
updateSearchOptions,
|
|
updateSearchOptions,
|
|
|
updateCurrentSearchHit,
|
|
updateCurrentSearchHit,
|
|
|
|
|
+ updateIsUserSearchActive,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
enum _IsolateEvent {
|
|
enum _IsolateEvent {
|
|
@@ -153,6 +154,7 @@ void terminalMain(SendPort port) async {
|
|
|
_terminal.userSearchResult,
|
|
_terminal.userSearchResult,
|
|
|
_terminal.userSearchPattern,
|
|
_terminal.userSearchPattern,
|
|
|
_terminal.userSearchOptions,
|
|
_terminal.userSearchOptions,
|
|
|
|
|
+ _terminal.isUserSearchActive,
|
|
|
);
|
|
);
|
|
|
port.send([_IsolateEvent.newState, newState]);
|
|
port.send([_IsolateEvent.newState, newState]);
|
|
|
_needNotify = true;
|
|
_needNotify = true;
|
|
@@ -176,6 +178,9 @@ void terminalMain(SendPort port) async {
|
|
|
case _IsolateCommand.updateCurrentSearchHit:
|
|
case _IsolateCommand.updateCurrentSearchHit:
|
|
|
_terminal?.currentSearchHit = msg[1];
|
|
_terminal?.currentSearchHit = msg[1];
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case _IsolateCommand.updateIsUserSearchActive:
|
|
|
|
|
+ _terminal?.isUserSearchActive = msg[1];
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -224,6 +229,7 @@ class TerminalState {
|
|
|
TerminalSearchResult searchResult;
|
|
TerminalSearchResult searchResult;
|
|
|
String? userSearchPattern;
|
|
String? userSearchPattern;
|
|
|
TerminalSearchOptions userSearchOptions;
|
|
TerminalSearchOptions userSearchOptions;
|
|
|
|
|
+ bool isUserSearchActive;
|
|
|
|
|
|
|
|
TerminalState(
|
|
TerminalState(
|
|
|
this.scrollOffsetFromBottom,
|
|
this.scrollOffsetFromBottom,
|
|
@@ -244,6 +250,7 @@ class TerminalState {
|
|
|
this.searchResult,
|
|
this.searchResult,
|
|
|
this.userSearchPattern,
|
|
this.userSearchPattern,
|
|
|
this.userSearchOptions,
|
|
this.userSearchOptions,
|
|
|
|
|
+ this.isUserSearchActive,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -410,7 +417,6 @@ class TerminalIsolate with Observable implements TerminalUiInteraction {
|
|
|
break;
|
|
break;
|
|
|
case _IsolateEvent.newState:
|
|
case _IsolateEvent.newState:
|
|
|
_lastState = message[1];
|
|
_lastState = message[1];
|
|
|
- _updateLocalCaches();
|
|
|
|
|
if (!initialRefreshCompleted.isCompleted) {
|
|
if (!initialRefreshCompleted.isCompleted) {
|
|
|
initialRefreshCompleted.complete(true);
|
|
initialRefreshCompleted.complete(true);
|
|
|
}
|
|
}
|
|
@@ -570,42 +576,29 @@ class TerminalIsolate with Observable implements TerminalUiInteraction {
|
|
|
_sendPort?.send([_IsolateCommand.updateCurrentSearchHit, currentSearchHit]);
|
|
_sendPort?.send([_IsolateCommand.updateCurrentSearchHit, currentSearchHit]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- TerminalSearchOptions? _localUserSearchOptionsCache;
|
|
|
|
|
-
|
|
|
|
|
@override
|
|
@override
|
|
|
TerminalSearchOptions get userSearchOptions =>
|
|
TerminalSearchOptions get userSearchOptions =>
|
|
|
- _localUserSearchOptionsCache ?? TerminalSearchOptions();
|
|
|
|
|
|
|
+ _lastState?.userSearchOptions ?? TerminalSearchOptions();
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void set userSearchOptions(TerminalSearchOptions options) {
|
|
void set userSearchOptions(TerminalSearchOptions options) {
|
|
|
- _localUserSearchOptionsCache = options;
|
|
|
|
|
_sendPort?.send([_IsolateCommand.updateSearchOptions, options]);
|
|
_sendPort?.send([_IsolateCommand.updateSearchOptions, options]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String? _localUserSearchPatternCache;
|
|
|
|
|
-
|
|
|
|
|
@override
|
|
@override
|
|
|
- String? get userSearchPattern => _localUserSearchPatternCache;
|
|
|
|
|
|
|
+ String? get userSearchPattern => _lastState?.userSearchPattern;
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void set userSearchPattern(String? newValue) {
|
|
void set userSearchPattern(String? newValue) {
|
|
|
- _localUserSearchPatternCache = newValue;
|
|
|
|
|
_sendPort?.send([_IsolateCommand.updateSearchPattern, newValue]);
|
|
_sendPort?.send([_IsolateCommand.updateSearchPattern, newValue]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- var _isUserSearchActive = false;
|
|
|
|
|
-
|
|
|
|
|
@override
|
|
@override
|
|
|
- bool get isUserSearchActive => _isUserSearchActive;
|
|
|
|
|
|
|
+ bool get isUserSearchActive => _lastState?.isUserSearchActive ?? false;
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void set isUserSearchActive(bool isUserSearchActive) {
|
|
void set isUserSearchActive(bool isUserSearchActive) {
|
|
|
- _isUserSearchActive = isUserSearchActive;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- void _updateLocalCaches() {
|
|
|
|
|
- _localUserSearchPatternCache = _lastState?.userSearchPattern;
|
|
|
|
|
- _localUserSearchOptionsCache =
|
|
|
|
|
- _lastState?.userSearchOptions ?? TerminalSearchOptions();
|
|
|
|
|
|
|
+ _sendPort
|
|
|
|
|
+ ?.send([_IsolateCommand.updateIsUserSearchActive, isUserSearchActive]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|