brakeman 6.2.2 → 8.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (626) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +110 -0
  3. data/README.md +4 -4
  4. data/bundle/load.rb +16 -14
  5. data/bundle/ruby/3.2.0/gems/csv-3.3.6/LICENSE.txt +33 -0
  6. data/bundle/ruby/3.2.0/gems/csv-3.3.6/NEWS.md +1047 -0
  7. data/bundle/ruby/3.2.0/gems/csv-3.3.6/README.md +55 -0
  8. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/core_ext/array.rb +9 -0
  9. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/core_ext/string.rb +9 -0
  10. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/fields_converter.rb +96 -0
  11. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/input_record_separator.rb +18 -0
  12. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/parser.rb +1307 -0
  13. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/row.rb +781 -0
  14. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/table.rb +1055 -0
  15. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/version.rb +6 -0
  16. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv/writer.rb +209 -0
  17. data/bundle/ruby/3.2.0/gems/csv-3.3.6/lib/csv.rb +2989 -0
  18. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/CHANGELOG +111 -0
  19. data/bundle/ruby/{3.1.0/gems/erubis-2.7.0 → 3.2.0/gems/erubi-1.13.1}/MIT-LICENSE +1 -0
  20. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/README.rdoc +151 -0
  21. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi/capture_block.rb +91 -0
  22. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi/capture_end.rb +58 -0
  23. data/bundle/ruby/3.2.0/gems/erubi-1.13.1/lib/erubi.rb +299 -0
  24. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/CHANGELOG.md +180 -4
  25. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/FAQ.md +1 -1
  26. data/bundle/ruby/3.2.0/gems/haml-6.4.0/Gemfile +34 -0
  27. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/MIT-LICENSE +1 -1
  28. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/README.md +23 -34
  29. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/REFERENCE.md +100 -171
  30. data/bundle/ruby/3.2.0/gems/haml-6.4.0/exe/haml +6 -0
  31. data/bundle/ruby/3.2.0/gems/haml-6.4.0/haml.gemspec +45 -0
  32. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/ambles.rb +20 -0
  33. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/attribute_builder.rb +162 -0
  34. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/attribute_compiler.rb +133 -0
  35. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/attribute_parser.rb +116 -0
  36. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/cli.rb +154 -0
  37. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler/children_compiler.rb +155 -0
  38. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler/comment_compiler.rb +51 -0
  39. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler/doctype_compiler.rb +52 -0
  40. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler/script_compiler.rb +114 -0
  41. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler/silent_script_compiler.rb +24 -0
  42. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler/tag_compiler.rb +76 -0
  43. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/compiler.rb +97 -0
  44. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/dynamic_merger.rb +67 -0
  45. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/engine.rb +59 -0
  46. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/lib/haml/error.rb +5 -4
  47. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/escape.rb +13 -0
  48. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/escape_any.rb +21 -0
  49. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/base.rb +12 -0
  50. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/cdata.rb +20 -0
  51. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/coffee.rb +17 -0
  52. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/css.rb +33 -0
  53. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/erb.rb +10 -0
  54. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/escaped.rb +22 -0
  55. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/javascript.rb +33 -0
  56. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/less.rb +20 -0
  57. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/markdown.rb +11 -0
  58. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/plain.rb +29 -0
  59. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/preserve.rb +22 -0
  60. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/ruby.rb +10 -0
  61. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/sass.rb +15 -0
  62. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/scss.rb +15 -0
  63. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/text_base.rb +25 -0
  64. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters/tilt_base.rb +59 -0
  65. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/filters.rb +75 -0
  66. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/force_escape.rb +29 -0
  67. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/helpers.rb +15 -0
  68. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/html.rb +22 -0
  69. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/identity.rb +13 -0
  70. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/object_ref.rb +35 -0
  71. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/lib/haml/parser.rb +159 -24
  72. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/rails_helpers.rb +53 -0
  73. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/rails_template.rb +62 -0
  74. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/railtie.rb +10 -0
  75. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/ruby_expression.rb +32 -0
  76. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/string_splitter.rb +140 -0
  77. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/template.rb +20 -0
  78. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/lib/haml/temple_line_counter.rb +2 -1
  79. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/lib/haml/util.rb +19 -15
  80. data/bundle/ruby/{3.1.0/gems/haml-5.2.2 → 3.2.0/gems/haml-6.4.0}/lib/haml/version.rb +1 -2
  81. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml/whitespace.rb +8 -0
  82. data/bundle/ruby/3.2.0/gems/haml-6.4.0/lib/haml.rb +13 -0
  83. data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/Changelog.md +4 -0
  84. data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/Gemfile +1 -0
  85. data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/list_renderer.rb +2 -2
  86. data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/menu.rb +7 -5
  87. data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/version.rb +1 -1
  88. data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline.rb +17 -12
  89. data/bundle/ruby/3.2.0/gems/parallel-1.28.0/lib/parallel/version.rb +4 -0
  90. data/bundle/ruby/{3.1.0/gems/parallel-1.26.3 → 3.2.0/gems/parallel-1.28.0}/lib/parallel.rb +12 -1
  91. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/config.rb +27 -26
  92. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/history.rb +3 -3
  93. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/io/ansi.rb +82 -142
  94. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/io/dumb.rb +16 -2
  95. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/io/windows.rb +120 -77
  96. data/bundle/ruby/3.2.0/gems/reline-0.7.0/lib/reline/io.rb +61 -0
  97. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_actor/base.rb +10 -4
  98. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_actor/emacs.rb +97 -97
  99. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_actor/vi_command.rb +182 -182
  100. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_actor/vi_insert.rb +137 -137
  101. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_stroke.rb +26 -16
  102. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/line_editor.rb +373 -537
  103. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/unicode/east_asian_width.rb +48 -23
  104. data/bundle/ruby/3.2.0/gems/reline-0.7.0/lib/reline/unicode.rb +421 -0
  105. data/bundle/ruby/3.2.0/gems/reline-0.7.0/lib/reline/version.rb +3 -0
  106. data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline.rb +49 -40
  107. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/NEWS.md +219 -1
  108. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/attribute.rb +7 -8
  109. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/cdata.rb +1 -1
  110. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/child.rb +2 -3
  111. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/comment.rb +1 -1
  112. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/doctype.rb +3 -8
  113. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/document.rb +21 -5
  114. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/element.rb +53 -59
  115. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/encoding.rb +3 -6
  116. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/functions.rb +3 -3
  117. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/instruction.rb +1 -1
  118. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/namespace.rb +4 -4
  119. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/node.rb +2 -2
  120. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/baseparser.rb +208 -116
  121. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/pullparser.rb +4 -0
  122. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/xpathparser.rb +4 -4
  123. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/quickpath.rb +19 -18
  124. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/rexml.rb +1 -1
  125. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/security.rb +2 -2
  126. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/source.rb +68 -8
  127. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/text.rb +29 -57
  128. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/validation/relaxng.rb +27 -26
  129. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/validation/validation.rb +8 -8
  130. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/xpath.rb +2 -13
  131. data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/xpath_parser.rb +44 -42
  132. data/bundle/ruby/{3.1.0/gems/ruby2ruby-2.5.1 → 3.2.0/gems/ruby2ruby-2.5.2}/History.rdoc +6 -0
  133. data/bundle/ruby/{3.1.0/gems/ruby2ruby-2.5.1 → 3.2.0/gems/ruby2ruby-2.5.2}/lib/ruby2ruby.rb +7 -4
  134. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/History.rdoc +67 -0
  135. data/bundle/ruby/3.2.0/gems/ruby_parser-3.22.0/Manifest.txt +39 -0
  136. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/README.rdoc +15 -3
  137. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/compare/normalize.rb +19 -3
  138. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/gauntlet.md +35 -5
  139. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/ruby_lexer.rb +9 -18
  140. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/ruby_lexer.rex.rb +1 -2
  141. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/ruby_parser.rb +18 -14
  142. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby_parser.yy → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser2.yy} +15 -22
  143. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby20_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser20.rb} +19 -22
  144. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby21_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser21.rb} +19 -22
  145. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby22_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser22.rb} +19 -22
  146. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby23_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser23.rb} +19 -22
  147. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby24_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser24.rb} +19 -22
  148. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby25_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser25.rb} +19 -22
  149. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby26_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser26.rb} +19 -22
  150. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby27_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser27.rb} +21 -24
  151. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby3_parser.yy → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser3.yy} +214 -79
  152. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby30_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser30.rb} +3339 -3351
  153. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3/lib/ruby31_parser.rb → 3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser31.rb} +3772 -3808
  154. data/bundle/ruby/3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser32.rb +13565 -0
  155. data/bundle/ruby/3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser33.rb +13653 -0
  156. data/bundle/ruby/3.2.0/gems/ruby_parser-3.22.0/lib/ruby_parser34.rb +13653 -0
  157. data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/ruby_parser_extras.rb +109 -60
  158. data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/History.rdoc +20 -0
  159. data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/pt_testcase.rb +1 -1
  160. data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/sexp.rb +1 -1
  161. data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/sexp_processor.rb +1 -1
  162. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/CHANGES +8 -2
  163. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/Gemfile +5 -2
  164. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/LICENSE +1 -1
  165. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/README.jp.md +10 -12
  166. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/README.md +21 -26
  167. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/embedded.rb +1 -1
  168. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/logic_less/context.rb +4 -3
  169. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/splat/builder.rb +18 -19
  170. data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/version.rb +1 -1
  171. data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/CHANGES +12 -0
  172. data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/README.md +1 -1
  173. data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/encoding.rb +1 -1
  174. data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/static_analyzer.rb +1 -1
  175. data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/string_splitter.rb +61 -5
  176. data/bundle/ruby/3.2.0/gems/temple-0.10.6/lib/temple/parser_engine.rb +34 -0
  177. data/bundle/ruby/3.2.0/gems/temple-0.10.6/lib/temple/static_analyzer.rb +148 -0
  178. data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/version.rb +1 -1
  179. data/bundle/ruby/3.2.0/gems/terminal-table-4.0.0/History.rdoc +149 -0
  180. data/bundle/ruby/3.2.0/gems/terminal-table-4.0.0/README.md +417 -0
  181. data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table/cell.rb +9 -9
  182. data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table/row.rb +18 -4
  183. data/bundle/ruby/3.2.0/gems/terminal-table-4.0.0/lib/terminal-table/separator.rb +66 -0
  184. data/bundle/ruby/3.2.0/gems/terminal-table-4.0.0/lib/terminal-table/style.rb +284 -0
  185. data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table/table.rb +49 -18
  186. data/bundle/ruby/3.2.0/gems/terminal-table-4.0.0/lib/terminal-table/util.rb +13 -0
  187. data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table/version.rb +1 -1
  188. data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table.rb +2 -2
  189. data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/terminal-table.gemspec +3 -4
  190. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/COPYING +1 -1
  191. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/asciidoc.rb +12 -5
  192. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/babel.rb +5 -0
  193. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/builder.rb +4 -0
  194. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/coffee.rb +14 -4
  195. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/commonmarker.rb +65 -0
  196. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/csv.rb +63 -0
  197. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/erb.rb +130 -0
  198. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/erubi.rb +41 -8
  199. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/etanni.rb +7 -0
  200. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/haml.rb +67 -1
  201. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/kramdown.rb +59 -0
  202. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/liquid.rb +93 -0
  203. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/livescript.rb +11 -4
  204. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/mapping.rb +9 -9
  205. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/markaby.rb +11 -2
  206. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/nokogiri.rb +13 -2
  207. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/pandoc.rb +81 -0
  208. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/pipeline.rb +6 -1
  209. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/plain.rb +5 -1
  210. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/prawn.rb +17 -6
  211. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/radius.rb +96 -0
  212. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rdiscount.rb +82 -0
  213. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rdoc.rb +41 -0
  214. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/redcarpet.rb +73 -0
  215. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/redcloth.rb +40 -0
  216. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/rst-pandoc.rb +33 -0
  217. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/sass.rb +16 -3
  218. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/slim.rb +18 -0
  219. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/string.rb +10 -2
  220. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/template.rb +189 -33
  221. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/typescript.rb +5 -0
  222. data/bundle/ruby/3.2.0/gems/tilt-2.8.0/lib/tilt/yajl.rb +91 -0
  223. data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt.rb +9 -5
  224. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/CHANGELOG.md +299 -0
  225. data/bundle/ruby/{3.1.0/gems/unicode-display_width-1.8.0 → 3.2.0/gems/unicode-display_width-3.2.0}/MIT-LICENSE.txt +1 -1
  226. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/README.md +194 -0
  227. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/data/display_width.marshal.gz +0 -0
  228. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/constants.rb +10 -0
  229. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/emoji_support.rb +55 -0
  230. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/index.rb +34 -0
  231. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/no_string_ext.rb +8 -0
  232. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/reline_ext.rb +14 -0
  233. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/string_ext.rb +9 -0
  234. data/bundle/ruby/3.2.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width.rb +247 -0
  235. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/CHANGELOG.md +202 -0
  236. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/CODE_OF_CONDUCT.md +74 -0
  237. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/Gemfile +9 -0
  238. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/Gemfile.lock +37 -0
  239. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/MIT-LICENSE.txt +20 -0
  240. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/README.md +205 -0
  241. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/data/emoji.marshal.gz +0 -0
  242. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/data/generate_constants.rb +344 -0
  243. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/constants.rb +50 -0
  244. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex.rb +8 -0
  245. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_basic.rb +8 -0
  246. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_emoji_keycap.rb +8 -0
  247. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_include_mqe.rb +8 -0
  248. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_include_mqe_uqe.rb +8 -0
  249. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_include_text.rb +8 -0
  250. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_picto.rb +8 -0
  251. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_picto_no_emoji.rb +8 -0
  252. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_possible.rb +8 -0
  253. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_prop_component.rb +8 -0
  254. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_prop_emoji.rb +8 -0
  255. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_prop_modifier.rb +8 -0
  256. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_prop_modifier_base.rb +8 -0
  257. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_prop_presentation.rb +8 -0
  258. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_text.rb +8 -0
  259. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_text_presentation.rb +8 -0
  260. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_valid.rb +8 -0
  261. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_valid_include_text.rb +8 -0
  262. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_well_formed.rb +8 -0
  263. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated/regex_well_formed_include_text.rb +8 -0
  264. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex.rb +8 -0
  265. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_basic.rb +8 -0
  266. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_emoji_keycap.rb +8 -0
  267. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_include_mqe.rb +8 -0
  268. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_include_mqe_uqe.rb +8 -0
  269. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_include_text.rb +8 -0
  270. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_picto.rb +8 -0
  271. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_picto_no_emoji.rb +8 -0
  272. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_possible.rb +8 -0
  273. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_prop_component.rb +8 -0
  274. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_prop_emoji.rb +8 -0
  275. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_prop_modifier.rb +8 -0
  276. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_prop_modifier_base.rb +8 -0
  277. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_prop_presentation.rb +8 -0
  278. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_text.rb +8 -0
  279. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_text_presentation.rb +8 -0
  280. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_valid.rb +8 -0
  281. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_valid_include_text.rb +8 -0
  282. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_well_formed.rb +8 -0
  283. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/generated_native/regex_well_formed_include_text.rb +8 -0
  284. data/bundle/ruby/{3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width → 3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji}/index.rb +5 -3
  285. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/lazy_constants.rb +56 -0
  286. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji/list.rb +13 -0
  287. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/lib/unicode/emoji.rb +111 -0
  288. data/bundle/ruby/3.2.0/gems/unicode-emoji-4.2.0/unicode-emoji.gemspec +22 -0
  289. data/lib/brakeman/app_tree.rb +87 -25
  290. data/lib/brakeman/checks/base_check.rb +5 -2
  291. data/lib/brakeman/checks/check_deserialize.rb +4 -1
  292. data/lib/brakeman/checks/check_eol_rails.rb +2 -0
  293. data/lib/brakeman/checks/check_eol_ruby.rb +2 -0
  294. data/lib/brakeman/checks/check_evaluation.rb +45 -8
  295. data/lib/brakeman/checks/check_execute.rb +23 -19
  296. data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -0
  297. data/lib/brakeman/checks/check_model_attributes.rb +1 -1
  298. data/lib/brakeman/checks/check_render.rb +6 -27
  299. data/lib/brakeman/checks/check_render_rce.rb +43 -0
  300. data/lib/brakeman/checks/check_session_settings.rb +1 -1
  301. data/lib/brakeman/checks/check_sql.rb +17 -7
  302. data/lib/brakeman/checks/check_weak_rsa_key.rb +1 -1
  303. data/lib/brakeman/checks.rb +31 -25
  304. data/lib/brakeman/commandline.rb +22 -5
  305. data/lib/brakeman/file_parser.rb +2 -0
  306. data/lib/brakeman/file_path.rb +4 -0
  307. data/lib/brakeman/logger.rb +265 -0
  308. data/lib/brakeman/messages.rb +1 -1
  309. data/lib/brakeman/options.rb +22 -16
  310. data/lib/brakeman/parsers/haml6_embedded.rb +23 -0
  311. data/lib/brakeman/parsers/rails_erubi.rb +82 -0
  312. data/lib/brakeman/parsers/template_parser.rb +39 -22
  313. data/lib/brakeman/processor.rb +4 -2
  314. data/lib/brakeman/processors/alias_processor.rb +18 -4
  315. data/lib/brakeman/processors/base_processor.rb +15 -6
  316. data/lib/brakeman/processors/controller_alias_processor.rb +1 -1
  317. data/lib/brakeman/processors/controller_processor.rb +3 -3
  318. data/lib/brakeman/processors/{erubis_template_processor.rb → erubi_template_procesor.rb} +3 -3
  319. data/lib/brakeman/processors/gem_processor.rb +1 -1
  320. data/lib/brakeman/processors/haml6_template_processor.rb +92 -0
  321. data/lib/brakeman/processors/haml_template_processor.rb +20 -3
  322. data/lib/brakeman/processors/lib/file_type_detector.rb +9 -7
  323. data/lib/brakeman/processors/lib/rails2_config_processor.rb +5 -4
  324. data/lib/brakeman/processors/lib/rails2_route_processor.rb +1 -1
  325. data/lib/brakeman/processors/lib/rails3_config_processor.rb +11 -2
  326. data/lib/brakeman/processors/lib/render_helper.rb +42 -3
  327. data/lib/brakeman/processors/lib/render_path.rb +1 -1
  328. data/lib/brakeman/processors/model_processor.rb +1 -1
  329. data/lib/brakeman/processors/template_processor.rb +1 -1
  330. data/lib/brakeman/report/ignore/config.rb +1 -2
  331. data/lib/brakeman/report/pager.rb +1 -1
  332. data/lib/brakeman/report/report_html.rb +1 -1
  333. data/lib/brakeman/report/report_junit.rb +4 -57
  334. data/lib/brakeman/report/report_sarif.rb +122 -2
  335. data/lib/brakeman/report/templates/header.html.erb +8 -3
  336. data/lib/brakeman/report/templates/ignored_warnings.html.erb +3 -3
  337. data/lib/brakeman/rescanner.rb +40 -390
  338. data/lib/brakeman/scanner.rb +113 -98
  339. data/lib/brakeman/tracker/collection.rb +12 -2
  340. data/lib/brakeman/tracker/config.rb +17 -13
  341. data/lib/brakeman/tracker/constants.rb +17 -2
  342. data/lib/brakeman/tracker/controller.rb +1 -1
  343. data/lib/brakeman/tracker/file_cache.rb +83 -0
  344. data/lib/brakeman/tracker.rb +32 -17
  345. data/lib/brakeman/version.rb +1 -1
  346. data/lib/brakeman.rb +130 -55
  347. data/lib/ruby_parser/bm_sexp.rb +14 -0
  348. metadata +460 -410
  349. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/CHANGES.txt +0 -828
  350. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/README.txt +0 -102
  351. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/contrib/erubis +0 -3468
  352. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -132
  353. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/contrib/inline-require +0 -179
  354. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/context.rb +0 -83
  355. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -357
  356. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -117
  357. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -113
  358. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -110
  359. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -119
  360. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -126
  361. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -95
  362. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -99
  363. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -125
  364. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -114
  365. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -127
  366. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -120
  367. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -723
  368. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/error.rb +0 -23
  369. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -88
  370. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -85
  371. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -47
  372. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -197
  373. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -353
  374. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -9
  375. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/main.rb +0 -516
  376. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -58
  377. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -144
  378. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis/util.rb +0 -22
  379. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/lib/erubis.rb +0 -73
  380. data/bundle/ruby/3.1.0/gems/erubis-2.7.0/setup.rb +0 -1331
  381. data/bundle/ruby/3.1.0/gems/haml-5.2.2/Gemfile +0 -16
  382. data/bundle/ruby/3.1.0/gems/haml-5.2.2/TODO +0 -24
  383. data/bundle/ruby/3.1.0/gems/haml-5.2.2/haml.gemspec +0 -45
  384. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/attribute_builder.rb +0 -219
  385. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/attribute_compiler.rb +0 -237
  386. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/attribute_parser.rb +0 -150
  387. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/buffer.rb +0 -182
  388. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/compiler.rb +0 -330
  389. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/engine.rb +0 -238
  390. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/escapable.rb +0 -77
  391. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/exec.rb +0 -347
  392. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/filters.rb +0 -399
  393. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/generator.rb +0 -42
  394. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers/action_view_extensions.rb +0 -60
  395. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers/action_view_mods.rb +0 -132
  396. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers/action_view_xss_mods.rb +0 -60
  397. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers/safe_erubi_template.rb +0 -20
  398. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers/safe_erubis_template.rb +0 -33
  399. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers/xss_mods.rb +0 -114
  400. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/helpers.rb +0 -709
  401. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/options.rb +0 -273
  402. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/plugin.rb +0 -54
  403. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/railtie.rb +0 -53
  404. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/sass_rails_filter.rb +0 -47
  405. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/template/options.rb +0 -27
  406. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/template.rb +0 -39
  407. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml/temple_engine.rb +0 -124
  408. data/bundle/ruby/3.1.0/gems/haml-5.2.2/lib/haml.rb +0 -25
  409. data/bundle/ruby/3.1.0/gems/haml-5.2.2/yard/default/fulldoc/html/css/common.sass +0 -15
  410. data/bundle/ruby/3.1.0/gems/haml-5.2.2/yard/default/layout/html/footer.erb +0 -12
  411. data/bundle/ruby/3.1.0/gems/parallel-1.26.3/lib/parallel/version.rb +0 -4
  412. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/io.rb +0 -41
  413. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/terminfo.rb +0 -158
  414. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/unicode.rb +0 -671
  415. data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/version.rb +0 -3
  416. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/Manifest.txt +0 -48
  417. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby20_parser.y +0 -2707
  418. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby21_parser.y +0 -2724
  419. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby22_parser.y +0 -2735
  420. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby23_parser.y +0 -2737
  421. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby24_parser.y +0 -2745
  422. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby25_parser.y +0 -2745
  423. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby26_parser.y +0 -2760
  424. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby27_parser.y +0 -3360
  425. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby30_parser.y +0 -3508
  426. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby31_parser.y +0 -3542
  427. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby32_parser.rb +0 -13601
  428. data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby32_parser.y +0 -3543
  429. data/bundle/ruby/3.1.0/gems/temple-0.10.3/lib/temple/static_analyzer.rb +0 -78
  430. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/History.rdoc +0 -85
  431. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/README.rdoc +0 -247
  432. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -14
  433. data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -79
  434. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/creole.rb +0 -14
  435. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/csv.rb +0 -53
  436. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/erb.rb +0 -65
  437. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/erubis.rb +0 -51
  438. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/kramdown.rb +0 -13
  439. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/liquid.rb +0 -40
  440. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/maruku.rb +0 -10
  441. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pandoc.rb +0 -39
  442. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/radius.rb +0 -41
  443. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/rdiscount.rb +0 -23
  444. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/rdoc.rb +0 -19
  445. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/redcarpet.rb +0 -31
  446. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/redcloth.rb +0 -13
  447. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/rst-pandoc.rb +0 -10
  448. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/slim.rb +0 -5
  449. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/wikicloth.rb +0 -12
  450. data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/yajl.rb +0 -81
  451. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/CHANGELOG.md +0 -137
  452. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/README.md +0 -124
  453. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
  454. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -8
  455. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -7
  456. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -17
  457. data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -51
  458. data/lib/brakeman/parsers/erubis_patch.rb +0 -11
  459. data/lib/brakeman/parsers/rails2_erubis.rb +0 -9
  460. data/lib/brakeman/parsers/rails2_xss_plugin_erubis.rb +0 -52
  461. data/lib/brakeman/parsers/rails3_erubis.rb +0 -85
  462. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/AUTHORS +0 -0
  463. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/COPYING +0 -0
  464. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/LICENSE +0 -0
  465. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/README.md +0 -0
  466. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/TODO +0 -0
  467. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/highline.gemspec +0 -0
  468. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/builtin_styles.rb +0 -0
  469. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/color_scheme.rb +0 -0
  470. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/compatibility.rb +0 -0
  471. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/custom_errors.rb +0 -0
  472. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/import.rb +0 -0
  473. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/io_console_compatible.rb +0 -0
  474. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/list.rb +0 -0
  475. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/menu/item.rb +0 -0
  476. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/paginator.rb +0 -0
  477. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/question/answer_converter.rb +0 -0
  478. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/question.rb +0 -0
  479. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/question_asker.rb +0 -0
  480. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/simulate.rb +0 -0
  481. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/statement.rb +0 -0
  482. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/string.rb +0 -0
  483. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/string_extensions.rb +0 -0
  484. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/style.rb +0 -0
  485. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/template_renderer.rb +0 -0
  486. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/terminal/io_console.rb +0 -0
  487. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/terminal/ncurses.rb +0 -0
  488. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/terminal/unix_stty.rb +0 -0
  489. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/terminal.rb +0 -0
  490. /data/bundle/ruby/{3.1.0/gems/highline-3.1.1 → 3.2.0/gems/highline-3.1.2}/lib/highline/wrapper.rb +0 -0
  491. /data/bundle/ruby/{3.1.0/gems/parallel-1.26.3 → 3.2.0/gems/parallel-1.28.0}/MIT-LICENSE.txt +0 -0
  492. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/BSDL +0 -0
  493. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/COPYING +0 -0
  494. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/README.md +0 -0
  495. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/face.rb +0 -0
  496. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_actor/composite.rb +0 -0
  497. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/key_actor.rb +0 -0
  498. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/lib/reline/kill_ring.rb +0 -0
  499. /data/bundle/ruby/{3.1.0/gems/reline-0.5.10 → 3.2.0/gems/reline-0.7.0}/license_of_rb-readline +0 -0
  500. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/LICENSE.txt +0 -0
  501. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/README.md +0 -0
  502. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/attlistdecl.rb +0 -0
  503. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/dtd/attlistdecl.rb +0 -0
  504. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/dtd/dtd.rb +0 -0
  505. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/dtd/elementdecl.rb +0 -0
  506. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/dtd/entitydecl.rb +0 -0
  507. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/dtd/notationdecl.rb +0 -0
  508. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/entity.rb +0 -0
  509. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/formatters/default.rb +0 -0
  510. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/formatters/pretty.rb +0 -0
  511. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/formatters/transitive.rb +0 -0
  512. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/light/node.rb +0 -0
  513. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/output.rb +0 -0
  514. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parent.rb +0 -0
  515. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parseexception.rb +0 -0
  516. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/lightparser.rb +0 -0
  517. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/sax2parser.rb +0 -0
  518. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/streamparser.rb +0 -0
  519. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/treeparser.rb +0 -0
  520. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/parsers/ultralightparser.rb +0 -0
  521. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/sax2listener.rb +0 -0
  522. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/streamlistener.rb +0 -0
  523. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/undefinednamespaceexception.rb +0 -0
  524. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/validation/validationexception.rb +0 -0
  525. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/xmldecl.rb +0 -0
  526. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml/xmltokens.rb +0 -0
  527. /data/bundle/ruby/{3.1.0/gems/rexml-3.3.8 → 3.2.0/gems/rexml-3.4.4}/lib/rexml.rb +0 -0
  528. /data/bundle/ruby/{3.1.0/gems/ruby2ruby-2.5.1 → 3.2.0/gems/ruby2ruby-2.5.2}/Manifest.txt +0 -0
  529. /data/bundle/ruby/{3.1.0/gems/ruby2ruby-2.5.1 → 3.2.0/gems/ruby2ruby-2.5.2}/README.rdoc +0 -0
  530. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/debugging.md +0 -0
  531. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/rp_extensions.rb +0 -0
  532. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/rp_stringscanner.rb +0 -0
  533. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/ruby_lexer.rex +0 -0
  534. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/lib/ruby_lexer_strings.rb +0 -0
  535. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/tools/munge.rb +0 -0
  536. /data/bundle/ruby/{3.1.0/gems/ruby_parser-3.20.3 → 3.2.0/gems/ruby_parser-3.22.0}/tools/ripper.rb +0 -0
  537. /data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/Manifest.txt +0 -0
  538. /data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/README.rdoc +0 -0
  539. /data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/composite_sexp_processor.rb +0 -0
  540. /data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/sexp_matcher.rb +0 -0
  541. /data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/strict_sexp.rb +0 -0
  542. /data/bundle/ruby/{3.1.0/gems/sexp_processor-4.17.2 → 3.2.0/gems/sexp_processor-4.17.5}/lib/unique.rb +0 -0
  543. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/code_attributes.rb +0 -0
  544. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/command.rb +0 -0
  545. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/controls.rb +0 -0
  546. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/do_inserter.rb +0 -0
  547. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/end_inserter.rb +0 -0
  548. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/engine.rb +0 -0
  549. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/erb_converter.rb +0 -0
  550. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/filter.rb +0 -0
  551. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/grammar.rb +0 -0
  552. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/include.rb +0 -0
  553. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/interpolation.rb +0 -0
  554. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/logic_less/filter.rb +0 -0
  555. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/logic_less.rb +0 -0
  556. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/parser.rb +0 -0
  557. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/railtie.rb +0 -0
  558. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/smart/escaper.rb +0 -0
  559. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/smart/filter.rb +0 -0
  560. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/smart/parser.rb +0 -0
  561. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/smart.rb +0 -0
  562. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/splat/filter.rb +0 -0
  563. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/template.rb +0 -0
  564. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim/translator.rb +0 -0
  565. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/lib/slim.rb +0 -0
  566. /data/bundle/ruby/{3.1.0/gems/slim-5.2.1 → 3.2.0/gems/slim-5.2.2}/slim.gemspec +0 -0
  567. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/EXPRESSIONS.md +0 -0
  568. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/Gemfile +0 -0
  569. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/LICENSE +0 -0
  570. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/engine.rb +0 -0
  571. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/erb/engine.rb +0 -0
  572. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/erb/parser.rb +0 -0
  573. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/erb/template.rb +0 -0
  574. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/erb/trimming.rb +0 -0
  575. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/exceptions.rb +0 -0
  576. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filter.rb +0 -0
  577. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/ambles.rb +0 -0
  578. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/code_merger.rb +0 -0
  579. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/control_flow.rb +0 -0
  580. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/dynamic_inliner.rb +0 -0
  581. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/dynamic_merger.rb +0 -0
  582. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/eraser.rb +0 -0
  583. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/escapable.rb +0 -0
  584. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/multi_flattener.rb +0 -0
  585. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/remove_bom.rb +0 -0
  586. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/static_merger.rb +0 -0
  587. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/filters/validator.rb +0 -0
  588. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/generator.rb +0 -0
  589. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/generators/array.rb +0 -0
  590. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/generators/array_buffer.rb +0 -0
  591. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/generators/erb.rb +0 -0
  592. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/generators/rails_output_buffer.rb +0 -0
  593. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/generators/string_buffer.rb +0 -0
  594. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/grammar.rb +0 -0
  595. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/attribute_merger.rb +0 -0
  596. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/attribute_remover.rb +0 -0
  597. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/attribute_sorter.rb +0 -0
  598. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/dispatcher.rb +0 -0
  599. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/fast.rb +0 -0
  600. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/filter.rb +0 -0
  601. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/pretty.rb +0 -0
  602. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/html/safe.rb +0 -0
  603. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/map.rb +0 -0
  604. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/mixins/dispatcher.rb +0 -0
  605. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/mixins/engine_dsl.rb +0 -0
  606. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/mixins/grammar_dsl.rb +0 -0
  607. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/mixins/options.rb +0 -0
  608. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/mixins/template.rb +0 -0
  609. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/parser.rb +0 -0
  610. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/templates/rails.rb +0 -0
  611. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/templates/tilt.rb +0 -0
  612. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/templates.rb +0 -0
  613. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple/utils.rb +0 -0
  614. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/lib/temple.rb +0 -0
  615. /data/bundle/ruby/{3.1.0/gems/temple-0.10.3 → 3.2.0/gems/temple-0.10.6}/temple.gemspec +0 -0
  616. /data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/Gemfile +0 -0
  617. /data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/LICENSE.txt +0 -0
  618. /data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/Manifest +0 -0
  619. /data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/Todo.rdoc +0 -0
  620. /data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table/import.rb +0 -0
  621. /data/bundle/ruby/{3.1.0/gems/terminal-table-1.8.0 → 3.2.0/gems/terminal-table-4.0.0}/lib/terminal-table/table_helper.rb +0 -0
  622. /data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/_emacs_org.rb +0 -0
  623. /data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/_handlebars.rb +0 -0
  624. /data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/_jbuilder.rb +0 -0
  625. /data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/_org.rb +0 -0
  626. /data/bundle/ruby/{3.1.0/gems/tilt-2.4.0 → 3.2.0/gems/tilt-2.8.0}/lib/tilt/cli.rb +0 -0
@@ -13,7 +13,7 @@ class Reline::LineEditor
13
13
  attr_accessor :prompt_proc
14
14
  attr_accessor :auto_indent_proc
15
15
  attr_accessor :dig_perfect_match_proc
16
- attr_writer :output
16
+ attr_accessor :rprompt
17
17
 
18
18
  VI_MOTIONS = %i{
19
19
  ed_prev_char
@@ -36,7 +36,6 @@ class Reline::LineEditor
36
36
 
37
37
  module CompletionState
38
38
  NORMAL = :normal
39
- COMPLETION = :completion
40
39
  MENU = :menu
41
40
  MENU_WITH_PERFECT_MATCH = :menu_with_perfect_match
42
41
  PERFECT_MATCH = :perfect_match
@@ -45,7 +44,6 @@ class Reline::LineEditor
45
44
  RenderedScreen = Struct.new(:base_y, :lines, :cursor_y, keyword_init: true)
46
45
 
47
46
  CompletionJourneyState = Struct.new(:line_index, :pre, :target, :post, :list, :pointer)
48
- NullActionState = [nil, nil].freeze
49
47
 
50
48
  class MenuInfo
51
49
  attr_reader :list
@@ -72,17 +70,21 @@ class Reline::LineEditor
72
70
 
73
71
  MINIMUM_SCROLLBAR_HEIGHT = 1
74
72
 
75
- def initialize(config, encoding)
73
+ def initialize(config)
76
74
  @config = config
77
75
  @completion_append_character = ''
78
76
  @screen_size = [0, 0] # Should be initialized with actual winsize in LineEditor#reset
79
- reset_variables(encoding: encoding)
77
+ reset_variables
80
78
  end
81
79
 
82
80
  def io_gate
83
81
  Reline::IOGate
84
82
  end
85
83
 
84
+ def encoding
85
+ io_gate.encoding
86
+ end
87
+
86
88
  def set_pasting_state(in_pasting)
87
89
  # While pasting, text to be inserted is stored to @continuous_insertion_buffer.
88
90
  # After pasting, this buffer should be force inserted.
@@ -136,9 +138,9 @@ class Reline::LineEditor
136
138
  end
137
139
  end
138
140
 
139
- def reset(prompt = '', encoding:)
141
+ def reset(prompt = '')
140
142
  @screen_size = Reline::IOGate.get_screen_size
141
- reset_variables(prompt, encoding: encoding)
143
+ reset_variables(prompt)
142
144
  @rendered_screen.base_y = Reline::IOGate.cursor_pos.y
143
145
  if ENV.key?('RELINE_ALT_SCROLLBAR')
144
146
  @full_block = '::'
@@ -150,7 +152,7 @@ class Reline::LineEditor
150
152
  @upper_half_block = '▀'
151
153
  @lower_half_block = '▄'
152
154
  @block_elem_width = 1
153
- elsif @encoding == Encoding::UTF_8
155
+ elsif encoding == Encoding::UTF_8
154
156
  @full_block = '█'
155
157
  @upper_half_block = '▀'
156
158
  @lower_half_block = '▄'
@@ -219,10 +221,9 @@ class Reline::LineEditor
219
221
  @eof
220
222
  end
221
223
 
222
- def reset_variables(prompt = '', encoding:)
224
+ def reset_variables(prompt = '')
223
225
  @prompt = prompt.gsub("\n", "\\n")
224
- @mark_pointer = nil
225
- @encoding = encoding
226
+ @mark_position = nil
226
227
  @is_multiline = false
227
228
  @finished = false
228
229
  @history_pointer = nil
@@ -239,7 +240,7 @@ class Reline::LineEditor
239
240
  @searching_prompt = nil
240
241
  @just_cursor_moving = false
241
242
  @eof = false
242
- @continuous_insertion_buffer = String.new(encoding: @encoding)
243
+ @continuous_insertion_buffer = String.new(encoding: encoding)
243
244
  @scroll_partial_screen = 0
244
245
  @drop_terminate_spaces = false
245
246
  @in_pasting = false
@@ -249,21 +250,20 @@ class Reline::LineEditor
249
250
  @resized = false
250
251
  @cache = {}
251
252
  @rendered_screen = RenderedScreen.new(base_y: 0, lines: [], cursor_y: 0)
252
- @input_lines = [[[""], 0, 0]]
253
- @input_lines_position = 0
254
- @undoing = false
255
- @prev_action_state = NullActionState
256
- @next_action_state = NullActionState
253
+ @undo_redo_history = [[[""], 0, 0]]
254
+ @undo_redo_index = 0
255
+ @restoring = false
256
+ @prev_action_state = {}
257
+ @next_action_state = {}
257
258
  reset_line
258
259
  end
259
260
 
260
261
  def reset_line
261
262
  @byte_pointer = 0
262
- @buffer_of_lines = [String.new(encoding: @encoding)]
263
+ @buffer_of_lines = [String.new(encoding: encoding)]
263
264
  @line_index = 0
264
265
  @cache.clear
265
266
  @line_backup_in_history = nil
266
- @multibyte_buffer = String.new(encoding: 'ASCII-8BIT')
267
267
  end
268
268
 
269
269
  def multiline_on
@@ -275,7 +275,7 @@ class Reline::LineEditor
275
275
  end
276
276
 
277
277
  private def insert_new_line(cursor_line, next_line)
278
- @buffer_of_lines.insert(@line_index + 1, String.new(next_line, encoding: @encoding))
278
+ @buffer_of_lines.insert(@line_index + 1, String.new(next_line, encoding: encoding))
279
279
  @buffer_of_lines[@line_index] = cursor_line
280
280
  @line_index += 1
281
281
  @byte_pointer = 0
@@ -297,8 +297,8 @@ class Reline::LineEditor
297
297
  end
298
298
  end
299
299
 
300
- private def split_by_width(str, max_width, offset: 0)
301
- Reline::Unicode.split_by_width(str, max_width, @encoding, offset: offset)
300
+ private def split_line_by_width(str, max_width, offset: 0)
301
+ Reline::Unicode.split_line_by_width(str, max_width, encoding, offset: offset)
302
302
  end
303
303
 
304
304
  def current_byte_pointer_cursor
@@ -388,8 +388,8 @@ class Reline::LineEditor
388
388
  if (cached = cached_wraps[[prompt, line]])
389
389
  next cached
390
390
  end
391
- *wrapped_prompts, code_line_prompt = split_by_width(prompt, width).first.compact
392
- wrapped_lines = split_by_width(line, width, offset: calculate_width(code_line_prompt, true)).first.compact
391
+ *wrapped_prompts, code_line_prompt = split_line_by_width(prompt, width)
392
+ wrapped_lines = split_line_by_width(line, width, offset: calculate_width(code_line_prompt, true))
393
393
  wrapped_prompts.map { |p| [p, ''] } + [[code_line_prompt, wrapped_lines.first]] + wrapped_lines.drop(1).map { |c| ['', c] }
394
394
  end
395
395
  end
@@ -413,7 +413,7 @@ class Reline::LineEditor
413
413
  # do nothing
414
414
  elsif level == :blank
415
415
  Reline::IOGate.move_cursor_column base_x
416
- @output.write "#{Reline::IOGate.reset_color_sequence}#{' ' * width}"
416
+ Reline::IOGate.write "#{Reline::IOGate.reset_color_sequence}#{' ' * width}"
417
417
  else
418
418
  x, w, content = new_items[level]
419
419
  cover_begin = base_x != 0 && new_levels[base_x - 1] == level
@@ -423,7 +423,7 @@ class Reline::LineEditor
423
423
  content, pos = Reline::Unicode.take_mbchar_range(content, base_x - x, width, cover_begin: cover_begin, cover_end: cover_end, padding: true)
424
424
  end
425
425
  Reline::IOGate.move_cursor_column x + pos
426
- @output.write "#{Reline::IOGate.reset_color_sequence}#{content}#{Reline::IOGate.reset_color_sequence}"
426
+ Reline::IOGate.write "#{Reline::IOGate.reset_color_sequence}#{content}#{Reline::IOGate.reset_color_sequence}"
427
427
  end
428
428
  base_x += width
429
429
  end
@@ -436,8 +436,8 @@ class Reline::LineEditor
436
436
  # Calculate cursor position in word wrapped content.
437
437
  def wrapped_cursor_position
438
438
  prompt_width = calculate_width(prompt_list[@line_index], true)
439
- line_before_cursor = whole_lines[@line_index].byteslice(0, @byte_pointer)
440
- wrapped_line_before_cursor = split_by_width(' ' * prompt_width + line_before_cursor, screen_width).first.compact
439
+ line_before_cursor = Reline::Unicode.escape_for_print(whole_lines[@line_index].byteslice(0, @byte_pointer))
440
+ wrapped_line_before_cursor = split_line_by_width(' ' * prompt_width + line_before_cursor, screen_width)
441
441
  wrapped_cursor_y = wrapped_prompt_and_input_lines[0...@line_index].sum(&:size) + wrapped_line_before_cursor.size - 1
442
442
  wrapped_cursor_x = calculate_width(wrapped_line_before_cursor.last)
443
443
  [wrapped_cursor_x, wrapped_cursor_y]
@@ -459,18 +459,15 @@ class Reline::LineEditor
459
459
  end
460
460
 
461
461
  def render_finished
462
- render_differential([], 0, 0)
463
- lines = @buffer_of_lines.size.times.map do |i|
464
- line = prompt_list[i] + modified_lines[i]
465
- wrapped_lines, = split_by_width(line, screen_width)
466
- wrapped_lines.last.empty? ? "#{line} " : line
462
+ Reline::IOGate.buffered_output do
463
+ render_differential([], 0, 0)
464
+ lines = @buffer_of_lines.size.times.map do |i|
465
+ line = Reline::Unicode.strip_non_printing_start_end(prompt_list[i]) + modified_lines[i]
466
+ wrapped_lines = split_line_by_width(line, screen_width)
467
+ wrapped_lines.last.empty? ? "#{line} " : line
468
+ end
469
+ Reline::IOGate.write lines.map { |l| "#{l}\r\n" }.join
467
470
  end
468
- @output.puts lines.map { |l| "#{l}\r\n" }.join
469
- end
470
-
471
- def print_nomultiline_prompt
472
- # Readline's test `TestRelineAsReadline#test_readline` requires first output to be prompt, not cursor reset escape sequence.
473
- @output.write @prompt if @prompt && !@is_multiline
474
471
  end
475
472
 
476
473
  def render
@@ -479,6 +476,20 @@ class Reline::LineEditor
479
476
  prompt_width = Reline::Unicode.calculate_width(prompt, true)
480
477
  [[0, prompt_width, prompt], [prompt_width, Reline::Unicode.calculate_width(line, true), line]]
481
478
  end
479
+
480
+ # Add rprompt to the first visible line if set and there's room
481
+ if @rprompt && !@rprompt.empty? && new_lines[0]
482
+ rprompt_width = Reline::Unicode.calculate_width(@rprompt, true)
483
+ right_col = screen_width - rprompt_width
484
+ first_line = new_lines[0]
485
+ # Calculate the end of the current content (prompt + input)
486
+ content_end = first_line.sum { |_, width, _| width }
487
+ # Only show rprompt if there's at least 1 char gap between content and rprompt
488
+ if right_col > content_end
489
+ first_line << [right_col, rprompt_width, @rprompt]
490
+ end
491
+ end
492
+
482
493
  if @menu_info
483
494
  @menu_info.lines(screen_width).each do |item|
484
495
  new_lines << [[0, Reline::Unicode.calculate_width(item), item]]
@@ -494,18 +505,21 @@ class Reline::LineEditor
494
505
  next if row < 0 || row >= screen_height
495
506
 
496
507
  dialog_rows = new_lines[row] ||= []
497
- # index 0 is for prompt, index 1 is for line, index 2.. is for dialog
498
- dialog_rows[index + 2] = [x_range.begin, dialog.width, dialog.contents[row - y_range.begin]]
508
+ # index 0 is for prompt, index 1 is for line, index 2 is for rprompt, index 3.. is for dialog
509
+ dialog_rows[index + 3] = [x_range.begin, dialog.width, dialog.contents[row - y_range.begin]]
499
510
  end
500
511
  end
501
512
 
502
- render_differential new_lines, wrapped_cursor_x, wrapped_cursor_y - screen_scroll_top
513
+ Reline::IOGate.buffered_output do
514
+ render_differential new_lines, wrapped_cursor_x, wrapped_cursor_y - screen_scroll_top
515
+ end
503
516
  end
504
517
 
505
518
  # Reflects lines to be rendered and new cursor position to the screen
506
519
  # by calculating the difference from the previous render.
507
520
 
508
521
  private def render_differential(new_lines, new_cursor_x, new_cursor_y)
522
+ Reline::IOGate.disable_auto_linewrap(true) if Reline::IOGate.win?
509
523
  rendered_lines = @rendered_screen.lines
510
524
  cursor_y = @rendered_screen.cursor_y
511
525
  if new_lines != rendered_lines
@@ -534,8 +548,11 @@ class Reline::LineEditor
534
548
  Reline::IOGate.show_cursor
535
549
  end
536
550
  Reline::IOGate.move_cursor_column new_cursor_x
551
+ new_cursor_y = new_cursor_y.clamp(0, screen_height - 1)
537
552
  Reline::IOGate.move_cursor_down new_cursor_y - cursor_y
538
553
  @rendered_screen.cursor_y = new_cursor_y
554
+ ensure
555
+ Reline::IOGate.disable_auto_linewrap(false) if Reline::IOGate.win?
539
556
  end
540
557
 
541
558
  private def clear_rendered_screen_cache
@@ -570,8 +587,9 @@ class Reline::LineEditor
570
587
  @context
571
588
  end
572
589
 
573
- def retrieve_completion_block(set_completion_quote_character = false)
574
- @line_editor.retrieve_completion_block(set_completion_quote_character)
590
+ def retrieve_completion_block(_unused = false)
591
+ preposing, target, postposing, _quote = @line_editor.retrieve_completion_block
592
+ [preposing, target, postposing]
575
593
  end
576
594
 
577
595
  def call_completion_proc_with_checking_args(pre, target, post)
@@ -791,98 +809,73 @@ class Reline::LineEditor
791
809
  @config.editing_mode
792
810
  end
793
811
 
794
- private def menu(_target, list)
812
+ private def menu(list)
795
813
  @menu_info = MenuInfo.new(list)
796
814
  end
797
815
 
798
- private def complete_internal_proc(list, is_menu)
799
- preposing, target, postposing = retrieve_completion_block
800
- list = list.select { |i|
801
- if i and not Encoding.compatible?(target.encoding, i.encoding)
802
- raise Encoding::CompatibilityError, "#{target.encoding.name} is not compatible with #{i.encoding.name}"
816
+ private def filter_normalize_candidates(target, list)
817
+ target = target.downcase if @config.completion_ignore_case
818
+ list.select do |item|
819
+ next unless item
820
+ unless Encoding.compatible?(target.encoding, item.encoding)
821
+ # Workaround for Readline test
822
+ if defined?(::Readline) && ::Readline == ::Reline
823
+ raise Encoding::CompatibilityError, "incompatible character encodings: #{target.encoding} and #{item.encoding}"
824
+ end
803
825
  end
826
+
804
827
  if @config.completion_ignore_case
805
- i&.downcase&.start_with?(target.downcase)
828
+ item.downcase.start_with?(target)
806
829
  else
807
- i&.start_with?(target)
830
+ item.start_with?(target)
808
831
  end
809
- }.uniq
810
- if is_menu
811
- menu(target, list)
812
- return nil
813
- end
814
- completed = list.inject { |memo, item|
815
- begin
816
- memo_mbchars = memo.unicode_normalize.grapheme_clusters
817
- item_mbchars = item.unicode_normalize.grapheme_clusters
818
- rescue Encoding::CompatibilityError
819
- memo_mbchars = memo.grapheme_clusters
820
- item_mbchars = item.grapheme_clusters
821
- end
822
- size = [memo_mbchars.size, item_mbchars.size].min
823
- result = +''
824
- size.times do |i|
825
- if @config.completion_ignore_case
826
- if memo_mbchars[i].casecmp?(item_mbchars[i])
827
- result << memo_mbchars[i]
828
- else
829
- break
830
- end
831
- else
832
- if memo_mbchars[i] == item_mbchars[i]
833
- result << memo_mbchars[i]
834
- else
835
- break
836
- end
837
- end
838
- end
839
- result
840
- }
841
- [target, preposing, completed, postposing]
832
+ end.map do |item|
833
+ item.unicode_normalize
834
+ rescue Encoding::CompatibilityError
835
+ item
836
+ end.uniq
842
837
  end
843
838
 
844
- private def perform_completion(list, just_show_list)
839
+ private def perform_completion(preposing, target, postposing, quote, list)
840
+ candidates = filter_normalize_candidates(target, list)
841
+
845
842
  case @completion_state
846
- when CompletionState::NORMAL
847
- @completion_state = CompletionState::COMPLETION
848
843
  when CompletionState::PERFECT_MATCH
849
- @dig_perfect_match_proc&.(@perfect_matched)
850
- end
851
- if just_show_list
852
- is_menu = true
853
- elsif @completion_state == CompletionState::MENU
854
- is_menu = true
855
- elsif @completion_state == CompletionState::MENU_WITH_PERFECT_MATCH
856
- is_menu = true
857
- else
858
- is_menu = false
859
- end
860
- result = complete_internal_proc(list, is_menu)
861
- if @completion_state == CompletionState::MENU_WITH_PERFECT_MATCH
844
+ if @dig_perfect_match_proc
845
+ @dig_perfect_match_proc.call(@perfect_matched)
846
+ return
847
+ end
848
+ when CompletionState::MENU
849
+ menu(candidates)
850
+ return
851
+ when CompletionState::MENU_WITH_PERFECT_MATCH
852
+ menu(candidates)
862
853
  @completion_state = CompletionState::PERFECT_MATCH
854
+ return
863
855
  end
864
- return if result.nil?
865
- target, preposing, completed, postposing = result
866
- return if completed.nil?
867
- if target <= completed and (@completion_state == CompletionState::COMPLETION)
868
- if list.include?(completed)
869
- if list.one?
870
- @completion_state = CompletionState::PERFECT_MATCH
871
- else
872
- @completion_state = CompletionState::MENU_WITH_PERFECT_MATCH
873
- perform_completion(list, true) if @config.show_all_if_ambiguous
874
- end
875
- @perfect_matched = completed
856
+
857
+ completed = Reline::Unicode.common_prefix(candidates, ignore_case: @config.completion_ignore_case)
858
+ return if completed.empty?
859
+
860
+ append_character = ''
861
+ if candidates.include?(completed)
862
+ if candidates.one?
863
+ append_character = quote || completion_append_character.to_s
864
+ @completion_state = CompletionState::PERFECT_MATCH
865
+ elsif @config.show_all_if_ambiguous
866
+ menu(candidates)
867
+ @completion_state = CompletionState::PERFECT_MATCH
876
868
  else
877
- @completion_state = CompletionState::MENU
878
- perform_completion(list, true) if @config.show_all_if_ambiguous
879
- end
880
- if not just_show_list and target < completed
881
- @buffer_of_lines[@line_index] = (preposing + completed + completion_append_character.to_s + postposing).split("\n")[@line_index] || String.new(encoding: @encoding)
882
- line_to_pointer = (preposing + completed + completion_append_character.to_s).split("\n")[@line_index] || String.new(encoding: @encoding)
883
- @byte_pointer = line_to_pointer.bytesize
869
+ @completion_state = CompletionState::MENU_WITH_PERFECT_MATCH
884
870
  end
871
+ @perfect_matched = completed
872
+ else
873
+ @completion_state = CompletionState::MENU
874
+ menu(candidates) if @config.show_all_if_ambiguous
885
875
  end
876
+ @buffer_of_lines[@line_index] = (preposing + completed + append_character + postposing).split("\n")[@line_index] || String.new(encoding: encoding)
877
+ line_to_pointer = (preposing + completed + append_character).split("\n")[@line_index] || String.new(encoding: encoding)
878
+ @byte_pointer = line_to_pointer.bytesize
886
879
  end
887
880
 
888
881
  def dialog_proc_scope_completion_journey_data
@@ -911,8 +904,8 @@ class Reline::LineEditor
911
904
  end
912
905
 
913
906
  private def retrieve_completion_journey_state
914
- preposing, target, postposing = retrieve_completion_block
915
- list = call_completion_proc
907
+ preposing, target, postposing, quote = retrieve_completion_block
908
+ list = call_completion_proc(preposing, target, postposing, quote)
916
909
  return unless list.is_a?(Array)
917
910
 
918
911
  candidates = list.select{ |item| item.start_with?(target) }
@@ -925,28 +918,36 @@ class Reline::LineEditor
925
918
  )
926
919
  end
927
920
 
928
- private def run_for_operators(key, method_symbol, &block)
921
+ private def run_for_operators(key, method_symbol)
922
+ # Reject multibyte input (converted to ed_insert) in vi_command mode
923
+ return if method_symbol == :ed_insert && @config.editing_mode_is?(:vi_command) && !@waiting_proc
924
+
925
+ if ARGUMENT_DIGIT_METHODS.include?(method_symbol) && !@waiting_proc
926
+ wrap_method_call(method_symbol, key, false)
927
+ return
928
+ end
929
+
929
930
  if @vi_waiting_operator
930
- if VI_MOTIONS.include?(method_symbol)
931
+ if @waiting_proc || VI_MOTIONS.include?(method_symbol)
931
932
  old_byte_pointer = @byte_pointer
932
933
  @vi_arg = (@vi_arg || 1) * @vi_waiting_operator_arg
933
- block.(true)
934
+ wrap_method_call(method_symbol, key, true)
934
935
  unless @waiting_proc
935
936
  byte_pointer_diff = @byte_pointer - old_byte_pointer
936
937
  @byte_pointer = old_byte_pointer
937
- method_obj = method(@vi_waiting_operator)
938
- wrap_method_call(@vi_waiting_operator, method_obj, byte_pointer_diff)
938
+ __send__(@vi_waiting_operator, byte_pointer_diff)
939
939
  cleanup_waiting
940
940
  end
941
941
  else
942
942
  # Ignores operator when not motion is given.
943
- block.(false)
943
+ wrap_method_call(method_symbol, key, false)
944
944
  cleanup_waiting
945
945
  end
946
- @vi_arg = nil
947
946
  else
948
- block.(false)
947
+ wrap_method_call(method_symbol, key, false)
949
948
  end
949
+ @vi_arg = nil
950
+ @kill_ring.process
950
951
  end
951
952
 
952
953
  private def argumentable?(method_obj)
@@ -959,20 +960,23 @@ class Reline::LineEditor
959
960
  method_obj and method_obj.parameters.any? { |param| param[0] == :key and param[1] == :inclusive }
960
961
  end
961
962
 
962
- def wrap_method_call(method_symbol, method_obj, key, with_operator = false)
963
- if @config.editing_mode_is?(:emacs, :vi_insert) and @vi_waiting_operator.nil?
964
- not_insertion = method_symbol != :ed_insert
965
- process_insert(force: not_insertion)
963
+ def wrap_method_call(method_symbol, key, with_operator)
964
+ if @waiting_proc
965
+ @waiting_proc.call(key, method_symbol)
966
+ return
966
967
  end
968
+
969
+ return unless respond_to?(method_symbol, true)
970
+ method_obj = method(method_symbol)
967
971
  if @vi_arg and argumentable?(method_obj)
968
- if with_operator and inclusive?(method_obj)
969
- method_obj.(key, arg: @vi_arg, inclusive: true)
972
+ if inclusive?(method_obj)
973
+ method_obj.(key, arg: @vi_arg, inclusive: with_operator)
970
974
  else
971
975
  method_obj.(key, arg: @vi_arg)
972
976
  end
973
977
  else
974
- if with_operator and inclusive?(method_obj)
975
- method_obj.(key, inclusive: true)
978
+ if inclusive?(method_obj)
979
+ method_obj.(key, inclusive: with_operator)
976
980
  else
977
981
  method_obj.(key)
978
982
  end
@@ -987,90 +991,20 @@ class Reline::LineEditor
987
991
  @drop_terminate_spaces = false
988
992
  end
989
993
 
990
- private def process_key(key, method_symbol)
991
- if key.is_a?(Symbol)
992
- cleanup_waiting
993
- elsif @waiting_proc
994
- old_byte_pointer = @byte_pointer
995
- @waiting_proc.call(key)
996
- if @vi_waiting_operator
997
- byte_pointer_diff = @byte_pointer - old_byte_pointer
998
- @byte_pointer = old_byte_pointer
999
- method_obj = method(@vi_waiting_operator)
1000
- wrap_method_call(@vi_waiting_operator, method_obj, byte_pointer_diff)
1001
- cleanup_waiting
1002
- end
1003
- @kill_ring.process
1004
- return
1005
- end
994
+ ARGUMENT_DIGIT_METHODS = %i[ed_digit vi_zero ed_argument_digit]
995
+ VI_WAITING_ACCEPT_METHODS = %i[vi_change_meta vi_delete_meta vi_yank ed_insert ed_argument_digit]
1006
996
 
1007
- if method_symbol and respond_to?(method_symbol, true)
1008
- method_obj = method(method_symbol)
997
+ private def process_key(key, method_symbol)
998
+ if @waiting_proc
999
+ cleanup_waiting unless key.size == 1
1009
1000
  end
1010
- if method_symbol and key.is_a?(Symbol)
1011
- if @vi_arg and argumentable?(method_obj)
1012
- run_for_operators(key, method_symbol) do |with_operator|
1013
- wrap_method_call(method_symbol, method_obj, key, with_operator)
1014
- end
1015
- else
1016
- wrap_method_call(method_symbol, method_obj, key) if method_obj
1017
- end
1018
- @kill_ring.process
1019
- if @vi_arg
1020
- @vi_arg = nil
1021
- end
1022
- elsif @vi_arg
1023
- if key.chr =~ /[0-9]/
1024
- ed_argument_digit(key)
1025
- else
1026
- if argumentable?(method_obj)
1027
- run_for_operators(key, method_symbol) do |with_operator|
1028
- wrap_method_call(method_symbol, method_obj, key, with_operator)
1029
- end
1030
- elsif method_obj
1031
- wrap_method_call(method_symbol, method_obj, key)
1032
- else
1033
- ed_insert(key) unless @config.editing_mode_is?(:vi_command)
1034
- end
1035
- @kill_ring.process
1036
- if @vi_arg
1037
- @vi_arg = nil
1038
- end
1039
- end
1040
- elsif method_obj
1041
- if method_symbol == :ed_argument_digit
1042
- wrap_method_call(method_symbol, method_obj, key)
1043
- else
1044
- run_for_operators(key, method_symbol) do |with_operator|
1045
- wrap_method_call(method_symbol, method_obj, key, with_operator)
1046
- end
1047
- end
1048
- @kill_ring.process
1049
- else
1050
- ed_insert(key) unless @config.editing_mode_is?(:vi_command)
1001
+ if @vi_waiting_operator
1002
+ cleanup_waiting unless VI_WAITING_ACCEPT_METHODS.include?(method_symbol) || VI_MOTIONS.include?(method_symbol)
1051
1003
  end
1052
- end
1053
1004
 
1054
- private def normal_char(key)
1055
- @multibyte_buffer << key.combined_char
1056
- if @multibyte_buffer.size > 1
1057
- if @multibyte_buffer.dup.force_encoding(@encoding).valid_encoding?
1058
- process_key(@multibyte_buffer.dup.force_encoding(@encoding), nil)
1059
- @multibyte_buffer.clear
1060
- else
1061
- # invalid
1062
- return
1063
- end
1064
- else # single byte
1065
- return if key.char >= 128 # maybe, first byte of multi byte
1066
- method_symbol = @config.editing_mode.get_method(key.combined_char)
1067
- process_key(key.combined_char, method_symbol)
1068
- @multibyte_buffer.clear
1069
- end
1070
- if @config.editing_mode_is?(:vi_command) and @byte_pointer > 0 and @byte_pointer == current_line.bytesize
1071
- byte_size = Reline::Unicode.get_prev_mbchar_size(@buffer_of_lines[@line_index], @byte_pointer)
1072
- @byte_pointer -= byte_size
1073
- end
1005
+ process_insert(force: method_symbol != :ed_insert)
1006
+
1007
+ run_for_operators(key, method_symbol)
1074
1008
  end
1075
1009
 
1076
1010
  def update(key)
@@ -1084,43 +1018,41 @@ class Reline::LineEditor
1084
1018
  end
1085
1019
 
1086
1020
  def input_key(key)
1087
- save_old_buffer
1021
+ old_buffer_of_lines = @buffer_of_lines.dup
1088
1022
  @config.reset_oneshot_key_bindings
1089
- @dialogs.each do |dialog|
1090
- if key.char.instance_of?(Symbol) and key.char == dialog.name
1091
- return
1092
- end
1093
- end
1094
1023
  if key.char.nil?
1095
1024
  process_insert(force: true)
1096
1025
  @eof = buffer_empty?
1097
1026
  finish
1098
1027
  return
1099
1028
  end
1029
+ return if @dialogs.any? { |dialog| dialog.name == key.method_symbol }
1030
+
1100
1031
  @completion_occurs = false
1101
1032
 
1102
- if key.char.is_a?(Symbol)
1103
- process_key(key.char, key.char)
1104
- else
1105
- normal_char(key)
1033
+ process_key(key.char, key.method_symbol)
1034
+ if @config.editing_mode_is?(:vi_command) and @byte_pointer > 0 and @byte_pointer == current_line.bytesize
1035
+ byte_size = Reline::Unicode.get_prev_mbchar_size(@buffer_of_lines[@line_index], @byte_pointer)
1036
+ @byte_pointer -= byte_size
1106
1037
  end
1107
1038
 
1108
- @prev_action_state, @next_action_state = @next_action_state, NullActionState
1039
+ @prev_action_state, @next_action_state = @next_action_state, {}
1109
1040
 
1110
1041
  unless @completion_occurs
1111
1042
  @completion_state = CompletionState::NORMAL
1112
1043
  @completion_journey_state = nil
1113
1044
  end
1114
1045
 
1115
- push_input_lines unless @undoing
1116
- @undoing = false
1046
+ modified = old_buffer_of_lines != @buffer_of_lines
1047
+
1048
+ push_undo_redo(modified) unless @restoring
1049
+ @restoring = false
1117
1050
 
1118
1051
  if @in_pasting
1119
1052
  clear_dialogs
1120
1053
  return
1121
1054
  end
1122
1055
 
1123
- modified = @old_buffer_of_lines != @buffer_of_lines
1124
1056
  if !@completion_occurs && modified && !@config.disable_completion && @config.autocompletion
1125
1057
  # Auto complete starts only when edited
1126
1058
  process_insert(force: true)
@@ -1129,26 +1061,17 @@ class Reline::LineEditor
1129
1061
  modified
1130
1062
  end
1131
1063
 
1132
- def save_old_buffer
1133
- @old_buffer_of_lines = @buffer_of_lines.dup
1134
- end
1135
-
1136
- def push_input_lines
1137
- if @old_buffer_of_lines == @buffer_of_lines
1138
- @input_lines[@input_lines_position] = [@buffer_of_lines.dup, @byte_pointer, @line_index]
1064
+ MAX_UNDO_REDO_HISTORY_SIZE = 100
1065
+ def push_undo_redo(modified)
1066
+ if modified
1067
+ @undo_redo_history = @undo_redo_history[0..@undo_redo_index]
1068
+ @undo_redo_history.push([@buffer_of_lines.dup, @byte_pointer, @line_index])
1069
+ if @undo_redo_history.size > MAX_UNDO_REDO_HISTORY_SIZE
1070
+ @undo_redo_history.shift
1071
+ end
1072
+ @undo_redo_index = @undo_redo_history.size - 1
1139
1073
  else
1140
- @input_lines = @input_lines[0..@input_lines_position]
1141
- @input_lines_position += 1
1142
- @input_lines.push([@buffer_of_lines.dup, @byte_pointer, @line_index])
1143
- end
1144
- trim_input_lines
1145
- end
1146
-
1147
- MAX_INPUT_LINES = 100
1148
- def trim_input_lines
1149
- if @input_lines.size > MAX_INPUT_LINES
1150
- @input_lines.shift
1151
- @input_lines_position -= 1
1074
+ @undo_redo_history[@undo_redo_index] = [@buffer_of_lines.dup, @byte_pointer, @line_index]
1152
1075
  end
1153
1076
  end
1154
1077
 
@@ -1162,9 +1085,8 @@ class Reline::LineEditor
1162
1085
  end
1163
1086
  end
1164
1087
 
1165
- def call_completion_proc
1166
- result = retrieve_completion_block(true)
1167
- pre, target, post = result
1088
+ def call_completion_proc(pre, target, post, quote)
1089
+ Reline.core.instance_variable_set(:@completion_quote_character, quote)
1168
1090
  result = call_completion_proc_with_checking_args(pre, target, post)
1169
1091
  Reline.core.instance_variable_set(:@completion_quote_character, nil)
1170
1092
  result
@@ -1228,84 +1150,32 @@ class Reline::LineEditor
1228
1150
  process_auto_indent
1229
1151
  end
1230
1152
 
1231
- def set_current_lines(lines, byte_pointer = nil, line_index = 0)
1232
- cursor = current_byte_pointer_cursor
1233
- @buffer_of_lines = lines
1234
- @line_index = line_index
1235
- if byte_pointer
1236
- @byte_pointer = byte_pointer
1237
- else
1238
- calculate_nearest_cursor(cursor)
1239
- end
1240
- process_auto_indent
1241
- end
1242
-
1243
- def retrieve_completion_block(set_completion_quote_character = false)
1244
- if Reline.completer_word_break_characters.empty?
1245
- word_break_regexp = nil
1246
- else
1247
- word_break_regexp = /\A[#{Regexp.escape(Reline.completer_word_break_characters)}]/
1248
- end
1249
- if Reline.completer_quote_characters.empty?
1250
- quote_characters_regexp = nil
1251
- else
1252
- quote_characters_regexp = /\A[#{Regexp.escape(Reline.completer_quote_characters)}]/
1253
- end
1254
- before = current_line.byteslice(0, @byte_pointer)
1255
- rest = nil
1256
- break_pointer = nil
1153
+ def retrieve_completion_block
1154
+ quote_characters = Reline.completer_quote_characters
1155
+ before = current_line.byteslice(0, @byte_pointer).grapheme_clusters
1257
1156
  quote = nil
1258
- closing_quote = nil
1259
- escaped_quote = nil
1260
- i = 0
1261
- while i < @byte_pointer do
1262
- slice = current_line.byteslice(i, @byte_pointer - i)
1263
- unless slice.valid_encoding?
1264
- i += 1
1265
- next
1266
- end
1267
- if quote and slice.start_with?(closing_quote)
1268
- quote = nil
1269
- i += 1
1270
- rest = nil
1271
- elsif quote and slice.start_with?(escaped_quote)
1272
- # skip
1273
- i += 2
1274
- elsif quote_characters_regexp and slice =~ quote_characters_regexp # find new "
1275
- rest = $'
1276
- quote = $&
1277
- closing_quote = /(?!\\)#{Regexp.escape(quote)}/
1278
- escaped_quote = /\\#{Regexp.escape(quote)}/
1279
- i += 1
1280
- break_pointer = i - 1
1281
- elsif word_break_regexp and not quote and slice =~ word_break_regexp
1282
- rest = $'
1283
- i += 1
1284
- before = current_line.byteslice(i, @byte_pointer - i)
1285
- break_pointer = i
1286
- else
1287
- i += 1
1288
- end
1289
- end
1290
- postposing = current_line.byteslice(@byte_pointer, current_line.bytesize - @byte_pointer)
1291
- if rest
1292
- preposing = current_line.byteslice(0, break_pointer)
1293
- target = rest
1294
- if set_completion_quote_character and quote
1295
- Reline.core.instance_variable_set(:@completion_quote_character, quote)
1296
- if postposing !~ /(?!\\)#{Regexp.escape(quote)}/ # closing quote
1297
- insert_text(quote)
1157
+ # Calculate closing quote when cursor is at the end of the line
1158
+ if current_line.bytesize == @byte_pointer && !quote_characters.empty?
1159
+ escaped = false
1160
+ before.each do |c|
1161
+ if escaped
1162
+ escaped = false
1163
+ next
1164
+ elsif c == '\\'
1165
+ escaped = true
1166
+ elsif quote
1167
+ quote = nil if c == quote
1168
+ elsif quote_characters.include?(c)
1169
+ quote = c
1298
1170
  end
1299
1171
  end
1300
- else
1301
- preposing = ''
1302
- if break_pointer
1303
- preposing = current_line.byteslice(0, break_pointer)
1304
- else
1305
- preposing = ''
1306
- end
1307
- target = before
1308
1172
  end
1173
+
1174
+ word_break_characters = quote_characters + Reline.completer_word_break_characters
1175
+ break_index = before.rindex { |c| word_break_characters.include?(c) || quote_characters.include?(c) } || -1
1176
+ preposing = before.take(break_index + 1).join
1177
+ target = before.drop(break_index + 1).join
1178
+ postposing = current_line.byteslice(@byte_pointer, current_line.bytesize - @byte_pointer)
1309
1179
  lines = whole_lines
1310
1180
  if @line_index > 0
1311
1181
  preposing = lines[0..(@line_index - 1)].join("\n") + "\n" + preposing
@@ -1313,7 +1183,7 @@ class Reline::LineEditor
1313
1183
  if (lines.size - 1) > @line_index
1314
1184
  postposing = postposing + "\n" + lines[(@line_index + 1)..-1].join("\n")
1315
1185
  end
1316
- [preposing.encode(@encoding), target.encode(@encoding), postposing.encode(@encoding)]
1186
+ [preposing.encode(encoding), target.encode(encoding), postposing.encode(encoding), quote&.encode(encoding)]
1317
1187
  end
1318
1188
 
1319
1189
  def confirm_multiline_termination
@@ -1322,15 +1192,13 @@ class Reline::LineEditor
1322
1192
  end
1323
1193
 
1324
1194
  def insert_multiline_text(text)
1325
- save_old_buffer
1326
1195
  pre = @buffer_of_lines[@line_index].byteslice(0, @byte_pointer)
1327
1196
  post = @buffer_of_lines[@line_index].byteslice(@byte_pointer..)
1328
- lines = (pre + text.gsub(/\r\n?/, "\n") + post).split("\n", -1)
1197
+ lines = (pre + Reline::Unicode.safe_encode(text, encoding).gsub(/\r\n?/, "\n") + post).split("\n", -1)
1329
1198
  lines << '' if lines.empty?
1330
1199
  @buffer_of_lines[@line_index, 1] = lines
1331
1200
  @line_index += lines.size - 1
1332
1201
  @byte_pointer = @buffer_of_lines[@line_index].bytesize - post.bytesize
1333
- push_input_lines
1334
1202
  end
1335
1203
 
1336
1204
  def insert_text(text)
@@ -1370,7 +1238,7 @@ class Reline::LineEditor
1370
1238
  last += current_line.bytesize if last < 0
1371
1239
  first += current_line.bytesize if first < 0
1372
1240
  range = range.exclude_end? ? first...last : first..last
1373
- line = current_line.bytes.reject.with_index{ |c, i| range.include?(i) }.map{ |c| c.chr(Encoding::ASCII_8BIT) }.join.force_encoding(@encoding)
1241
+ line = current_line.bytes.reject.with_index{ |c, i| range.include?(i) }.map{ |c| c.chr(Encoding::ASCII_8BIT) }.join.force_encoding(encoding)
1374
1242
  set_current_line(line)
1375
1243
  else
1376
1244
  set_current_line(current_line.byteslice(0, start))
@@ -1444,10 +1312,11 @@ class Reline::LineEditor
1444
1312
  @completion_occurs = move_completed_list(:down)
1445
1313
  else
1446
1314
  @completion_journey_state = nil
1447
- result = call_completion_proc
1315
+ pre, target, post, quote = retrieve_completion_block
1316
+ result = call_completion_proc(pre, target, post, quote)
1448
1317
  if result.is_a?(Array)
1449
1318
  @completion_occurs = true
1450
- perform_completion(result, false)
1319
+ perform_completion(pre, target, post, quote, result)
1451
1320
  end
1452
1321
  end
1453
1322
  end
@@ -1495,21 +1364,11 @@ class Reline::LineEditor
1495
1364
  # digit or if the existing argument is already greater than a
1496
1365
  # million.
1497
1366
  # GNU Readline:: +self-insert+ (a, b, A, 1, !, …) Insert yourself.
1498
- private def ed_insert(key)
1499
- if key.instance_of?(String)
1500
- begin
1501
- key.encode(Encoding::UTF_8)
1502
- rescue Encoding::UndefinedConversionError
1503
- return
1504
- end
1505
- str = key
1506
- else
1507
- begin
1508
- key.chr.encode(Encoding::UTF_8)
1509
- rescue Encoding::UndefinedConversionError
1510
- return
1511
- end
1512
- str = key.chr
1367
+ private def ed_insert(str)
1368
+ begin
1369
+ str.encode(Encoding::UTF_8)
1370
+ rescue Encoding::UndefinedConversionError
1371
+ return
1513
1372
  end
1514
1373
  if @in_pasting
1515
1374
  @continuous_insertion_buffer << str
@@ -1520,24 +1379,26 @@ class Reline::LineEditor
1520
1379
 
1521
1380
  insert_text(str)
1522
1381
  end
1523
- alias_method :ed_digit, :ed_insert
1524
1382
  alias_method :self_insert, :ed_insert
1525
1383
 
1526
- private def ed_quoted_insert(str, arg: 1)
1527
- @waiting_proc = proc { |key|
1528
- arg.times do
1529
- if key == "\C-j".ord or key == "\C-m".ord
1530
- key_newline(key)
1531
- elsif key == 0
1532
- # Ignore NUL.
1533
- else
1534
- ed_insert(key)
1535
- end
1384
+ private def ed_digit(key)
1385
+ if @vi_arg
1386
+ ed_argument_digit(key)
1387
+ else
1388
+ ed_insert(key)
1389
+ end
1390
+ end
1391
+
1392
+ private def insert_raw_char(str, arg: 1)
1393
+ arg.times do
1394
+ if str == "\C-j" or str == "\C-m"
1395
+ key_newline(str)
1396
+ elsif str != "\0"
1397
+ # Ignore NUL.
1398
+ ed_insert(str)
1536
1399
  end
1537
- @waiting_proc = nil
1538
- }
1400
+ end
1539
1401
  end
1540
- alias_method :quoted_insert, :ed_quoted_insert
1541
1402
 
1542
1403
  private def ed_next_char(key, arg: 1)
1543
1404
  byte_size = Reline::Unicode.get_next_mbchar_size(current_line, @byte_pointer)
@@ -1566,42 +1427,47 @@ class Reline::LineEditor
1566
1427
  alias_method :backward_char, :ed_prev_char
1567
1428
 
1568
1429
  private def vi_first_print(key)
1569
- @byte_pointer, = Reline::Unicode.vi_first_print(current_line)
1430
+ @byte_pointer = Reline::Unicode.vi_first_print(current_line)
1570
1431
  end
1571
1432
 
1572
1433
  private def ed_move_to_beg(key)
1573
1434
  @byte_pointer = 0
1574
1435
  end
1575
1436
  alias_method :beginning_of_line, :ed_move_to_beg
1576
- alias_method :vi_zero, :ed_move_to_beg
1437
+
1438
+ private def vi_zero(key)
1439
+ if @vi_arg
1440
+ ed_argument_digit(key)
1441
+ else
1442
+ ed_move_to_beg(key)
1443
+ end
1444
+ end
1577
1445
 
1578
1446
  private def ed_move_to_end(key)
1579
1447
  @byte_pointer = current_line.bytesize
1580
1448
  end
1581
1449
  alias_method :end_of_line, :ed_move_to_end
1582
1450
 
1583
- private def generate_searcher(search_key)
1584
- search_word = String.new(encoding: @encoding)
1585
- multibyte_buf = String.new(encoding: 'ASCII-8BIT')
1451
+ private def generate_searcher(direction)
1452
+ search_word = String.new(encoding: encoding)
1586
1453
  hit_pointer = nil
1587
- lambda do |key|
1454
+ lambda do |key, key_symbol|
1588
1455
  search_again = false
1589
- case key
1590
- when "\C-h".ord, "\C-?".ord
1456
+ case key_symbol
1457
+ when :em_delete_prev_char, :backward_delete_char
1591
1458
  grapheme_clusters = search_word.grapheme_clusters
1592
1459
  if grapheme_clusters.size > 0
1593
1460
  grapheme_clusters.pop
1594
1461
  search_word = grapheme_clusters.join
1595
1462
  end
1596
- when "\C-r".ord, "\C-s".ord
1597
- search_again = true if search_key == key
1598
- search_key = key
1463
+ when :reverse_search_history, :vi_search_prev
1464
+ search_again = direction == :reverse
1465
+ direction = :reverse
1466
+ when :forward_search_history, :vi_search_next
1467
+ search_again = direction == :forward
1468
+ direction = :forward
1599
1469
  else
1600
- multibyte_buf << key
1601
- if multibyte_buf.dup.force_encoding(@encoding).valid_encoding?
1602
- search_word << multibyte_buf.dup.force_encoding(@encoding)
1603
- multibyte_buf.clear
1604
- end
1470
+ search_word << key
1605
1471
  end
1606
1472
  hit = nil
1607
1473
  if not search_word.empty? and @line_backup_in_history&.include?(search_word)
@@ -1613,11 +1479,11 @@ class Reline::LineEditor
1613
1479
  search_word = Reline.last_incremental_search
1614
1480
  end
1615
1481
  if @history_pointer
1616
- case search_key
1617
- when "\C-r".ord
1482
+ case direction
1483
+ when :reverse
1618
1484
  history_pointer_base = 0
1619
1485
  history = Reline::HISTORY[0..(@history_pointer - 1)]
1620
- when "\C-s".ord
1486
+ when :forward
1621
1487
  history_pointer_base = @history_pointer + 1
1622
1488
  history = Reline::HISTORY[(@history_pointer + 1)..-1]
1623
1489
  end
@@ -1626,11 +1492,11 @@ class Reline::LineEditor
1626
1492
  history = Reline::HISTORY
1627
1493
  end
1628
1494
  elsif @history_pointer
1629
- case search_key
1630
- when "\C-r".ord
1495
+ case direction
1496
+ when :reverse
1631
1497
  history_pointer_base = 0
1632
1498
  history = Reline::HISTORY[0..@history_pointer]
1633
- when "\C-s".ord
1499
+ when :forward
1634
1500
  history_pointer_base = @history_pointer
1635
1501
  history = Reline::HISTORY[@history_pointer..-1]
1636
1502
  end
@@ -1638,12 +1504,12 @@ class Reline::LineEditor
1638
1504
  history_pointer_base = 0
1639
1505
  history = Reline::HISTORY
1640
1506
  end
1641
- case search_key
1642
- when "\C-r".ord
1507
+ case direction
1508
+ when :reverse
1643
1509
  hit_index = history.rindex { |item|
1644
1510
  item.include?(search_word)
1645
1511
  }
1646
- when "\C-s".ord
1512
+ when :forward
1647
1513
  hit_index = history.index { |item|
1648
1514
  item.include?(search_word)
1649
1515
  }
@@ -1653,80 +1519,48 @@ class Reline::LineEditor
1653
1519
  hit = Reline::HISTORY[hit_pointer]
1654
1520
  end
1655
1521
  end
1656
- case search_key
1657
- when "\C-r".ord
1658
- prompt_name = 'reverse-i-search'
1659
- when "\C-s".ord
1660
- prompt_name = 'i-search'
1661
- end
1522
+ prompt_name = direction == :forward ? 'i-search' : 'reverse-i-search'
1662
1523
  prompt_name = "failed #{prompt_name}" unless hit
1663
1524
  [search_word, prompt_name, hit_pointer]
1664
1525
  end
1665
1526
  end
1666
1527
 
1667
- private def incremental_search_history(key)
1668
- unless @history_pointer
1669
- @line_backup_in_history = whole_buffer
1670
- end
1671
- searcher = generate_searcher(key)
1672
- @searching_prompt = "(reverse-i-search)`': "
1673
- termination_keys = ["\C-j".ord]
1674
- termination_keys.concat(@config.isearch_terminators&.chars&.map(&:ord)) if @config.isearch_terminators
1675
- @waiting_proc = ->(k) {
1676
- case k
1677
- when *termination_keys
1678
- if @history_pointer
1679
- buffer = Reline::HISTORY[@history_pointer]
1680
- else
1681
- buffer = @line_backup_in_history
1682
- end
1683
- @buffer_of_lines = buffer.split("\n")
1684
- @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty?
1685
- @line_index = @buffer_of_lines.size - 1
1528
+ private def incremental_search_history(direction)
1529
+ backup = @buffer_of_lines.dup, @line_index, @byte_pointer, @history_pointer, @line_backup_in_history
1530
+ searcher = generate_searcher(direction)
1531
+ prompt_name = direction == :forward ? 'i-search' : 'reverse-i-search'
1532
+ @searching_prompt = "(#{prompt_name})`': "
1533
+ termination_keys = ["\C-j"]
1534
+ termination_keys.concat(@config.isearch_terminators.chars) if @config.isearch_terminators
1535
+ accept_key_syms = [:em_delete_prev_char, :backward_delete_char, :vi_search_prev, :vi_search_next, :reverse_search_history, :forward_search_history]
1536
+ @waiting_proc = ->(k, key_symbol) {
1537
+ if k == "\C-g"
1538
+ # cancel search and restore buffer
1539
+ @buffer_of_lines, @line_index, @byte_pointer, @history_pointer, @line_backup_in_history = backup
1686
1540
  @searching_prompt = nil
1687
1541
  @waiting_proc = nil
1688
- @byte_pointer = 0
1689
- when "\C-g".ord
1690
- @buffer_of_lines = @line_backup_in_history.split("\n")
1691
- @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty?
1692
- @line_index = @buffer_of_lines.size - 1
1693
- move_history(nil, line: :end, cursor: :end, save_buffer: false)
1542
+ elsif !termination_keys.include?(k) && (k.match?(/[[:print:]]/) || accept_key_syms.include?(key_symbol))
1543
+ search_word, prompt_name, hit_pointer = searcher.call(k, key_symbol)
1544
+ Reline.last_incremental_search = search_word
1545
+ @searching_prompt = "(%s)`%s'" % [prompt_name, search_word]
1546
+ @searching_prompt += ': ' unless @is_multiline
1547
+ move_history(hit_pointer, line: :end, cursor: :end) if hit_pointer
1548
+ else
1549
+ # terminaton_keys and other keys will terminalte
1550
+ move_history(@history_pointer, line: :end, cursor: :start)
1694
1551
  @searching_prompt = nil
1695
1552
  @waiting_proc = nil
1696
- @byte_pointer = 0
1697
- else
1698
- chr = k.is_a?(String) ? k : k.chr(Encoding::ASCII_8BIT)
1699
- if chr.match?(/[[:print:]]/) or k == "\C-h".ord or k == "\C-?".ord or k == "\C-r".ord or k == "\C-s".ord
1700
- search_word, prompt_name, hit_pointer = searcher.call(k)
1701
- Reline.last_incremental_search = search_word
1702
- @searching_prompt = "(%s)`%s'" % [prompt_name, search_word]
1703
- @searching_prompt += ': ' unless @is_multiline
1704
- move_history(hit_pointer, line: :end, cursor: :end, save_buffer: false) if hit_pointer
1705
- else
1706
- if @history_pointer
1707
- line = Reline::HISTORY[@history_pointer]
1708
- else
1709
- line = @line_backup_in_history
1710
- end
1711
- @line_backup_in_history = whole_buffer
1712
- @buffer_of_lines = line.split("\n")
1713
- @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty?
1714
- @line_index = @buffer_of_lines.size - 1
1715
- @searching_prompt = nil
1716
- @waiting_proc = nil
1717
- @byte_pointer = 0
1718
- end
1719
1553
  end
1720
1554
  }
1721
1555
  end
1722
1556
 
1723
1557
  private def vi_search_prev(key)
1724
- incremental_search_history(key)
1558
+ incremental_search_history(:reverse)
1725
1559
  end
1726
1560
  alias_method :reverse_search_history, :vi_search_prev
1727
1561
 
1728
1562
  private def vi_search_next(key)
1729
- incremental_search_history(key)
1563
+ incremental_search_history(:forward)
1730
1564
  end
1731
1565
  alias_method :forward_search_history, :vi_search_next
1732
1566
 
@@ -1770,14 +1604,14 @@ class Reline::LineEditor
1770
1604
  end
1771
1605
  alias_method :history_search_forward, :ed_search_next_history
1772
1606
 
1773
- private def move_history(history_pointer, line:, cursor:, save_buffer: true)
1607
+ private def move_history(history_pointer, line:, cursor:)
1774
1608
  history_pointer ||= Reline::HISTORY.size
1775
1609
  return if history_pointer < 0 || history_pointer > Reline::HISTORY.size
1776
1610
  old_history_pointer = @history_pointer || Reline::HISTORY.size
1777
1611
  if old_history_pointer == Reline::HISTORY.size
1778
- @line_backup_in_history = save_buffer ? whole_buffer : ''
1612
+ @line_backup_in_history = whole_buffer
1779
1613
  else
1780
- Reline::HISTORY[old_history_pointer] = whole_buffer if save_buffer
1614
+ Reline::HISTORY[old_history_pointer] = whole_buffer
1781
1615
  end
1782
1616
  if history_pointer == Reline::HISTORY.size
1783
1617
  buf = @line_backup_in_history
@@ -1787,7 +1621,7 @@ class Reline::LineEditor
1787
1621
  @history_pointer = history_pointer
1788
1622
  end
1789
1623
  @buffer_of_lines = buf.split("\n")
1790
- @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty?
1624
+ @buffer_of_lines = [String.new(encoding: encoding)] if @buffer_of_lines.empty?
1791
1625
  @line_index = line == :start ? 0 : line == :end ? @buffer_of_lines.size - 1 : line
1792
1626
  @byte_pointer = cursor == :start ? 0 : cursor == :end ? current_line.bytesize : cursor
1793
1627
  end
@@ -1826,6 +1660,16 @@ class Reline::LineEditor
1826
1660
  end
1827
1661
  alias_method :next_history, :ed_next_history
1828
1662
 
1663
+ private def ed_beginning_of_history(key)
1664
+ move_history(0, line: :end, cursor: :end)
1665
+ end
1666
+ alias_method :beginning_of_history, :ed_beginning_of_history
1667
+
1668
+ private def ed_end_of_history(key)
1669
+ move_history(Reline::HISTORY.size, line: :end, cursor: :end)
1670
+ end
1671
+ alias_method :end_of_history, :ed_end_of_history
1672
+
1829
1673
  private def ed_newline(key)
1830
1674
  process_insert(force: true)
1831
1675
  if @is_multiline
@@ -1837,17 +1681,10 @@ class Reline::LineEditor
1837
1681
  finish
1838
1682
  end
1839
1683
  else
1840
- if @line_index == (@buffer_of_lines.size - 1)
1841
- if confirm_multiline_termination
1842
- finish
1843
- else
1844
- key_newline(key)
1845
- end
1846
- else
1847
- # should check confirm_multiline_termination to finish?
1848
- @line_index = @buffer_of_lines.size - 1
1849
- @byte_pointer = current_line.bytesize
1684
+ if @line_index == @buffer_of_lines.size - 1 && confirm_multiline_termination
1850
1685
  finish
1686
+ else
1687
+ key_newline(key)
1851
1688
  end
1852
1689
  end
1853
1690
  else
@@ -1855,6 +1692,11 @@ class Reline::LineEditor
1855
1692
  end
1856
1693
  end
1857
1694
 
1695
+ private def ed_force_submit(_key)
1696
+ process_insert(force: true)
1697
+ finish
1698
+ end
1699
+
1858
1700
  private def em_delete_prev_char(key, arg: 1)
1859
1701
  arg.times do
1860
1702
  if @byte_pointer == 0 and @line_index > 0
@@ -1921,7 +1763,7 @@ class Reline::LineEditor
1921
1763
  alias_method :kill_whole_line, :em_kill_line
1922
1764
 
1923
1765
  private def em_delete(key)
1924
- if buffer_empty? and key == "\C-d".ord
1766
+ if buffer_empty? and key == "\C-d"
1925
1767
  @eof = true
1926
1768
  finish
1927
1769
  elsif @byte_pointer < current_line.bytesize
@@ -1939,9 +1781,11 @@ class Reline::LineEditor
1939
1781
  if current_line.empty? or @byte_pointer < current_line.bytesize
1940
1782
  em_delete(key)
1941
1783
  elsif !@config.autocompletion # show completed list
1942
- result = call_completion_proc
1784
+ pre, target, post, quote = retrieve_completion_block
1785
+ result = call_completion_proc(pre, target, post, quote)
1943
1786
  if result.is_a?(Array)
1944
- perform_completion(result, true)
1787
+ candidates = filter_normalize_candidates(target, result)
1788
+ menu(candidates)
1945
1789
  end
1946
1790
  end
1947
1791
  end
@@ -1949,17 +1793,24 @@ class Reline::LineEditor
1949
1793
 
1950
1794
  private def em_yank(key)
1951
1795
  yanked = @kill_ring.yank
1952
- insert_text(yanked) if yanked
1796
+ return unless yanked
1797
+
1798
+ before_cursor = current_line.byteslice(0, @byte_pointer)
1799
+ after_cursor = current_line.byteslice(@byte_pointer, current_line.bytesize)
1800
+ set_current_line(before_cursor + yanked + after_cursor, before_cursor.bytesize + yanked.bytesize)
1801
+ set_next_action_state(:em_yank_line, [before_cursor, after_cursor])
1953
1802
  end
1954
1803
  alias_method :yank, :em_yank
1955
1804
 
1956
1805
  private def em_yank_pop(key)
1957
- yanked, prev_yank = @kill_ring.yank_pop
1958
- if yanked
1959
- line, = byteslice!(current_line, @byte_pointer - prev_yank.bytesize, prev_yank.bytesize)
1960
- set_current_line(line, @byte_pointer - prev_yank.bytesize)
1961
- insert_text(yanked)
1962
- end
1806
+ before_cursor, after_cursor = prev_action_state_value(:em_yank_line)
1807
+ return unless before_cursor and after_cursor
1808
+
1809
+ yanked, = @kill_ring.yank_pop
1810
+ return unless yanked
1811
+
1812
+ set_current_line(before_cursor + yanked + after_cursor, before_cursor.bytesize + yanked.bytesize)
1813
+ set_next_action_state(:em_yank_line, [before_cursor, after_cursor])
1963
1814
  end
1964
1815
  alias_method :yank_pop, :em_yank_pop
1965
1816
 
@@ -1973,7 +1824,7 @@ class Reline::LineEditor
1973
1824
 
1974
1825
  private def em_next_word(key)
1975
1826
  if current_line.bytesize > @byte_pointer
1976
- byte_size, _ = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
1827
+ byte_size = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
1977
1828
  @byte_pointer += byte_size
1978
1829
  end
1979
1830
  end
@@ -1981,7 +1832,7 @@ class Reline::LineEditor
1981
1832
 
1982
1833
  private def ed_prev_word(key)
1983
1834
  if @byte_pointer > 0
1984
- byte_size, _ = Reline::Unicode.em_backward_word(current_line, @byte_pointer)
1835
+ byte_size = Reline::Unicode.em_backward_word(current_line, @byte_pointer)
1985
1836
  @byte_pointer -= byte_size
1986
1837
  end
1987
1838
  end
@@ -1989,7 +1840,7 @@ class Reline::LineEditor
1989
1840
 
1990
1841
  private def em_delete_next_word(key)
1991
1842
  if current_line.bytesize > @byte_pointer
1992
- byte_size, _ = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
1843
+ byte_size = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
1993
1844
  line, word = byteslice!(current_line, @byte_pointer, byte_size)
1994
1845
  set_current_line(line)
1995
1846
  @kill_ring.append(word)
@@ -1999,7 +1850,7 @@ class Reline::LineEditor
1999
1850
 
2000
1851
  private def ed_delete_prev_word(key)
2001
1852
  if @byte_pointer > 0
2002
- byte_size, _ = Reline::Unicode.em_backward_word(current_line, @byte_pointer)
1853
+ byte_size = Reline::Unicode.em_backward_word(current_line, @byte_pointer)
2003
1854
  line, word = byteslice!(current_line, @byte_pointer - byte_size, byte_size)
2004
1855
  set_current_line(line, @byte_pointer - byte_size)
2005
1856
  @kill_ring.append(word, true)
@@ -2039,7 +1890,7 @@ class Reline::LineEditor
2039
1890
 
2040
1891
  private def em_capitol_case(key)
2041
1892
  if current_line.bytesize > @byte_pointer
2042
- byte_size, _, new_str = Reline::Unicode.em_forward_word_with_capitalization(current_line, @byte_pointer)
1893
+ byte_size, new_str = Reline::Unicode.em_forward_word_with_capitalization(current_line, @byte_pointer)
2043
1894
  before = current_line.byteslice(0, @byte_pointer)
2044
1895
  after = current_line.byteslice((@byte_pointer + byte_size)..-1)
2045
1896
  set_current_line(before + new_str + after, @byte_pointer + new_str.bytesize)
@@ -2049,7 +1900,7 @@ class Reline::LineEditor
2049
1900
 
2050
1901
  private def em_lower_case(key)
2051
1902
  if current_line.bytesize > @byte_pointer
2052
- byte_size, = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
1903
+ byte_size = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
2053
1904
  part = current_line.byteslice(@byte_pointer, byte_size).grapheme_clusters.map { |mbchar|
2054
1905
  mbchar =~ /[A-Z]/ ? mbchar.downcase : mbchar
2055
1906
  }.join
@@ -2062,7 +1913,7 @@ class Reline::LineEditor
2062
1913
 
2063
1914
  private def em_upper_case(key)
2064
1915
  if current_line.bytesize > @byte_pointer
2065
- byte_size, = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
1916
+ byte_size = Reline::Unicode.em_forward_word(current_line, @byte_pointer)
2066
1917
  part = current_line.byteslice(@byte_pointer, byte_size).grapheme_clusters.map { |mbchar|
2067
1918
  mbchar =~ /[a-z]/ ? mbchar.upcase : mbchar
2068
1919
  }.join
@@ -2075,7 +1926,7 @@ class Reline::LineEditor
2075
1926
 
2076
1927
  private def em_kill_region(key)
2077
1928
  if @byte_pointer > 0
2078
- byte_size, _ = Reline::Unicode.em_big_backward_word(current_line, @byte_pointer)
1929
+ byte_size = Reline::Unicode.em_big_backward_word(current_line, @byte_pointer)
2079
1930
  line, deleted = byteslice!(current_line, @byte_pointer - byte_size, byte_size)
2080
1931
  set_current_line(line, @byte_pointer - byte_size)
2081
1932
  @kill_ring.append(deleted, true)
@@ -2106,7 +1957,7 @@ class Reline::LineEditor
2106
1957
 
2107
1958
  private def vi_next_word(key, arg: 1)
2108
1959
  if current_line.bytesize > @byte_pointer
2109
- byte_size, _ = Reline::Unicode.vi_forward_word(current_line, @byte_pointer, @drop_terminate_spaces)
1960
+ byte_size = Reline::Unicode.vi_forward_word(current_line, @byte_pointer, @drop_terminate_spaces)
2110
1961
  @byte_pointer += byte_size
2111
1962
  end
2112
1963
  arg -= 1
@@ -2115,7 +1966,7 @@ class Reline::LineEditor
2115
1966
 
2116
1967
  private def vi_prev_word(key, arg: 1)
2117
1968
  if @byte_pointer > 0
2118
- byte_size, _ = Reline::Unicode.vi_backward_word(current_line, @byte_pointer)
1969
+ byte_size = Reline::Unicode.vi_backward_word(current_line, @byte_pointer)
2119
1970
  @byte_pointer -= byte_size
2120
1971
  end
2121
1972
  arg -= 1
@@ -2124,7 +1975,7 @@ class Reline::LineEditor
2124
1975
 
2125
1976
  private def vi_end_word(key, arg: 1, inclusive: false)
2126
1977
  if current_line.bytesize > @byte_pointer
2127
- byte_size, _ = Reline::Unicode.vi_forward_end_word(current_line, @byte_pointer)
1978
+ byte_size = Reline::Unicode.vi_forward_end_word(current_line, @byte_pointer)
2128
1979
  @byte_pointer += byte_size
2129
1980
  end
2130
1981
  arg -= 1
@@ -2139,7 +1990,7 @@ class Reline::LineEditor
2139
1990
 
2140
1991
  private def vi_next_big_word(key, arg: 1)
2141
1992
  if current_line.bytesize > @byte_pointer
2142
- byte_size, _ = Reline::Unicode.vi_big_forward_word(current_line, @byte_pointer)
1993
+ byte_size = Reline::Unicode.vi_big_forward_word(current_line, @byte_pointer)
2143
1994
  @byte_pointer += byte_size
2144
1995
  end
2145
1996
  arg -= 1
@@ -2148,7 +1999,7 @@ class Reline::LineEditor
2148
1999
 
2149
2000
  private def vi_prev_big_word(key, arg: 1)
2150
2001
  if @byte_pointer > 0
2151
- byte_size, _ = Reline::Unicode.vi_big_backward_word(current_line, @byte_pointer)
2002
+ byte_size = Reline::Unicode.vi_big_backward_word(current_line, @byte_pointer)
2152
2003
  @byte_pointer -= byte_size
2153
2004
  end
2154
2005
  arg -= 1
@@ -2157,7 +2008,7 @@ class Reline::LineEditor
2157
2008
 
2158
2009
  private def vi_end_big_word(key, arg: 1, inclusive: false)
2159
2010
  if current_line.bytesize > @byte_pointer
2160
- byte_size, _ = Reline::Unicode.vi_big_forward_end_word(current_line, @byte_pointer)
2011
+ byte_size = Reline::Unicode.vi_big_forward_end_word(current_line, @byte_pointer)
2161
2012
  @byte_pointer += byte_size
2162
2013
  end
2163
2014
  arg -= 1
@@ -2312,7 +2163,7 @@ class Reline::LineEditor
2312
2163
  }
2313
2164
  system("#{ENV['EDITOR']} #{path}")
2314
2165
  @buffer_of_lines = File.read(path).split("\n")
2315
- @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty?
2166
+ @buffer_of_lines = [String.new(encoding: encoding)] if @buffer_of_lines.empty?
2316
2167
  @line_index = 0
2317
2168
  finish
2318
2169
  end
@@ -2337,20 +2188,9 @@ class Reline::LineEditor
2337
2188
  end
2338
2189
 
2339
2190
  private def ed_argument_digit(key)
2340
- if @vi_arg.nil?
2341
- if key.chr.to_i.zero?
2342
- if key.anybits?(0b10000000)
2343
- unescaped_key = key ^ 0b10000000
2344
- unless unescaped_key.chr.to_i.zero?
2345
- @vi_arg = unescaped_key.chr.to_i
2346
- end
2347
- end
2348
- else
2349
- @vi_arg = key.chr.to_i
2350
- end
2351
- else
2352
- @vi_arg = @vi_arg * 10 + key.chr.to_i
2353
- end
2191
+ # key is expected to be `ESC digit` or `digit`
2192
+ num = key[/\d/].to_i
2193
+ @vi_arg = (@vi_arg || 0) * 10 + num
2354
2194
  end
2355
2195
 
2356
2196
  private def vi_to_column(key, arg: 0)
@@ -2363,13 +2203,13 @@ class Reline::LineEditor
2363
2203
  end
2364
2204
 
2365
2205
  private def vi_replace_char(key, arg: 1)
2366
- @waiting_proc = ->(k) {
2206
+ @waiting_proc = ->(k, _sym) {
2367
2207
  if arg == 1
2368
2208
  byte_size = Reline::Unicode.get_next_mbchar_size(current_line, @byte_pointer)
2369
2209
  before = current_line.byteslice(0, @byte_pointer)
2370
2210
  remaining_point = @byte_pointer + byte_size
2371
2211
  after = current_line.byteslice(remaining_point, current_line.bytesize - remaining_point)
2372
- set_current_line(before + k.chr + after)
2212
+ set_current_line(before + k + after)
2373
2213
  @waiting_proc = nil
2374
2214
  elsif arg > 1
2375
2215
  byte_size = 0
@@ -2379,7 +2219,7 @@ class Reline::LineEditor
2379
2219
  before = current_line.byteslice(0, @byte_pointer)
2380
2220
  remaining_point = @byte_pointer + byte_size
2381
2221
  after = current_line.byteslice(remaining_point, current_line.bytesize - remaining_point)
2382
- replaced = k.chr * arg
2222
+ replaced = k * arg
2383
2223
  set_current_line(before + replaced + after, @byte_pointer + replaced.bytesize)
2384
2224
  @waiting_proc = nil
2385
2225
  end
@@ -2387,19 +2227,14 @@ class Reline::LineEditor
2387
2227
  end
2388
2228
 
2389
2229
  private def vi_next_char(key, arg: 1, inclusive: false)
2390
- @waiting_proc = ->(key_for_proc) { search_next_char(key_for_proc, arg, inclusive: inclusive) }
2230
+ @waiting_proc = ->(key_for_proc, _sym) { search_next_char(key_for_proc, arg, inclusive: inclusive) }
2391
2231
  end
2392
2232
 
2393
2233
  private def vi_to_next_char(key, arg: 1, inclusive: false)
2394
- @waiting_proc = ->(key_for_proc) { search_next_char(key_for_proc, arg, need_prev_char: true, inclusive: inclusive) }
2234
+ @waiting_proc = ->(key_for_proc, _sym) { search_next_char(key_for_proc, arg, need_prev_char: true, inclusive: inclusive) }
2395
2235
  end
2396
2236
 
2397
2237
  private def search_next_char(key, arg, need_prev_char: false, inclusive: false)
2398
- if key.instance_of?(String)
2399
- inputed_char = key
2400
- else
2401
- inputed_char = key.chr
2402
- end
2403
2238
  prev_total = nil
2404
2239
  total = nil
2405
2240
  found = false
@@ -2410,7 +2245,7 @@ class Reline::LineEditor
2410
2245
  width = Reline::Unicode.get_mbchar_width(mbchar)
2411
2246
  total = [mbchar.bytesize, width]
2412
2247
  else
2413
- if inputed_char == mbchar
2248
+ if key == mbchar
2414
2249
  arg -= 1
2415
2250
  if arg.zero?
2416
2251
  found = true
@@ -2439,19 +2274,14 @@ class Reline::LineEditor
2439
2274
  end
2440
2275
 
2441
2276
  private def vi_prev_char(key, arg: 1)
2442
- @waiting_proc = ->(key_for_proc) { search_prev_char(key_for_proc, arg) }
2277
+ @waiting_proc = ->(key_for_proc, _sym) { search_prev_char(key_for_proc, arg) }
2443
2278
  end
2444
2279
 
2445
2280
  private def vi_to_prev_char(key, arg: 1)
2446
- @waiting_proc = ->(key_for_proc) { search_prev_char(key_for_proc, arg, true) }
2281
+ @waiting_proc = ->(key_for_proc, _sym) { search_prev_char(key_for_proc, arg, true) }
2447
2282
  end
2448
2283
 
2449
2284
  private def search_prev_char(key, arg, need_next_char = false)
2450
- if key.instance_of?(String)
2451
- inputed_char = key
2452
- else
2453
- inputed_char = key.chr
2454
- end
2455
2285
  prev_total = nil
2456
2286
  total = nil
2457
2287
  found = false
@@ -2462,7 +2292,7 @@ class Reline::LineEditor
2462
2292
  width = Reline::Unicode.get_mbchar_width(mbchar)
2463
2293
  total = [mbchar.bytesize, width]
2464
2294
  else
2465
- if inputed_char == mbchar
2295
+ if key == mbchar
2466
2296
  arg -= 1
2467
2297
  if arg.zero?
2468
2298
  found = true
@@ -2494,15 +2324,22 @@ class Reline::LineEditor
2494
2324
  end
2495
2325
 
2496
2326
  private def em_set_mark(key)
2497
- @mark_pointer = [@byte_pointer, @line_index]
2327
+ cursor_column = Reline::Unicode.calculate_width(current_line.byteslice(0, @byte_pointer))
2328
+ @mark_position = [@line_index, cursor_column]
2498
2329
  end
2499
2330
  alias_method :set_mark, :em_set_mark
2500
2331
 
2501
2332
  private def em_exchange_mark(key)
2502
- return unless @mark_pointer
2503
- new_pointer = [@byte_pointer, @line_index]
2504
- @byte_pointer, @line_index = @mark_pointer
2505
- @mark_pointer = new_pointer
2333
+ return unless @mark_position
2334
+ line_index, cursor_column = @mark_position
2335
+ em_set_mark(key)
2336
+ if @buffer_of_lines.size <= line_index
2337
+ @line_index = @buffer_of_lines.size - 1
2338
+ @byte_pointer = current_line.bytesize
2339
+ else
2340
+ @line_index = line_index
2341
+ calculate_nearest_cursor(cursor_column)
2342
+ end
2506
2343
  end
2507
2344
  alias_method :exchange_point_and_mark, :em_exchange_mark
2508
2345
 
@@ -2514,32 +2351,31 @@ class Reline::LineEditor
2514
2351
  @config.editing_mode = :vi_insert
2515
2352
  end
2516
2353
 
2517
- private def undo(_key)
2518
- @undoing = true
2354
+ private def move_undo_redo(direction)
2355
+ @restoring = true
2356
+ return unless (0..@undo_redo_history.size - 1).cover?(@undo_redo_index + direction)
2519
2357
 
2520
- return if @input_lines_position <= 0
2358
+ @undo_redo_index += direction
2359
+ buffer_of_lines, byte_pointer, line_index = @undo_redo_history[@undo_redo_index]
2360
+ @buffer_of_lines = buffer_of_lines.dup
2361
+ @line_index = line_index
2362
+ @byte_pointer = byte_pointer
2363
+ end
2521
2364
 
2522
- @input_lines_position -= 1
2523
- target_lines, target_cursor_x, target_cursor_y = @input_lines[@input_lines_position]
2524
- set_current_lines(target_lines.dup, target_cursor_x, target_cursor_y)
2365
+ private def undo(_key)
2366
+ move_undo_redo(-1)
2525
2367
  end
2526
2368
 
2527
2369
  private def redo(_key)
2528
- @undoing = true
2529
-
2530
- return if @input_lines_position >= @input_lines.size - 1
2531
-
2532
- @input_lines_position += 1
2533
- target_lines, target_cursor_x, target_cursor_y = @input_lines[@input_lines_position]
2534
- set_current_lines(target_lines.dup, target_cursor_x, target_cursor_y)
2370
+ move_undo_redo(+1)
2535
2371
  end
2536
2372
 
2537
2373
  private def prev_action_state_value(type)
2538
- @prev_action_state[0] == type ? @prev_action_state[1] : nil
2374
+ @prev_action_state[type]
2539
2375
  end
2540
2376
 
2541
2377
  private def set_next_action_state(type, value)
2542
- @next_action_state = [type, value]
2378
+ @next_action_state[type] = value
2543
2379
  end
2544
2380
 
2545
2381
  private def re_read_init_file(_key)