mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
fix history index update
This commit is contained in:
parent
1622529c89
commit
356972ae39
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue