aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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