mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 16:04:15 +00:00
fix history index update
This commit is contained in:
parent
1622529c89
commit
356972ae39
@ -77,7 +77,7 @@ impl History {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn try_back(&self, follow_to_index: bool) -> Option<GString> {
|
pub fn try_back(&self, follow_to_index: bool) -> Option<GString> {
|
||||||
if let Some(index) = self.index.take() {
|
if let Some(index) = self.index.borrow().as_ref() {
|
||||||
if let Some(memory) = self.memory.borrow().get(index - 1) {
|
if let Some(memory) = self.memory.borrow().get(index - 1) {
|
||||||
if follow_to_index {
|
if follow_to_index {
|
||||||
self.index.replace(Some(index - 1));
|
self.index.replace(Some(index - 1));
|
||||||
@ -94,7 +94,7 @@ impl History {
|
|||||||
} */
|
} */
|
||||||
|
|
||||||
pub fn try_forward(&self, follow_to_index: bool) -> Option<GString> {
|
pub fn try_forward(&self, follow_to_index: bool) -> Option<GString> {
|
||||||
if let Some(index) = self.index.take() {
|
if let Some(index) = self.index.borrow().as_ref() {
|
||||||
if let Some(memory) = self.memory.borrow().get(index + 1) {
|
if let Some(memory) = self.memory.borrow().get(index + 1) {
|
||||||
if follow_to_index {
|
if follow_to_index {
|
||||||
self.index.replace(Some(index + 1));
|
self.index.replace(Some(index + 1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user