Advertisement
Guest User

tpp.patch

a guest
Dec 11th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. --- ../tpp-old/tpp-1.3.1/tpp.rb 2007-04-23 02:12:21.000000000 -0700
  2. +++ tpp.rb 2014-12-10 22:28:07.945586931 -0800
  3. @@ -590,7 +590,7 @@
  4. string = string[0...([0, cursor_pos-1].max)] + string[cursor_pos..-1]
  5. cursor_pos = [0, cursor_pos-1].max
  6. window.mvaddstr(@termheight/4, 1+prompt.length+string.length, " ")
  7. - when " "[0]..255
  8. + when " "[0].ord..255
  9. if (cursor_pos < max_len)
  10. string[cursor_pos,0] = ch.chr
  11. cursor_pos += 1
  12. @@ -1396,17 +1396,17 @@
  13. loop do
  14. ch = @vis.get_key
  15. case ch
  16. - when 'q'[0], 'Q'[0] # 'Q'uit
  17. + when 'q'[0].ord, 'Q'[0].ord # 'Q'uit
  18. return
  19. - when 'r'[0], 'R'[0] # 'R'edraw slide
  20. + when 'r'[0].ord, 'R'[0].ord # 'R'edraw slide
  21. changed_page = true # @todo: actually implement redraw
  22. - when 'e'[0], 'E'[0]
  23. + when 'e'[0].ord, 'E'[0].ord
  24. @cur_page = @pages.size - 1
  25. break
  26. - when 's'[0], 'S'[0]
  27. + when 's'[0].ord, 'S'[0].ord
  28. @cur_page = 0
  29. break
  30. - when 'j'[0], 'J'[0] # 'J'ump to slide
  31. + when 'j'[0].ord, 'J'[0].ord # 'J'ump to slide
  32. screen = @vis.store_screen
  33. p = @vis.read_newpage(@pages,@cur_page)
  34. if p >= 0 and p < @pages.size
  35. @@ -1417,28 +1417,28 @@
  36. @vis.restore_screen(screen)
  37. end
  38. break
  39. - when 'l'[0], 'L'[0] # re'l'oad current file
  40. + when 'l'[0].ord, 'L'[0].ord # re'l'oad current file
  41. @reload_file = true
  42. return
  43. - when 'c'[0], 'C'[0] # command prompt
  44. + when 'c'[0].ord, 'C'[0].ord # command prompt
  45. screen = @vis.store_screen
  46. @vis.do_command_prompt
  47. @vis.clear
  48. @vis.restore_screen(screen)
  49. - when '?'[0], 'h'[0]
  50. + when '?'[0].ord, 'h'[0].ord
  51. screen = @vis.store_screen
  52. @vis.show_help_page
  53. ch = @vis.get_key
  54. @vis.clear
  55. @vis.restore_screen(screen)
  56. - when :keyright, :keydown, ' '[0]
  57. + when :keyright, :keydown, ' '[0].ord
  58. if @cur_page + 1 < @pages.size and eop then
  59. @cur_page += 1
  60. @pages[@cur_page].reset_eop
  61. @vis.new_page
  62. end
  63. break
  64. - when 'b'[0], 'B'[0], :keyleft, :keyup
  65. + when 'b'[0].ord, 'B'[0].ord, :keyleft, :keyup
  66. if @cur_page > 0 then
  67. @cur_page -= 1
  68. @pages[@cur_page].reset_eop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement