aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-06 15:56:17 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-06 15:56:17 -0400
commitb7e9966907434c6f58efa1307b2118a470c63d2b (patch)
tree42b496444cb1e08607867410f8c57e07d66cc0f9
parentb32558e3fb7021bb7fe2af311aaa535c79fc5637 (diff)
downloadLR-87-b7e9966907434c6f58efa1307b2118a470c63d2b.tar.gz
LR-87-b7e9966907434c6f58efa1307b2118a470c63d2b.zip
Back functionality now works
-rw-r--r--dumb_render.f904
-rw-r--r--history.f908
-rw-r--r--main.F907
-rw-r--r--render.f903
4 files changed, 17 insertions, 5 deletions
diff --git a/dumb_render.f90 b/dumb_render.f90
index 9172557..e6ca671 100644
--- a/dumb_render.f90
+++ b/dumb_render.f90
@@ -258,7 +258,7 @@ contains
character(*), intent(out)::input
- write(*, '(A68)', advance='no') "*** [A] PgUp | [Z] PgDn | [#] Link | [U] URL | [Q] Quit => "
+ write(*, '(A68)', advance='no') "*** [A]/[Z] PgUp/PgDn | [#] Link | [B] Back | [U] URL | [Q] Quit => "
read(*, *) input
end subroutine prompt_user
@@ -285,6 +285,8 @@ contains
else if(trim(input) == "z" .or. trim(input) == "Z") then
self%first_line = self%first_line + 24
dumb_action = render_action_layout
+ else if(trim(input) == "b" .or. trim(input) == "B") then
+ dumb_action = render_action_back
else if(trim(input) == "q" .or. trim(input) == "Q") then
dumb_action = render_action_quit
else if(trim(input) == "u" .or. trim(input) == "U") then
diff --git a/history.f90 b/history.f90
index d8193f8..e915855 100644
--- a/history.f90
+++ b/history.f90
@@ -67,16 +67,20 @@ contains
last => last_location(first_location)
if(associated(last)) then
- url = last%url
if(.not. associated(last, first_location)) then
new_last => first_location
do while(.not. associated(new_last%next, last))
new_last => new_last%next
end do
- new_last%next => null()
deallocate(last)
+ else
+ new_last => first_location
end if
+
+ new_last%next => null()
+ url = new_last%url
+
end if
end subroutine back_location
diff --git a/main.F90 b/main.F90
index f31a3ca..66e6d57 100644
--- a/main.F90
+++ b/main.F90
@@ -116,7 +116,12 @@ implicit none
select case(r%request_action(input))
case (render_action_quit)
running = .false.
-
+
+ case (render_action_back)
+ call back_location(locations_visited, current_url)
+ call free_lines(first_line)
+ loaded = .false.
+
case (render_action_layout)
call r%report_status("Performing Layout")
call layout_lines(first_line, r)
diff --git a/render.f90 b/render.f90
index 405fff9..578948c 100644
--- a/render.f90
+++ b/render.f90
@@ -4,7 +4,8 @@ implicit none
integer, parameter::render_action_none = 1
integer, parameter::render_action_goto = 2
integer, parameter::render_action_layout = 3
- integer, parameter::render_action_quit = 4
+ integer, parameter::render_action_back = 4
+ integer, parameter::render_action_quit = 5
type, abstract :: renderer