diff -Nru ruby-codemirror-rails-5.6/codemirror-rails.gemspec ruby-codemirror-rails-5.16.0/codemirror-rails.gemspec --- ruby-codemirror-rails-5.6/codemirror-rails.gemspec 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/codemirror-rails.gemspec 2018-08-23 17:28:17.000000000 +0000 @@ -1,20 +1,43 @@ -require File.expand_path('../lib/codemirror/rails/version', __FILE__) +######################################################### +# This file has been automatically generated by gem2tgz # +######################################################### +# -*- encoding: utf-8 -*- +# stub: codemirror-rails 5.16.0 ruby lib Gem::Specification.new do |s| - s.name = 'codemirror-rails' - s.version = Codemirror::Rails::VERSION - s.authors = ['Nathan Fixler'] - s.email = 'nathan@fixler.org' - s.license = 'MIT' - s.summary = 'Use CodeMirror with Rails' - s.description = 'This gem provides CodeMirror assets for your Rails application.' - s.homepage = 'https://rubygems.org/gems/codemirror-rails' + s.name = "codemirror-rails".freeze + s.version = "5.16.0" - s.files = `git ls-files`.split("\n") + s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib".freeze] + s.authors = ["Nathan Fixler".freeze] + s.date = "2016-07-04" + s.description = "This gem provides CodeMirror assets for your Rails application.".freeze + s.email = "nathan@fixler.org".freeze + s.files = ["LICENSE".freeze, "README.md".freeze, "doc/CodeMirror-LICENSE".freeze, "lib/codemirror-rails.rb".freeze, "lib/codemirror/rails.rb".freeze, "lib/codemirror/rails/engine.rb".freeze, "lib/codemirror/rails/railtie.rb".freeze, "lib/codemirror/rails/version.rb".freeze, "lib/generators/codemirror/install/install_generator.rb".freeze, "vendor/assets/javascripts/codemirror.js".freeze, "vendor/assets/javascripts/codemirror/addons/comment/comment.js".freeze, "vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js".freeze, "vendor/assets/javascripts/codemirror/addons/dialog/dialog.js".freeze, "vendor/assets/javascripts/codemirror/addons/display/autorefresh.js".freeze, "vendor/assets/javascripts/codemirror/addons/display/fullscreen.js".freeze, "vendor/assets/javascripts/codemirror/addons/display/panel.js".freeze, "vendor/assets/javascripts/codemirror/addons/display/placeholder.js".freeze, "vendor/assets/javascripts/codemirror/addons/display/rulers.js".freeze, "vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js".freeze, "vendor/assets/javascripts/codemirror/addons/edit/closetag.js".freeze, "vendor/assets/javascripts/codemirror/addons/edit/continuelist.js".freeze, "vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js".freeze, "vendor/assets/javascripts/codemirror/addons/edit/matchtags.js".freeze, "vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/foldcode.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js".freeze, "vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/css-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/html-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/show-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/css-lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/html-lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/json-lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js".freeze, "vendor/assets/javascripts/codemirror/addons/merge/merge.js".freeze, "vendor/assets/javascripts/codemirror/addons/mode/loadmode.js".freeze, "vendor/assets/javascripts/codemirror/addons/mode/multiplex.js".freeze, "vendor/assets/javascripts/codemirror/addons/mode/overlay.js".freeze, "vendor/assets/javascripts/codemirror/addons/mode/simple.js".freeze, "vendor/assets/javascripts/codemirror/addons/runmode/colorize.js".freeze, "vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js".freeze, "vendor/assets/javascripts/codemirror/addons/runmode/runmode.js".freeze, "vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js".freeze, "vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js".freeze, "vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js".freeze, "vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js".freeze, "vendor/assets/javascripts/codemirror/addons/search/jump-to-line.js".freeze, "vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js".freeze, "vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.js".freeze, "vendor/assets/javascripts/codemirror/addons/search/search.js".freeze, "vendor/assets/javascripts/codemirror/addons/search/searchcursor.js".freeze, "vendor/assets/javascripts/codemirror/addons/selection/active-line.js".freeze, "vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js".freeze, "vendor/assets/javascripts/codemirror/addons/selection/selection-pointer.js".freeze, "vendor/assets/javascripts/codemirror/addons/tern/tern.js".freeze, "vendor/assets/javascripts/codemirror/addons/tern/worker.js".freeze, "vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js".freeze, "vendor/assets/javascripts/codemirror/keymaps/emacs.js".freeze, "vendor/assets/javascripts/codemirror/keymaps/sublime.js".freeze, "vendor/assets/javascripts/codemirror/keymaps/vim.js".freeze, "vendor/assets/javascripts/codemirror/modes/apl.js".freeze, "vendor/assets/javascripts/codemirror/modes/asciiarmor.js".freeze, "vendor/assets/javascripts/codemirror/modes/asn.1.js".freeze, "vendor/assets/javascripts/codemirror/modes/asterisk.js".freeze, "vendor/assets/javascripts/codemirror/modes/brainfuck.js".freeze, "vendor/assets/javascripts/codemirror/modes/clike.js".freeze, "vendor/assets/javascripts/codemirror/modes/clojure.js".freeze, "vendor/assets/javascripts/codemirror/modes/cmake.js".freeze, "vendor/assets/javascripts/codemirror/modes/cobol.js".freeze, "vendor/assets/javascripts/codemirror/modes/coffeescript.js".freeze, "vendor/assets/javascripts/codemirror/modes/commonlisp.js".freeze, "vendor/assets/javascripts/codemirror/modes/crystal.js".freeze, "vendor/assets/javascripts/codemirror/modes/css.js".freeze, "vendor/assets/javascripts/codemirror/modes/cypher.js".freeze, "vendor/assets/javascripts/codemirror/modes/d.js".freeze, "vendor/assets/javascripts/codemirror/modes/dart.js".freeze, "vendor/assets/javascripts/codemirror/modes/diff.js".freeze, "vendor/assets/javascripts/codemirror/modes/django.js".freeze, "vendor/assets/javascripts/codemirror/modes/dockerfile.js".freeze, "vendor/assets/javascripts/codemirror/modes/dtd.js".freeze, "vendor/assets/javascripts/codemirror/modes/dylan.js".freeze, "vendor/assets/javascripts/codemirror/modes/ebnf.js".freeze, "vendor/assets/javascripts/codemirror/modes/ecl.js".freeze, "vendor/assets/javascripts/codemirror/modes/eiffel.js".freeze, "vendor/assets/javascripts/codemirror/modes/elm.js".freeze, "vendor/assets/javascripts/codemirror/modes/erlang.js".freeze, "vendor/assets/javascripts/codemirror/modes/factor.js".freeze, "vendor/assets/javascripts/codemirror/modes/fcl.js".freeze, "vendor/assets/javascripts/codemirror/modes/forth.js".freeze, "vendor/assets/javascripts/codemirror/modes/fortran.js".freeze, "vendor/assets/javascripts/codemirror/modes/gas.js".freeze, "vendor/assets/javascripts/codemirror/modes/gfm.js".freeze, "vendor/assets/javascripts/codemirror/modes/gherkin.js".freeze, "vendor/assets/javascripts/codemirror/modes/go.js".freeze, "vendor/assets/javascripts/codemirror/modes/groovy.js".freeze, "vendor/assets/javascripts/codemirror/modes/haml.js".freeze, "vendor/assets/javascripts/codemirror/modes/handlebars.js".freeze, "vendor/assets/javascripts/codemirror/modes/haskell-literate.js".freeze, "vendor/assets/javascripts/codemirror/modes/haskell.js".freeze, "vendor/assets/javascripts/codemirror/modes/haxe.js".freeze, "vendor/assets/javascripts/codemirror/modes/htmlembedded.js".freeze, "vendor/assets/javascripts/codemirror/modes/htmlmixed.js".freeze, "vendor/assets/javascripts/codemirror/modes/http.js".freeze, "vendor/assets/javascripts/codemirror/modes/idl.js".freeze, "vendor/assets/javascripts/codemirror/modes/jade.js".freeze, "vendor/assets/javascripts/codemirror/modes/javascript.js".freeze, "vendor/assets/javascripts/codemirror/modes/jinja2.js".freeze, "vendor/assets/javascripts/codemirror/modes/jsx.js".freeze, "vendor/assets/javascripts/codemirror/modes/julia.js".freeze, "vendor/assets/javascripts/codemirror/modes/livescript.js".freeze, "vendor/assets/javascripts/codemirror/modes/lua.js".freeze, "vendor/assets/javascripts/codemirror/modes/markdown.js".freeze, "vendor/assets/javascripts/codemirror/modes/mathematica.js".freeze, "vendor/assets/javascripts/codemirror/modes/mbox.js".freeze, "vendor/assets/javascripts/codemirror/modes/mirc.js".freeze, "vendor/assets/javascripts/codemirror/modes/mllike.js".freeze, "vendor/assets/javascripts/codemirror/modes/modelica.js".freeze, "vendor/assets/javascripts/codemirror/modes/mscgen.js".freeze, "vendor/assets/javascripts/codemirror/modes/mumps.js".freeze, "vendor/assets/javascripts/codemirror/modes/nginx.js".freeze, "vendor/assets/javascripts/codemirror/modes/nsis.js".freeze, "vendor/assets/javascripts/codemirror/modes/ntriples.js".freeze, "vendor/assets/javascripts/codemirror/modes/octave.js".freeze, "vendor/assets/javascripts/codemirror/modes/oz.js".freeze, "vendor/assets/javascripts/codemirror/modes/pascal.js".freeze, "vendor/assets/javascripts/codemirror/modes/pegjs.js".freeze, "vendor/assets/javascripts/codemirror/modes/perl.js".freeze, "vendor/assets/javascripts/codemirror/modes/php.js".freeze, "vendor/assets/javascripts/codemirror/modes/pig.js".freeze, "vendor/assets/javascripts/codemirror/modes/powershell.js".freeze, "vendor/assets/javascripts/codemirror/modes/properties.js".freeze, "vendor/assets/javascripts/codemirror/modes/protobuf.js".freeze, "vendor/assets/javascripts/codemirror/modes/puppet.js".freeze, "vendor/assets/javascripts/codemirror/modes/python.js".freeze, "vendor/assets/javascripts/codemirror/modes/q.js".freeze, "vendor/assets/javascripts/codemirror/modes/r.js".freeze, "vendor/assets/javascripts/codemirror/modes/rpm.js".freeze, "vendor/assets/javascripts/codemirror/modes/rst.js".freeze, "vendor/assets/javascripts/codemirror/modes/ruby.js".freeze, "vendor/assets/javascripts/codemirror/modes/rust.js".freeze, "vendor/assets/javascripts/codemirror/modes/sas.js".freeze, "vendor/assets/javascripts/codemirror/modes/sass.js".freeze, "vendor/assets/javascripts/codemirror/modes/scheme.js".freeze, "vendor/assets/javascripts/codemirror/modes/shell.js".freeze, "vendor/assets/javascripts/codemirror/modes/sieve.js".freeze, "vendor/assets/javascripts/codemirror/modes/slim.js".freeze, "vendor/assets/javascripts/codemirror/modes/smalltalk.js".freeze, "vendor/assets/javascripts/codemirror/modes/smarty.js".freeze, "vendor/assets/javascripts/codemirror/modes/solr.js".freeze, "vendor/assets/javascripts/codemirror/modes/soy.js".freeze, "vendor/assets/javascripts/codemirror/modes/sparql.js".freeze, "vendor/assets/javascripts/codemirror/modes/spreadsheet.js".freeze, "vendor/assets/javascripts/codemirror/modes/sql.js".freeze, "vendor/assets/javascripts/codemirror/modes/stex.js".freeze, "vendor/assets/javascripts/codemirror/modes/stylus.js".freeze, "vendor/assets/javascripts/codemirror/modes/swift.js".freeze, "vendor/assets/javascripts/codemirror/modes/tcl.js".freeze, "vendor/assets/javascripts/codemirror/modes/textile.js".freeze, "vendor/assets/javascripts/codemirror/modes/tiddlywiki.js".freeze, "vendor/assets/javascripts/codemirror/modes/tiki.js".freeze, "vendor/assets/javascripts/codemirror/modes/toml.js".freeze, "vendor/assets/javascripts/codemirror/modes/tornado.js".freeze, "vendor/assets/javascripts/codemirror/modes/troff.js".freeze, "vendor/assets/javascripts/codemirror/modes/ttcn-cfg.js".freeze, "vendor/assets/javascripts/codemirror/modes/ttcn.js".freeze, "vendor/assets/javascripts/codemirror/modes/turtle.js".freeze, "vendor/assets/javascripts/codemirror/modes/twig.js".freeze, "vendor/assets/javascripts/codemirror/modes/vb.js".freeze, "vendor/assets/javascripts/codemirror/modes/vbscript.js".freeze, "vendor/assets/javascripts/codemirror/modes/velocity.js".freeze, "vendor/assets/javascripts/codemirror/modes/verilog.js".freeze, "vendor/assets/javascripts/codemirror/modes/vhdl.js".freeze, "vendor/assets/javascripts/codemirror/modes/vue.js".freeze, "vendor/assets/javascripts/codemirror/modes/webidl.js".freeze, "vendor/assets/javascripts/codemirror/modes/xml.js".freeze, "vendor/assets/javascripts/codemirror/modes/xquery.js".freeze, "vendor/assets/javascripts/codemirror/modes/yacas.js".freeze, "vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js".freeze, "vendor/assets/javascripts/codemirror/modes/yaml.js".freeze, "vendor/assets/javascripts/codemirror/modes/z80.js".freeze, "vendor/assets/stylesheets/codemirror.css".freeze, "vendor/assets/stylesheets/codemirror/addons/dialog/dialog.css".freeze, "vendor/assets/stylesheets/codemirror/addons/display/fullscreen.css".freeze, "vendor/assets/stylesheets/codemirror/addons/fold/foldgutter.css".freeze, "vendor/assets/stylesheets/codemirror/addons/hint/show-hint.css".freeze, "vendor/assets/stylesheets/codemirror/addons/lint/lint.css".freeze, "vendor/assets/stylesheets/codemirror/addons/merge/merge.css".freeze, "vendor/assets/stylesheets/codemirror/addons/scroll/simplescrollbars.css".freeze, "vendor/assets/stylesheets/codemirror/addons/search/matchesonscrollbar.css".freeze, "vendor/assets/stylesheets/codemirror/addons/tern/tern.css".freeze, "vendor/assets/stylesheets/codemirror/modes/tiddlywiki.css".freeze, "vendor/assets/stylesheets/codemirror/modes/tiki.css".freeze, "vendor/assets/stylesheets/codemirror/themes/3024-day.css".freeze, "vendor/assets/stylesheets/codemirror/themes/3024-night.css".freeze, "vendor/assets/stylesheets/codemirror/themes/abcdef.css".freeze, "vendor/assets/stylesheets/codemirror/themes/ambiance-mobile.css".freeze, "vendor/assets/stylesheets/codemirror/themes/ambiance.css".freeze, "vendor/assets/stylesheets/codemirror/themes/base16-dark.css".freeze, "vendor/assets/stylesheets/codemirror/themes/base16-light.css".freeze, "vendor/assets/stylesheets/codemirror/themes/bespin.css".freeze, "vendor/assets/stylesheets/codemirror/themes/blackboard.css".freeze, "vendor/assets/stylesheets/codemirror/themes/cobalt.css".freeze, "vendor/assets/stylesheets/codemirror/themes/colorforth.css".freeze, "vendor/assets/stylesheets/codemirror/themes/dracula.css".freeze, "vendor/assets/stylesheets/codemirror/themes/eclipse.css".freeze, "vendor/assets/stylesheets/codemirror/themes/elegant.css".freeze, "vendor/assets/stylesheets/codemirror/themes/erlang-dark.css".freeze, "vendor/assets/stylesheets/codemirror/themes/hopscotch.css".freeze, "vendor/assets/stylesheets/codemirror/themes/icecoder.css".freeze, "vendor/assets/stylesheets/codemirror/themes/isotope.css".freeze, "vendor/assets/stylesheets/codemirror/themes/lesser-dark.css".freeze, "vendor/assets/stylesheets/codemirror/themes/liquibyte.css".freeze, "vendor/assets/stylesheets/codemirror/themes/material.css".freeze, "vendor/assets/stylesheets/codemirror/themes/mbo.css".freeze, "vendor/assets/stylesheets/codemirror/themes/mdn-like.css".freeze, "vendor/assets/stylesheets/codemirror/themes/midnight.css".freeze, "vendor/assets/stylesheets/codemirror/themes/monokai.css".freeze, "vendor/assets/stylesheets/codemirror/themes/neat.css".freeze, "vendor/assets/stylesheets/codemirror/themes/neo.css".freeze, "vendor/assets/stylesheets/codemirror/themes/night.css".freeze, "vendor/assets/stylesheets/codemirror/themes/paraiso-dark.css".freeze, "vendor/assets/stylesheets/codemirror/themes/paraiso-light.css".freeze, "vendor/assets/stylesheets/codemirror/themes/pastel-on-dark.css".freeze, "vendor/assets/stylesheets/codemirror/themes/railscasts.css".freeze, "vendor/assets/stylesheets/codemirror/themes/rubyblue.css".freeze, "vendor/assets/stylesheets/codemirror/themes/seti.css".freeze, "vendor/assets/stylesheets/codemirror/themes/solarized.css".freeze, "vendor/assets/stylesheets/codemirror/themes/the-matrix.css".freeze, "vendor/assets/stylesheets/codemirror/themes/tomorrow-night-bright.css".freeze, "vendor/assets/stylesheets/codemirror/themes/tomorrow-night-eighties.css".freeze, "vendor/assets/stylesheets/codemirror/themes/ttcn.css".freeze, "vendor/assets/stylesheets/codemirror/themes/twilight.css".freeze, "vendor/assets/stylesheets/codemirror/themes/vibrant-ink.css".freeze, "vendor/assets/stylesheets/codemirror/themes/xq-dark.css".freeze, "vendor/assets/stylesheets/codemirror/themes/xq-light.css".freeze, "vendor/assets/stylesheets/codemirror/themes/yeti.css".freeze, "vendor/assets/stylesheets/codemirror/themes/zenburn.css".freeze] + s.homepage = "https://rubygems.org/gems/codemirror-rails".freeze + s.licenses = ["MIT".freeze] + s.rubygems_version = "2.5.2.1".freeze + s.summary = "Use CodeMirror with Rails".freeze - s.add_runtime_dependency 'railties', '>= 3.0', '< 5' + if s.respond_to? :specification_version then + s.specification_version = 4 - s.add_development_dependency 'rails' - s.add_development_dependency 'sqlite3' - s.add_development_dependency 'minitest' + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_development_dependency(%q.freeze, [">= 0"]) + s.add_development_dependency(%q.freeze, [">= 0"]) + s.add_runtime_dependency(%q.freeze, ["< 6.0", ">= 3.0"]) + s.add_development_dependency(%q.freeze, [">= 0"]) + else + s.add_dependency(%q.freeze, [">= 0"]) + s.add_dependency(%q.freeze, [">= 0"]) + s.add_dependency(%q.freeze, ["< 6.0", ">= 3.0"]) + s.add_dependency(%q.freeze, [">= 0"]) + end + else + s.add_dependency(%q.freeze, [">= 0"]) + s.add_dependency(%q.freeze, [">= 0"]) + s.add_dependency(%q.freeze, ["< 6.0", ">= 3.0"]) + s.add_dependency(%q.freeze, [">= 0"]) + end end diff -Nru ruby-codemirror-rails-5.6/debian/changelog ruby-codemirror-rails-5.16.0/debian/changelog --- ruby-codemirror-rails-5.6/debian/changelog 2016-07-05 16:09:58.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/changelog 2018-08-25 20:51:35.000000000 +0000 @@ -1,3 +1,26 @@ +ruby-codemirror-rails (5.16.0-1) unstable; urgency=medium + + * Team upload. + + [ Andrew Lee (李健秋) ] + * Imported Upstream version 5.11.1 + + [ Lucas Kanashiro ] + * New upstream version 5.16.0 + * Bump debhelper compatibility level to 11 + * Declare compliance with Debian Policy 4.2.0 + * Update VCS urls to point to salsa + * debian/control: use autopkgtest-pkg-ruby instead of autopkgtest + * debian/copyright: use secure url in Format field + * debian/copyright: reorganize paragraphs + * Update Debian packaging copyright + * debian/watch: use secure url + * Lintian override source-is-missing for JS files. Those files are not + minified. + * Make patch DEP-3 complaiant, silence lintian + + -- Lucas Kanashiro Sat, 25 Aug 2018 17:51:35 -0300 + ruby-codemirror-rails (5.6-2) unstable; urgency=medium * debian/control: depends on libjs-codemirror. diff -Nru ruby-codemirror-rails-5.6/debian/compat ruby-codemirror-rails-5.16.0/debian/compat --- ruby-codemirror-rails-5.6/debian/compat 2015-09-09 08:16:58.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/compat 2018-08-25 20:51:35.000000000 +0000 @@ -1 +1 @@ -9 +11 diff -Nru ruby-codemirror-rails-5.6/debian/control ruby-codemirror-rails-5.16.0/debian/control --- ruby-codemirror-rails-5.6/debian/control 2016-07-04 08:31:51.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/control 2018-08-25 20:51:35.000000000 +0000 @@ -3,14 +3,14 @@ Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Andrew Lee (李健秋) -Build-Depends: debhelper (>= 9~), +Build-Depends: debhelper (>= 11~), gem2deb, rake -Standards-Version: 3.9.8 -Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-codemirror-rails.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-codemirror-rails.git +Standards-Version: 4.2.0 +Vcs-Git: https://salsa.debian.org/ruby-team/ruby-codemirror-rails.git +Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-codemirror-rails Homepage: https://rubygems.org/gems/codemirror-rails -Testsuite: autopkgtest +Testsuite: autopkgtest-pkg-ruby XS-Ruby-Versions: all Package: ruby-codemirror-rails diff -Nru ruby-codemirror-rails-5.6/debian/copyright ruby-codemirror-rails-5.16.0/debian/copyright --- ruby-codemirror-rails-5.6/debian/copyright 2016-01-13 08:32:30.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/copyright 2018-08-25 20:51:35.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: codemirror-rails Source: https://rubygems.org/gems/codemirror-rails @@ -8,6 +8,11 @@ 2013 by Marijn Haverbeke License: Expat +Files: debian/* +Copyright: 2015 Andrew Lee (李健秋) + 2018 Lucas Kanashiro +License: Expat + License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -27,7 +32,3 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Files: debian/* -Copyright: 2015 Andrew Lee (李健秋) -License: Expat diff -Nru ruby-codemirror-rails-5.6/debian/patches/engine-root.patch ruby-codemirror-rails-5.16.0/debian/patches/engine-root.patch --- ruby-codemirror-rails-5.6/debian/patches/engine-root.patch 2016-07-04 08:31:51.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/patches/engine-root.patch 2018-08-25 20:51:35.000000000 +0000 @@ -1,3 +1,7 @@ +Description: Config root directory of codemirror +Author: Andrew Lee (李健秋) +Last-Updated: 2018-23-08 + --- ruby-codemirror-rails-4.2.orig/lib/codemirror/rails/engine.rb +++ ruby-codemirror-rails-4.2/lib/codemirror/rails/engine.rb @@ -1,6 +1,7 @@ diff -Nru ruby-codemirror-rails-5.6/debian/source/lintian-overrides ruby-codemirror-rails-5.16.0/debian/source/lintian-overrides --- ruby-codemirror-rails-5.6/debian/source/lintian-overrides 2016-05-31 17:14:14.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/source/lintian-overrides 2018-08-25 20:51:35.000000000 +0000 @@ -1,15 +1,15 @@ # All these are lintian false positive -ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/clojure.js line length is 536 characters (>512) -ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/cypher.js line length is 683 characters (>512) +ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/cypher.js line length is 714 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/ecl.js line length is 1006 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/gherkin.js line length is 1153 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/mumps.js line length is 682 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/nginx.js line length is 5103 characters (>512) -ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/php.js line length is 9217 characters (>512) +ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/php.js line length is 9282 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/q.js line length is 1247 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/scheme.js line length is 2179 characters (>512) +ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/gfm.js line length is 1157 characters (>512) +ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/nsis.js line length is 2409 characters (>512) +ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/sas.js line length is 528 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/sql.js line length is 3058 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/stylus.js line length is 860 characters (>512) -ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/swift.js line length is 586 characters (>512) ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/addons/hint/html-hint.js line length is 577 characters (>512) - diff -Nru ruby-codemirror-rails-5.6/debian/source.lintian-overrides ruby-codemirror-rails-5.16.0/debian/source.lintian-overrides --- ruby-codemirror-rails-5.6/debian/source.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/source.lintian-overrides 2018-08-25 20:51:35.000000000 +0000 @@ -0,0 +1,12 @@ +# Those JS files are not minified +#ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/cypher.js line length is 714 characters (>512) +#ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/gfm.js line length is 1157 characters (>512) +#ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/nsis.js line length is 2409 characters (>512) +#ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/php.js line length is 9282 characters (>512) +#ruby-codemirror-rails source: source-is-missing vendor/assets/javascripts/codemirror/modes/sas.js line length is 528 characters (>512) + +source-is-missing vendor/assets/javascripts/codemirror/modes/cypher.js +source-is-missing vendor/assets/javascripts/codemirror/modes/gfm.js +source-is-missing vendor/assets/javascripts/codemirror/modes/nsis.js +source-is-missing vendor/assets/javascripts/codemirror/modes/php.js +source-is-missing vendor/assets/javascripts/codemirror/modes/sas.js diff -Nru ruby-codemirror-rails-5.6/debian/watch ruby-codemirror-rails-5.16.0/debian/watch --- ruby-codemirror-rails-5.6/debian/watch 2015-08-28 05:29:27.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/debian/watch 2018-08-25 20:51:35.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/codemirror-rails .*/codemirror-rails-(.*).tar.gz +https://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/codemirror-rails .*/codemirror-rails-(.*).tar.gz diff -Nru ruby-codemirror-rails-5.6/Gemfile ruby-codemirror-rails-5.16.0/Gemfile --- ruby-codemirror-rails-5.6/Gemfile 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/Gemfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -source 'https://rubygems.org' -gemspec diff -Nru ruby-codemirror-rails-5.6/gemfiles/Gemfile.rails-3.2 ruby-codemirror-rails-5.16.0/gemfiles/Gemfile.rails-3.2 --- ruby-codemirror-rails-5.6/gemfiles/Gemfile.rails-3.2 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/gemfiles/Gemfile.rails-3.2 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -source 'https://rubygems.org' -gemspec :path => '../' - -gem 'rails', '~> 3.2.0' -gem 'minitest', '~> 4.0' diff -Nru ruby-codemirror-rails-5.6/gemfiles/Gemfile.rails-4.0 ruby-codemirror-rails-5.16.0/gemfiles/Gemfile.rails-4.0 --- ruby-codemirror-rails-5.6/gemfiles/Gemfile.rails-4.0 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/gemfiles/Gemfile.rails-4.0 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -source 'https://rubygems.org' -gemspec :path => '../' - -gem 'rails', '~> 4.0.0' diff -Nru ruby-codemirror-rails-5.6/gemfiles/Gemfile.rails-4.1 ruby-codemirror-rails-5.16.0/gemfiles/Gemfile.rails-4.1 --- ruby-codemirror-rails-5.6/gemfiles/Gemfile.rails-4.1 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/gemfiles/Gemfile.rails-4.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -source 'https://rubygems.org' -gemspec :path => '../' - -gem 'rails', '~> 4.1.0' diff -Nru ruby-codemirror-rails-5.6/.gitignore ruby-codemirror-rails-5.16.0/.gitignore --- ruby-codemirror-rails-5.6/.gitignore 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -*.gem -Gemfile.lock -test/dummy*/tmp/cache/assets/* diff -Nru ruby-codemirror-rails-5.6/lib/codemirror/rails/version.rb ruby-codemirror-rails-5.16.0/lib/codemirror/rails/version.rb --- ruby-codemirror-rails-5.6/lib/codemirror/rails/version.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/lib/codemirror/rails/version.rb 2018-08-23 17:28:17.000000000 +0000 @@ -1,6 +1,6 @@ module Codemirror module Rails - VERSION = '5.6' - CODEMIRROR_VERSION = '5.6' + VERSION = '5.16.0' + CODEMIRROR_VERSION = '5.16.0' end end diff -Nru ruby-codemirror-rails-5.6/metadata.yml ruby-codemirror-rails-5.16.0/metadata.yml --- ruby-codemirror-rails-5.6/metadata.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/metadata.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,455 +0,0 @@ ---- !ruby/object:Gem::Specification -name: codemirror-rails -version: !ruby/object:Gem::Version - version: '5.6' -platform: ruby -authors: -- Nathan Fixler -autorequire: -bindir: bin -cert_chain: [] -date: 2015-08-22 00:00:00.000000000 Z -dependencies: -- !ruby/object:Gem::Dependency - name: railties - requirement: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '3.0' - - - "<" - - !ruby/object:Gem::Version - version: '5' - type: :runtime - prerelease: false - version_requirements: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '3.0' - - - "<" - - !ruby/object:Gem::Version - version: '5' -- !ruby/object:Gem::Dependency - name: rails - requirement: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' - type: :development - prerelease: false - version_requirements: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' -- !ruby/object:Gem::Dependency - name: sqlite3 - requirement: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' - type: :development - prerelease: false - version_requirements: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' -- !ruby/object:Gem::Dependency - name: minitest - requirement: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' - type: :development - prerelease: false - version_requirements: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' -description: This gem provides CodeMirror assets for your Rails application. -email: nathan@fixler.org -executables: [] -extensions: [] -extra_rdoc_files: [] -files: -- ".gitignore" -- ".travis.yml" -- Gemfile -- LICENSE -- README.md -- Rakefile -- codemirror-rails.gemspec -- doc/CodeMirror-LICENSE -- gemfiles/Gemfile.rails-3.2 -- gemfiles/Gemfile.rails-4.0 -- gemfiles/Gemfile.rails-4.1 -- lib/codemirror-rails.rb -- lib/codemirror/rails.rb -- lib/codemirror/rails/engine.rb -- lib/codemirror/rails/railtie.rb -- lib/codemirror/rails/version.rb -- lib/generators/codemirror/install/install_generator.rb -- test/dummy-3.2.x/README.rdoc -- test/dummy-3.2.x/Rakefile -- test/dummy-3.2.x/app/assets/javascripts/application.js -- test/dummy-3.2.x/app/assets/stylesheets/application.css -- test/dummy-3.2.x/app/controllers/application_controller.rb -- test/dummy-3.2.x/app/helpers/application_helper.rb -- test/dummy-3.2.x/app/mailers/.gitkeep -- test/dummy-3.2.x/app/models/.gitkeep -- test/dummy-3.2.x/app/views/layouts/application.html.erb -- test/dummy-3.2.x/config.ru -- test/dummy-3.2.x/config/application.rb -- test/dummy-3.2.x/config/boot.rb -- test/dummy-3.2.x/config/database.yml -- test/dummy-3.2.x/config/environment.rb -- test/dummy-3.2.x/config/environments/development.rb -- test/dummy-3.2.x/config/environments/production.rb -- test/dummy-3.2.x/config/environments/test.rb -- test/dummy-3.2.x/config/initializers/backtrace_silencers.rb -- test/dummy-3.2.x/config/initializers/inflections.rb -- test/dummy-3.2.x/config/initializers/mime_types.rb -- test/dummy-3.2.x/config/initializers/secret_token.rb -- test/dummy-3.2.x/config/initializers/session_store.rb -- test/dummy-3.2.x/config/initializers/wrap_parameters.rb -- test/dummy-3.2.x/config/locales/en.yml -- test/dummy-3.2.x/config/routes.rb -- test/dummy-3.2.x/db/.gitkeep -- test/dummy-3.2.x/lib/assets/.gitkeep -- test/dummy-3.2.x/log/.gitkeep -- test/dummy-3.2.x/public/404.html -- test/dummy-3.2.x/public/422.html -- test/dummy-3.2.x/public/500.html -- test/dummy-3.2.x/public/favicon.ico -- test/dummy-3.2.x/script/rails -- test/dummy-4.0.x/README.rdoc -- test/dummy-4.0.x/Rakefile -- test/dummy-4.0.x/app/assets/images/.keep -- test/dummy-4.0.x/app/assets/javascripts/application.js -- test/dummy-4.0.x/app/assets/stylesheets/application.css -- test/dummy-4.0.x/app/controllers/application_controller.rb -- test/dummy-4.0.x/app/controllers/concerns/.keep -- test/dummy-4.0.x/app/helpers/application_helper.rb -- test/dummy-4.0.x/app/mailers/.keep -- test/dummy-4.0.x/app/models/.keep -- test/dummy-4.0.x/app/models/concerns/.keep -- test/dummy-4.0.x/app/views/layouts/application.html.erb -- test/dummy-4.0.x/bin/bundle -- test/dummy-4.0.x/bin/rails -- test/dummy-4.0.x/bin/rake -- test/dummy-4.0.x/config.ru -- test/dummy-4.0.x/config/application.rb -- test/dummy-4.0.x/config/boot.rb -- test/dummy-4.0.x/config/database.yml -- test/dummy-4.0.x/config/environment.rb -- test/dummy-4.0.x/config/environments/development.rb -- test/dummy-4.0.x/config/environments/production.rb -- test/dummy-4.0.x/config/environments/test.rb -- test/dummy-4.0.x/config/initializers/backtrace_silencers.rb -- test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb -- test/dummy-4.0.x/config/initializers/inflections.rb -- test/dummy-4.0.x/config/initializers/mime_types.rb -- test/dummy-4.0.x/config/initializers/secret_token.rb -- test/dummy-4.0.x/config/initializers/session_store.rb -- test/dummy-4.0.x/config/initializers/wrap_parameters.rb -- test/dummy-4.0.x/config/locales/en.yml -- test/dummy-4.0.x/config/routes.rb -- test/dummy-4.0.x/lib/assets/.keep -- test/dummy-4.0.x/log/.keep -- test/dummy-4.0.x/public/404.html -- test/dummy-4.0.x/public/422.html -- test/dummy-4.0.x/public/500.html -- test/dummy-4.0.x/public/favicon.ico -- test/dummy-4.1.x/README.rdoc -- test/dummy-4.1.x/Rakefile -- test/dummy-4.1.x/app/assets/images/.keep -- test/dummy-4.1.x/app/assets/javascripts/application.js -- test/dummy-4.1.x/app/assets/stylesheets/application.css -- test/dummy-4.1.x/app/controllers/application_controller.rb -- test/dummy-4.1.x/app/controllers/concerns/.keep -- test/dummy-4.1.x/app/helpers/application_helper.rb -- test/dummy-4.1.x/app/mailers/.keep -- test/dummy-4.1.x/app/models/.keep -- test/dummy-4.1.x/app/models/concerns/.keep -- test/dummy-4.1.x/app/views/layouts/application.html.erb -- test/dummy-4.1.x/bin/bundle -- test/dummy-4.1.x/bin/rails -- test/dummy-4.1.x/bin/rake -- test/dummy-4.1.x/config.ru -- test/dummy-4.1.x/config/application.rb -- test/dummy-4.1.x/config/boot.rb -- test/dummy-4.1.x/config/database.yml -- test/dummy-4.1.x/config/environment.rb -- test/dummy-4.1.x/config/environments/development.rb -- test/dummy-4.1.x/config/environments/production.rb -- test/dummy-4.1.x/config/environments/test.rb -- test/dummy-4.1.x/config/initializers/assets.rb -- test/dummy-4.1.x/config/initializers/backtrace_silencers.rb -- test/dummy-4.1.x/config/initializers/cookies_serializer.rb -- test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb -- test/dummy-4.1.x/config/initializers/inflections.rb -- test/dummy-4.1.x/config/initializers/mime_types.rb -- test/dummy-4.1.x/config/initializers/session_store.rb -- test/dummy-4.1.x/config/initializers/wrap_parameters.rb -- test/dummy-4.1.x/config/locales/en.yml -- test/dummy-4.1.x/config/routes.rb -- test/dummy-4.1.x/config/secrets.yml -- test/dummy-4.1.x/lib/assets/.keep -- test/dummy-4.1.x/log/.keep -- test/dummy-4.1.x/public/404.html -- test/dummy-4.1.x/public/422.html -- test/dummy-4.1.x/public/500.html -- test/dummy-4.1.x/public/favicon.ico -- test/integration/codemirror_rails_integration_test.rb -- test/test_helper.rb -- vendor/assets/javascripts/codemirror.js -- vendor/assets/javascripts/codemirror/addons/comment/comment.js -- vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js -- vendor/assets/javascripts/codemirror/addons/dialog/dialog.js -- vendor/assets/javascripts/codemirror/addons/display/autorefresh.js -- vendor/assets/javascripts/codemirror/addons/display/fullscreen.js -- vendor/assets/javascripts/codemirror/addons/display/panel.js -- vendor/assets/javascripts/codemirror/addons/display/placeholder.js -- vendor/assets/javascripts/codemirror/addons/display/rulers.js -- vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js -- vendor/assets/javascripts/codemirror/addons/edit/closetag.js -- vendor/assets/javascripts/codemirror/addons/edit/continuelist.js -- vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js -- vendor/assets/javascripts/codemirror/addons/edit/matchtags.js -- vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js -- vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js -- vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js -- vendor/assets/javascripts/codemirror/addons/fold/foldcode.js -- vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js -- vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js -- vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js -- vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js -- vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js -- vendor/assets/javascripts/codemirror/addons/hint/css-hint.js -- vendor/assets/javascripts/codemirror/addons/hint/html-hint.js -- vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js -- vendor/assets/javascripts/codemirror/addons/hint/show-hint.js -- vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js -- vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js -- vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js -- vendor/assets/javascripts/codemirror/addons/lint/css-lint.js -- vendor/assets/javascripts/codemirror/addons/lint/html-lint.js -- vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js -- vendor/assets/javascripts/codemirror/addons/lint/json-lint.js -- vendor/assets/javascripts/codemirror/addons/lint/lint.js -- vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js -- vendor/assets/javascripts/codemirror/addons/merge/merge.js -- vendor/assets/javascripts/codemirror/addons/mode/loadmode.js -- vendor/assets/javascripts/codemirror/addons/mode/multiplex.js -- vendor/assets/javascripts/codemirror/addons/mode/overlay.js -- vendor/assets/javascripts/codemirror/addons/mode/simple.js -- vendor/assets/javascripts/codemirror/addons/runmode/colorize.js -- vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js -- vendor/assets/javascripts/codemirror/addons/runmode/runmode.js -- vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js -- vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js -- vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js -- vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js -- vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js -- vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.js -- vendor/assets/javascripts/codemirror/addons/search/search.js -- vendor/assets/javascripts/codemirror/addons/search/searchcursor.js -- vendor/assets/javascripts/codemirror/addons/selection/active-line.js -- vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js -- vendor/assets/javascripts/codemirror/addons/selection/selection-pointer.js -- vendor/assets/javascripts/codemirror/addons/tern/tern.js -- vendor/assets/javascripts/codemirror/addons/tern/worker.js -- vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js -- vendor/assets/javascripts/codemirror/keymaps/emacs.js -- vendor/assets/javascripts/codemirror/keymaps/sublime.js -- vendor/assets/javascripts/codemirror/keymaps/vim.js -- vendor/assets/javascripts/codemirror/modes/apl.js -- vendor/assets/javascripts/codemirror/modes/asciiarmor.js -- vendor/assets/javascripts/codemirror/modes/asn.1.js -- vendor/assets/javascripts/codemirror/modes/asterisk.js -- vendor/assets/javascripts/codemirror/modes/brainfuck.js -- vendor/assets/javascripts/codemirror/modes/clike.js -- vendor/assets/javascripts/codemirror/modes/clojure.js -- vendor/assets/javascripts/codemirror/modes/cmake.js -- vendor/assets/javascripts/codemirror/modes/cobol.js -- vendor/assets/javascripts/codemirror/modes/coffeescript.js -- vendor/assets/javascripts/codemirror/modes/commonlisp.js -- vendor/assets/javascripts/codemirror/modes/css.js -- vendor/assets/javascripts/codemirror/modes/cypher.js -- vendor/assets/javascripts/codemirror/modes/d.js -- vendor/assets/javascripts/codemirror/modes/dart.js -- vendor/assets/javascripts/codemirror/modes/diff.js -- vendor/assets/javascripts/codemirror/modes/django.js -- vendor/assets/javascripts/codemirror/modes/dockerfile.js -- vendor/assets/javascripts/codemirror/modes/dtd.js -- vendor/assets/javascripts/codemirror/modes/dylan.js -- vendor/assets/javascripts/codemirror/modes/ebnf.js -- vendor/assets/javascripts/codemirror/modes/ecl.js -- vendor/assets/javascripts/codemirror/modes/eiffel.js -- vendor/assets/javascripts/codemirror/modes/elm.js -- vendor/assets/javascripts/codemirror/modes/erlang.js -- vendor/assets/javascripts/codemirror/modes/factor.js -- vendor/assets/javascripts/codemirror/modes/forth.js -- vendor/assets/javascripts/codemirror/modes/fortran.js -- vendor/assets/javascripts/codemirror/modes/gas.js -- vendor/assets/javascripts/codemirror/modes/gfm.js -- vendor/assets/javascripts/codemirror/modes/gherkin.js -- vendor/assets/javascripts/codemirror/modes/go.js -- vendor/assets/javascripts/codemirror/modes/groovy.js -- vendor/assets/javascripts/codemirror/modes/haml.js -- vendor/assets/javascripts/codemirror/modes/handlebars.js -- vendor/assets/javascripts/codemirror/modes/haskell.js -- vendor/assets/javascripts/codemirror/modes/haxe.js -- vendor/assets/javascripts/codemirror/modes/htmlembedded.js -- vendor/assets/javascripts/codemirror/modes/htmlmixed.js -- vendor/assets/javascripts/codemirror/modes/http.js -- vendor/assets/javascripts/codemirror/modes/idl.js -- vendor/assets/javascripts/codemirror/modes/jade.js -- vendor/assets/javascripts/codemirror/modes/javascript.js -- vendor/assets/javascripts/codemirror/modes/jinja2.js -- vendor/assets/javascripts/codemirror/modes/julia.js -- vendor/assets/javascripts/codemirror/modes/kotlin.js -- vendor/assets/javascripts/codemirror/modes/livescript.js -- vendor/assets/javascripts/codemirror/modes/lua.js -- vendor/assets/javascripts/codemirror/modes/markdown.js -- vendor/assets/javascripts/codemirror/modes/mathematica.js -- vendor/assets/javascripts/codemirror/modes/mirc.js -- vendor/assets/javascripts/codemirror/modes/mllike.js -- vendor/assets/javascripts/codemirror/modes/modelica.js -- vendor/assets/javascripts/codemirror/modes/mumps.js -- vendor/assets/javascripts/codemirror/modes/nginx.js -- vendor/assets/javascripts/codemirror/modes/ntriples.js -- vendor/assets/javascripts/codemirror/modes/octave.js -- vendor/assets/javascripts/codemirror/modes/pascal.js -- vendor/assets/javascripts/codemirror/modes/pegjs.js -- vendor/assets/javascripts/codemirror/modes/perl.js -- vendor/assets/javascripts/codemirror/modes/php.js -- vendor/assets/javascripts/codemirror/modes/pig.js -- vendor/assets/javascripts/codemirror/modes/properties.js -- vendor/assets/javascripts/codemirror/modes/puppet.js -- vendor/assets/javascripts/codemirror/modes/python.js -- vendor/assets/javascripts/codemirror/modes/q.js -- vendor/assets/javascripts/codemirror/modes/r.js -- vendor/assets/javascripts/codemirror/modes/rpm.js -- vendor/assets/javascripts/codemirror/modes/rst.js -- vendor/assets/javascripts/codemirror/modes/ruby.js -- vendor/assets/javascripts/codemirror/modes/rust.js -- vendor/assets/javascripts/codemirror/modes/sass.js -- vendor/assets/javascripts/codemirror/modes/scheme.js -- vendor/assets/javascripts/codemirror/modes/shell.js -- vendor/assets/javascripts/codemirror/modes/sieve.js -- vendor/assets/javascripts/codemirror/modes/slim.js -- vendor/assets/javascripts/codemirror/modes/smalltalk.js -- vendor/assets/javascripts/codemirror/modes/smarty.js -- vendor/assets/javascripts/codemirror/modes/solr.js -- vendor/assets/javascripts/codemirror/modes/soy.js -- vendor/assets/javascripts/codemirror/modes/sparql.js -- vendor/assets/javascripts/codemirror/modes/spreadsheet.js -- vendor/assets/javascripts/codemirror/modes/sql.js -- vendor/assets/javascripts/codemirror/modes/stex.js -- vendor/assets/javascripts/codemirror/modes/stylus.js -- vendor/assets/javascripts/codemirror/modes/swift.js -- vendor/assets/javascripts/codemirror/modes/tcl.js -- vendor/assets/javascripts/codemirror/modes/textile.js -- vendor/assets/javascripts/codemirror/modes/tiddlywiki.js -- vendor/assets/javascripts/codemirror/modes/tiki.js -- vendor/assets/javascripts/codemirror/modes/toml.js -- vendor/assets/javascripts/codemirror/modes/tornado.js -- vendor/assets/javascripts/codemirror/modes/troff.js -- vendor/assets/javascripts/codemirror/modes/ttcn-cfg.js -- vendor/assets/javascripts/codemirror/modes/ttcn.js -- vendor/assets/javascripts/codemirror/modes/turtle.js -- vendor/assets/javascripts/codemirror/modes/twig.js -- vendor/assets/javascripts/codemirror/modes/vb.js -- vendor/assets/javascripts/codemirror/modes/vbscript.js -- vendor/assets/javascripts/codemirror/modes/velocity.js -- vendor/assets/javascripts/codemirror/modes/verilog.js -- vendor/assets/javascripts/codemirror/modes/vhdl.js -- vendor/assets/javascripts/codemirror/modes/xml.js -- vendor/assets/javascripts/codemirror/modes/xquery.js -- vendor/assets/javascripts/codemirror/modes/yaml.js -- vendor/assets/javascripts/codemirror/modes/z80.js -- vendor/assets/stylesheets/codemirror.css -- vendor/assets/stylesheets/codemirror/addons/dialog/dialog.css -- vendor/assets/stylesheets/codemirror/addons/display/fullscreen.css -- vendor/assets/stylesheets/codemirror/addons/fold/foldgutter.css -- vendor/assets/stylesheets/codemirror/addons/hint/show-hint.css -- vendor/assets/stylesheets/codemirror/addons/lint/lint.css -- vendor/assets/stylesheets/codemirror/addons/merge/merge.css -- vendor/assets/stylesheets/codemirror/addons/scroll/simplescrollbars.css -- vendor/assets/stylesheets/codemirror/addons/search/matchesonscrollbar.css -- vendor/assets/stylesheets/codemirror/addons/tern/tern.css -- vendor/assets/stylesheets/codemirror/modes/tiddlywiki.css -- vendor/assets/stylesheets/codemirror/modes/tiki.css -- vendor/assets/stylesheets/codemirror/themes/3024-day.css -- vendor/assets/stylesheets/codemirror/themes/3024-night.css -- vendor/assets/stylesheets/codemirror/themes/abcdef.css -- vendor/assets/stylesheets/codemirror/themes/ambiance-mobile.css -- vendor/assets/stylesheets/codemirror/themes/ambiance.css -- vendor/assets/stylesheets/codemirror/themes/base16-dark.css -- vendor/assets/stylesheets/codemirror/themes/base16-light.css -- vendor/assets/stylesheets/codemirror/themes/blackboard.css -- vendor/assets/stylesheets/codemirror/themes/cobalt.css -- vendor/assets/stylesheets/codemirror/themes/colorforth.css -- vendor/assets/stylesheets/codemirror/themes/dracula.css -- vendor/assets/stylesheets/codemirror/themes/eclipse.css -- vendor/assets/stylesheets/codemirror/themes/elegant.css -- vendor/assets/stylesheets/codemirror/themes/erlang-dark.css -- vendor/assets/stylesheets/codemirror/themes/icecoder.css -- vendor/assets/stylesheets/codemirror/themes/lesser-dark.css -- vendor/assets/stylesheets/codemirror/themes/liquibyte.css -- vendor/assets/stylesheets/codemirror/themes/material.css -- vendor/assets/stylesheets/codemirror/themes/mbo.css -- vendor/assets/stylesheets/codemirror/themes/mdn-like.css -- vendor/assets/stylesheets/codemirror/themes/midnight.css -- vendor/assets/stylesheets/codemirror/themes/monokai.css -- vendor/assets/stylesheets/codemirror/themes/neat.css -- vendor/assets/stylesheets/codemirror/themes/neo.css -- vendor/assets/stylesheets/codemirror/themes/night.css -- vendor/assets/stylesheets/codemirror/themes/paraiso-dark.css -- vendor/assets/stylesheets/codemirror/themes/paraiso-light.css -- vendor/assets/stylesheets/codemirror/themes/pastel-on-dark.css -- vendor/assets/stylesheets/codemirror/themes/rubyblue.css -- vendor/assets/stylesheets/codemirror/themes/seti.css -- vendor/assets/stylesheets/codemirror/themes/solarized.css -- vendor/assets/stylesheets/codemirror/themes/the-matrix.css -- vendor/assets/stylesheets/codemirror/themes/tomorrow-night-bright.css -- vendor/assets/stylesheets/codemirror/themes/tomorrow-night-eighties.css -- vendor/assets/stylesheets/codemirror/themes/ttcn.css -- vendor/assets/stylesheets/codemirror/themes/twilight.css -- vendor/assets/stylesheets/codemirror/themes/vibrant-ink.css -- vendor/assets/stylesheets/codemirror/themes/xq-dark.css -- vendor/assets/stylesheets/codemirror/themes/xq-light.css -- vendor/assets/stylesheets/codemirror/themes/yeti.css -- vendor/assets/stylesheets/codemirror/themes/zenburn.css -homepage: https://rubygems.org/gems/codemirror-rails -licenses: -- MIT -metadata: {} -post_install_message: -rdoc_options: [] -require_paths: -- lib -required_ruby_version: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' -required_rubygems_version: !ruby/object:Gem::Requirement - requirements: - - - ">=" - - !ruby/object:Gem::Version - version: '0' -requirements: [] -rubyforge_project: -rubygems_version: 2.4.5 -signing_key: -specification_version: 4 -summary: Use CodeMirror with Rails -test_files: [] diff -Nru ruby-codemirror-rails-5.6/Rakefile ruby-codemirror-rails-5.16.0/Rakefile --- ruby-codemirror-rails-5.6/Rakefile 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/Rakefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#!/usr/bin/env rake -begin - require 'bundler/setup' -rescue LoadError - puts 'You must `gem install bundler` and `bundle install` to run rake tasks' -end - -Bundler::GemHelper.install_tasks - -require 'rake/testtask' - -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' - t.verbose = false -end - -task :default => :test diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/assets/javascripts/application.js ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/assets/javascripts/application.js --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/assets/javascripts/application.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/assets/javascripts/application.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// the compiled file. -// -// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD -// GO AFTER THE REQUIRES BELOW. -// -//= require jquery -//= require jquery_ujs -//= require_tree . diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/assets/stylesheets/application.css ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/assets/stylesheets/application.css --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/assets/stylesheets/application.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/assets/stylesheets/application.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - *= require_tree . -*/ diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/controllers/application_controller.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/controllers/application_controller.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/controllers/application_controller.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/controllers/application_controller.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -class ApplicationController < ActionController::Base - protect_from_forgery -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/helpers/application_helper.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/helpers/application_helper.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/helpers/application_helper.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/helpers/application_helper.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/views/layouts/application.html.erb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/views/layouts/application.html.erb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/app/views/layouts/application.html.erb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/app/views/layouts/application.html.erb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - - Dummy - <%= stylesheet_link_tag "application", :media => "all" %> - <%= javascript_include_tag "application" %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/application.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/application.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/application.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/application.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -Bundler.require -require "codemirror-rails" - -module Dummy - class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Custom directories with classes and modules you want to be autoloadable. - # config.autoload_paths += %W(#{config.root}/extras) - - # Only load the plugins named here, in the order given (default is alphabetical). - # :all can be used as a placeholder for all plugins not explicitly named. - # config.plugins = [ :exception_notification, :ssl_requirement, :all ] - - # Activate observers that should always be running. - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - - # Configure the default encoding used in templates for Ruby 1.9. - config.encoding = "utf-8" - - # Configure sensitive parameters which will be filtered from the log file. - config.filter_parameters += [:password] - - # Use SQL instead of Active Record's schema dumper when creating the database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Enforce whitelist mode for mass assignment. - # This will create an empty whitelist of attributes available for mass-assignment for all models - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible - # parameters by using an attr_accessible or attr_protected declaration. - # config.active_record.whitelist_attributes = true - - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' - end -end - diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/boot.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/boot.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/boot.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/boot.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -require 'rubygems' -gemfile = File.expand_path('../../../../Gemfile', __FILE__) - -if File.exist?(gemfile) - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -end - -$:.unshift File.expand_path('../../../../lib', __FILE__) \ No newline at end of file diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/database.yml ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/database.yml --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/database.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/database.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environment.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environment.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environment.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environment.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -Dummy::Application.initialize! diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environments/development.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environments/development.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environments/development.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environments/development.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger - config.active_support.deprecation = :log - - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin - - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 - - # Do not compress assets - config.assets.compress = false - - # Expands the lines which load the assets - config.assets.debug = true -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environments/production.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environments/production.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environments/production.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environments/production.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # Code is not reloaded between requests - config.cache_classes = true - - # Full error reports are disabled and caching is turned on - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false - - # Compress JavaScripts and CSS - config.assets.compress = true - - # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false - - # Generate digests for assets URLs - config.assets.digest = true - - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH - - # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # See everything in the log (default is :info) - # config.log_level = :debug - - # Prepend all log lines with the following tags - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) - - # Disable delivery errors, bad email addresses will be ignored - # config.action_mailer.raise_delivery_errors = false - - # Enable threaded mode - # config.threadsafe! - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners - config.active_support.deprecation = :notify - - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - # config.active_record.auto_explain_threshold_in_seconds = 0.5 -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environments/test.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environments/test.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/environments/test.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/environments/test.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true - config.static_cache_control = "public, max-age=3600" - - # Log error messages when you accidentally call methods on nil - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/backtrace_silencers.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/backtrace_silencers.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/backtrace_silencers.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/backtrace_silencers.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/inflections.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/inflections.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/inflections.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/inflections.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end -# -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.acronym 'RESTful' -# end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/mime_types.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/mime_types.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/mime_types.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/mime_types.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/secret_token.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/secret_token.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/secret_token.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/secret_token.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -Dummy::Application.config.secret_token = '17f0c3cb560a96dbd11a2322311215f4457303a24e9e09a49a3d538129decaa98eadf5a27f4e100940452796238c3e54bd131229ca341ea5379f894f09540fa8' diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/session_store.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/session_store.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/session_store.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/session_store.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# Dummy::Application.config.session_store :active_record_store diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/wrap_parameters.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/wrap_parameters.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/initializers/wrap_parameters.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/initializers/wrap_parameters.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] -end - -# Disable root element in JSON by default. -ActiveSupport.on_load(:active_record) do - self.include_root_in_json = false -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/locales/en.yml ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/locales/en.yml --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/locales/en.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/locales/en.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en: - hello: "Hello world" diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/routes.rb ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/routes.rb --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config/routes.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config/routes.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -Dummy::Application.routes.draw do - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => 'welcome#index' - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id))(.:format)' -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/config.ru ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config.ru --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/config.ru 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/config.ru 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Dummy::Application diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/public/404.html ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/public/404.html --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/public/404.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/public/404.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - -
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/public/422.html ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/public/422.html --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/public/422.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/public/422.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - -
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/public/500.html ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/public/500.html --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/public/500.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/public/500.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - -
-

We're sorry, but something went wrong.

-
- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/Rakefile ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/Rakefile --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/Rakefile 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/Rakefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#!/usr/bin/env rake -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Dummy::Application.load_tasks diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/README.rdoc ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/README.rdoc --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/README.rdoc 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/README.rdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,261 +0,0 @@ -== Welcome to Rails - -Rails is a web-application framework that includes everything needed to create -database-backed web applications according to the Model-View-Control pattern. - -This pattern splits the view (also called the presentation) into "dumb" -templates that are primarily responsible for inserting pre-built data in between -HTML tags. The model contains the "smart" domain objects (such as Account, -Product, Person, Post) that holds all the business logic and knows how to -persist themselves to a database. The controller handles the incoming requests -(such as Save New Account, Update Product, Show Post) by manipulating the model -and directing data to the view. - -In Rails, the model is handled by what's called an object-relational mapping -layer entitled Active Record. This layer allows you to present the data from -database rows as objects and embellish these data objects with business logic -methods. You can read more about Active Record in -link:files/vendor/rails/activerecord/README.html. - -The controller and view are handled by the Action Pack, which handles both -layers by its two parts: Action View and Action Controller. These two layers -are bundled in a single package due to their heavy interdependence. This is -unlike the relationship between the Active Record and Action Pack that is much -more separate. Each of these packages can be used independently outside of -Rails. You can read more about Action Pack in -link:files/vendor/rails/actionpack/README.html. - - -== Getting Started - -1. At the command prompt, create a new Rails application: - rails new myapp (where myapp is the application name) - -2. Change directory to myapp and start the web server: - cd myapp; rails server (run with --help for options) - -3. Go to http://localhost:3000/ and you'll see: - "Welcome aboard: You're riding Ruby on Rails!" - -4. Follow the guidelines to start developing your application. You can find -the following resources handy: - -* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html -* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ - - -== Debugging Rails - -Sometimes your application goes wrong. Fortunately there are a lot of tools that -will help you debug it and get it back on the rails. - -First area to check is the application log files. Have "tail -f" commands -running on the server.log and development.log. Rails will automatically display -debugging and runtime information to these files. Debugging info will also be -shown in the browser on requests from 127.0.0.1. - -You can also log your own messages directly into the log file from your code -using the Ruby logger class from inside your controllers. Example: - - class WeblogController < ActionController::Base - def destroy - @weblog = Weblog.find(params[:id]) - @weblog.destroy - logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") - end - end - -The result will be a message in your log file along the lines of: - - Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! - -More information on how to use the logger is at http://www.ruby-doc.org/core/ - -Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are -several books available online as well: - -* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) -* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) - -These two books will bring you up to speed on the Ruby language and also on -programming in general. - - -== Debugger - -Debugger support is available through the debugger command when you start your -Mongrel or WEBrick server with --debugger. This means that you can break out of -execution at any point in the code, investigate and change the model, and then, -resume execution! You need to install ruby-debug to run the server in debugging -mode. With gems, use sudo gem install ruby-debug. Example: - - class WeblogController < ActionController::Base - def index - @posts = Post.all - debugger - end - end - -So the controller will accept the action, run the first line, then present you -with a IRB prompt in the server window. Here you can do things like: - - >> @posts.inspect - => "[#nil, "body"=>nil, "id"=>"1"}>, - #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" - >> @posts.first.title = "hello from a debugger" - => "hello from a debugger" - -...and even better, you can examine how your runtime objects actually work: - - >> f = @posts.first - => #nil, "body"=>nil, "id"=>"1"}> - >> f. - Display all 152 possibilities? (y or n) - -Finally, when you're ready to resume execution, you can enter "cont". - - -== Console - -The console is a Ruby shell, which allows you to interact with your -application's domain model. Here you'll have all parts of the application -configured, just like it is when the application is running. You can inspect -domain models, change values, and save to the database. Starting the script -without arguments will launch it in the development environment. - -To start the console, run rails console from the application -directory. - -Options: - -* Passing the -s, --sandbox argument will rollback any modifications - made to the database. -* Passing an environment name as an argument will load the corresponding - environment. Example: rails console production. - -To reload your controllers and models after launching the console run -reload! - -More information about irb can be found at: -link:http://www.rubycentral.org/pickaxe/irb.html - - -== dbconsole - -You can go to the command line of your database directly through rails -dbconsole. You would be connected to the database with the credentials -defined in database.yml. Starting the script without arguments will connect you -to the development database. Passing an argument will connect you to a different -database, like rails dbconsole production. Currently works for MySQL, -PostgreSQL and SQLite 3. - -== Description of Contents - -The default directory structure of a generated Ruby on Rails application: - - |-- app - | |-- assets - | |-- images - | |-- javascripts - | `-- stylesheets - | |-- controllers - | |-- helpers - | |-- mailers - | |-- models - | `-- views - | `-- layouts - |-- config - | |-- environments - | |-- initializers - | `-- locales - |-- db - |-- doc - |-- lib - | `-- tasks - |-- log - |-- public - |-- script - |-- test - | |-- fixtures - | |-- functional - | |-- integration - | |-- performance - | `-- unit - |-- tmp - | |-- cache - | |-- pids - | |-- sessions - | `-- sockets - `-- vendor - |-- assets - `-- stylesheets - `-- plugins - -app - Holds all the code that's specific to this particular application. - -app/assets - Contains subdirectories for images, stylesheets, and JavaScript files. - -app/controllers - Holds controllers that should be named like weblogs_controller.rb for - automated URL mapping. All controllers should descend from - ApplicationController which itself descends from ActionController::Base. - -app/models - Holds models that should be named like post.rb. Models descend from - ActiveRecord::Base by default. - -app/views - Holds the template files for the view that should be named like - weblogs/index.html.erb for the WeblogsController#index action. All views use - eRuby syntax by default. - -app/views/layouts - Holds the template files for layouts to be used with views. This models the - common header/footer method of wrapping views. In your views, define a layout - using the layout :default and create a file named default.html.erb. - Inside default.html.erb, call <% yield %> to render the view using this - layout. - -app/helpers - Holds view helpers that should be named like weblogs_helper.rb. These are - generated for you automatically when using generators for controllers. - Helpers can be used to wrap functionality for your views into methods. - -config - Configuration files for the Rails environment, the routing map, the database, - and other dependencies. - -db - Contains the database schema in schema.rb. db/migrate contains all the - sequence of Migrations for your schema. - -doc - This directory is where your application documentation will be stored when - generated using rake doc:app - -lib - Application specific libraries. Basically, any kind of custom code that - doesn't belong under controllers, models, or helpers. This directory is in - the load path. - -public - The directory available for the web server. Also contains the dispatchers and the - default HTML files. This should be set as the DOCUMENT_ROOT of your web - server. - -script - Helper scripts for automation and generation. - -test - Unit and functional tests along with fixtures. When using the rails generate - command, template test files will be generated for you and placed in this - directory. - -vendor - External libraries that the application depends on. Also includes the plugins - subdirectory. If the app has frozen rails, those gems also go here, under - vendor/rails/. This directory is in the load path. diff -Nru ruby-codemirror-rails-5.6/test/dummy-3.2.x/script/rails ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/script/rails --- ruby-codemirror-rails-5.6/test/dummy-3.2.x/script/rails 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-3.2.x/script/rails 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/usr/bin/env ruby -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. - -APP_PATH = File.expand_path('../../config/application', __FILE__) -require File.expand_path('../../config/boot', __FILE__) -require 'rails/commands' diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/assets/javascripts/application.js ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/assets/javascripts/application.js --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/assets/javascripts/application.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/assets/javascripts/application.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require_tree . diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/assets/stylesheets/application.css ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/assets/stylesheets/application.css --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/assets/stylesheets/application.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/assets/stylesheets/application.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - *= require_tree . - */ diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/controllers/application_controller.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/controllers/application_controller.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/controllers/application_controller.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/controllers/application_controller.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/helpers/application_helper.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/helpers/application_helper.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/helpers/application_helper.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/helpers/application_helper.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/views/layouts/application.html.erb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/views/layouts/application.html.erb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/app/views/layouts/application.html.erb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/app/views/layouts/application.html.erb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - - Dummy - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/bin/bundle ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/bin/bundle --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/bin/bundle 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/bin/bundle 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/bin/rails ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/bin/rails --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/bin/rails 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/bin/rails 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/bin/rake ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/bin/rake --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/bin/rake 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/bin/rake 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/application.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/application.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/application.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/application.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -Bundler.require(*Rails.groups) -require "codemirror-rails" - -module Dummy - class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - end -end - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/boot.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/boot.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/boot.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/boot.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/database.yml ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/database.yml --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/database.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/database.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environment.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environment.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environment.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environment.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Dummy::Application.initialize! diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environments/development.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environments/development.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environments/development.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environments/development.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environments/production.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environments/production.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environments/production.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environments/production.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both thread web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Enable Rack::Cache to put a simple HTTP cache in front of your application - # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. - # config.action_dispatch.rack_cache = true - - # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Generate digests for assets URLs. - config.assets.digest = true - - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Set to :debug to see everything in the log. - config.log_level = :info - - # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups. - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Disable automatic flushing of the log to improve performance. - # config.autoflush_log = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environments/test.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environments/test.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/environments/test.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/environments/test.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true - config.static_cache_control = "public, max-age=3600" - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/backtrace_silencers.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/backtrace_silencers.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/backtrace_silencers.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/backtrace_silencers.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/filter_parameter_logging.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/inflections.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/inflections.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/inflections.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/inflections.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/mime_types.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/mime_types.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/mime_types.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/mime_types.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/secret_token.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/secret_token.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/secret_token.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/secret_token.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -Dummy::Application.config.secret_key_base = 'fe67dd57d4d9fb770a0011d8bd8b946b3dc9c9e0dcba38cc43e54af53c1fb1ae358077cc311b5c80821e4a0cf242a467860cc46a7bee9422a8537d2931862e1a' diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/session_store.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/session_store.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/session_store.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/session_store.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/wrap_parameters.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/wrap_parameters.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/initializers/wrap_parameters.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/initializers/wrap_parameters.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/locales/en.yml ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/locales/en.yml --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/locales/en.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/locales/en.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/routes.rb ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/routes.rb --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config/routes.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config/routes.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -Dummy::Application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/config.ru ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config.ru --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/config.ru 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/config.ru 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/public/404.html ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/public/404.html --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/public/404.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/public/404.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - -
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/public/422.html ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/public/422.html --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/public/422.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/public/422.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - -
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/public/500.html ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/public/500.html --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/public/500.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/public/500.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - -
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/Rakefile ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/Rakefile --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/Rakefile 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/Rakefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Dummy::Application.load_tasks diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.0.x/README.rdoc ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/README.rdoc --- ruby-codemirror-rails-5.6/test/dummy-4.0.x/README.rdoc 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.0.x/README.rdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -== README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/assets/javascripts/application.js ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/assets/javascripts/application.js --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/assets/javascripts/application.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/assets/javascripts/application.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require_tree . diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/assets/stylesheets/application.css ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/assets/stylesheets/application.css --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/assets/stylesheets/application.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/assets/stylesheets/application.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/controllers/application_controller.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/controllers/application_controller.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/controllers/application_controller.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/controllers/application_controller.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/helpers/application_helper.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/helpers/application_helper.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/helpers/application_helper.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/helpers/application_helper.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/views/layouts/application.html.erb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/views/layouts/application.html.erb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/app/views/layouts/application.html.erb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/app/views/layouts/application.html.erb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - - Dummy - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/bin/bundle ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/bin/bundle --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/bin/bundle 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/bin/bundle 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/bin/rails ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/bin/rails --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/bin/rails 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/bin/rails 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/bin/rake ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/bin/rake --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/bin/rake 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/bin/rake 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/application.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/application.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/application.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/application.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -Bundler.require(*Rails.groups) -require "codemirror-rails" - -module Dummy - class Application < Rails::Application - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - end -end - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/boot.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/boot.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/boot.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/boot.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) - -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) -$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/database.yml ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/database.yml --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/database.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/database.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -# -default: &default - adapter: sqlite3 - pool: 5 - timeout: 5000 - -development: - <<: *default - database: db/development.sqlite3 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - <<: *default - database: db/test.sqlite3 - -production: - <<: *default - database: db/production.sqlite3 diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environment.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environment.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environment.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environment.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Rails.application.initialize! diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environments/development.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environments/development.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environments/development.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environments/development.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - # Adds additional error checking when serving assets at runtime. - # Checks for improperly declared sprockets dependencies. - # Raises helpful error messages. - config.assets.raise_runtime_errors = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environments/production.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environments/production.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environments/production.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environments/production.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Enable Rack::Cache to put a simple HTTP cache in front of your application - # Add `rack-cache` to your Gemfile before enabling this. - # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. - # config.action_dispatch.rack_cache = true - - # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Generate digests for assets URLs. - config.assets.digest = true - - # `config.assets.precompile` has moved to config/initializers/assets.rb - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Set to :debug to see everything in the log. - config.log_level = :info - - # Prepend all log lines with the following tags. - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups. - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Disable automatic flushing of the log to improve performance. - # config.autoflush_log = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environments/test.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environments/test.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/environments/test.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/environments/test.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true - config.static_cache_control = 'public, max-age=3600' - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/assets.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/assets.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/assets.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/assets.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -# Rails.application.config.assets.precompile += %w( search.js ) diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/backtrace_silencers.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/backtrace_silencers.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/backtrace_silencers.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/backtrace_silencers.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/cookies_serializer.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/cookies_serializer.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/cookies_serializer.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/cookies_serializer.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/filter_parameter_logging.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/inflections.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/inflections.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/inflections.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/inflections.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/mime_types.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/mime_types.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/mime_types.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/mime_types.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/session_store.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/session_store.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/session_store.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/session_store.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/wrap_parameters.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/wrap_parameters.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/initializers/wrap_parameters.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/initializers/wrap_parameters.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] if respond_to?(:wrap_parameters) -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/locales/en.yml ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/locales/en.yml --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/locales/en.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/locales/en.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/routes.rb ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/routes.rb --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/routes.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/routes.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end -end diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/secrets.yml ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/secrets.yml --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config/secrets.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config/secrets.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: f0e4e041743de2d6246bfe53493e444c3aa63a0b2bc348c660346f8a9fa36a38aae2b0d4afef263ca1cb597c2aa7d2cf660ef1bb813ac80f35602b99212aa59d - -test: - secret_key_base: b7df7801dddcc9790549d4753167aea56483b33322e835eb629e88e6228229f55046a5261c2d22507cb84a5b7d05208115e721f3799cf1ff11b78ec98b654582 - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/config.ru ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config.ru --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/config.ru 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/config.ru 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/public/404.html ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/public/404.html --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/public/404.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/public/404.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/public/422.html ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/public/422.html --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/public/422.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/public/422.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/public/500.html ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/public/500.html --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/public/500.html 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/public/500.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/Rakefile ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/Rakefile --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/Rakefile 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/Rakefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Rails.application.load_tasks diff -Nru ruby-codemirror-rails-5.6/test/dummy-4.1.x/README.rdoc ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/README.rdoc --- ruby-codemirror-rails-5.6/test/dummy-4.1.x/README.rdoc 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/dummy-4.1.x/README.rdoc 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -== README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. diff -Nru ruby-codemirror-rails-5.6/test/integration/codemirror_rails_integration_test.rb ruby-codemirror-rails-5.16.0/test/integration/codemirror_rails_integration_test.rb --- ruby-codemirror-rails-5.6/test/integration/codemirror_rails_integration_test.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/integration/codemirror_rails_integration_test.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -require 'test_helper' - -describe 'codemiror-rails integration' do - it 'provides codemirror.js on the asset pipeline' do - asset_file('codemirror.js').must_include 'function CodeMirror' - end - - it 'provides codemirror css on the asset pipeline' do - asset_file('codemirror.css').must_include '.CodeMirror' - end - - def asset_file(name) - Dummy::Application.assets[name].to_s - end -end diff -Nru ruby-codemirror-rails-5.6/test/test_helper.rb ruby-codemirror-rails-5.16.0/test/test_helper.rb --- ruby-codemirror-rails-5.6/test/test_helper.rb 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/test/test_helper.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -ENV['RAILS_ENV'] = 'test' - -require 'rails/version' -case "#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}" -when '3.2' - require File.expand_path('../dummy-3.2.x/config/environment', __FILE__) -when '4.0' - require File.expand_path('../dummy-4.0.x/config/environment', __FILE__) -when '4.1' - require File.expand_path('../dummy-4.1.x/config/environment', __FILE__) -end - -require 'rails/test_help' -require 'minitest/autorun' - -Rails.backtrace_cleaner.remove_silencers! diff -Nru ruby-codemirror-rails-5.6/.travis.yml ruby-codemirror-rails-5.16.0/.travis.yml --- ruby-codemirror-rails-5.6/.travis.yml 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ ---- -language: ruby -rvm: - - 1.9.3 - - 2.0.0 - - 2.1.2 -gemfile: - - gemfiles/Gemfile.rails-3.2 - - gemfiles/Gemfile.rails-4.0 - - gemfiles/Gemfile.rails-4.1 diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/comment/comment.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/comment/comment.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/comment/comment.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/comment/comment.js 2018-08-23 17:28:17.000000000 +0000 @@ -21,26 +21,40 @@ } CodeMirror.commands.toggleComment = function(cm) { - var minLine = Infinity, ranges = cm.listSelections(), mode = null; + cm.toggleComment(); + }; + + CodeMirror.defineExtension("toggleComment", function(options) { + if (!options) options = noOptions; + var cm = this; + var minLine = Infinity, ranges = this.listSelections(), mode = null; for (var i = ranges.length - 1; i >= 0; i--) { var from = ranges[i].from(), to = ranges[i].to(); if (from.line >= minLine) continue; if (to.line >= minLine) to = Pos(minLine, 0); minLine = from.line; if (mode == null) { - if (cm.uncomment(from, to)) mode = "un"; - else { cm.lineComment(from, to); mode = "line"; } + if (cm.uncomment(from, to, options)) mode = "un"; + else { cm.lineComment(from, to, options); mode = "line"; } } else if (mode == "un") { - cm.uncomment(from, to); + cm.uncomment(from, to, options); } else { - cm.lineComment(from, to); + cm.lineComment(from, to, options); } } - }; + }); + + // Rough heuristic to try and detect lines that are part of multi-line string + function probablyInsideString(cm, pos, line) { + return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"`]/.test(line) + } CodeMirror.defineExtension("lineComment", function(from, to, options) { if (!options) options = noOptions; var self = this, mode = self.getModeAt(from); + var firstLine = self.getLine(from.line); + if (firstLine == null || probablyInsideString(self, from, firstLine)) return; + var commentString = options.lineComment || mode.lineComment; if (!commentString) { if (options.blockCommentStart || mode.blockCommentStart) { @@ -49,15 +63,21 @@ } return; } - var firstLine = self.getLine(from.line); - if (firstLine == null) return; + var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); var pad = options.padding == null ? " " : options.padding; var blankLines = options.commentBlankLines || from.line == to.line; self.operation(function() { if (options.indent) { - var baseString = firstLine.slice(0, firstNonWS(firstLine)); + var baseString = null; + for (var i = from.line; i < end; ++i) { + var line = self.getLine(i); + var whitespace = line.slice(0, firstNonWS(line)); + if (baseString == null || baseString.length > whitespace.length) { + baseString = whitespace; + } + } for (var i = from.line; i < end; ++i) { var line = self.getLine(i), cut = baseString.length; if (!blankLines && !nonWS.test(line)) continue; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js 2018-08-23 17:28:17.000000000 +0000 @@ -56,6 +56,8 @@ var inp = dialog.getElementsByTagName("input")[0], button; if (inp) { + inp.focus(); + if (options.value) { inp.value = options.value; if (options.selectValueOnOpen !== false) { @@ -79,8 +81,6 @@ }); if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); - - inp.focus(); } else if (button = dialog.getElementsByTagName("button")[0]) { CodeMirror.on(button, "click", function() { close(); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/display/placeholder.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/display/placeholder.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/display/placeholder.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/display/placeholder.js 2018-08-23 17:28:17.000000000 +0000 @@ -14,10 +14,12 @@ if (val && !prev) { cm.on("blur", onBlur); cm.on("change", onChange); + cm.on("swapDoc", onChange); onChange(cm); } else if (!val && prev) { cm.off("blur", onBlur); cm.off("change", onChange); + cm.off("swapDoc", onChange); clearPlaceholder(cm); var wrapper = cm.getWrapperElement(); wrapper.className = wrapper.className.replace(" CodeMirror-empty", ""); @@ -37,7 +39,9 @@ var elt = cm.state.placeholder = document.createElement("pre"); elt.style.cssText = "height: 0; overflow: visible"; elt.className = "CodeMirror-placeholder"; - elt.appendChild(document.createTextNode(cm.getOption("placeholder"))); + var placeHolder = cm.getOption("placeholder") + if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder) + elt.appendChild(placeHolder) cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild); } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/display/rulers.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/display/rulers.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/display/rulers.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/display/rulers.js 2018-08-23 17:28:17.000000000 +0000 @@ -11,30 +11,26 @@ })(function(CodeMirror) { "use strict"; - CodeMirror.defineOption("rulers", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - clearRulers(cm); - cm.off("refresh", refreshRulers); + CodeMirror.defineOption("rulers", false, function(cm, val) { + if (cm.state.rulerDiv) { + cm.display.lineSpace.removeChild(cm.state.rulerDiv) + cm.state.rulerDiv = null + cm.off("refresh", drawRulers) } if (val && val.length) { - setRulers(cm); - cm.on("refresh", refreshRulers); + cm.state.rulerDiv = cm.display.lineSpace.insertBefore(document.createElement("div"), cm.display.cursorDiv) + cm.state.rulerDiv.className = "CodeMirror-rulers" + drawRulers(cm) + cm.on("refresh", drawRulers) } }); - function clearRulers(cm) { - for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) { - var node = cm.display.lineSpace.childNodes[i]; - if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className)) - node.parentNode.removeChild(node); - } - } - - function setRulers(cm) { + function drawRulers(cm) { + cm.state.rulerDiv.textContent = "" var val = cm.getOption("rulers"); var cw = cm.defaultCharWidth(); var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; - var minH = cm.display.scroller.offsetHeight + 30; + cm.state.rulerDiv.style.minHeight = (cm.display.scroller.offsetHeight + 30) + "px"; for (var i = 0; i < val.length; i++) { var elt = document.createElement("div"); elt.className = "CodeMirror-ruler"; @@ -49,15 +45,7 @@ if (conf.width) elt.style.borderLeftWidth = conf.width; } elt.style.left = (left + col * cw) + "px"; - elt.style.top = "-50px"; - elt.style.bottom = "-20px"; - elt.style.minHeight = minH + "px"; - cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv); + cm.state.rulerDiv.appendChild(elt) } } - - function refreshRulers(cm) { - clearRulers(cm); - setRulers(cm); - } }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js 2018-08-23 17:28:17.000000000 +0000 @@ -63,7 +63,7 @@ } for (var i = ranges.length - 1; i >= 0; i--) { var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete"); } } @@ -90,6 +90,12 @@ }); } + function contractSelection(sel) { + var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0; + return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)), + head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))}; + } + function handleChar(cm, ch) { var conf = getConfig(cm); if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; @@ -103,7 +109,7 @@ var ranges = cm.listSelections(); var opening = pos % 2 == 0; - var type, next; + var type; for (var i = 0; i < ranges.length; i++) { var range = ranges[i], cur = range.head, curType; var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); @@ -145,6 +151,10 @@ for (var i = 0; i < sels.length; i++) sels[i] = left + sels[i] + right; cm.replaceSelections(sels, "around"); + sels = cm.listSelections().slice(); + for (var i = 0; i < sels.length; i++) + sels[i] = contractSelection(sels[i]); + cm.setSelections(sels); } else if (type == "both") { cm.replaceSelection(left + right, null); cm.triggerElectric(left + right); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js 2018-08-23 17:28:17.000000000 +0000 @@ -13,7 +13,7 @@ CodeMirror.registerHelper("fold", "brace", function(cm, start) { var line = start.line, lineText = cm.getLine(line); - var startCh, tokenType; + var tokenType; function findOpening(openCh) { for (var at = start.ch, pass = 0;;) { @@ -72,15 +72,15 @@ } } - var start = start.line, has = hasImport(start), prev; - if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) + var startLine = start.line, has = hasImport(startLine), prev; + if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1)) return null; for (var end = has.end;;) { var next = hasImport(end.line + 1); if (next == null) break; end = next.end; } - return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; + return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end}; }); CodeMirror.registerHelper("fold", "include", function(cm, start) { @@ -91,14 +91,14 @@ if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; } - var start = start.line, has = hasInclude(start); - if (has == null || hasInclude(start - 1) != null) return null; - for (var end = start;;) { + var startLine = start.line, has = hasInclude(startLine); + if (has == null || hasInclude(startLine - 1) != null) return null; + for (var end = startLine;;) { var next = hasInclude(end + 1); if (next == null) break; ++end; } - return {from: CodeMirror.Pos(start, has + 1), + return {from: CodeMirror.Pos(startLine, has + 1), to: cm.clipPos(CodeMirror.Pos(end))}; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js 2018-08-23 17:28:17.000000000 +0000 @@ -28,7 +28,9 @@ continue; } if (pass == 1 && found < start.ch) return; - if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) { + if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) && + (found == 0 || lineText.slice(found - endToken.length, found) == endToken || + !/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) { startCh = found + startToken.length; break; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js 2018-08-23 17:28:17.000000000 +0000 @@ -49,7 +49,7 @@ }); var myRange = cm.markText(range.from, range.to, { replacedWith: myWidget, - clearOnEnter: true, + clearOnEnter: getOption(cm, options, "clearOnEnter"), __isFold: true }); myRange.on("clear", function(from, to) { @@ -129,7 +129,8 @@ rangeFinder: CodeMirror.fold.auto, widget: "\u2194", minFoldSize: 0, - scanUp: false + scanUp: false, + clearOnEnter: true }; CodeMirror.defineOption("foldOptions", null); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js 2018-08-23 17:28:17.000000000 +0000 @@ -20,7 +20,7 @@ cm.off("viewportChange", onViewportChange); cm.off("fold", onFold); cm.off("unfold", onFold); - cm.off("swapDoc", updateInViewport); + cm.off("swapDoc", onChange); } if (val) { cm.state.foldGutter = new State(parseOptions(val)); @@ -30,7 +30,7 @@ cm.on("viewportChange", onViewportChange); cm.on("fold", onFold); cm.on("unfold", onFold); - cm.on("swapDoc", updateInViewport); + cm.on("swapDoc", onChange); } }); @@ -50,7 +50,7 @@ } function isFolded(cm, line) { - var marks = cm.findMarksAt(Pos(line)); + var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0)); for (var i = 0; i < marks.length; ++i) if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i]; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js 2018-08-23 17:28:17.000000000 +0000 @@ -140,9 +140,9 @@ var openTag = toNextTag(iter), end; if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; if (!openTag[1] && end != "selfClose") { - var start = Pos(iter.line, iter.ch); - var close = findMatchingClose(iter, openTag[2]); - return close && {from: start, to: close.from}; + var startPos = Pos(iter.line, iter.ch); + var endPos = findMatchingClose(iter, openTag[2]); + return endPos && {from: startPos, to: endPos.from}; } } }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js 2018-08-23 17:28:17.000000000 +0000 @@ -25,8 +25,18 @@ }; CodeMirror.defineExtension("showHint", function(options) { - // We want a single cursor position. - if (this.listSelections().length > 1 || this.somethingSelected()) return; + options = parseOptions(this, this.getCursor("start"), options); + var selections = this.listSelections() + if (selections.length > 1) return; + // By default, don't allow completion when something is selected. + // A hint function can have a `supportsSelection` property to + // indicate that it can handle selections. + if (this.somethingSelected()) { + if (!options.hint.supportsSelection) return; + // Don't try with cross-line selections + for (var i = 0; i < selections.length; i++) + if (selections[i].head.line != selections[i].anchor.line) return; + } if (this.state.completionActive) this.state.completionActive.close(); var completion = this.state.completionActive = new Completion(this, options); @@ -38,12 +48,12 @@ function Completion(cm, options) { this.cm = cm; - this.options = this.buildOptions(options); + this.options = options; this.widget = null; this.debounce = 0; this.tick = 0; - this.startPos = this.cm.getCursor(); - this.startLen = this.cm.getLine(this.startPos.line).length; + this.startPos = this.cm.getCursor("start"); + this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; var self = this; cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); @@ -98,24 +108,22 @@ }, update: function(first) { - if (this.tick == null) return; - if (!this.options.hint.async) { - this.finishUpdate(this.options.hint(this.cm, this.options), first); - } else { - var myTick = ++this.tick, self = this; - this.options.hint(this.cm, function(data) { - if (self.tick == myTick) self.finishUpdate(data, first); - }, this.options); - } + if (this.tick == null) return + var self = this, myTick = ++this.tick + fetchHints(this.options.hint, this.cm, this.options, function(data) { + if (self.tick == myTick) self.finishUpdate(data, first) + }) }, finishUpdate: function(data, first) { if (this.data) CodeMirror.signal(this.data, "update"); - if (data && this.data && CodeMirror.cmpPos(data.from, this.data.from)) data = null; - this.data = data; var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); if (this.widget) this.widget.close(); + + if (data && this.data && isNewCompletion(this.data, data)) return; + this.data = data; + if (data && data.list.length) { if (picked && data.list.length == 1) { this.pick(data, 0); @@ -124,20 +132,26 @@ CodeMirror.signal(data, "shown"); } } - }, - - buildOptions: function(options) { - var editor = this.cm.options.hintOptions; - var out = {}; - for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; - if (editor) for (var prop in editor) - if (editor[prop] !== undefined) out[prop] = editor[prop]; - if (options) for (var prop in options) - if (options[prop] !== undefined) out[prop] = options[prop]; - return out; } }; + function isNewCompletion(old, nw) { + var moved = CodeMirror.cmpPos(nw.from, old.from) + return moved > 0 && old.to.ch - old.from.ch != nw.to.ch - nw.from.ch + } + + function parseOptions(cm, pos, options) { + var editor = cm.options.hintOptions; + var out = {}; + for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; + if (editor) for (var prop in editor) + if (editor[prop] !== undefined) out[prop] = editor[prop]; + if (options) for (var prop in options) + if (options[prop] !== undefined) out[prop] = options[prop]; + if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos) + return out; + } + function getText(completion) { if (typeof completion == "string") return completion; else return completion.text; @@ -215,6 +229,7 @@ var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); (completion.options.container || document.body).appendChild(hints); var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; + var scrolls = hints.scrollHeight > hints.clientHeight + 1 if (overlapY > 0) { var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); if (curTop - height > 0) { // Fits above cursor @@ -239,6 +254,8 @@ } hints.style.left = (left = pos.left - overlapX) + "px"; } + if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) + node.style.paddingRight = cm.display.nativeBarWidth + "px" cm.addKeyMap(this.keyMap = buildKeyMap(completion, { moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); }, @@ -336,18 +353,52 @@ } }; - CodeMirror.registerHelper("hint", "auto", function(cm, options) { - var helpers = cm.getHelpers(cm.getCursor(), "hint"), words; + function applicableHelpers(cm, helpers) { + if (!cm.somethingSelected()) return helpers + var result = [] + for (var i = 0; i < helpers.length; i++) + if (helpers[i].supportsSelection) result.push(helpers[i]) + return result + } + + function fetchHints(hint, cm, options, callback) { + if (hint.async) { + hint(cm, callback, options) + } else { + var result = hint(cm, options) + if (result && result.then) result.then(callback) + else callback(result) + } + } + + function resolveAutoHints(cm, pos) { + var helpers = cm.getHelpers(pos, "hint"), words if (helpers.length) { - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, options); - if (cur && cur.list.length) return cur; + var resolved = function(cm, callback, options) { + var app = applicableHelpers(cm, helpers); + function run(i) { + if (i == app.length) return callback(null) + fetchHints(app[i], cm, options, function(result) { + if (result && result.list.length > 0) callback(result) + else run(i + 1) + }) + } + run(0) } + resolved.async = true + resolved.supportsSelection = true + return resolved } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { - if (words) return CodeMirror.hint.fromList(cm, {words: words}); + return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) } } else if (CodeMirror.hint.anyword) { - return CodeMirror.hint.anyword(cm, options); + return function(cm, options) { return CodeMirror.hint.anyword(cm, options) } + } else { + return function() {} } + } + + CodeMirror.registerHelper("hint", "auto", { + resolve: resolveAutoHints }); CodeMirror.registerHelper("hint", "fromList", function(cm, options) { @@ -376,7 +427,7 @@ alignWithWord: true, closeCharacters: /[\s()\[\]{};:>,]/, closeOnUnfocus: true, - completeOnSingleClick: false, + completeOnSingleClick: true, container: null, customKeys: null, extraKeys: null diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js 2018-08-23 17:28:17.000000000 +0000 @@ -18,7 +18,9 @@ QUERY_DIV: ";", ALIAS_KEYWORD: "AS" }; - var Pos = CodeMirror.Pos; + var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos; + + function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" } function getKeywords(editor) { var mode = editor.doc.modeOption; @@ -30,10 +32,28 @@ return typeof item == "string" ? item : item.text; } - function getItem(list, item) { - if (!list.slice) return list[item]; - for (var i = list.length - 1; i >= 0; i--) if (getText(list[i]) == item) - return list[i]; + function wrapTable(name, value) { + if (isArray(value)) value = {columns: value} + if (!value.text) value.text = name + return value + } + + function parseTables(input) { + var result = {} + if (isArray(input)) { + for (var i = input.length - 1; i >= 0; i--) { + var item = input[i] + result[getText(item).toUpperCase()] = wrapTable(getText(item), item) + } + } else if (input) { + for (var name in input) + result[name.toUpperCase()] = wrapTable(name, input[name]) + } + return result + } + + function getTable(name) { + return tables[name.toUpperCase()] } function shallowClone(object) { @@ -50,11 +70,18 @@ } function addMatches(result, search, wordlist, formatter) { - for (var word in wordlist) { - if (!wordlist.hasOwnProperty(word)) continue; - if (wordlist.slice) word = wordlist[word]; - - if (match(search, word)) result.push(formatter(word)); + if (isArray(wordlist)) { + for (var i = 0; i < wordlist.length; i++) + if (match(search, wordlist[i])) result.push(formatter(wordlist[i])) + } else { + for (var word in wordlist) if (wordlist.hasOwnProperty(word)) { + var val = wordlist[word] + if (!val || val === true) + val = word + else + val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text + if (match(search, val)) result.push(formatter(val)) + } } } @@ -78,7 +105,7 @@ } function nameCompletion(cur, token, result, editor) { - // Try to complete table, colunm names and return start position of completion + // Try to complete table, column names and return start position of completion var useBacktick = false; var nameParts = []; var start = token.start; @@ -115,13 +142,13 @@ var alias = false; var aliasTable = table; // Check if table is available. If not, find table by Alias - if (!getItem(tables, table)) { + if (!getTable(table)) { var oldTable = table; table = findTableByAlias(table, editor); if (table !== oldTable) alias = true; } - var columns = getItem(tables, table); + var columns = getTable(table); if (columns && columns.columns) columns = columns.columns; @@ -151,15 +178,6 @@ } } - function convertCurToNumber(cur) { - // max characters of a line is 999,999. - return cur.line + cur.ch / Math.pow(10, 6); - } - - function convertNumberToCur(num) { - return Pos(Math.floor(num), +num.toString().split('.').pop()); - } - function findTableByAlias(alias, editor) { var doc = editor.doc; var fullQuery = doc.getValue(); @@ -182,15 +200,14 @@ separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length)); //find valid range - var prevItem = 0; - var current = convertCurToNumber(editor.getCursor()); - for (var i=0; i< separator.length; i++) { - var _v = convertCurToNumber(separator[i]); - if (current > prevItem && current <= _v) { - validRange = { start: convertNumberToCur(prevItem), end: convertNumberToCur(_v) }; + var prevItem = null; + var current = editor.getCursor() + for (var i = 0; i < separator.length; i++) { + if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) { + validRange = {start: prevItem, end: separator[i]}; break; } - prevItem = _v; + prevItem = separator[i]; } var query = doc.getRange(validRange.start, validRange.end, false); @@ -199,7 +216,7 @@ var lineText = query[i]; eachWord(lineText, function(word) { var wordUpperCase = word.toUpperCase(); - if (wordUpperCase === aliasUpperCase && getItem(tables, previousWord)) + if (wordUpperCase === aliasUpperCase && getTable(previousWord)) table = previousWord; if (wordUpperCase !== CONS.ALIAS_KEYWORD) previousWord = word; @@ -210,11 +227,11 @@ } CodeMirror.registerHelper("hint", "sql", function(editor, options) { - tables = (options && options.tables) || {}; + tables = parseTables(options && options.tables) var defaultTableName = options && options.defaultTable; var disableKeywords = options && options.disableKeywords; - defaultTable = defaultTableName && getItem(tables, defaultTableName); - keywords = keywords || getKeywords(editor); + defaultTable = defaultTableName && getTable(defaultTableName); + keywords = getKeywords(editor); if (defaultTableName && !defaultTable) defaultTable = findTableByAlias(defaultTableName, editor); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/lint/lint.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/lint/lint.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/lint/lint.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/lint/lint.js 2018-08-23 17:28:17.000000000 +0000 @@ -61,6 +61,7 @@ this.timeout = null; this.hasGutter = hasGutter; this.onMouseOver = function(e) { onMouseOver(cm, e); }; + this.waitingFor = 0 } function parseOptions(_cm, options) { @@ -115,15 +116,32 @@ return tip; } + function lintAsync(cm, getAnnotations, passOptions) { + var state = cm.state.lint + var id = ++state.waitingFor + function abort() { + id = -1 + cm.off("change", abort) + } + cm.on("change", abort) + getAnnotations(cm.getValue(), function(annotations, arg2) { + cm.off("change", abort) + if (state.waitingFor != id) return + if (arg2 && annotations instanceof CodeMirror) annotations = arg2 + updateLinting(cm, annotations) + }, passOptions, cm); + } + function startLinting(cm) { var state = cm.state.lint, options = state.options; var passOptions = options.options || options; // Support deprecated passing of `options` property in options var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); if (!getAnnotations) return; - if (options.async || getAnnotations.async) - getAnnotations(cm.getValue(), updateLinting, passOptions, cm); - else + if (options.async || getAnnotations.async) { + lintAsync(cm, getAnnotations, passOptions) + } else { updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm)); + } } function updateLinting(cm, annotationsNotSorted) { @@ -168,9 +186,14 @@ state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500); } - function popupSpanTooltip(ann, e) { + function popupTooltips(annotations, e) { var target = e.target || e.srcElement; - showTooltipFor(e, annotationTooltip(ann), target); + var tooltip = document.createDocumentFragment(); + for (var i = 0; i < annotations.length; i++) { + var ann = annotations[i]; + tooltip.appendChild(annotationTooltip(ann)); + } + showTooltipFor(e, tooltip, target); } function onMouseOver(cm, e) { @@ -178,10 +201,13 @@ if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2; var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client")); + + var annotations = []; for (var i = 0; i < spans.length; ++i) { var ann = spans[i].__annotation; - if (ann) return popupSpanTooltip(ann, e); + if (ann) annotations.push(ann); } + if (annotations.length) popupTooltips(annotations, e); } CodeMirror.defineOption("lint", false, function(cm, val, old) { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/merge/merge.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/merge/merge.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/merge/merge.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/merge/merge.js 2018-08-23 17:28:17.000000000 +0000 @@ -5,7 +5,7 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("diff_match_patch")); + mod(require("../../lib/codemirror")); // Note non-packaged dependency diff_match_patch else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "diff_match_patch"], mod); else // Plain browser env @@ -427,8 +427,9 @@ function copyChunk(dv, to, from, chunk) { if (dv.diffOutOfDate) return; - to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)), - Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0)); + var editStart = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0) + var origStart = chunk.origTo > from.lastLine() ? Pos(chunk.origFrom - 1) : Pos(chunk.origFrom, 0) + to.replaceRange(from.getRange(origStart, Pos(chunk.origTo, 0)), editStart, Pos(chunk.editTo, 0)) } // Merge view, containing 0, 1, or 2 diff views. @@ -471,13 +472,10 @@ if (left) left.init(leftPane, origLeft, options); if (right) right.init(rightPane, origRight, options); - if (options.collapseIdentical) { - updating = true; + if (options.collapseIdentical) this.editor().operation(function() { collapseIdenticalStretches(self, options.collapseIdentical); }); - updating = false; - } if (options.connect == "align") { this.aligners = []; alignChunks(this.left || this.right, true); @@ -640,7 +638,7 @@ mark.clear(); cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line"); } - widget.addEventListener("click", clear); + CodeMirror.on(widget, "click", clear); return {mark: mark, clear: clear}; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js 2018-08-23 17:28:17.000000000 +0000 @@ -51,7 +51,7 @@ if (!other.parseDelimiters) stream.match(other.open); state.innerActive = other; state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; + return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open"); } else if (found != -1 && found < cutOff) { cutOff = found; } @@ -70,7 +70,7 @@ if (found == stream.pos && !curInner.parseDelimiters) { stream.match(curInner.close); state.innerActive = state.inner = null; - return curInner.delimStyle; + return curInner.delimStyle && (curInner.delimStyle + " " + curInner.delimStyle + "-close"); } if (found > -1) stream.string = oldContent.slice(0, found); var innerToken = curInner.mode.token(stream, state.inner); @@ -80,7 +80,7 @@ state.innerActive = state.inner = null; if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; + if (innerToken) innerToken = innerToken + " " + curInner.innerStyle; else innerToken = curInner.innerStyle; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/mode/simple.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/mode/simple.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/mode/simple.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/mode/simple.js 2018-08-23 17:28:17.000000000 +0000 @@ -60,7 +60,7 @@ function ensureState(states, name) { if (!states.hasOwnProperty(name)) - throw new Error("Undefined state " + name + "in simple mode"); + throw new Error("Undefined state " + name + " in simple mode"); } function toRegex(val, caret) { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js 2018-08-23 17:28:17.000000000 +0000 @@ -16,7 +16,7 @@ var ie = /MSIE \d/.test(navigator.userAgent); var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9); - if (callback.nodeType == 1) { + if (callback.appendChild) { var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; var node = callback, col = 0; node.innerHTML = ""; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js 2018-08-23 17:28:17.000000000 +0000 @@ -176,3 +176,4 @@ }; require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]; +require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")]; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js 2018-08-23 17:28:17.000000000 +0000 @@ -51,7 +51,7 @@ Annotation.prototype.computeScale = function() { var cm = this.cm; var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) / - cm.heightAtLine(cm.lastLine() + 1, "local"); + cm.getScrollerElement().scrollHeight if (hScale != this.hScale) { this.hScale = hScale; return true; @@ -100,6 +100,9 @@ elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + (top + this.buttonHeight) + "px; height: " + height + "px"; elt.className = this.options.className; + if (ann.id) { + elt.setAttribute("annotation-id", ann.id); + } } this.div.textContent = ""; this.div.appendChild(frag); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js 2018-08-23 17:28:17.000000000 +0000 @@ -40,7 +40,9 @@ if (cm.state.scrollPastEndPadding != padding) { cm.state.scrollPastEndPadding = padding; cm.display.lineSpace.parentNode.style.paddingBottom = padding; + cm.off("refresh", updateBottomMargin); cm.setSize(); + cm.on("refresh", updateBottomMargin); } } }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js 2018-08-23 17:28:17.000000000 +0000 @@ -59,22 +59,29 @@ CodeMirror.on(this.node, "DOMMouseScroll", onWheel); } - Bar.prototype.moveTo = function(pos, update) { + Bar.prototype.setPos = function(pos, force) { if (pos < 0) pos = 0; if (pos > this.total - this.screen) pos = this.total - this.screen; - if (pos == this.pos) return; + if (!force && pos == this.pos) return false; this.pos = pos; this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = (pos * (this.size / this.total)) + "px"; - if (update !== false) this.scroll(pos, this.orientation); + return true }; + Bar.prototype.moveTo = function(pos) { + if (this.setPos(pos)) this.scroll(pos, this.orientation); + } + var minButtonSize = 10; Bar.prototype.update = function(scrollSize, clientSize, barSize) { - this.screen = clientSize; - this.total = scrollSize; - this.size = barSize; + var sizeChanged = this.screen != clientSize || this.total != scrollSize || this.size != barSize + if (sizeChanged) { + this.screen = clientSize; + this.total = scrollSize; + this.size = barSize; + } var buttonSize = this.screen * (this.size / this.total); if (buttonSize < minButtonSize) { @@ -83,8 +90,7 @@ } this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = buttonSize + "px"; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - this.pos * (this.size / this.total) + "px"; + this.setPos(this.pos, sizeChanged); }; function SimpleScrollbars(cls, place, scroll) { @@ -111,7 +117,6 @@ if (needsV) { this.vert.update(measure.scrollHeight, measure.clientHeight, measure.viewHeight - (needsH ? width : 0)); - this.vert.node.style.display = "block"; this.vert.node.style.bottom = needsH ? width + "px" : "0"; } if (needsH) { @@ -125,11 +130,11 @@ }; SimpleScrollbars.prototype.setScrollTop = function(pos) { - this.vert.moveTo(pos, false); + this.vert.setPos(pos); }; SimpleScrollbars.prototype.setScrollLeft = function(pos) { - this.horiz.moveTo(pos, false); + this.horiz.setPos(pos); }; SimpleScrollbars.prototype.clear = function() { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/search/jump-to-line.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/search/jump-to-line.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/search/jump-to-line.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/search/jump-to-line.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,49 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Defines jumpToLine command. Uses dialog.js if present. + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../dialog/dialog")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../dialog/dialog"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function dialog(cm, text, shortText, deflt, f) { + if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true}); + else f(prompt(shortText, deflt)); + } + + var jumpDialog = + 'Jump to line: (Use line:column or scroll% syntax)'; + + function interpretLine(cm, string) { + var num = Number(string) + if (/^[-+]/.test(string)) return cm.getCursor().line + num + else return num - 1 + } + + CodeMirror.commands.jumpToLine = function(cm) { + var cur = cm.getCursor(); + dialog(cm, jumpDialog, "Jump to line:", (cur.line + 1) + ":" + cur.ch, function(posStr) { + if (!posStr) return; + + var match; + if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) { + cm.setCursor(interpretLine(cm, match[1]), Number(match[2])) + } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) { + var line = Math.round(cm.lineCount() * Number(match[1]) / 100); + if (/^[-+]/.test(match[1])) line = cur.line + line + 1; + cm.setCursor(line - 1, cur.ch); + } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) { + cm.setCursor(interpretLine(cm, match[1]), cur.ch); + } + }); + }; + + CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine"; +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js 2018-08-23 17:28:17.000000000 +0000 @@ -16,42 +16,40 @@ // highlighted only if the selected text is a word. showToken, when enabled, // will cause the current token to be highlighted when nothing is selected. // delay is used to specify how much time to wait, in milliseconds, before -// highlighting the matches. +// highlighting the matches. If annotateScrollbar is enabled, the occurences +// will be highlighted on the scrollbar via the matchesonscrollbar addon. (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); + mod(require("../../lib/codemirror"), require("./matchesonscrollbar")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); + define(["../../lib/codemirror", "./matchesonscrollbar"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; - var DEFAULT_MIN_CHARS = 2; - var DEFAULT_TOKEN_STYLE = "matchhighlight"; - var DEFAULT_DELAY = 100; - var DEFAULT_WORDS_ONLY = false; + var defaults = { + style: "matchhighlight", + minChars: 2, + delay: 100, + wordsOnly: false, + annotateScrollbar: false, + showToken: false, + trim: true + } function State(options) { - if (typeof options == "object") { - this.minChars = options.minChars; - this.style = options.style; - this.showToken = options.showToken; - this.delay = options.delay; - this.wordsOnly = options.wordsOnly; - } - if (this.style == null) this.style = DEFAULT_TOKEN_STYLE; - if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS; - if (this.delay == null) this.delay = DEFAULT_DELAY; - if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY; + this.options = {} + for (var name in defaults) + this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name] this.overlay = this.timeout = null; + this.matchesonscroll = null; } CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { if (old && old != CodeMirror.Init) { - var over = cm.state.matchHighlighter.overlay; - if (over) cm.removeOverlay(over); + removeOverlay(cm); clearTimeout(cm.state.matchHighlighter.timeout); cm.state.matchHighlighter = null; cm.off("cursorActivity", cursorActivity); @@ -66,31 +64,51 @@ function cursorActivity(cm) { var state = cm.state.matchHighlighter; clearTimeout(state.timeout); - state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay); + state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay); + } + + function addOverlay(cm, query, hasBoundary, style) { + var state = cm.state.matchHighlighter; + cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style)); + if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) { + var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query; + state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, true, + {className: "CodeMirror-selection-highlight-scrollbar"}); + } + } + + function removeOverlay(cm) { + var state = cm.state.matchHighlighter; + if (state.overlay) { + cm.removeOverlay(state.overlay); + state.overlay = null; + if (state.matchesonscroll) { + state.matchesonscroll.clear(); + state.matchesonscroll = null; + } + } } function highlightMatches(cm) { cm.operation(function() { var state = cm.state.matchHighlighter; - if (state.overlay) { - cm.removeOverlay(state.overlay); - state.overlay = null; - } - if (!cm.somethingSelected() && state.showToken) { - var re = state.showToken === true ? /[\w$]/ : state.showToken; + removeOverlay(cm); + if (!cm.somethingSelected() && state.options.showToken) { + var re = state.options.showToken === true ? /[\w$]/ : state.options.showToken; var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start; while (start && re.test(line.charAt(start - 1))) --start; while (end < line.length && re.test(line.charAt(end))) ++end; if (start < end) - cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style)); + addOverlay(cm, line.slice(start, end), re, state.options.style); return; } var from = cm.getCursor("from"), to = cm.getCursor("to"); if (from.line != to.line) return; - if (state.wordsOnly && !isWord(cm, from, to)) return; - var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, ""); - if (selection.length >= state.minChars) - cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style)); + if (state.options.wordsOnly && !isWord(cm, from, to)) return; + var selection = cm.getRange(from, to) + if (state.options.trim) selection = selection.replace(/^\s+|\s+$/g, "") + if (selection.length >= state.options.minChars) + addOverlay(cm, selection, false, state.options.style); }); } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/search/search.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/search/search.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/search/search.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/search/search.js 2018-08-23 17:28:17.000000000 +0000 @@ -29,7 +29,7 @@ query.lastIndex = stream.pos; var match = query.exec(stream.string); if (match && match.index == stream.pos) { - stream.pos += match[0].length; + stream.pos += match[0].length || 1; return "searching"; } else if (match) { stream.pos = match.index; @@ -57,12 +57,13 @@ return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); } - function persistentDialog(cm, text, deflt, f) { - cm.openDialog(text, f, { + function persistentDialog(cm, text, deflt, onEnter, onKeyDown) { + cm.openDialog(text, onEnter, { value: deflt, selectValueOnOpen: true, closeOnEnter: false, - onClose: function() { clearSearch(cm); } + onClose: function() { clearSearch(cm); }, + onKeyDown: onKeyDown }); } @@ -112,17 +113,43 @@ } } - function doSearch(cm, rev, persistent) { + function doSearch(cm, rev, persistent, immediate) { var state = getSearchState(cm); if (state.query) return findNext(cm, rev); var q = cm.getSelection() || state.lastQuery; if (persistent && cm.openDialog) { - persistentDialog(cm, queryDialog, q, function(query, event) { + var hiding = null + var searchNext = function(query, event) { CodeMirror.e_stop(event); if (!query) return; - if (query != state.queryText) startSearch(cm, state, query); - findNext(cm, event.shiftKey); + if (query != state.queryText) { + startSearch(cm, state, query); + state.posFrom = state.posTo = cm.getCursor(); + } + if (hiding) hiding.style.opacity = 1 + findNext(cm, event.shiftKey, function(_, to) { + var dialog + if (to.line < 3 && document.querySelector && + (dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) && + dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top) + (hiding = dialog).style.opacity = .4 + }) + }; + persistentDialog(cm, queryDialog, q, searchNext, function(event, query) { + var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][CodeMirror.keyName(event)]; + if (cmd == "findNext" || cmd == "findPrev") { + CodeMirror.e_stop(event); + startSearch(cm, getSearchState(cm), query); + cm.execCommand(cmd); + } else if (cmd == "find" || cmd == "findPersistent") { + CodeMirror.e_stop(event); + searchNext(query, event); + } }); + if (immediate) { + startSearch(cm, state, q); + findNext(cm, rev); + } } else { dialog(cm, queryDialog, "Search for:", q, function(query) { if (query && !state.query) cm.operation(function() { @@ -134,7 +161,7 @@ } } - function findNext(cm, rev) {cm.operation(function() { + function findNext(cm, rev, callback) {cm.operation(function() { var state = getSearchState(cm); var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); if (!cursor.find(rev)) { @@ -144,6 +171,7 @@ cm.setSelection(cursor.from(), cursor.to()); cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20); state.posFrom = cursor.from(); state.posTo = cursor.to(); + if (callback) callback(cursor.from(), cursor.to()) });} function clearSearch(cm) {cm.operation(function() { @@ -156,30 +184,35 @@ });} var replaceQueryDialog = - 'Replace: (Use /re/ syntax for regexp search)'; + ' (Use /re/ syntax for regexp search)'; var replacementQueryDialog = 'With: '; - var doReplaceConfirm = "Replace? "; + var doReplaceConfirm = "Replace? "; + + function replaceAll(cm, query, text) { + cm.operation(function() { + for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { + if (typeof query != "string") { + var match = cm.getRange(cursor.from(), cursor.to()).match(query); + cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];})); + } else cursor.replace(text); + } + }); + } function replace(cm, all) { if (cm.getOption("readOnly")) return; var query = cm.getSelection() || getSearchState(cm).lastQuery; - dialog(cm, replaceQueryDialog, "Replace:", query, function(query) { + var dialogText = all ? "Replace all:" : "Replace:" + dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) { if (!query) return; query = parseQuery(query); dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) { text = parseString(text) if (all) { - cm.operation(function() { - for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { - if (typeof query != "string") { - var match = cm.getRange(cursor.from(), cursor.to()).match(query); - cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];})); - } else cursor.replace(text); - } - }); + replaceAll(cm, query, text) } else { clearSearch(cm); - var cursor = getSearchCursor(cm, query, cm.getCursor()); + var cursor = getSearchCursor(cm, query, cm.getCursor("from")); var advance = function() { var start = cursor.from(), match; if (!(match = cursor.findNext())) { @@ -190,7 +223,8 @@ cm.setSelection(cursor.from(), cursor.to()); cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); confirmDialog(cm, doReplaceConfirm, "Replace?", - [function() {doReplace(match);}, advance]); + [function() {doReplace(match);}, advance, + function() {replaceAll(cm, query, text)}]); }; var doReplace = function(match) { cursor.replace(typeof query == "string" ? text : @@ -205,6 +239,8 @@ CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);}; + CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);}; + CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);}; CodeMirror.commands.findNext = doSearch; CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; CodeMirror.commands.clearSearch = clearSearch; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/selection/active-line.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/selection/active-line.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/selection/active-line.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/selection/active-line.js 2018-08-23 17:28:17.000000000 +0000 @@ -18,6 +18,7 @@ "use strict"; var WRAP_CLASS = "CodeMirror-activeline"; var BACK_CLASS = "CodeMirror-activeline-background"; + var GUTT_CLASS = "CodeMirror-activeline-gutter"; CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { var prev = old && old != CodeMirror.Init; @@ -36,6 +37,7 @@ for (var i = 0; i < cm.state.activeLines.length; i++) { cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); + cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS); } } @@ -60,6 +62,7 @@ for (var i = 0; i < active.length; i++) { cm.addLineClass(active[i], "wrap", WRAP_CLASS); cm.addLineClass(active[i], "background", BACK_CLASS); + cm.addLineClass(active[i], "gutter", GUTT_CLASS); } cm.state.activeLines = active; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/tern/tern.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/tern/tern.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/tern/tern.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/tern/tern.js 2018-08-23 17:28:17.000000000 +0000 @@ -135,6 +135,7 @@ }, destroy: function () { + closeArgHints(this) if (this.worker) { this.worker.terminate(); this.worker = null; @@ -178,7 +179,7 @@ var data = findDoc(ts, doc); var argHints = ts.cachedArgHints; - if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) <= 0) + if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) >= 0) ts.cachedArgHints = null; var changed = data.changed; @@ -305,7 +306,7 @@ ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) { if (error || !data.type || !(/^fn\(/).test(data.type)) return; ts.cachedArgHints = { - start: pos, + start: start, type: parseFnType(data.type), name: data.exprName || data.name || "fn", guess: data.guess, diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js 2018-08-23 17:28:17.000000000 +0000 @@ -30,13 +30,17 @@ } function findBreakPoint(text, column, wrapOn, killTrailingSpace) { - for (var at = column; at > 0; --at) + var at = column + while (at < text.length && text.charAt(at) == " ") at++ + for (; at > 0; --at) if (wrapOn.test(text.slice(at - 1, at + 1))) break; - if (at == 0) at = column; - var endOfText = at; - if (killTrailingSpace) - while (text.charAt(endOfText - 1) == " ") --endOfText; - return {from: endOfText, to: at}; + for (var first = true;; first = false) { + var endOfText = at; + if (killTrailingSpace) + while (text.charAt(endOfText - 1) == " ") --endOfText; + if (endOfText == 0 && first) at = column; + else return {from: endOfText, to: at}; + } } function wrapRange(cm, from, to, options) { @@ -86,7 +90,8 @@ if (changes.length) cm.operation(function() { for (var i = 0; i < changes.length; ++i) { var change = changes[i]; - cm.replaceRange(change.text, change.from, change.to); + if (change.text || CodeMirror.cmpPos(change.from, change.to)) + cm.replaceRange(change.text, change.from, change.to); } }); return changes.length ? {from: changes[0].from, to: CodeMirror.changeEnd(changes[changes.length - 1])} : null; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/keymaps/sublime.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/keymaps/sublime.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/keymaps/sublime.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/keymaps/sublime.js 2018-08-23 17:28:17.000000000 +0000 @@ -55,6 +55,8 @@ cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); }; cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); }; + if (mac) map["Cmd-Left"] = "goLineStartSmart"; + var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-"; cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) { @@ -105,9 +107,10 @@ cm.setSelections(extended); }; - map["Shift-" + ctrl + "K"] = "deleteLine"; + map["Shift-Ctrl-K"] = "deleteLine"; function insertLine(cm, above) { + if (cm.isReadOnly()) return CodeMirror.Pass cm.operation(function() { var len = cm.listSelections().length, newSelection = [], last = -1; for (var i = 0; i < len; i++) { @@ -121,11 +124,12 @@ } cm.setSelections(newSelection); }); + cm.execCommand("indentAuto"); } - cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { insertLine(cm, false); }; + cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); }; - cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { insertLine(cm, true); }; + cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { return insertLine(cm, true); }; function wordAt(cm, pos) { var start = pos.ch, end = start, line = cm.getLine(pos.line); @@ -192,6 +196,7 @@ var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-"; cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) { + if (cm.isReadOnly()) return CodeMirror.Pass var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = []; for (var i = 0; i < ranges.length; i++) { var range = ranges[i], from = range.from().line - 1, to = range.to().line; @@ -218,6 +223,7 @@ }; cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) { + if (cm.isReadOnly()) return CodeMirror.Pass var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1; for (var i = ranges.length - 1; i >= 0; i--) { var range = ranges[i], from = range.to().line + 1, to = range.from().line; @@ -240,7 +246,9 @@ }); }; - map[ctrl + "/"] = "toggleComment"; + cmds[map[ctrl + "/"] = "toggleCommentIndented"] = function(cm) { + cm.toggleComment({ indent: true }); + } cmds[map[ctrl + "J"] = "joinLines"] = function(cm) { var ranges = cm.listSelections(), joined = []; @@ -287,6 +295,7 @@ map[ctrl + "T"] = "transposeChars"; function sortLines(cm, caseSensitive) { + if (cm.isReadOnly()) return CodeMirror.Pass var ranges = cm.listSelections(), toSort = [], selected; for (var i = 0; i < ranges.length; i++) { var range = ranges[i]; @@ -414,14 +423,29 @@ cmds[map["Backspace"] = "smartBackspace"] = function(cm) { if (cm.somethingSelected()) return CodeMirror.Pass; - var cursor = cm.getCursor(); - var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor); - var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); - - if (toStartOfLine && !/\S/.test(toStartOfLine) && column % cm.getOption("indentUnit") == 0) - return cm.indentSelection("subtract"); - else - return CodeMirror.Pass; + cm.operation(function() { + var cursors = cm.listSelections(); + var indentUnit = cm.getOption("indentUnit"); + + for (var i = cursors.length - 1; i >= 0; i--) { + var cursor = cursors[i].head; + var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor); + var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); + + // Delete by one character by default + var deletePos = cm.findPosH(cursor, -1, "char", false); + + if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) { + var prevIndent = new Pos(cursor.line, + CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit)); + + // Smart delete only if we found a valid prevIndent location + if (prevIndent.ch != cursor.ch) deletePos = prevIndent; + } + + cm.replaceRange("", deletePos, cursor, "+delete"); + } + }); }; cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) { @@ -476,7 +500,8 @@ cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); }; - cmds[map["Shift-Alt-Up"] = "selectLinesUpward"] = function(cm) { + var selectLinesCombo = mac ? "Ctrl-Shift-" : "Ctrl-Alt-"; + cmds[map[selectLinesCombo + "Up"] = "selectLinesUpward"] = function(cm) { cm.operation(function() { var ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { @@ -486,7 +511,7 @@ } }); }; - cmds[map["Shift-Alt-Down"] = "selectLinesDownward"] = function(cm) { + cmds[map[selectLinesCombo + "Down"] = "selectLinesDownward"] = function(cm) { cm.operation(function() { var ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/keymaps/vim.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/keymaps/vim.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/keymaps/vim.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/keymaps/vim.js 2018-08-23 17:28:17.000000000 +0000 @@ -26,7 +26,7 @@ * 2. Variable declarations and short basic helpers * 3. Instance (External API) implementation * 4. Internal state tracking objects (input state, counter) implementation - * and instanstiation + * and instantiation * 5. Key handler (the main command dispatcher) implementation * 6. Motion, operator, and action implementations * 7. Helper functions for the key handler, motions, operators, and actions @@ -64,9 +64,9 @@ { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' }, - { keys: 's', type: 'keyToKey', toKeys: 'xi', context: 'visual'}, + { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'}, { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, - { keys: 'S', type: 'keyToKey', toKeys: 'dcc', context: 'visual' }, + { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' }, { keys: '', type: 'keyToKey', toKeys: '0' }, { keys: '', type: 'keyToKey', toKeys: '$' }, { keys: '', type: 'keyToKey', toKeys: '' }, @@ -164,6 +164,7 @@ { keys: 'v', type: 'action', action: 'toggleVisualMode' }, { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, + { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, { keys: 'J', type: 'action', action: 'joinLines', isEdit: true }, { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }}, @@ -225,6 +226,7 @@ { name: 'sort', shortName: 'sor' }, { name: 'substitute', shortName: 's', possiblyAsync: true }, { name: 'nohlsearch', shortName: 'noh' }, + { name: 'yank', shortName: 'y' }, { name: 'delmarks', shortName: 'delm' }, { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, { name: 'global', shortName: 'g' } @@ -292,12 +294,7 @@ // Keypress character binding of format "'a'" return key.charAt(1); } - var pieces = key.split('-'); - if (/-$/.test(key)) { - // If the - key was typed, split will result in 2 extra empty strings - // in the array. Replace them with 1 '-'. - pieces.splice(-2, 2, '-'); - } + var pieces = key.split(/-(?!$)/); var lastPiece = pieces[pieces.length - 1]; if (pieces.length == 1 && pieces[0].length == 1) { // No-modifier bindings use literal character bindings above. Skip. @@ -645,7 +642,7 @@ jumpList: createCircularJumpList(), macroModeState: new MacroModeState, // Recording latest f, t, F or T motion command. - lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, + lastCharacterSearch: {increment:0, forward:true, selectedCharacter:''}, registerController: new RegisterController({}), // search history buffer searchHistoryController: new HistoryController({}), @@ -686,6 +683,9 @@ // Add user defined key bindings. exCommandDispatcher.map(lhs, rhs, ctx); }, + unmap: function(lhs, ctx) { + exCommandDispatcher.unmap(lhs, ctx); + }, // TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace // them, or somehow make them work with the existing CodeMirror setOption/getOption API. setOption: setOption, @@ -1048,7 +1048,7 @@ }; function HistoryController() { this.historyBuffer = []; - this.iterator; + this.iterator = 0; this.initialPrefix = null; } HistoryController.prototype = { @@ -1373,7 +1373,7 @@ } }, evalInput: function(cm, vim) { - // If the motion comand is set, execute both the operator and motion. + // If the motion command is set, execute both the operator and motion. // Otherwise return. var inputState = vim.inputState; var motion = inputState.motion; @@ -1697,11 +1697,12 @@ var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; var first = cm.firstLine(); var last = cm.lastLine(); - // Vim cancels linewise motions that start on an edge and move beyond - // that edge. It does not cancel motions that do not start on an edge. - if ((line < first && cur.line == first) || - (line > last && cur.line == last)) { - return; + // Vim go to line begin or line end when cursor at first/last line and + // move to previous/next line is triggered. + if (line < first && cur.line == first){ + return this.moveToStartOfLine(cm, head, motionArgs, vim); + }else if (line > last && cur.line == last){ + return this.moveToEol(cm, head, motionArgs, vim); } if (motionArgs.toFirstChar){ endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); @@ -1909,7 +1910,7 @@ }, repeatLastCharacterSearch: function(cm, head, motionArgs) { - var lastSearch = vimGlobalState.lastChararacterSearch; + var lastSearch = vimGlobalState.lastCharacterSearch; var repeat = motionArgs.repeat; var forward = motionArgs.forward === lastSearch.forward; var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1); @@ -1959,13 +1960,21 @@ text = text.slice(0, - match[0].length); } } - var wasLastLine = head.line - 1 == cm.lastLine(); - cm.replaceRange('', anchor, head); - if (args.linewise && !wasLastLine) { + var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE); + var wasLastLine = cm.firstLine() == cm.lastLine(); + if (head.line > cm.lastLine() && args.linewise && !wasLastLine) { + cm.replaceRange('', prevLineEnd, head); + } else { + cm.replaceRange('', anchor, head); + } + if (args.linewise) { // Push the next line back down, if there is a next line. - CodeMirror.commands.newlineAndIndent(cm); - // null ch so setCursor moves to end of line. - anchor.ch = null; + if (!wasLastLine) { + cm.setCursor(prevLineEnd); + CodeMirror.commands.newlineAndIndent(cm); + } + // make sure cursor ends up at the end of the line. + anchor.ch = Number.MAX_VALUE; } finalHead = anchor; } else { @@ -2144,9 +2153,7 @@ switch (actionArgs.position) { case 'center': y = y - (height / 2) + lineHeight; break; - case 'bottom': y = y - height + lineHeight*1.4; - break; - case 'top': y = y + lineHeight*0.4; + case 'bottom': y = y - height + lineHeight; break; } cm.scrollTo(null, y); @@ -2996,7 +3003,7 @@ // Only clip if the selection ends with trailing newline + whitespace if (/\n\s*$/.test(selection)) { var lines = selection.split('\n'); - // We know this is all whitepsace. + // We know this is all whitespace. lines.pop(); // Cases: @@ -3082,9 +3089,9 @@ } function recordLastCharacterSearch(increment, args) { - vimGlobalState.lastChararacterSearch.increment = increment; - vimGlobalState.lastChararacterSearch.forward = args.forward; - vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter; + vimGlobalState.lastCharacterSearch.increment = increment; + vimGlobalState.lastCharacterSearch.forward = args.forward; + vimGlobalState.lastCharacterSearch.selectedCharacter = args.selectedCharacter; } var symbolToMode = { @@ -3208,7 +3215,7 @@ return cur; } - /* + /** * Returns the boundaries of the next word. If the cursor in the middle of * the word, then returns the boundaries of the current word, starting at * the cursor. If the cursor is at the start/end of a word, and we are going @@ -3283,8 +3290,6 @@ line = cm.getLine(lineNum); pos = (dir > 0) ? 0 : line.length; } - // Should never get here. - throw new Error('The impossible happened.'); } /** @@ -3446,7 +3451,7 @@ } // TODO: perhaps this finagling of start and end positions belonds - // in codmirror/replaceRange? + // in codemirror/replaceRange? function selectCompanionObject(cm, head, symb, inclusive) { var cur = head, start, end; @@ -3777,17 +3782,10 @@ } } function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '' + prefix + ''; - } - raw += ' ' + - ''; - if (desc) { - raw += ''; - raw += desc; - raw += ''; - } + var raw = '' + + (prefix || "") + ''; + if (desc) + raw += ' ' + desc + ''; return raw; } var searchPromptDesc = '(Javascript regexp)'; @@ -4508,14 +4506,21 @@ if (CodeMirror.commands.save) { // If a save command is defined, call it. CodeMirror.commands.save(cm); - } else { - // Saves to text area if no save command is defined. + } else if (cm.save) { + // Saves to text area if no save command is defined and cm.save() is available. cm.save(); } }, nohlsearch: function(cm) { clearSearchHighlight(cm); }, + yank: function (cm) { + var cur = copyCursor(cm.getCursor()); + var line = cur.line; + var lineText = cm.getLine(line); + vimGlobalState.registerController.pushText( + '0', 'yank', lineText, true, true); + }, delmarks: function(cm, params) { if (!params.argString || !trim(params.argString)) { showConfirm(cm, 'Argument required'); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/clike.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/clike.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/clike.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/clike.js 2018-08-23 17:28:17.000000000 +0000 @@ -11,6 +11,41 @@ })(function(CodeMirror) { "use strict"; +function Context(indented, column, type, info, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.info = info; + this.align = align; + this.prev = prev; +} +function pushContext(state, col, type, info) { + var indent = state.indented; + if (state.context && state.context.type != "statement" && type != "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, info, null, state.context); +} +function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; +} + +function typeBefore(stream, state, pos) { + if (state.prevToken == "variable" || state.prevToken == "variable-3") return true; + if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true; + if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true; +} + +function isTopScope(context) { + for (;;) { + if (!context || context.type == "top") return true; + if (context.type == "}" && context.prev.info != "namespace") return false; + context = context.prev; + } +} + CodeMirror.defineMode("clike", function(config, parserConfig) { var indentUnit = config.indentUnit, statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, @@ -25,8 +60,12 @@ multiLineStrings = parserConfig.multiLineStrings, indentStatements = parserConfig.indentStatements !== false, indentSwitch = parserConfig.indentSwitch !== false, - namespaceSeparator = parserConfig.namespaceSeparator; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; + namespaceSeparator = parserConfig.namespaceSeparator, + isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/, + numberStart = parserConfig.numberStart || /[\d\.]/, + number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i, + isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/, + endStatement = parserConfig.endStatement || /^[;:,]$/; var curPunc, isDefKeyword; @@ -40,13 +79,14 @@ state.tokenize = tokenString(ch); return state.tokenize(stream, state); } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + if (isPunctuationChar.test(ch)) { curPunc = ch; return null; } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; + if (numberStart.test(ch)) { + stream.backUp(1) + if (stream.match(number)) return "number" + stream.next() } if (ch == "/") { if (stream.eat("*")) { @@ -59,7 +99,7 @@ } } if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); + while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {} return "operator"; } stream.eatWhile(/[\w\$_\xa1-\uffff]/); @@ -67,17 +107,17 @@ stream.eatWhile(/[\w\$_\xa1-\uffff]/); var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true; + if (contains(keywords, cur)) { + if (contains(blockKeywords, cur)) curPunc = "newstatement"; + if (contains(defKeywords, cur)) isDefKeyword = true; return "keyword"; } - if (types.propertyIsEnumerable(cur)) return "variable-3"; - if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + if (contains(types, cur)) return "variable-3"; + if (contains(builtin, cur)) { + if (contains(blockKeywords, cur)) curPunc = "newstatement"; return "builtin"; } - if (atoms.propertyIsEnumerable(cur)) return "atom"; + if (contains(atoms, cur)) return "atom"; return "variable"; } @@ -106,40 +146,9 @@ return "comment"; } - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function isStatement(type) { - return type == "statement" || type == "switchstatement" || type == "namespace"; - } - function pushContext(state, col, type) { - var indent = state.indented; - if (state.context && isStatement(state.context.type) && !isStatement(type)) - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - function typeBefore(stream, state) { - if (state.prevToken == "variable" || state.prevToken == "variable-3") return true; - if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true; - } - - function isTopScope(context) { - for (;;) { - if (!context || context.type == "top") return true; - if (context.type == "}" && context.prev.type != "namespace") return false; - context = context.prev; - } + function maybeEOL(stream, state) { + if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) + state.typeAtEndOfLine = typeBefore(stream, state, stream.pos) } // Interface @@ -148,7 +157,7 @@ startState: function(basecolumn) { return { tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false), indented: 0, startOfLine: true, prevToken: null @@ -162,37 +171,31 @@ state.indented = stream.indentation(); state.startOfLine = true; } - if (stream.eatSpace()) return null; + if (stream.eatSpace()) { maybeEOL(stream, state); return null; } curPunc = isDefKeyword = null; var style = (state.tokenize || tokenBase)(stream, state); if (style == "comment" || style == "meta") return style; if (ctx.align == null) ctx.align = true; - if ((curPunc == ";" || curPunc == ":" || curPunc == ",")) - while (isStatement(state.context.type)) popContext(state); + if (endStatement.test(curPunc)) while (state.context.type == "statement") popContext(state); else if (curPunc == "{") pushContext(state, stream.column(), "}"); else if (curPunc == "[") pushContext(state, stream.column(), "]"); else if (curPunc == "(") pushContext(state, stream.column(), ")"); else if (curPunc == "}") { - while (isStatement(ctx.type)) ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); if (ctx.type == "}") ctx = popContext(state); - while (isStatement(ctx.type)) ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); } else if (curPunc == ctx.type) popContext(state); else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") || - (isStatement(ctx.type) && curPunc == "newstatement"))) { - var type = "statement"; - if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch") - type = "switchstatement"; - else if (style == "keyword" && stream.current() == "namespace") - type = "namespace"; - pushContext(state, stream.column(), type); + (ctx.type == "statement" && curPunc == "newstatement"))) { + pushContext(state, stream.column(), "statement", stream.current()); } if (style == "variable" && ((state.prevToken == "def" || - (parserConfig.typeFirstDefinitions && typeBefore(stream, state) && + (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))))) style = "def"; @@ -205,16 +208,28 @@ state.startOfLine = false; state.prevToken = isDefKeyword ? "def" : style || curPunc; + maybeEOL(stream, state); return style; }, indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass; var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev; + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + if (parserConfig.dontIndentStatements) + while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) + ctx = ctx.prev + if (hooks.indent) { + var hook = hooks.indent(state, ctx, textAfter); + if (typeof hook == "number") return hook + } var closing = firstChar == ctx.type; - var switchBlock = ctx.prev && ctx.prev.type == "switchstatement"; - if (isStatement(ctx.type)) + var switchBlock = ctx.prev && ctx.prev.info == "switch"; + if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) { + while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev + return ctx.indented + } + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1); @@ -238,27 +253,30 @@ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } + function contains(words, word) { + if (typeof words === "function") { + return words(word); + } else { + return words.propertyIsEnumerable(word); + } + } var cKeywords = "auto if break case register continue return default do sizeof " + - "static else struct switch extern typedef float union for " + - "goto while enum const volatile"; + "static else struct switch extern typedef union for goto while enum const volatile"; var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t"; function cppHook(stream, state) { - if (!state.startOfLine) return false; - for (;;) { - if (stream.skipTo("\\")) { - stream.next(); - if (stream.eol()) { - state.tokenize = cppHook; - break; - } - } else { - stream.skipToEnd(); - state.tokenize = null; - break; + if (!state.startOfLine) return false + for (var ch, next = null; ch = stream.peek();) { + if (ch == "\\" && stream.match(/^.$/)) { + next = cppHook + break + } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) { + break } + stream.next() } - return "meta"; + state.tokenize = next + return "meta" } function pointerHook(_stream, state) { @@ -266,6 +284,11 @@ return false; } + function cpp14Literal(stream) { + stream.eatWhile(/[\w\.']/); + return "number"; + } + function cpp11StringHook(stream, state) { stream.backUp(1); // Raw strings. @@ -366,6 +389,7 @@ defKeywords: words("class namespace struct enum union"), typeFirstDefinitions: true, atoms: words("true false null"), + dontIndentStatements: /^template$/, hooks: { "#": cppHook, "*": pointerHook, @@ -373,6 +397,16 @@ "U": cpp11StringHook, "L": cpp11StringHook, "R": cpp11StringHook, + "0": cpp14Literal, + "1": cpp14Literal, + "2": cpp14Literal, + "3": cpp14Literal, + "4": cpp14Literal, + "5": cpp14Literal, + "6": cpp14Literal, + "7": cpp14Literal, + "8": cpp14Literal, + "9": cpp14Literal, token: function(stream, state, style) { if (style == "variable" && stream.peek() == "(" && (state.prevToken == ";" || state.prevToken == null || @@ -398,6 +432,8 @@ defKeywords: words("class interface package enum"), typeFirstDefinitions: true, atoms: words("true false null"), + endStatement: /^[;:]$/, + number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i, hooks: { "@": function(stream) { stream.eatWhile(/[\w\$_]/); @@ -453,7 +489,7 @@ keywords: words( /* scala */ - "abstract case catch class def do else extends false final finally for forSome if " + + "abstract case catch class def do else extends final finally for forSome if " + "implicit import lazy match new null object override package private protected return " + "sealed super this throw trait try type val var while with yield _ : = => <- <: " + "<% >: # @ " + @@ -466,7 +502,7 @@ ), types: words( "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + - "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " + + "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " + "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " + @@ -496,6 +532,68 @@ "'": function(stream) { stream.eatWhile(/[\w\$_\xa1-\uffff]/); return "atom"; + }, + "=": function(stream, state) { + var cx = state.context + if (cx.type == "}" && cx.align && stream.eat(">")) { + state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev) + return "operator" + } else { + return false + } + } + }, + modeProps: {closeBrackets: {triples: '"'}} + }); + + function tokenKotlinString(tripleString){ + return function (stream, state) { + var escaped = false, next, end = false; + while (!stream.eol()) { + if (!tripleString && !escaped && stream.match('"') ) {end = true; break;} + if (tripleString && stream.match('"""')) {end = true; break;} + next = stream.next(); + if(!escaped && next == "$" && stream.match('{')) + stream.skipTo("}"); + escaped = !escaped && next == "\\" && !tripleString; + } + if (end || !tripleString) + state.tokenize = null; + return "string"; + } + } + + def("text/x-kotlin", { + name: "clike", + keywords: words( + /*keywords*/ + "package as typealias class interface this super val " + + "var fun for is in This throw return " + + "break continue object if else while do try when !in !is as? " + + + /*soft keywords*/ + "file import where by get set abstract enum open inner override private public internal " + + "protected catch finally out final vararg reified dynamic companion constructor init " + + "sealed field property receiver param sparam lateinit data inline noinline tailrec " + + "external annotation crossinline const operator infix" + ), + types: words( + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + + "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" + ), + intendSwitch: false, + indentStatements: false, + multiLineStrings: true, + blockKeywords: words("catch class do else finally for if where try while enum"), + defKeywords: words("class val var object package interface fun"), + atoms: words("true false null this"), + hooks: { + '"': function(stream, state) { + state.tokenize = tokenKotlinString(stream.match('""')); + return state.tokenize(stream, state); } }, modeProps: {closeBrackets: {triples: '"'}} @@ -574,7 +672,7 @@ def("text/x-objectivec", { name: "clike", - keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " + + keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " + "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"), types: words(cTypes), atoms: words("YES NO NULL NILL ON OFF true false"), @@ -583,7 +681,10 @@ stream.eatWhile(/[\w\$]/); return "keyword"; }, - "#": cppHook + "#": cppHook, + indent: function(_state, ctx, textAfter) { + if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented + } }, modeProps: {fold: "brace"} }); @@ -601,4 +702,85 @@ modeProps: {fold: ["brace", "include"]} }); + // Ceylon Strings need to deal with interpolation + var stringTokenizer = null; + function tokenCeylonString(type) { + return function(stream, state) { + var escaped = false, next, end = false; + while (!stream.eol()) { + if (!escaped && stream.match('"') && + (type == "single" || stream.match('""'))) { + end = true; + break; + } + if (!escaped && stream.match('``')) { + stringTokenizer = tokenCeylonString(type); + end = true; + break; + } + next = stream.next(); + escaped = type == "single" && !escaped && next == "\\"; + } + if (end) + state.tokenize = null; + return "string"; + } + } + + def("text/x-ceylon", { + name: "clike", + keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" + + " exists extends finally for function given if import in interface is let module new" + + " nonempty object of out outer package return satisfies super switch then this throw" + + " try value void while"), + types: function(word) { + // In Ceylon all identifiers that start with an uppercase are types + var first = word.charAt(0); + return (first === first.toUpperCase() && first !== first.toLowerCase()); + }, + blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"), + defKeywords: words("class dynamic function interface module object package value"), + builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" + + " native optional sealed see serializable shared suppressWarnings tagged throws variable"), + isPunctuationChar: /[\[\]{}\(\),;\:\.`]/, + isOperatorChar: /[+\-*&%=<>!?|^~:\/]/, + numberStart: /[\d#$]/, + number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i, + multiLineStrings: true, + typeFirstDefinitions: true, + atoms: words("true false null larger smaller equal empty finished"), + indentSwitch: false, + styleDefs: false, + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + }, + '"': function(stream, state) { + state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single"); + return state.tokenize(stream, state); + }, + '`': function(stream, state) { + if (!stringTokenizer || !stream.match('`')) return false; + state.tokenize = stringTokenizer; + stringTokenizer = null; + return state.tokenize(stream, state); + }, + "'": function(stream) { + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + return "atom"; + }, + token: function(_stream, state, style) { + if ((style == "variable" || style == "variable-3") && + state.prevToken == ".") { + return "variable-2"; + } + } + }, + modeProps: { + fold: ["brace", "import"], + closeBrackets: {triples: '"'} + } + }); + }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/clojure.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/clojure.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/clojure.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/clojure.js 2018-08-23 17:28:17.000000000 +0000 @@ -31,14 +31,70 @@ var atoms = makeKeywords("true false nil"); var keywords = makeKeywords( - "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); + "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest " + + "slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn " + + "do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync " + + "doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars " + + "binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); var builtins = makeKeywords( - "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"); + "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* " + + "*compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* " + + "*math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* " + + "*source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> " + + "->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor " + + "aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! " + + "alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double " + + "aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 " + + "bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set " + + "bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast " + + "byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append " + + "chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors " + + "clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp " + + "conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? " + + "declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol " + + "defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc " + + "dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last " + + "drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info " + + "extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword " + + "find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? " + + "fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? " + + "gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash " + + "hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? " + + "int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep " + + "keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file " + + "load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array " + + "make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods " + + "min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty " + + "not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias " + + "ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all " + + "partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers " + + "primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str " + + "prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues " + + "quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern " + + "re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history " + + "ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods " + + "remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest " + + "restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? " + + "seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts " + + "shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? " + + "special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol " + + "symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce " + + "transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec " + + "unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int " + + "unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int "+ + "unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote " + + "unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of " + + "vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context " + + "with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap " + + "*default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! " + + "set-agent-send-off-executor! some-> some->>"); var indentKeys = makeKeywords( // Built-ins - "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " + + "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto " + + "locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type " + + "try catch " + // Binding forms "let letfn binding loop for doseq dotimes when-let if-let " + @@ -59,7 +115,8 @@ sign: /[+-]/, exponent: /e/i, keyword_char: /[^\s\(\[\;\)\]]/, - symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/ + symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/, + block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/ }; function stateStack(indent, type, prev) { // represents a state stack object @@ -96,6 +153,9 @@ if ( '.' == stream.peek() ) { stream.eat('.'); stream.eatWhile(tests.digit); + } else if ('/' == stream.peek() ) { + stream.eat('/'); + stream.eatWhile(tests.digit); } if ( stream.eat(tests.exponent) ) { @@ -139,7 +199,7 @@ } // skip spaces - if (stream.eatSpace()) { + if (state.mode != "string" && stream.eatSpace()) { return null; } var returnType = null; @@ -187,7 +247,7 @@ } if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || - /^(?:def|with)/.test(keyWord))) { // indent-word + tests.block_indent.test(keyWord))) { // indent-word pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); } else { // non-indent word // we continue eating the spaces @@ -240,5 +300,7 @@ }); CodeMirror.defineMIME("text/x-clojure", "clojure"); +CodeMirror.defineMIME("text/x-clojurescript", "clojure"); +CodeMirror.defineMIME("application/edn", "clojure"); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/coffeescript.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/coffeescript.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/coffeescript.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/coffeescript.js 2018-08-23 17:28:17.000000000 +0000 @@ -25,7 +25,7 @@ var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/; var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/; var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/; - var properties = /^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/; + var atProp = /^@[_A-Za-z$][_A-Za-z$0-9]*/; var wordOperators = wordRegexp(["and", "or", "not", "is", "isnt", "in", @@ -145,6 +145,8 @@ } } + + // Handle operators and delimiters if (stream.match(operators) || stream.match(wordOperators)) { return "operator"; @@ -157,6 +159,10 @@ return "atom"; } + if (stream.match(atProp) || state.prop && stream.match(identifiers)) { + return "property"; + } + if (stream.match(keywords)) { return "keyword"; } @@ -165,10 +171,6 @@ return "variable"; } - if (stream.match(properties)) { - return "property"; - } - // Handle non-detected items stream.next(); return ERRORCLASS; @@ -265,24 +267,11 @@ var style = state.tokenize(stream, state); var current = stream.current(); - // Handle "." connected identifiers - if (current === ".") { - style = state.tokenize(stream, state); - current = stream.current(); - if (/^\.[\w$]+$/.test(current)) { - return "variable"; - } else { - return ERRORCLASS; - } - } - // Handle scope changes. if (current === "return") { state.dedent = true; } - if (((current === "->" || current === "=>") && - !state.lambda && - !stream.peek()) + if (((current === "->" || current === "=>") && stream.eol()) || style === "indent") { indent(stream, state); } @@ -324,8 +313,7 @@ return { tokenize: tokenBase, scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false}, - lastToken: null, - lambda: false, + prop: false, dedent: 0 }; }, @@ -335,12 +323,9 @@ if (fillAlign && stream.sol()) fillAlign.align = false; var style = tokenLexer(stream, state); - if (fillAlign && style && style != "comment") fillAlign.align = true; - - state.lastToken = {style:style, content: stream.current()}; - - if (stream.eol() && stream.lambda) { - state.lambda = false; + if (style && style != "comment") { + if (fillAlign) fillAlign.align = true; + state.prop = style == "punctuation" && stream.current() == "." } return style; @@ -365,5 +350,6 @@ }); CodeMirror.defineMIME("text/x-coffeescript", "coffeescript"); +CodeMirror.defineMIME("text/coffeescript", "coffeescript"); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/crystal.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/crystal.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/crystal.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/crystal.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,391 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("crystal", function(config) { + function wordRegExp(words, end) { + return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b")); + } + + function chain(tokenize, stream, state) { + state.tokenize.push(tokenize); + return tokenize(stream, state); + } + + var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/; + var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/; + var indexingOperators = /^(?:\[\][?=]?)/; + var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/; + var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/; + var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/; + var keywords = wordRegExp([ + "abstract", "alias", "as", "asm", "begin", "break", "case", "class", "def", "do", + "else", "elsif", "end", "ensure", "enum", "extend", "for", "fun", "if", "ifdef", + "include", "instance_sizeof", "lib", "macro", "module", "next", "of", "out", "pointerof", + "private", "protected", "rescue", "return", "require", "sizeof", "struct", + "super", "then", "type", "typeof", "union", "unless", "until", "when", "while", "with", + "yield", "__DIR__", "__FILE__", "__LINE__" + ]); + var atomWords = wordRegExp(["true", "false", "nil", "self"]); + var indentKeywordsArray = [ + "def", "fun", "macro", + "class", "module", "struct", "lib", "enum", "union", + "if", "unless", "case", "while", "until", "begin", "then", + "do", + "for", "ifdef" + ]; + var indentKeywords = wordRegExp(indentKeywordsArray); + var dedentKeywordsArray = [ + "end", + "else", "elsif", + "rescue", "ensure" + ]; + var dedentKeywords = wordRegExp(dedentKeywordsArray); + var dedentPunctualsArray = ["\\)", "\\}", "\\]"]; + var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$"); + var nextTokenizer = { + "def": tokenFollowIdent, "fun": tokenFollowIdent, "macro": tokenMacroDef, + "class": tokenFollowType, "module": tokenFollowType, "struct": tokenFollowType, + "lib": tokenFollowType, "enum": tokenFollowType, "union": tokenFollowType + }; + var matching = {"[": "]", "{": "}", "(": ")", "<": ">"}; + + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + // Macros + if (state.lastToken != "\\" && stream.match("{%", false)) { + return chain(tokenMacro("%", "%"), stream, state); + } + + if (state.lastToken != "\\" && stream.match("{{", false)) { + return chain(tokenMacro("{", "}"), stream, state); + } + + // Comments + if (stream.peek() == "#") { + stream.skipToEnd(); + return "comment"; + } + + // Variables and keywords + var matched; + if (stream.match(idents)) { + stream.eat(/[?!]/); + + matched = stream.current(); + if (stream.eat(":")) { + return "atom"; + } else if (state.lastToken == ".") { + return "property"; + } else if (keywords.test(matched)) { + if (state.lastToken != "abstract" && indentKeywords.test(matched)) { + if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0)) { + state.blocks.push(matched); + state.currentIndent += 1; + } + } else if (dedentKeywords.test(matched)) { + state.blocks.pop(); + state.currentIndent -= 1; + } + + if (nextTokenizer.hasOwnProperty(matched)) { + state.tokenize.push(nextTokenizer[matched]); + } + + return "keyword"; + } else if (atomWords.test(matched)) { + return "atom"; + } + + return "variable"; + } + + // Class variables and instance variables + // or attributes + if (stream.eat("@")) { + if (stream.peek() == "[") { + return chain(tokenNest("[", "]", "meta"), stream, state); + } + + stream.eat("@"); + stream.match(idents) || stream.match(types); + return "variable-2"; + } + + // Global variables + if (stream.eat("$")) { + stream.eat(/[0-9]+|\?/) || stream.match(idents) || stream.match(types); + return "variable-3"; + } + + // Constants and types + if (stream.match(types)) { + return "tag"; + } + + // Symbols or ':' operator + if (stream.eat(":")) { + if (stream.eat("\"")) { + return chain(tokenQuote("\"", "atom", false), stream, state); + } else if (stream.match(idents) || stream.match(types) || + stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) { + return "atom"; + } + stream.eat(":"); + return "operator"; + } + + // Strings + if (stream.eat("\"")) { + return chain(tokenQuote("\"", "string", true), stream, state); + } + + // Strings or regexps or macro variables or '%' operator + if (stream.peek() == "%") { + var style = "string"; + var embed = true; + var delim; + + if (stream.match("%r")) { + // Regexps + style = "string-2"; + delim = stream.next(); + } else if (stream.match("%w")) { + embed = false; + delim = stream.next(); + } else { + if(delim = stream.match(/^%([^\w\s=])/)) { + delim = delim[1]; + } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) { + // Macro variables + return "meta"; + } else { + // '%' operator + return "operator"; + } + } + + if (matching.hasOwnProperty(delim)) { + delim = matching[delim]; + } + return chain(tokenQuote(delim, style, embed), stream, state); + } + + // Characters + if (stream.eat("'")) { + stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/); + stream.eat("'"); + return "atom"; + } + + // Numbers + if (stream.eat("0")) { + if (stream.eat("x")) { + stream.match(/^[0-9a-fA-F]+/); + } else if (stream.eat("o")) { + stream.match(/^[0-7]+/); + } else if (stream.eat("b")) { + stream.match(/^[01]+/); + } + return "number"; + } + + if (stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/); + return "number"; + } + + // Operators + if (stream.match(operators)) { + stream.eat("="); // Operators can follow assign symbol. + return "operator"; + } + + if (stream.match(conditionalOperators) || stream.match(anotherOperators)) { + return "operator"; + } + + // Parens and braces + if (matched = stream.match(/[({[]/, false)) { + matched = matched[0]; + return chain(tokenNest(matched, matching[matched], null), stream, state); + } + + // Escapes + if (stream.eat("\\")) { + stream.next(); + return "meta"; + } + + stream.next(); + return null; + } + + function tokenNest(begin, end, style, started) { + return function (stream, state) { + if (!started && stream.match(begin)) { + state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true); + state.currentIndent += 1; + return style; + } + + var nextStyle = tokenBase(stream, state); + if (stream.current() === end) { + state.tokenize.pop(); + state.currentIndent -= 1; + nextStyle = style; + } + + return nextStyle; + }; + } + + function tokenMacro(begin, end, started) { + return function (stream, state) { + if (!started && stream.match("{" + begin)) { + state.currentIndent += 1; + state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true); + return "meta"; + } + + if (stream.match(end + "}")) { + state.currentIndent -= 1; + state.tokenize.pop(); + return "meta"; + } + + return tokenBase(stream, state); + }; + } + + function tokenMacroDef(stream, state) { + if (stream.eatSpace()) { + return null; + } + + var matched; + if (matched = stream.match(idents)) { + if (matched == "def") { + return "keyword"; + } + stream.eat(/[?!]/); + } + + state.tokenize.pop(); + return "def"; + } + + function tokenFollowIdent(stream, state) { + if (stream.eatSpace()) { + return null; + } + + if (stream.match(idents)) { + stream.eat(/[!?]/); + } else { + stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators); + } + state.tokenize.pop(); + return "def"; + } + + function tokenFollowType(stream, state) { + if (stream.eatSpace()) { + return null; + } + + stream.match(types); + state.tokenize.pop(); + return "def"; + } + + function tokenQuote(end, style, embed) { + return function (stream, state) { + var escaped = false; + + while (stream.peek()) { + if (!escaped) { + if (stream.match("{%", false)) { + state.tokenize.push(tokenMacro("%", "%")); + return style; + } + + if (stream.match("{{", false)) { + state.tokenize.push(tokenMacro("{", "}")); + return style; + } + + if (embed && stream.match("#{", false)) { + state.tokenize.push(tokenNest("#{", "}", "meta")); + return style; + } + + var ch = stream.next(); + + if (ch == end) { + state.tokenize.pop(); + return style; + } + + escaped = ch == "\\"; + } else { + stream.next(); + escaped = false; + } + } + + return style; + }; + } + + return { + startState: function () { + return { + tokenize: [tokenBase], + currentIndent: 0, + lastToken: null, + blocks: [] + }; + }, + + token: function (stream, state) { + var style = state.tokenize[state.tokenize.length - 1](stream, state); + var token = stream.current(); + + if (style && style != "comment") { + state.lastToken = token; + } + + return style; + }, + + indent: function (state, textAfter) { + textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, ""); + + if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) { + return config.indentUnit * (state.currentIndent - 1); + } + + return config.indentUnit * state.currentIndent; + }, + + fold: "indent", + electricInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true), + lineComment: '#' + }; + }); + + CodeMirror.defineMIME("text/x-crystal", "crystal"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/css.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/css.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/css.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/css.js 2018-08-23 17:28:17.000000000 +0000 @@ -12,9 +12,8 @@ "use strict"; CodeMirror.defineMode("css", function(config, parserConfig) { - var provided = parserConfig; + var inline = parserConfig.inline if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); - parserConfig.inline = provided.inline; var indentUnit = config.indentUnit, tokenHooks = parserConfig.tokenHooks, @@ -28,7 +27,8 @@ counterDescriptors = parserConfig.counterDescriptors || {}, colorKeywords = parserConfig.colorKeywords || {}, valueKeywords = parserConfig.valueKeywords || {}, - allowNested = parserConfig.allowNested; + allowNested = parserConfig.allowNested, + supportsAtComponent = parserConfig.supportsAtComponent === true; var type, override; function ret(style, tp) { type = tp; return style; } @@ -122,13 +122,14 @@ this.prev = prev; } - function pushContext(state, stream, type) { - state.context = new Context(type, stream.indentation() + indentUnit, state.context); + function pushContext(state, stream, type, indent) { + state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context); return type; } function popContext(state) { - state.context = state.context.prev; + if (state.context.prev) + state.context = state.context.prev; return state.context.type; } @@ -160,9 +161,13 @@ return pushContext(state, stream, "block"); } else if (type == "}" && state.context.prev) { return popContext(state); - } else if (/@(media|supports|(-moz-)?document)/.test(type)) { + } else if (supportsAtComponent && /@component/.test(type)) { + return pushContext(state, stream, "atComponentBlock"); + } else if (/^@(-moz-)?document$/.test(type)) { + return pushContext(state, stream, "documentTypes"); + } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) { return pushContext(state, stream, "atBlock"); - } else if (/@(font-face|counter-style)/.test(type)) { + } else if (/^@(font-face|counter-style)/.test(type)) { state.stateArg = type; return "restricted_atBlock_before"; } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { @@ -222,7 +227,7 @@ if (type == "}" || type == "{") return popAndPass(type, stream, state); if (type == "(") return pushContext(state, stream, "parens"); - if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { + if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) { override += " error"; } else if (type == "word") { wordAsValue(stream); @@ -255,17 +260,26 @@ return pass(type, stream, state); }; + states.documentTypes = function(type, stream, state) { + if (type == "word" && documentTypes.hasOwnProperty(stream.current())) { + override = "tag"; + return state.context.type; + } else { + return states.atBlock(type, stream, state); + } + }; + states.atBlock = function(type, stream, state) { if (type == "(") return pushContext(state, stream, "atBlock_parens"); - if (type == "}") return popAndPass(type, stream, state); + if (type == "}" || type == ";") return popAndPass(type, stream, state); if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); + if (type == "interpolation") return pushContext(state, stream, "interpolation"); + if (type == "word") { var word = stream.current().toLowerCase(); if (word == "only" || word == "not" || word == "and" || word == "or") override = "keyword"; - else if (documentTypes.hasOwnProperty(word)) - override = "tag"; else if (mediaTypes.hasOwnProperty(word)) override = "attribute"; else if (mediaFeatures.hasOwnProperty(word)) @@ -286,6 +300,16 @@ return state.context.type; }; + states.atComponentBlock = function(type, stream, state) { + if (type == "}") + return popAndPass(type, stream, state); + if (type == "{") + return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false); + if (type == "word") + override = "error"; + return state.context.type; + }; + states.atBlock_parens = function(type, stream, state) { if (type == ")") return popContext(state); if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); @@ -343,9 +367,9 @@ return { startState: function(base) { return {tokenize: null, - state: parserConfig.inline ? "block" : "top", + state: inline ? "block" : "top", stateArg: null, - context: new Context(parserConfig.inline ? "block" : "top", base || 0, null)}; + context: new Context(inline ? "block" : "top", base || 0, null)}; }, token: function(stream, state) { @@ -364,12 +388,18 @@ var cx = state.context, ch = textAfter && textAfter.charAt(0); var indent = cx.indent; if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; - if (cx.prev && - (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") || - ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || - ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) { - indent = cx.indent - indentUnit; - cx = cx.prev; + if (cx.prev) { + if (ch == "}" && (cx.type == "block" || cx.type == "top" || + cx.type == "interpolation" || cx.type == "restricted_atBlock")) { + // Resume indentation from parent context. + cx = cx.prev; + indent = cx.indent; + } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at" || cx.type == "atBlock")) { + // Dedent relative to current context. + indent = Math.max(0, cx.indent - indentUnit); + cx = cx.prev; + } } return indent; }, @@ -422,8 +452,8 @@ "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "appearance", "azimuth", "backface-visibility", - "background", "background-attachment", "background-clip", "background-color", - "background-image", "background-origin", "background-position", + "background", "background-attachment", "background-blend-mode", "background-clip", + "background-color", "background-image", "background-origin", "background-position", "background-repeat", "background-size", "baseline-shift", "binding", "bleed", "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target", "border", "border-bottom", "border-bottom-color", @@ -454,9 +484,9 @@ "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position", "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", - "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end", - "grid-column-start", "grid-row", "grid-row-end", "grid-row-start", - "grid-template", "grid-template-areas", "grid-template-columns", + "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap", + "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", + "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon", "image-orientation", "image-rendering", "image-resolution", "inline-box-align", "justify-content", "left", "letter-spacing", @@ -567,11 +597,12 @@ "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", - "col-resize", "collapse", "column", "column-reverse", "compact", "condensed", "contain", "content", + "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse", + "compact", "condensed", "contain", "content", "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", - "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal", - "decimal-leading-zero", "default", "default-button", "destination-atop", - "destination-in", "destination-out", "destination-over", "devanagari", + "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal", + "decimal-leading-zero", "default", "default-button", "dense", "destination-atop", + "destination-in", "destination-out", "destination-over", "devanagari", "difference", "disc", "discard", "disclosure-closed", "disclosure-open", "document", "dot-dash", "dot-dot-dash", "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", @@ -582,23 +613,23 @@ "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", - "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed", + "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes", - "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", - "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", + "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew", "help", "hidden", "hide", "higher", "highlight", "highlighttext", - "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", - "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert", + "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "japanese-formal", "japanese-informal", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", - "landscape", "lao", "large", "larger", "left", "level", "lighter", + "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten", "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", - "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d", + "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d", "media-controls-background", "media-current-time-display", "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button", @@ -607,7 +638,7 @@ "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", - "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", + "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", @@ -621,7 +652,7 @@ "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running", - "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", + "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen", "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", @@ -629,7 +660,7 @@ "simp-chinese-formal", "simp-chinese-informal", "single", "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", - "small", "small-caps", "small-caption", "smaller", "solid", "somali", + "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali", "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table", @@ -769,4 +800,26 @@ helperType: "less" }); + CodeMirror.defineMIME("text/x-gss", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + supportsAtComponent: true, + tokenHooks: { + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css", + helperType: "gss" + }); + }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/cypher.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/cypher.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/cypher.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/cypher.js 2018-08-23 17:28:17.000000000 +0000 @@ -60,9 +60,9 @@ }; var indentUnit = config.indentUnit; var curPunc; - var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]); - var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor", "like", "ilike", "exists"]); - var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); + var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]); + var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]); + var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); var operatorChars = /[*+\-<>=&|~%^]/; return { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/dart.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/dart.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/dart.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/dart.js 2018-08-23 17:28:17.000000000 +0000 @@ -15,7 +15,7 @@ "implements get native operator set typedef with enum throw rethrow " + "assert break case continue default in return new deferred async await " + "try catch finally do else for if switch while import library export " + - "part of show hide is").split(" "); + "part of show hide is as").split(" "); var blockKeywords = "try catch finally do else for if switch while".split(" "); var atoms = "true false null".split(" "); var builtins = "void bool num int double dynamic var String".split(" "); @@ -26,21 +26,128 @@ return obj; } + function pushInterpolationStack(state) { + (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize); + } + + function popInterpolationStack(state) { + return (state.interpolationStack || (state.interpolationStack = [])).pop(); + } + + function sizeInterpolationStack(state) { + return state.interpolationStack ? state.interpolationStack.length : 0; + } + CodeMirror.defineMIME("application/dart", { name: "clike", keywords: set(keywords), - multiLineStrings: true, blockKeywords: set(blockKeywords), builtin: set(builtins), atoms: set(atoms), hooks: { "@": function(stream) { - stream.eatWhile(/[\w\$_]/); + stream.eatWhile(/[\w\$_\.]/); return "meta"; + }, + + // custom string handling to deal with triple-quoted strings and string interpolation + "'": function(stream, state) { + return tokenString("'", stream, state, false); + }, + "\"": function(stream, state) { + return tokenString("\"", stream, state, false); + }, + "r": function(stream, state) { + var peek = stream.peek(); + if (peek == "'" || peek == "\"") { + return tokenString(stream.next(), stream, state, true); + } + return false; + }, + + "}": function(_stream, state) { + // "}" is end of interpolation, if interpolation stack is non-empty + if (sizeInterpolationStack(state) > 0) { + state.tokenize = popInterpolationStack(state); + return null; + } + return false; + }, + + "/": function(stream, state) { + if (!stream.eat("*")) return false + state.tokenize = tokenNestedComment(1) + return state.tokenize(stream, state) } } }); + function tokenString(quote, stream, state, raw) { + var tripleQuoted = false; + if (stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; //empty string + } + function tokenStringHelper(stream, state) { + var escaped = false; + while (!stream.eol()) { + if (!raw && !escaped && stream.peek() == "$") { + pushInterpolationStack(state); + state.tokenize = tokenInterpolation; + return "string"; + } + var next = stream.next(); + if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) { + state.tokenize = null; + break; + } + escaped = !raw && !escaped && next == "\\"; + } + return "string"; + } + state.tokenize = tokenStringHelper; + return tokenStringHelper(stream, state); + } + + function tokenInterpolation(stream, state) { + stream.eat("$"); + if (stream.eat("{")) { + // let clike handle the content of ${...}, + // we take over again when "}" appears (see hooks). + state.tokenize = null; + } else { + state.tokenize = tokenInterpolationIdentifier; + } + return null; + } + + function tokenInterpolationIdentifier(stream, state) { + stream.eatWhile(/[\w_]/); + state.tokenize = popInterpolationStack(state); + return "variable"; + } + + function tokenNestedComment(depth) { + return function (stream, state) { + var ch + while (ch = stream.next()) { + if (ch == "*" && stream.eat("/")) { + if (depth == 1) { + state.tokenize = null + break + } else { + state.tokenize = tokenNestedComment(depth - 1) + return state.tokenize(stream, state) + } + } else if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenNestedComment(depth + 1) + return state.tokenize(stream, state) + } + } + return "comment" + } + } + CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); // This is needed to make loading through meta.js work. diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/django.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/django.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/django.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/django.js 2018-08-23 17:28:17.000000000 +0000 @@ -14,14 +14,14 @@ "use strict"; CodeMirror.defineMode("django:inner", function() { - var keywords = ["block", "endblock", "for", "endfor", "true", "false", - "loop", "none", "self", "super", "if", "endif", "as", - "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal", - "ifnotequal", "endifnotequal", "extends", "include", "load", "comment", - "endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup", - "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token", - "autoescape", "endautoescape", "spaceless", "ssi", "templatetag", - "verbatim", "endverbatim", "widthratio"], + var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter", + "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import", + "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal", + "endifnotequal", "extends", "include", "load", "comment", "endcomment", + "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now", + "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", + "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless", + "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"], filters = ["add", "addslashes", "capfirst", "center", "cut", "date", "default", "default_if_none", "dictsort", "dictsortreversed", "divisibleby", "escape", "escapejs", @@ -35,11 +35,13 @@ "truncatechars_html", "truncatewords", "truncatewords_html", "unordered_list", "upper", "urlencode", "urlize", "urlizetrunc", "wordcount", "wordwrap", "yesno"], - operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"]; + operators = ["==", "!=", "<", ">", "<=", ">="], + wordOperators = ["in", "not", "or", "and"]; keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); + wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b"); // We have to return "null" instead of null, in order to avoid string // styling as the default, when using Django templates inside HTML @@ -59,16 +61,16 @@ // Ignore completely any stream series that do not match the // Django template opening tags. - while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {} + while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {} return null; } // A string can be included in either single or double quotes (this is - // the delimeter). Mark everything as a string until the start delimeter + // the delimiter). Mark everything as a string until the start delimiter // occurs again. - function inString (delimeter, previousTokenizer) { + function inString (delimiter, previousTokenizer) { return function (stream, state) { - if (!state.escapeNext && stream.eat(delimeter)) { + if (!state.escapeNext && stream.eat(delimiter)) { state.tokenize = previousTokenizer; } else { if (state.escapeNext) { @@ -78,7 +80,7 @@ var ch = stream.next(); // Take into account the backslash for escaping characters, such as - // the string delimeter. + // the string delimiter. if (ch == "\\") { state.escapeNext = true; } @@ -98,7 +100,7 @@ return "null"; } - // Dot folowed by a non-word character should be considered an error. + // Dot followed by a non-word character should be considered an error. if (stream.match(/\.\W+/)) { return "error"; } else if (stream.eat(".")) { @@ -117,7 +119,7 @@ return "null"; } - // Pipe folowed by a non-word character should be considered an error. + // Pipe followed by a non-word character should be considered an error. if (stream.match(/\.\W+/)) { return "error"; } else if (stream.eat("|")) { @@ -197,7 +199,7 @@ return "null"; } - // Dot folowed by a non-word character should be considered an error. + // Dot followed by a non-word character should be considered an error. if (stream.match(/\.\W+/)) { return "error"; } else if (stream.eat(".")) { @@ -216,7 +218,7 @@ return "null"; } - // Pipe folowed by a non-word character should be considered an error. + // Pipe followed by a non-word character should be considered an error. if (stream.match(/\.\W+/)) { return "error"; } else if (stream.eat("|")) { @@ -270,6 +272,11 @@ return "operator"; } + // Attempt to match a word operator + if (stream.match(wordOperators)) { + return "keyword"; + } + // Attempt to match a keyword var keywordMatch = stream.match(keywords); if (keywordMatch) { @@ -310,9 +317,8 @@ // Mark everything as comment inside the tag and the tag itself. function inComment (stream, state) { - if (stream.match("#}")) { - state.tokenize = tokenBase; - } + if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase + else stream.skipToEnd() return "comment"; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/dtd.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/dtd.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/dtd.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/dtd.js 2018-08-23 17:28:17.000000000 +0000 @@ -114,17 +114,17 @@ if( textAfter.match(/\]\s+|\]/) )n=n-1; else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){ - if(textAfter.substr(0,1) === "<")n; - else if( type == "doindent" && textAfter.length > 1 )n; + if(textAfter.substr(0,1) === "<") {} + else if( type == "doindent" && textAfter.length > 1 ) {} else if( type == "doindent")n--; - else if( type == ">" && textAfter.length > 1)n; - else if( type == "tag" && textAfter !== ">")n; + else if( type == ">" && textAfter.length > 1) {} + else if( type == "tag" && textAfter !== ">") {} else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--; else if( type == "tag")n++; else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--; - else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n; + else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule") {} else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1; - else if( textAfter === ">")n; + else if( textAfter === ">") {} else n=n-1; //over rule them all if(type == null || type == "]")n--; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/dylan.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/dylan.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/dylan.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/dylan.js 2018-08-23 17:28:17.000000000 +0000 @@ -169,15 +169,16 @@ } else if (stream.eat("/")) { stream.skipToEnd(); return "comment"; - } else { - stream.skipTo(" "); - return "operator"; } + stream.backUp(1); } // Decimal - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/); - return "number"; + else if (/[+\-\d\.]/.test(ch)) { + if (stream.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i) || + stream.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i) || + stream.match(/^[+-]?\d+/)) { + return "number"; + } } // Hash else if (ch == "#") { @@ -186,7 +187,7 @@ ch = stream.peek(); if (ch == '"') { stream.next(); - return chain(stream, state, tokenString('"', "string-2")); + return chain(stream, state, tokenString('"', "string")); } // Binary number else if (ch == "b") { @@ -206,11 +207,51 @@ stream.eatWhile(/[0-7]/); return "number"; } + // Token concatenation in macros + else if (ch == '#') { + stream.next(); + return "punctuation"; + } + // Sequence literals + else if ((ch == '[') || (ch == '(')) { + stream.next(); + return "bracket"; // Hash symbol - else { + } else if (stream.match(/f|t|all-keys|include|key|next|rest/i)) { + return "atom"; + } else { stream.eatWhile(/[-a-zA-Z]/); - return "keyword"; + return "error"; + } + } else if (ch == "~") { + stream.next(); + ch = stream.peek(); + if (ch == "=") { + stream.next(); + ch = stream.peek(); + if (ch == "=") { + stream.next(); + return "operator"; + } + return "operator"; } + return "operator"; + } else if (ch == ":") { + stream.next(); + ch = stream.peek(); + if (ch == "=") { + stream.next(); + return "operator"; + } else if (ch == ":") { + stream.next(); + return "punctuation"; + } + } else if ("[](){}".indexOf(ch) != -1) { + stream.next(); + return "bracket"; + } else if (".,".indexOf(ch) != -1) { + stream.next(); + return "punctuation"; } else if (stream.match("end")) { return "keyword"; } @@ -223,6 +264,10 @@ return patternStyles[name]; } } + if (/[+\-*\/^=<>&|]/.test(ch)) { + stream.next(); + return "operator"; + } if (stream.match("define")) { return "def"; } else { @@ -240,29 +285,37 @@ } function tokenComment(stream, state) { - var maybeEnd = false, - ch; + var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; while ((ch = stream.next())) { if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; + if (nestedCount > 0) { + nestedCount--; + } else { + state.tokenize = tokenBase; + break; + } + } else if (ch == "*" && maybeNested) { + nestedCount++; } maybeEnd = (ch == "*"); + maybeNested = (ch == "/"); } return "comment"; } function tokenString(quote, style) { return function(stream, state) { - var next, end = false; + var escaped = false, next, end = false; while ((next = stream.next()) != null) { - if (next == quote) { + if (next == quote && !escaped) { end = true; break; } + escaped = !escaped && next == "\\"; } - if (end) + if (end || !escaped) { state.tokenize = tokenBase; + } return style; }; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/ebnf.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/ebnf.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/ebnf.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/ebnf.js 2018-08-23 17:28:17.000000000 +0000 @@ -94,7 +94,7 @@ if (bracesMode !== null && (state.braced || peek === "{")) { if (state.localState === null) - state.localState = bracesMode.startState(); + state.localState = CodeMirror.startState(bracesMode); var token = bracesMode.token(stream, state.localState), text = stream.current(); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/elm.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/elm.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/elm.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/elm.js 2018-08-23 17:28:17.000000000 +0000 @@ -202,4 +202,4 @@ }); CodeMirror.defineMIME("text/x-elm", "elm"); -})(); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/fcl.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/fcl.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/fcl.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/fcl.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,173 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("fcl", function(config) { + var indentUnit = config.indentUnit; + + var keywords = { + "term": true, + "method": true, "accu": true, + "rule": true, "then": true, "is": true, "and": true, "or": true, + "if": true, "default": true + }; + + var start_blocks = { + "var_input": true, + "var_output": true, + "fuzzify": true, + "defuzzify": true, + "function_block": true, + "ruleblock": true + }; + + var end_blocks = { + "end_ruleblock": true, + "end_defuzzify": true, + "end_function_block": true, + "end_fuzzify": true, + "end_var": true + }; + + var atoms = { + "true": true, "false": true, "nan": true, + "real": true, "min": true, "max": true, "cog": true, "cogs": true + }; + + var isOperatorChar = /[+\-*&^%:=<>!|\/]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (/[\d\.]/.test(ch)) { + if (ch == ".") { + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + } else if (ch == "0") { + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + } else { + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + } + return "number"; + } + + if (ch == "/" || ch == "(") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + + var cur = stream.current().toLowerCase(); + if (keywords.propertyIsEnumerable(cur) || + start_blocks.propertyIsEnumerable(cur) || + end_blocks.propertyIsEnumerable(cur)) { + return "keyword"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if ((ch == "/" || ch == ")") && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + + function popContext(state) { + if (!state.context.prev) return; + var t = state.context.type; + if (t == "end_block") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + var cur = stream.current().toLowerCase(); + + if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), "end_block"); + else if (end_blocks.propertyIsEnumerable(cur)) popContext(state); + + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context; + + var closing = end_blocks.propertyIsEnumerable(textAfter); + if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "ryk", + fold: "brace", + blockCommentStart: "(*", + blockCommentEnd: "*)", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-fcl", "fcl"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/gfm.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/gfm.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/gfm.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/gfm.js 2018-08-23 17:28:17.000000000 +0000 @@ -11,6 +11,8 @@ })(function(CodeMirror) { "use strict"; +var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i + CodeMirror.defineMode("gfm", function(config, modeConfig) { var codeDepth = 0; function blankLine(state) { @@ -37,7 +39,7 @@ // Hack to prevent formatting override inside code blocks (block and inline) if (state.codeBlock) { - if (stream.match(/^```/)) { + if (stream.match(/^```+/)) { state.codeBlock = false; return null; } @@ -47,7 +49,7 @@ if (stream.sol()) { state.code = false; } - if (stream.sol() && stream.match(/^```/)) { + if (stream.sol() && stream.match(/^```+/)) { stream.skipToEnd(); state.codeBlock = true; return null; @@ -78,25 +80,29 @@ } if (stream.sol() || state.ateSpace) { state.ateSpace = false; - if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { - // User/Project@SHA - // User@SHA - // SHA - state.combineTokens = true; - return "link"; - } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { - // User/Project#Num - // User#Num - // #Num - state.combineTokens = true; - return "link"; + if (modeConfig.gitHubSpice !== false) { + if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { + // User/Project@SHA + // User@SHA + // SHA + state.combineTokens = true; + return "link"; + } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { + // User/Project#Num + // User#Num + // #Num + state.combineTokens = true; + return "link"; + } } } - if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) && - stream.string.slice(stream.start - 2, stream.start) != "](") { + if (stream.match(urlRE) && + stream.string.slice(stream.start - 2, stream.start) != "](" && + (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) { // URLs // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine + // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL state.combineTokens = true; return "link"; } @@ -109,7 +115,7 @@ var markdownConfig = { underscoresBreakWords: false, taskLists: true, - fencedCodeBlocks: true, + fencedCodeBlocks: '```', strikethrough: true }; for (var attr in modeConfig) { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/go.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/go.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/go.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/go.js 2018-08-23 17:28:17.000000000 +0000 @@ -23,7 +23,7 @@ "bool":true, "byte":true, "complex64":true, "complex128":true, "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, - "uint64":true, "int":true, "uint":true, "uintptr":true + "uint64":true, "int":true, "uint":true, "uintptr":true, "error": true }; var atoms = { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/haml.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/haml.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/haml.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/haml.js 2018-08-23 17:28:17.000000000 +0000 @@ -11,7 +11,7 @@ })(function(CodeMirror) { "use strict"; - // full haml mode. This handled embeded ruby and html fragments too + // full haml mode. This handled embedded ruby and html fragments too CodeMirror.defineMode("haml", function(config) { var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); var rubyMode = CodeMirror.getMode(config, "ruby"); @@ -85,8 +85,10 @@ state.tokenize = rubyInQuote(")"); return state.tokenize(stream, state); } else if (ch == "{") { - state.tokenize = rubyInQuote("}"); - return state.tokenize(stream, state); + if (!stream.match(/^\{%.*/)) { + state.tokenize = rubyInQuote("}"); + return state.tokenize(stream, state); + } } } @@ -96,8 +98,8 @@ return { // default to html mode startState: function() { - var htmlState = htmlMode.startState(); - var rubyState = rubyMode.startState(); + var htmlState = CodeMirror.startState(htmlMode); + var rubyState = CodeMirror.startState(rubyMode); return { htmlState: htmlState, rubyState: rubyState, diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/handlebars.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/handlebars.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/handlebars.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/handlebars.js 2018-08-23 17:28:17.000000000 +0000 @@ -3,15 +3,15 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); + mod(require("../../lib/codemirror"), require("../../addon/mode/simple"), require("../../addon/mode/multiplex")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); + define(["../../lib/codemirror", "../../addon/mode/simple", "../../addon/mode/multiplex"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; - CodeMirror.defineSimpleMode("handlebars", { + CodeMirror.defineSimpleMode("handlebars-tags", { start: [ { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, { regex: /\{\{!/, push: "comment", token: "comment" }, @@ -21,8 +21,8 @@ { regex: /\}\}/, pop: true, token: "tag" }, // Double and single quotes - { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, - { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, + { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, + { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, // Handlebars keywords { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, @@ -49,5 +49,14 @@ ] }); + CodeMirror.defineMode("handlebars", function(config, parserConfig) { + var handlebars = CodeMirror.getMode(config, "handlebars-tags"); + if (!parserConfig || !parserConfig.base) return handlebars; + return CodeMirror.multiplexingMode( + CodeMirror.getMode(config, parserConfig.base), + {open: "{{", close: "}}", mode: handlebars, parseDelimiters: true} + ); + }); + CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/haskell-literate.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/haskell-literate.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/haskell-literate.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/haskell-literate.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,43 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../haskell/haskell")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../haskell/haskell"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + "use strict" + + CodeMirror.defineMode("haskell-literate", function (config, parserConfig) { + var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell") + + return { + startState: function () { + return { + inCode: false, + baseState: CodeMirror.startState(baseMode) + } + }, + token: function (stream, state) { + if (stream.sol()) { + if (state.inCode = stream.eat(">")) + return "meta" + } + if (state.inCode) { + return baseMode.token(stream, state.baseState) + } else { + stream.skipToEnd() + return "comment" + } + }, + innerMode: function (state) { + return state.inCode ? {state: state.baseState, mode: baseMode} : null + } + } + }, "haskell") + + CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate") +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/haxe.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/haxe.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/haxe.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/haxe.js 2018-08-23 17:28:17.000000000 +0000 @@ -16,23 +16,21 @@ // Tokenizer - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; var type = kw("typedef"); - return { - "if": A, "while": A, "else": B, "do": B, "try": B, - "return": C, "break": C, "continue": C, "new": C, "throw": C, - "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), + var keywords = { + "if": A, "while": A, "else": B, "do": B, "try": B, + "return": C, "break": C, "continue": C, "new": C, "throw": C, + "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), - "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "never": kw("property_access"), "trace":kw("trace"), + "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "never": kw("property_access"), "trace":kw("trace"), "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, - "true": atom, "false": atom, "null": atom - }; - }(); + "true": atom, "false": atom, "null": atom + }; var isOperatorChar = /[+\-*&%=<>!?|]/; @@ -41,14 +39,13 @@ return f(stream, state); } - function nextUntilUnescaped(stream, end) { + function toUnescaped(stream, end) { var escaped = false, next; while ((next = stream.next()) != null) { if (next == end && !escaped) - return false; + return true; escaped = !escaped && next == "\\"; } - return escaped; } // Used as scratch variables to communicate multiple values without @@ -61,70 +58,58 @@ function haxeTokenBase(stream, state) { var ch = stream.next(); - if (ch == '"' || ch == "'") + if (ch == '"' || ch == "'") { return chain(stream, state, haxeTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { + } else if (ch == "0" && stream.eat(/x/i)) { stream.eatWhile(/[\da-f]/i); return ret("number", "number"); - } - else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/); return ret("number", "number"); - } - else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { - nextUntilUnescaped(stream, "/"); + } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { + toUnescaped(stream, "/"); stream.eatWhile(/[gimsu]/); return ret("regexp", "string-2"); - } - else if (ch == "/") { + } else if (ch == "/") { if (stream.eat("*")) { return chain(stream, state, haxeTokenComment); - } - else if (stream.eat("/")) { + } else if (stream.eat("/")) { stream.skipToEnd(); return ret("comment", "comment"); - } - else { + } else { stream.eatWhile(isOperatorChar); return ret("operator", null, stream.current()); } - } - else if (ch == "#") { + } else if (ch == "#") { stream.skipToEnd(); return ret("conditional", "meta"); - } - else if (ch == "@") { + } else if (ch == "@") { stream.eat(/:/); stream.eatWhile(/[\w_]/); return ret ("metadata", "meta"); - } - else if (isOperatorChar.test(ch)) { + } else if (isOperatorChar.test(ch)) { stream.eatWhile(isOperatorChar); return ret("operator", null, stream.current()); - } - else { - var word; - if(/[A-Z]/.test(ch)) - { - stream.eatWhile(/[\w_<>]/); - word = stream.current(); - return ret("type", "variable-3", word); - } - else - { + } else { + var word; + if(/[A-Z]/.test(ch)) { + stream.eatWhile(/[\w_<>]/); + word = stream.current(); + return ret("type", "variable-3", word); + } else { stream.eatWhile(/[\w_]/); var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; return (known && state.kwAllowed) ? ret(known.type, known.style, word) : ret("variable", "variable", word); - } + } } } function haxeTokenString(quote) { return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) + if (toUnescaped(stream, quote)) state.tokenize = haxeTokenBase; return ret("string", "string"); }; @@ -176,27 +161,25 @@ cc.pop()(); if (cx.marked) return cx.marked; if (type == "variable" && inScope(state, content)) return "variable-2"; - if (type == "variable" && imported(state, content)) return "variable-3"; + if (type == "variable" && imported(state, content)) return "variable-3"; return style; } } } - function imported(state, typename) - { - if (/[a-z]/.test(typename.charAt(0))) - return false; - var len = state.importedtypes.length; - for (var i = 0; i") { - // Script block: mode to change to depends on type attribute - var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); - scriptType = scriptType ? scriptType[1] : ""; - if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); - for (var i = 0; i < scriptTypes.length; ++i) { - var tp = scriptTypes[i]; - if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { - if (tp.mode) { - state.token = script; - state.localMode = tp.mode; - state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); - } - break; - } - } - } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { - state.token = css; - state.localMode = cssMode; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - } - return style; - } function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat); - if (close > -1) stream.backUp(cur.length - close); - else if (cur.match(/<\/?$/)) { + var cur = stream.current(), close = cur.search(pat); + if (close > -1) { + stream.backUp(cur.length - close); + } else if (cur.match(/<\/?$/)) { stream.backUp(cur.length); if (!stream.match(pat, false)) stream.match(cur); } return style; } - function script(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; + + var attrRegexpCache = {}; + function getAttrRegexp(attr) { + var regexp = attrRegexpCache[attr]; + if (regexp) return regexp; + return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"); + } + + function getAttrValue(text, attr) { + var match = text.match(getAttrRegexp(attr)) + return match ? match[2] : "" + } + + function getTagRegexp(tagName, anchored) { + return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); + } + + function addTags(from, to) { + for (var tag in from) { + var dest = to[tag] || (to[tag] = []); + var source = from[tag]; + for (var i = source.length - 1; i >= 0; i--) + dest.unshift(source[i]) } - return maybeBackup(stream, /<\/\s*script\s*>/, - state.localMode.token(stream, state.localState)); } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; + + function findMatchingMode(tagInfo, tagText) { + for (var i = 0; i < tagInfo.length; i++) { + var spec = tagInfo[i]; + if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2]; } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); } - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.localMode, state.localState); - return {token: state.token, localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter); - else - return CodeMirror.Pass; - }, + CodeMirror.defineMode("htmlmixed", function (config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, { + name: "xml", + htmlMode: true, + multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, + multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag + }); + + var tags = {}; + var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes; + addTags(defaultTags, tags); + if (configTags) addTags(configTags, tags); + if (configScript) for (var i = configScript.length - 1; i >= 0; i--) + tags.script.unshift(["type", configScript[i].matches, configScript[i].mode]) + + function html(stream, state) { + var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName + if (tag && !/[<>\s\/]/.test(stream.current()) && + (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) && + tags.hasOwnProperty(tagName)) { + state.inTag = tagName + " " + } else if (state.inTag && tag && />$/.test(stream.current())) { + var inTag = /^([\S]+) (.*)/.exec(state.inTag) + state.inTag = null + var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2]) + var mode = CodeMirror.getMode(config, modeSpec) + var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false); + state.token = function (stream, state) { + if (stream.match(endTagA, false)) { + state.token = html; + state.localState = state.localMode = null; + return null; + } + return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState)); + }; + state.localMode = mode; + state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "")); + } else if (state.inTag) { + state.inTag += stream.current() + if (stream.eol()) state.inTag += " " + } + return style; + }; - innerMode: function(state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; - } - }; -}, "xml", "javascript", "css"); + return { + startState: function () { + var state = CodeMirror.startState(htmlMode); + return {token: html, inTag: null, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function (state) { + var local; + if (state.localState) { + local = CodeMirror.copyState(state.localMode, state.localState); + } + return {token: state.token, inTag: state.inTag, + localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function (stream, state) { + return state.token(stream, state); + }, + + indent: function (state, textAfter) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter); + else + return CodeMirror.Pass; + }, -CodeMirror.defineMIME("text/html", "htmlmixed"); + innerMode: function (state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; + }, "xml", "javascript", "css"); + CodeMirror.defineMIME("text/html", "htmlmixed"); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/jade.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/jade.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/jade.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/jade.js 2018-08-23 17:28:17.000000000 +0000 @@ -36,7 +36,7 @@ this.isInterpolating = false; this.interpolationNesting = 0; - this.jsState = jsMode.startState(); + this.jsState = CodeMirror.startState(jsMode); this.restOfLine = ''; @@ -74,7 +74,7 @@ res.javaScriptArguments = this.javaScriptArguments; res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; res.isInterpolating = this.isInterpolating; - res.interpolationNesting = this.intpolationNesting; + res.interpolationNesting = this.interpolationNesting; res.jsState = CodeMirror.copyState(jsMode, this.jsState); @@ -167,7 +167,7 @@ if (state.interpolationNesting < 0) { stream.next(); state.isInterpolating = false; - return 'puncutation'; + return 'punctuation'; } } else if (stream.peek() === '{') { state.interpolationNesting++; @@ -386,7 +386,7 @@ if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { if (stream.peek() === '=' || stream.peek() === '!') { state.inAttributeName = false; - state.jsState = jsMode.startState(); + state.jsState = CodeMirror.startState(jsMode); if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { state.attributeIsType = true; } else { @@ -492,7 +492,7 @@ if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { if (state.innerMode) { if (!state.innerState) { - state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {}; + state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {}; } return stream.hideFirstChars(state.indentOf + 2, function () { return state.innerMode.token(stream, state.innerState) || true; @@ -583,7 +583,7 @@ copyState: copyState, token: nextToken }; -}); +}, 'javascript', 'css', 'htmlmixed'); CodeMirror.defineMIME('text/x-jade', 'jade'); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/javascript.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/javascript.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/javascript.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/javascript.js 2018-08-23 17:28:17.000000000 +0000 @@ -13,6 +13,11 @@ })(function(CodeMirror) { "use strict"; +function expressionAllowed(stream, state, backUp) { + return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) +} + CodeMirror.defineMode("javascript", function(config, parserConfig) { var indentUnit = config.indentUnit; var statementIndent = parserConfig.statementIndent; @@ -30,14 +35,15 @@ var jsKeywords = { "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C, + "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C, "var": kw("var"), "const": kw("var"), "let": kw("var"), "function": kw("function"), "catch": kw("catch"), "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), "in": operator, "typeof": operator, "instanceof": operator, "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, "this": kw("this"), "class": kw("class"), "super": kw("atom"), - "yield": C, "export": kw("export"), "import": kw("import"), "extends": C + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, + "await": C, "async": kw("async") }; // Extend the 'normal' keywords with the TypeScript language extensions @@ -45,18 +51,23 @@ var type = {type: "variable", style: "variable-3"}; var tsKeywords = { // object-like things - "interface": kw("interface"), - "extends": kw("extends"), - "constructor": kw("constructor"), + "interface": kw("class"), + "implements": C, + "namespace": C, + "module": kw("module"), + "enum": kw("module"), // scope modifiers - "public": kw("public"), - "private": kw("private"), - "protected": kw("protected"), - "static": kw("static"), + "public": kw("modifier"), + "private": kw("modifier"), + "protected": kw("modifier"), + "abstract": kw("modifier"), + + // operators + "as": operator, // types - "string": type, "number": type, "bool": type, "any": type + "string": type, "number": type, "boolean": type, "any": type }; for (var attr in tsKeywords) { @@ -105,6 +116,12 @@ } else if (ch == "0" && stream.eat(/x/i)) { stream.eatWhile(/[\da-f]/i); return ret("number", "number"); + } else if (ch == "0" && stream.eat(/o/i)) { + stream.eatWhile(/[0-7]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/b/i)) { + stream.eatWhile(/[01]/i); + return ret("number", "number"); } else if (/\d/.test(ch)) { stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); return ret("number", "number"); @@ -115,8 +132,7 @@ } else if (stream.eat("/")) { stream.skipToEnd(); return ret("comment", "comment"); - } else if (state.lastType == "operator" || state.lastType == "keyword c" || - state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { + } else if (expressionAllowed(stream, state, 1)) { readRegexp(stream); stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); return ret("regexp", "string-2"); @@ -275,8 +291,8 @@ return false; } var state = cx.state; + cx.marked = "def"; if (state.context) { - cx.marked = "def"; if (inList(state.localVars)) return; state.localVars = {name: varname, next: state.localVars}; } else { @@ -348,8 +364,10 @@ if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext); if (type == "class") return cont(pushlex("form"), className, poplex); - if (type == "export") return cont(pushlex("form"), afterExport, poplex); - if (type == "import") return cont(pushlex("form"), afterImport, poplex); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) + if (type == "async") return cont(statement) return pass(pushlex("stat"), expression, expect(";"), poplex); } function expression(type) { @@ -373,7 +391,8 @@ if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); if (type == "{") return contCommasep(objprop, "}", null, maybeop); - if (type == "quasi") { return pass(quasi, maybeop); } + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); return cont(); } function maybeexpression(type) { @@ -424,6 +443,18 @@ findFatArrow(cx.stream, cx.state); return pass(type == "{" ? statement : expressionNoComma); } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } function maybelabel(type) { if (type == ":") return cont(poplex, statement); return pass(maybeoperatorComma, expect(";"), poplex); @@ -441,8 +472,12 @@ return cont(afterprop); } else if (type == "jsonld-keyword") { return cont(afterprop); + } else if (type == "modifier") { + return cont(objprop) } else if (type == "[") { return cont(expression, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expression); } } function getterSetter(type) { @@ -455,17 +490,17 @@ if (type == "(") return pass(functiondef); } function commasep(what, end) { - function proceed(type) { + function proceed(type, value) { if (type == ",") { var lex = cx.state.lexical; if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; return cont(what, proceed); } - if (type == end) return cont(); + if (type == end || value == end) return cont(); return cont(expect(end)); } - return function(type) { - if (type == end) return cont(); + return function(type, value) { + if (type == end || value == end) return cont(); return pass(what, proceed); }; } @@ -479,19 +514,25 @@ return pass(statement, block); } function maybetype(type) { - if (isTS && type == ":") return cont(typedef); + if (isTS && type == ":") return cont(typeexpr); } function maybedefault(_, value) { if (value == "=") return cont(expressionNoComma); } - function typedef(type) { - if (type == "variable") {cx.marked = "variable-3"; return cont();} + function typeexpr(type) { + if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);} + } + function afterType(type, value) { + if (value == "<") return cont(commasep(typeexpr, ">"), afterType) + if (type == "[") return cont(expect("]"), afterType) } function vardef() { return pass(pattern, maybetype, maybeAssign, vardefCont); } function pattern(type, value) { + if (type == "modifier") return cont(pattern) if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); if (type == "[") return contCommasep(pattern, "]"); if (type == "{") return contCommasep(proppattern, "}"); } @@ -501,6 +542,8 @@ return cont(maybeAssign); } if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); return cont(expect(":"), pattern, maybeAssign); } function maybeAssign(_type, value) { @@ -536,7 +579,7 @@ function functiondef(type, value) { if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext); + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext); } function funarg(type) { if (type == "spread") return cont(funarg); @@ -623,7 +666,7 @@ lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), localVars: parserConfig.localVars, context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: 0 + indented: basecolumn || 0 }; if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") state.globalVars = parserConfig.globalVars; @@ -679,7 +722,13 @@ helperType: jsonMode ? "json" : "javascript", jsonldMode: jsonldMode, - jsonMode: jsonMode + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } }; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/jsx.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/jsx.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/jsx.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/jsx.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,147 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod) + else // Plain browser env + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + + // Depth means the amount of open braces in JS context, in XML + // context 0 means not in tag, 1 means in tag, and 2 means in tag + // and js block comment. + function Context(state, mode, depth, prev) { + this.state = state; this.mode = mode; this.depth = depth; this.prev = prev + } + + function copyContext(context) { + return new Context(CodeMirror.copyState(context.mode, context.state), + context.mode, + context.depth, + context.prev && copyContext(context.prev)) + } + + CodeMirror.defineMode("jsx", function(config, modeConfig) { + var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false}) + var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript") + + function flatXMLIndent(state) { + var tagName = state.tagName + state.tagName = null + var result = xmlMode.indent(state, "") + state.tagName = tagName + return result + } + + function token(stream, state) { + if (state.context.mode == xmlMode) + return xmlToken(stream, state, state.context) + else + return jsToken(stream, state, state.context) + } + + function xmlToken(stream, state, cx) { + if (cx.depth == 2) { // Inside a JS /* */ comment + if (stream.match(/^.*?\*\//)) cx.depth = 1 + else stream.skipToEnd() + return "comment" + } + + if (stream.peek() == "{") { + xmlMode.skipAttribute(cx.state) + + var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context + // If JS starts on same line as tag + if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) { + while (xmlContext.prev && !xmlContext.startOfLine) + xmlContext = xmlContext.prev + // If tag starts the line, use XML indentation level + if (xmlContext.startOfLine) indent -= config.indentUnit + // Else use JS indentation level + else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented + // Else if inside of tag + } else if (cx.depth == 1) { + indent += config.indentUnit + } + + state.context = new Context(CodeMirror.startState(jsMode, indent), + jsMode, 0, state.context) + return null + } + + if (cx.depth == 1) { // Inside of tag + if (stream.peek() == "<") { // Tag inside of tag + xmlMode.skipAttribute(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)), + xmlMode, 0, state.context) + return null + } else if (stream.match("//")) { + stream.skipToEnd() + return "comment" + } else if (stream.match("/*")) { + cx.depth = 2 + return token(stream, state) + } + } + + var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop + if (/\btag\b/.test(style)) { + if (/>$/.test(cur)) { + if (cx.state.context) cx.depth = 0 + else state.context = state.context.prev + } else if (/^ -1) { + stream.backUp(cur.length - stop) + } + return style + } + + function jsToken(stream, state, cx) { + if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) { + jsMode.skipExpression(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")), + xmlMode, 0, state.context) + return null + } + + var style = jsMode.token(stream, cx.state) + if (!style && cx.depth != null) { + var cur = stream.current() + if (cur == "{") { + cx.depth++ + } else if (cur == "}") { + if (--cx.depth == 0) state.context = state.context.prev + } + } + return style + } + + return { + startState: function() { + return {context: new Context(CodeMirror.startState(jsMode), jsMode)} + }, + + copyState: function(state) { + return {context: copyContext(state.context)} + }, + + token: token, + + indent: function(state, textAfter, fullLine) { + return state.context.mode.indent(state.context.state, textAfter, fullLine) + }, + + innerMode: function(state) { + return state.context + } + } + }, "xml", "javascript") + + CodeMirror.defineMIME("text/jsx", "jsx") +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/julia.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/julia.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/julia.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/julia.js 2018-08-23 17:28:17.000000000 +0000 @@ -14,39 +14,45 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { var ERRORCLASS = 'error'; - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); + function wordRegexp(words, end) { + if (typeof end === 'undefined') { end = "\\b"; } + return new RegExp("^((" + words.join(")|(") + "))" + end); } - var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/; + var octChar = "\\\\[0-7]{1,3}"; + var hexChar = "\\\\x[A-Fa-f0-9]{1,2}"; + var specialChar = "\\\\[abfnrtv0%?'\"\\\\]"; + var singleChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"; + var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b(?!\()|[\u2208\u2209](?!\()/; var delimiters = parserConf.delimiters || /^[;,()[\]{}]/; - var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/; + var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/; + var charsList = [octChar, hexChar, specialChar, singleChar]; var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"]; var blockClosers = ["end", "else", "elseif", "catch", "finally"]; - var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall']; - var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf']; + var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype']; + var builtinList = ['true', 'false', 'nothing', 'NaN', 'Inf']; //var stringPrefixes = new RegExp("^[br]?('|\")") - var stringPrefixes = /^(`|'|"{3}|([br]?"))/; + var stringPrefixes = /^(`|"{3}|([brv]?"))/; + var chars = wordRegexp(charsList, "'"); var keywords = wordRegexp(keywordList); var builtins = wordRegexp(builtinList); var openers = wordRegexp(blockOpeners); var closers = wordRegexp(blockClosers); - var macro = /^@[_A-Za-z][_A-Za-z0-9]*/; - var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/; - - function in_array(state) { - var ch = cur_scope(state); - if(ch=="[" || ch=="{") { + var macro = /^@[_A-Za-z][\w]*/; + var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/; + var typeAnnotation = /^::[^,;"{()=$\s]+({[^}]*}+)*/; + + function inArray(state) { + var ch = currentScope(state); + if (ch == '[') { return true; } - else { - return false; - } + return false; } - function cur_scope(state) { - if(state.scopes.length==0) { + function currentScope(state) { + if (state.scopes.length == 0) { return null; } return state.scopes[state.scopes.length - 1]; @@ -54,20 +60,25 @@ // tokenizers function tokenBase(stream, state) { + // Handle multiline comments + if (stream.match(/^#=/, false)) { + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + // Handle scope changes - var leaving_expr = state.leaving_expr; - if(stream.sol()) { - leaving_expr = false; - } - state.leaving_expr = false; - if(leaving_expr) { - if(stream.match(/^'+/)) { + var leavingExpr = state.leavingExpr; + if (stream.sol()) { + leavingExpr = false; + } + state.leavingExpr = false; + if (leavingExpr) { + if (stream.match(/^'+/)) { return 'operator'; } - } - if(stream.match(/^\.{2,3}/)) { + if (stream.match(/^\.{2,3}/)) { return 'operator'; } @@ -76,99 +87,95 @@ } var ch = stream.peek(); - // Handle Comments + + // Handle single line comments if (ch === '#') { - stream.skipToEnd(); - return 'comment'; + stream.skipToEnd(); + return 'comment'; } - if(ch==='[') { - state.scopes.push("["); + + if (ch === '[') { + state.scopes.push('['); } - if(ch==='{') { - state.scopes.push("{"); + if (ch === '(') { + state.scopes.push('('); } - var scope=cur_scope(state); + var scope = currentScope(state); - if(scope==='[' && ch===']') { + if (scope == '[' && ch === ']') { state.scopes.pop(); - state.leaving_expr=true; + state.leavingExpr = true; } - if(scope==='{' && ch==='}') { + if (scope == '(' && ch === ')') { state.scopes.pop(); - state.leaving_expr=true; - } - - if(ch===')') { - state.leaving_expr = true; + state.leavingExpr = true; } var match; - if(!in_array(state) && (match=stream.match(openers, false))) { + if (!inArray(state) && (match=stream.match(openers, false))) { state.scopes.push(match); } - if(!in_array(state) && stream.match(closers, false)) { + if (!inArray(state) && stream.match(closers, false)) { state.scopes.pop(); } - if(in_array(state)) { - if(stream.match(/^end/)) { + if (inArray(state)) { + if (state.lastToken == 'end' && stream.match(/^:/)) { + return 'operator'; + } + if (stream.match(/^end/)) { return 'number'; } - } - if(stream.match(/^=>/)) { + if (stream.match(/^=>/)) { return 'operator'; } - // Handle Number Literals if (stream.match(/^[0-9\.]/, false)) { var imMatcher = RegExp(/^im\b/); - var floatLiteral = false; + var numberLiteral = false; // Floats - if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.match(imMatcher); - state.leaving_expr = true; - return 'number'; - } + if (stream.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)) { numberLiteral = true; } + if (stream.match(/^\d+\.(?!\.)\d*/)) { numberLiteral = true; } + if (stream.match(/^\.\d+/)) { numberLiteral = true; } + if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { numberLiteral = true; } // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } - // Binary - if (stream.match(/^0b[01]+/i)) { intLiteral = true; } - // Octal - if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - intLiteral = true; - } + if (stream.match(/^0x[0-9a-f]+/i)) { numberLiteral = true; } // Hex + if (stream.match(/^0b[01]+/i)) { numberLiteral = true; } // Binary + if (stream.match(/^0o[0-7]+/i)) { numberLiteral = true; } // Octal + if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { numberLiteral = true; } // Decimal // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { + if (stream.match(/^0(?![\dx])/i)) { numberLiteral = true; } + if (numberLiteral) { // Integer literals may be "long" stream.match(imMatcher); - state.leaving_expr = true; + state.leavingExpr = true; return 'number'; } } - if(stream.match(/^(::)|(<:)/)) { + if (stream.match(/^<:/)) { return 'operator'; } + if (stream.match(typeAnnotation)) { + return 'builtin'; + } + // Handle symbols - if(!leaving_expr && stream.match(symbol)) { - return 'string'; + if (!leavingExpr && stream.match(symbol) || stream.match(/:\./)) { + return 'builtin'; + } + + // Handle parametric types + if (stream.match(/^{[^}]*}(?=\()/)) { + return 'builtin'; } // Handle operators and Delimiters @@ -176,6 +183,11 @@ return 'operator'; } + // Handle Chars + if (stream.match(/^'/)) { + state.tokenize = tokenChar; + return state.tokenize(stream, state); + } // Handle Strings if (stream.match(stringPrefixes)) { @@ -187,7 +199,6 @@ return 'meta'; } - if (stream.match(delimiters)) { return null; } @@ -200,43 +211,128 @@ return 'builtin'; } + var isDefinition = state.isDefinition || + state.lastToken == 'function' || + state.lastToken == 'macro' || + state.lastToken == 'type' || + state.lastToken == 'immutable'; if (stream.match(identifiers)) { - state.leaving_expr=true; + if (isDefinition) { + if (stream.peek() === '.') { + state.isDefinition = true; + return 'variable'; + } + state.isDefinition = false; + return 'def'; + } + if (stream.match(/^({[^}]*})*\(/, false)) { + return callOrDef(stream, state); + } + state.leavingExpr = true; return 'variable'; } + // Handle non-detected items stream.next(); return ERRORCLASS; } + function callOrDef(stream, state) { + var match = stream.match(/^(\(\s*)/); + if (match) { + if (state.firstParenPos < 0) + state.firstParenPos = state.scopes.length; + state.scopes.push('('); + state.charsAdvanced += match[1].length; + } + if (currentScope(state) == '(' && stream.match(/^\)/)) { + state.scopes.pop(); + state.charsAdvanced += 1; + if (state.scopes.length <= state.firstParenPos) { + var isDefinition = stream.match(/^\s*?=(?!=)/, false); + stream.backUp(state.charsAdvanced); + state.firstParenPos = -1; + state.charsAdvanced = 0; + if (isDefinition) + return 'def'; + return 'builtin'; + } + } + // Unfortunately javascript does not support multiline strings, so we have + // to undo anything done upto here if a function call or definition splits + // over two or more lines. + if (stream.match(/^$/g, false)) { + stream.backUp(state.charsAdvanced); + while (state.scopes.length > state.firstParenPos) + state.scopes.pop(); + state.firstParenPos = -1; + state.charsAdvanced = 0; + return 'builtin'; + } + state.charsAdvanced += stream.match(/^([^()]*)/)[1].length; + return callOrDef(stream, state); + } + + function tokenComment(stream, state) { + if (stream.match(/^#=/)) { + state.weakScopes++; + } + if (!stream.match(/.*?(?=(#=|=#))/)) { + stream.skipToEnd(); + } + if (stream.match(/^=#/)) { + state.weakScopes--; + if (state.weakScopes == 0) + state.tokenize = tokenBase; + } + return 'comment'; + } + + function tokenChar(stream, state) { + var isChar = false, match; + if (stream.match(chars)) { + isChar = true; + } else if (match = stream.match(/\\u([a-f0-9]{1,4})(?=')/i)) { + var value = parseInt(match[1], 16); + if (value <= 55295 || value >= 57344) { // (U+0,U+D7FF), (U+E000,U+FFFF) + isChar = true; + stream.next(); + } + } else if (match = stream.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) { + var value = parseInt(match[1], 16); + if (value <= 1114111) { // U+10FFFF + isChar = true; + stream.next(); + } + } + if (isChar) { + state.leavingExpr = true; + state.tokenize = tokenBase; + return 'string'; + } + if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); } + if (stream.match(/^'/)) { state.tokenize = tokenBase; } + return ERRORCLASS; + } + function tokenStringFactory(delimiter) { - while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { + while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { delimiter = delimiter.substr(1); } - var singleline = delimiter.length == 1; var OUTCLASS = 'string'; function tokenString(stream, state) { while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); + stream.eatWhile(/[^"\\]/); if (stream.eat('\\')) { stream.next(); - if (singleline && stream.eol()) { - return OUTCLASS; - } } else if (stream.match(delimiter)) { state.tokenize = tokenBase; + state.leavingExpr = true; return OUTCLASS; } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; + stream.eat(/["]/); } } return OUTCLASS; @@ -245,50 +341,47 @@ return tokenString; } - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style === null && state.lastStyle === 'meta') { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = 'meta'; - } - return style; - } - - return style; - } - var external = { startState: function() { return { tokenize: tokenBase, scopes: [], - leaving_expr: false + weakScopes: 0, + lastToken: null, + leavingExpr: false, + isDefinition: false, + charsAdvanced: 0, + firstParenPos: -1 }; }, token: function(stream, state) { - var style = tokenLexer(stream, state); - state.lastStyle = style; + var style = state.tokenize(stream, state); + var current = stream.current(); + + if (current && style) { + state.lastToken = current; + } + + // Handle '.' connected identifiers + if (current === '.') { + style = stream.match(identifiers, false) || stream.match(macro, false) || + stream.match(/\(/, false) ? 'operator' : ERRORCLASS; + } return style; }, indent: function(state, textAfter) { var delta = 0; - if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") { + if (textAfter == "]" || textAfter == ")" || textAfter == "end" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") { delta = -1; } - return (state.scopes.length + delta) * 4; + return (state.scopes.length + delta) * _conf.indentUnit; }, + electricInput: /(end|else(if)?|catch|finally)$/, lineComment: "#", - fold: "indent", - electricChars: "edlsifyh]}" + fold: "indent" }; return external; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/kotlin.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/kotlin.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/kotlin.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/kotlin.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,284 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("kotlin", function (config, parserConfig) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var multiLineStrings = parserConfig.multiLineStrings; - - var keywords = words( - "package continue return object while break class data trait interface throw super" + - " when type this else This try val var fun for is in if do as true false null get set"); - var softKeywords = words("import" + - " where by get set abstract enum open annotation override private public internal" + - " protected catch out vararg inline finally final ref"); - var blockKeywords = words("catch class do else finally for if where try while enum"); - var atoms = words("null true false this"); - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return startString(ch, stream, state); - } - // Wildcard import w/o trailing semicolon (import smth.*) - if (ch == "." && stream.eat("*")) { - return "word"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - if (stream.eat(/eE/)) { - stream.eat(/\+\-/); - stream.eatWhile(/\d/); - } - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize.push(tokenComment); - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - if (expectExpression(state.lastToken)) { - return startString(ch, stream, state); - } - } - // Commented - if (ch == "-" && stream.eat(">")) { - curPunc = "->"; - return null; - } - if (/[\-+*&%=<>!?|\/~]/.test(ch)) { - stream.eatWhile(/[\-+*&%=<>|~]/); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - - var cur = stream.current(); - if (atoms.propertyIsEnumerable(cur)) { - return "atom"; - } - if (softKeywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "softKeyword"; - } - - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - return "word"; - } - - tokenBase.isBase = true; - - function startString(quote, stream, state) { - var tripleQuoted = false; - if (quote != "/" && stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; - } - function t(stream, state) { - var escaped = false, next, end = !tripleQuoted; - - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - if (!tripleQuoted) { - break; - } - if (stream.match(quote + quote)) { - end = true; - break; - } - } - - if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace()); - return "string"; - } - - if (next == "$" && !escaped && !stream.eat(" ")) { - state.tokenize.push(tokenBaseUntilSpace()); - return "string"; - } - escaped = !escaped && next == "\\"; - } - if (multiLineStrings) - state.tokenize.push(t); - if (end) state.tokenize.pop(); - return "string"; - } - - state.tokenize.push(t); - return t(stream, state); - } - - function tokenBaseUntilBrace() { - var depth = 1; - - function t(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length - 1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - } - - t.isBase = true; - return t; - } - - function tokenBaseUntilSpace() { - function t(stream, state) { - if (stream.eat(/[\w]/)) { - var isWord = stream.eatWhile(/[\w]/); - if (isWord) { - state.tokenize.pop(); - return "word"; - } - } - state.tokenize.pop(); - return "string"; - } - - t.isBase = true; - return t; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize.pop(); - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function expectExpression(last) { - return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || - last == "newstatement" || last == "keyword" || last == "proplabel"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function (basecolumn) { - return { - tokenize: [tokenBase], - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true, - lastToken: null - }; - }, - - token: function (stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - // Automatic semicolon insertion - if (ctx.type == "statement" && !expectExpression(state.lastToken)) { - popContext(state); - ctx = state.context; - } - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = state.tokenize[state.tokenize.length - 1](stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - // Handle indentation for {x -> \n ... } - else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { - popContext(state); - state.context.align = false; - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - state.lastToken = curPunc || style; - return style; - }, - - indent: function (state, textAfter) { - if (!state.tokenize[state.tokenize.length - 1].isBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; - if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") { - return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); - } - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - - closeBrackets: {triples: "'\""}, - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-kotlin", "kotlin"); - -}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/markdown.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/markdown.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/markdown.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/markdown.js 2018-08-23 17:28:17.000000000 +0000 @@ -13,8 +13,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - var htmlFound = CodeMirror.modes.hasOwnProperty("xml"); - var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain"); + var htmlMode = CodeMirror.getMode(cmCfg, "text/html"); + var htmlModeMissing = htmlMode.name == "null" function getMode(name) { if (CodeMirror.findModeByName) { @@ -39,8 +39,10 @@ if (modeCfg.underscoresBreakWords === undefined) modeCfg.underscoresBreakWords = true; - // Turn on fenced code blocks? ("```" to start/end) - if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false; + // Use `fencedCodeBlocks` to configure fenced code blocks. false to + // disable, string to specify a precise regexp that the fence should + // match, and true to allow three or more backticks or tildes (as + // per CommonMark). // Turn on task lists? ("- [ ] " and "- [x] ") if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; @@ -49,32 +51,44 @@ if (modeCfg.strikethrough === undefined) modeCfg.strikethrough = false; - var codeDepth = 0; - - var header = 'header' - , code = 'comment' - , quote = 'quote' - , list1 = 'variable-2' - , list2 = 'variable-3' - , list3 = 'keyword' - , hr = 'hr' - , image = 'tag' - , formatting = 'formatting' - , linkinline = 'link' - , linkemail = 'link' - , linktext = 'link' - , linkhref = 'string' - , em = 'em' - , strong = 'strong' - , strikethrough = 'strikethrough'; + // Allow token types to be overridden by user-provided token types. + if (modeCfg.tokenTypeOverrides === undefined) + modeCfg.tokenTypeOverrides = {}; + + var tokenTypes = { + header: "header", + code: "comment", + quote: "quote", + list1: "variable-2", + list2: "variable-3", + list3: "keyword", + hr: "hr", + image: "tag", + formatting: "formatting", + linkInline: "link", + linkEmail: "link", + linkText: "link", + linkHref: "string", + em: "em", + strong: "strong", + strikethrough: "strikethrough" + }; + + for (var tokenType in tokenTypes) { + if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) { + tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType]; + } + } var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ , ulRE = /^[*\-+]\s+/ , olRE = /^[0-9]+([.)])\s+/ , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE - , atxHeaderRE = /^(#+)(?: |$)/ + , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/ , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ - , textRE = /^[^#!\[\]*_\\<>` "'(~]+/; + , textRE = /^[^#!\[\]*_\\<>` "'(~]+/ + , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) + + ")[ \\t]*([\\w+#\-]*)"); function switchInline(stream, state, f) { state.f = state.inline = f; @@ -86,6 +100,9 @@ return f(stream, state); } + function lineIsEmpty(line) { + return !line || !/\S/.test(line.string) + } // Blocks @@ -102,7 +119,7 @@ state.quote = 0; // Reset state.indentedCode state.indentedCode = false; - if (!htmlFound && state.f == htmlBlock) { + if (htmlModeMissing && state.f == htmlBlock) { state.f = inlineNormal; state.block = blockNormal; } @@ -110,7 +127,8 @@ state.trailingSpace = 0; state.trailingSpaceNewLine = false; // Mark this line as blank - state.thisLineHasContent = false; + state.prevLine = state.thisLine + state.thisLine = null return null; } @@ -131,20 +149,18 @@ state.list = null; } else if (state.indentation > 0) { state.list = null; - state.listDepth = Math.floor(state.indentation / 4); } else { // No longer a list state.list = false; - state.listDepth = 0; } } var match = null; if (state.indentationDiff >= 4) { stream.skipToEnd(); - if (prevLineIsIndentedCode || !state.prevLineHasContent) { + if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) { state.indentation -= 4; state.indentedCode = true; - return code; + return tokenTypes.code; } else { return null; } @@ -155,7 +171,8 @@ if (modeCfg.highlightFormatting) state.formatting = "header"; state.f = state.inline; return getType(state); - } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { + } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList && + !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { state.header = match[0].charAt(0) == '=' ? 1 : 2; if (modeCfg.highlightFormatting) state.formatting = "header"; state.f = state.inline; @@ -169,8 +186,8 @@ return switchInline(stream, state, footnoteLink); } else if (stream.match(hrRE, true)) { state.hr = true; - return hr; - } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { + return tokenTypes.hr; + } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { var listType = null; if (stream.match(ulRE, true)) { listType = 'ul'; @@ -178,22 +195,33 @@ stream.match(olRE, true); listType = 'ol'; } - state.indentation += 4; + state.indentation = stream.column() + stream.current().length; state.list = true; - state.listDepth++; + + // While this list item's marker's indentation + // is less than the deepest list item's content's indentation, + // pop the deepest list item indentation off the stack. + while (state.listStack && stream.column() < state.listStack[state.listStack.length - 1]) { + state.listStack.pop(); + } + + // Add this list item's content's indentation to the stack + state.listStack.push(state.indentation); + if (modeCfg.taskLists && stream.match(taskListRE, false)) { state.taskList = true; } state.f = state.inline; if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; return getType(state); - } else if (modeCfg.fencedCodeBlocks && stream.match(/^```[ \t]*([\w+#]*)/, true)) { + } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) { + state.fencedChars = match[1] // try switching mode - state.localMode = getMode(RegExp.$1); - if (state.localMode) state.localState = state.localMode.startState(); + state.localMode = getMode(match[2]); + if (state.localMode) state.localState = CodeMirror.startState(state.localMode); state.f = state.block = local; if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = true; + state.code = -1 return getType(state); } @@ -202,18 +230,21 @@ function htmlBlock(stream, state) { var style = htmlMode.token(stream, state.htmlState); - if ((htmlFound && state.htmlState.tagStart === null && - (!state.htmlState.context && state.htmlState.tokenize.isInText)) || - (state.md_inside && stream.current().indexOf(">") > -1)) { - state.f = inlineNormal; - state.block = blockNormal; - state.htmlState = null; + if (!htmlModeMissing) { + var inner = CodeMirror.innerMode(htmlMode, state.htmlState) + if ((inner.mode.name == "xml" && inner.state.tagStart === null && + (!inner.state.context && inner.state.tokenize.isInText)) || + (state.md_inside && stream.current().indexOf(">") > -1)) { + state.f = inlineNormal; + state.block = blockNormal; + state.htmlState = null; + } } return style; } function local(stream, state) { - if (stream.sol() && stream.match("```", false)) { + if (state.fencedChars && stream.match(state.fencedChars, false)) { state.localMode = state.localState = null; state.f = state.block = leavingLocal; return null; @@ -221,18 +252,19 @@ return state.localMode.token(stream, state.localState); } else { stream.skipToEnd(); - return code; + return tokenTypes.code; } } function leavingLocal(stream, state) { - stream.match("```"); + stream.match(state.fencedChars); state.block = blockNormal; state.f = inlineNormal; + state.fencedChars = null; if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = true; + state.code = 1 var returnType = getType(state); - state.code = false; + state.code = 0 return returnType; } @@ -241,22 +273,22 @@ var styles = []; if (state.formatting) { - styles.push(formatting); + styles.push(tokenTypes.formatting); if (typeof state.formatting === "string") state.formatting = [state.formatting]; for (var i = 0; i < state.formatting.length; i++) { - styles.push(formatting + "-" + state.formatting[i]); + styles.push(tokenTypes.formatting + "-" + state.formatting[i]); if (state.formatting[i] === "header") { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.header); + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header); } // Add `formatting-quote` and `formatting-quote-#` for blockquotes // Add `error` instead if the maximum blockquote nesting depth is passed if (state.formatting[i] === "quote") { if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote); + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote); } else { styles.push("error"); } @@ -274,38 +306,36 @@ } if (state.linkHref) { - styles.push(linkhref, "url"); + styles.push(tokenTypes.linkHref, "url"); } else { // Only apply inline styles to non-url text - if (state.strong) { styles.push(strong); } - if (state.em) { styles.push(em); } - if (state.strikethrough) { styles.push(strikethrough); } - - if (state.linkText) { styles.push(linktext); } - - if (state.code) { styles.push(code); } + if (state.strong) { styles.push(tokenTypes.strong); } + if (state.em) { styles.push(tokenTypes.em); } + if (state.strikethrough) { styles.push(tokenTypes.strikethrough); } + if (state.linkText) { styles.push(tokenTypes.linkText); } + if (state.code) { styles.push(tokenTypes.code); } } - if (state.header) { styles.push(header); styles.push(header + "-" + state.header); } + if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); } if (state.quote) { - styles.push(quote); + styles.push(tokenTypes.quote); // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(quote + "-" + state.quote); + styles.push(tokenTypes.quote + "-" + state.quote); } else { - styles.push(quote + "-" + modeCfg.maxBlockquoteDepth); + styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth); } } if (state.list !== false) { - var listMod = (state.listDepth - 1) % 3; + var listMod = (state.listStack.length - 1) % 3; if (!listMod) { - styles.push(list1); + styles.push(tokenTypes.list1); } else if (listMod === 1) { - styles.push(list2); + styles.push(tokenTypes.list2); } else { - styles.push(list3); + styles.push(tokenTypes.list3); } } @@ -357,14 +387,6 @@ var ch = stream.next(); - if (ch === '\\') { - stream.next(); - if (modeCfg.highlightFormatting) { - var type = getType(state); - return type ? type + " formatting-escape" : "formatting-escape"; - } - } - // Matches link titles present on next line if (state.linkTitle) { state.linkTitle = false; @@ -375,7 +397,7 @@ matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; if (stream.match(new RegExp(regex), true)) { - return linkhref; + return tokenTypes.linkHref; } } @@ -383,39 +405,45 @@ if (ch === '`') { var previousFormatting = state.formatting; if (modeCfg.highlightFormatting) state.formatting = "code"; - var t = getType(state); - var before = stream.pos; stream.eatWhile('`'); - var difference = 1 + stream.pos - before; - if (!state.code) { - codeDepth = difference; - state.code = true; - return getType(state); + var count = stream.current().length + if (state.code == 0) { + state.code = count + return getType(state) + } else if (count == state.code) { // Must be exact + var t = getType(state) + state.code = 0 + return t } else { - if (difference === codeDepth) { // Must be exact - state.code = false; - return t; - } - state.formatting = previousFormatting; - return getType(state); + state.formatting = previousFormatting + return getType(state) } } else if (state.code) { return getType(state); } + if (ch === '\\') { + stream.next(); + if (modeCfg.highlightFormatting) { + var type = getType(state); + var formattingEscape = tokenTypes.formatting + "-escape"; + return type ? type + " " + formattingEscape : formattingEscape; + } + } + if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { stream.match(/\[[^\]]*\]/); state.inline = state.f = linkHref; - return image; + return tokenTypes.image; } - if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) { + if (ch === '[' && stream.match(/[^\]]*\](\(.*\)| ?\[.*?\])/, false)) { state.linkText = true; if (modeCfg.highlightFormatting) state.formatting = "link"; return getType(state); } - if (ch === ']' && state.linkText && stream.match(/\(.*\)| ?\[.*\]/, false)) { + if (ch === ']' && state.linkText && stream.match(/\(.*?\)| ?\[.*?\]/, false)) { if (modeCfg.highlightFormatting) state.formatting = "link"; var type = getType(state); state.linkText = false; @@ -432,7 +460,7 @@ } else { type = ""; } - return type + linkinline; + return type + tokenTypes.linkInline; } if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { @@ -444,7 +472,7 @@ } else { type = ""; } - return type + linkemail; + return type + tokenTypes.linkEmail; } if (ch === '<' && stream.match(/^(!--|\w)/, false)) { @@ -553,12 +581,12 @@ } else { type = ""; } - return type + linkinline; + return type + tokenTypes.linkInline; } stream.match(/^[^>]+/, true); - return linkinline; + return tokenTypes.linkInline; } function linkHref(stream, state) { @@ -568,7 +596,7 @@ } var ch = stream.next(); if (ch === '(' || ch === '[') { - state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]"); + state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0); if (modeCfg.highlightFormatting) state.formatting = "link-string"; state.linkHref = true; return getType(state); @@ -576,6 +604,11 @@ return 'error'; } + var linkRE = { + ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/, + "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/ + } + function getLinkHrefInside(endChar) { return function(stream, state) { var ch = stream.next(); @@ -588,17 +621,14 @@ return returnState; } - if (stream.match(inlineRE(endChar), true)) { - stream.backUp(1); - } - + stream.match(linkRE[endChar]) state.linkHref = true; return getType(state); }; } function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, false)) { + if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) { state.f = footnoteLinkInside; stream.next(); // Consume [ if (modeCfg.highlightFormatting) state.formatting = "link"; @@ -617,9 +647,9 @@ return returnType; } - stream.match(/^[^\]]+/, true); + stream.match(/^([^\]\\]|\\.)+/, true); - return linktext; + return tokenTypes.linkText; } function footnoteUrl(stream, state) { @@ -636,19 +666,7 @@ stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); } state.f = state.inline = inlineNormal; - return linkhref + " url"; - } - - var savedInlineRE = []; - function inlineRE(endChar) { - if (!savedInlineRE[endChar]) { - // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741) - endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - // Match any non-endChar, escaped character, as well as the closing - // endChar. - savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')'); - } - return savedInlineRE[endChar]; + return tokenTypes.linkHref + " url"; } var mode = { @@ -656,8 +674,8 @@ return { f: blockNormal, - prevLineHasContent: false, - thisLineHasContent: false, + prevLine: null, + thisLine: null, block: blockNormal, htmlState: null, @@ -670,17 +688,19 @@ linkText: false, linkHref: false, linkTitle: false, + code: 0, em: false, strong: false, header: 0, hr: false, taskList: false, list: false, - listDepth: 0, + listStack: [], quote: 0, trailingSpace: 0, trailingSpaceNewLine: false, - strikethrough: false + strikethrough: false, + fencedChars: null }; }, @@ -688,8 +708,8 @@ return { f: s.f, - prevLineHasContent: s.prevLineHasContent, - thisLineHasContent: s.thisLineHasContent, + prevLine: s.prevLine, + thisLine: s.thisLine, block: s.block, htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), @@ -702,6 +722,7 @@ text: s.text, formatting: false, linkTitle: s.linkTitle, + code: s.code, em: s.em, strong: s.strong, strikethrough: s.strikethrough, @@ -709,12 +730,13 @@ hr: s.hr, taskList: s.taskList, list: s.list, - listDepth: s.listDepth, + listStack: s.listStack.slice(0), quote: s.quote, indentedCode: s.indentedCode, trailingSpace: s.trailingSpace, trailingSpaceNewLine: s.trailingSpaceNewLine, - md_inside: s.md_inside + md_inside: s.md_inside, + fencedChars: s.fencedChars }; }, @@ -723,39 +745,33 @@ // Reset state.formatting state.formatting = false; - if (stream.sol()) { - var forceBlankLine = !!state.header || state.hr; + if (stream != state.thisLine) { + var forceBlankLine = state.header || state.hr; // Reset state.header and state.hr state.header = 0; state.hr = false; if (stream.match(/^\s*$/, true) || forceBlankLine) { - state.prevLineHasContent = false; blankLine(state); - return forceBlankLine ? this.token(stream, state) : null; - } else { - state.prevLineHasContent = state.thisLineHasContent; - state.thisLineHasContent = true; + if (!forceBlankLine) return null + state.prevLine = null } + state.prevLine = state.thisLine + state.thisLine = stream + // Reset state.taskList state.taskList = false; - // Reset state.code - state.code = false; - // Reset state.trailingSpace state.trailingSpace = 0; state.trailingSpaceNewLine = false; state.f = state.block; var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; - var difference = Math.floor((indentation - state.indentation) / 4) * 4; - if (difference > 4) difference = 4; - var adjustedIndentation = state.indentation + difference; - state.indentationDiff = adjustedIndentation - state.indentation; - state.indentation = adjustedIndentation; + state.indentationDiff = Math.min(indentation - state.indentation, 4); + state.indentation = state.indentation + state.indentationDiff; if (indentation > 0) return null; } return state.f(stream, state); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/mathematica.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/mathematica.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/mathematica.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/mathematica.js 2018-08-23 17:28:17.000000000 +0000 @@ -126,6 +126,7 @@ } // everything else is an error + stream.next(); // advance the stream. return 'error'; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/mbox.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/mbox.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/mbox.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/mbox.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,129 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var rfc2822 = [ + "From", "Sender", "Reply-To", "To", "Cc", "Bcc", "Message-ID", + "In-Reply-To", "References", "Resent-From", "Resent-Sender", "Resent-To", + "Resent-Cc", "Resent-Bcc", "Resent-Message-ID", "Return-Path", "Received" +]; +var rfc2822NoEmail = [ + "Date", "Subject", "Comments", "Keywords", "Resent-Date" +]; + +CodeMirror.registerHelper("hintWords", "mbox", rfc2822.concat(rfc2822NoEmail)); + +var whitespace = /^[ \t]/; +var separator = /^From /; // See RFC 4155 +var rfc2822Header = new RegExp("^(" + rfc2822.join("|") + "): "); +var rfc2822HeaderNoEmail = new RegExp("^(" + rfc2822NoEmail.join("|") + "): "); +var header = /^[^:]+:/; // Optional fields defined in RFC 2822 +var email = /^[^ ]+@[^ ]+/; +var untilEmail = /^.*?(?=[^ ]+?@[^ ]+)/; +var bracketedEmail = /^<.*?>/; +var untilBracketedEmail = /^.*?(?=<.*>)/; + +function styleForHeader(header) { + if (header === "Subject") return "header"; + return "string"; +} + +function readToken(stream, state) { + if (stream.sol()) { + // From last line + state.inSeparator = false; + if (state.inHeader && stream.match(whitespace)) { + // Header folding + return null; + } else { + state.inHeader = false; + state.header = null; + } + + if (stream.match(separator)) { + state.inHeaders = true; + state.inSeparator = true; + return "atom"; + } + + var match; + var emailPermitted = false; + if ((match = stream.match(rfc2822HeaderNoEmail)) || + (emailPermitted = true) && (match = stream.match(rfc2822Header))) { + state.inHeaders = true; + state.inHeader = true; + state.emailPermitted = emailPermitted; + state.header = match[1]; + return "atom"; + } + + // Use vim's heuristics: recognize custom headers only if the line is in a + // block of legitimate headers. + if (state.inHeaders && (match = stream.match(header))) { + state.inHeader = true; + state.emailPermitted = true; + state.header = match[1]; + return "atom"; + } + + state.inHeaders = false; + stream.skipToEnd(); + return null; + } + + if (state.inSeparator) { + if (stream.match(email)) return "link"; + if (stream.match(untilEmail)) return "atom"; + stream.skipToEnd(); + return "atom"; + } + + if (state.inHeader) { + var style = styleForHeader(state.header); + + if (state.emailPermitted) { + if (stream.match(bracketedEmail)) return style + " link"; + if (stream.match(untilBracketedEmail)) return style; + } + stream.skipToEnd(); + return style; + } + + stream.skipToEnd(); + return null; +}; + +CodeMirror.defineMode("mbox", function() { + return { + startState: function() { + return { + // Is in a mbox separator + inSeparator: false, + // Is in a mail header + inHeader: false, + // If bracketed email is permitted. Only applicable when inHeader + emailPermitted: false, + // Name of current header + header: null, + // Is in a region of mail headers + inHeaders: false + }; + }, + token: readToken, + blankLine: function(state) { + state.inHeaders = state.inSeparator = state.inHeader = false; + } + }; +}); + +CodeMirror.defineMIME("application/mbox", "mbox"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/mscgen.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/mscgen.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/mscgen.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/mscgen.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,169 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// mode(s) for the sequence chart dsl's mscgen, xù and msgenny +// For more information on mscgen, see the site of the original author: +// http://www.mcternan.me.uk/mscgen +// +// This mode for mscgen and the two derivative languages were +// originally made for use in the mscgen_js interpreter +// (https://sverweij.github.io/mscgen_js) + +(function(mod) { + if ( typeof exports == "object" && typeof module == "object")// CommonJS + mod(require("../../lib/codemirror")); + else if ( typeof define == "function" && define.amd)// AMD + define(["../../lib/codemirror"], mod); + else// Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var languages = { + mscgen: { + "keywords" : ["msc"], + "options" : ["hscale", "width", "arcgradient", "wordwraparcs"], + "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], + "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists + "arcsWords" : ["note", "abox", "rbox", "box"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + }, + xu: { + "keywords" : ["msc"], + "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], + "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], + "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists + "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + }, + msgenny: { + "keywords" : null, + "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], + "attributes" : null, + "brackets" : ["\\{", "\\}"], + "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + } + } + + CodeMirror.defineMode("mscgen", function(_, modeConfig) { + var language = languages[modeConfig && modeConfig.language || "mscgen"] + return { + startState: startStateFn, + copyState: copyStateFn, + token: produceTokenFunction(language), + lineComment : "#", + blockCommentStart : "/*", + blockCommentEnd : "*/" + }; + }); + + CodeMirror.defineMIME("text/x-mscgen", "mscgen"); + CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"}); + CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"}); + + function wordRegexpBoundary(pWords) { + return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i"); + } + + function wordRegexp(pWords) { + return new RegExp("(" + pWords.join("|") + ")", "i"); + } + + function startStateFn() { + return { + inComment : false, + inString : false, + inAttributeList : false, + inScript : false + }; + } + + function copyStateFn(pState) { + return { + inComment : pState.inComment, + inString : pState.inString, + inAttributeList : pState.inAttributeList, + inScript : pState.inScript + }; + } + + function produceTokenFunction(pConfig) { + + return function(pStream, pState) { + if (pStream.match(wordRegexp(pConfig.brackets), true, true)) { + return "bracket"; + } + /* comments */ + if (!pState.inComment) { + if (pStream.match(/\/\*[^\*\/]*/, true, true)) { + pState.inComment = true; + return "comment"; + } + if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) { + pStream.skipToEnd(); + return "comment"; + } + } + if (pState.inComment) { + if (pStream.match(/[^\*\/]*\*\//, true, true)) + pState.inComment = false; + else + pStream.skipToEnd(); + return "comment"; + } + /* strings */ + if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) { + pState.inString = true; + return "string"; + } + if (pState.inString) { + if (pStream.match(/[^\"]*\"/, true, true)) + pState.inString = false; + else + pStream.skipToEnd(); + return "string"; + } + /* keywords & operators */ + if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true)) + return "keyword"; + + if (pStream.match(wordRegexpBoundary(pConfig.options), true, true)) + return "keyword"; + + if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true)) + return "keyword"; + + if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true)) + return "keyword"; + + if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true)) + return "operator"; + + /* attribute lists */ + if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) { + pConfig.inAttributeList = true; + return "bracket"; + } + if (pConfig.inAttributeList) { + if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) { + return "attribute"; + } + if (pStream.match(/]/, true, true)) { + pConfig.inAttributeList = false; + return "bracket"; + } + } + + pStream.next(); + return "base"; + }; + } + +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/nginx.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/nginx.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/nginx.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/nginx.js 2018-08-23 17:28:17.000000000 +0000 @@ -173,6 +173,6 @@ }; }); -CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf"); +CodeMirror.defineMIME("text/x-nginx-conf", "nginx"); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/nsis.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/nsis.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/nsis.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/nsis.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,95 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Author: Jan T. Sott (http://github.com/idleberg) + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../../addon/mode/simple"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineSimpleMode("nsis",{ + start:[ + // Numbers + {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"}, + + // Strings + { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, + { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, + { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" }, + + // Compile Time Commands + {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"}, + + // Conditional Compilation + {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true}, + {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true}, + + // Runtime Commands + {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"}, + {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true}, + {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true}, + + // Command Options + {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"}, + {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"}, + + // LogicLib.nsh + {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true}, + + // FileFunc.nsh + {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true}, + + // Memento.nsh + {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true}, + + // TextFunc.nsh + {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true}, + + // WinVer.nsh + {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true}, + + // WordFunc.nsh + {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true}, + + // x64.nsh + {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true}, + {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true}, + + // Line Comment + {regex: /(#|;).*/, token: "comment"}, + + // Block Comment + {regex: /\/\*/, token: "comment", next: "comment"}, + + // Operator + {regex: /[-+\/*=<>!]+/, token: "operator"}, + + // Variable + {regex: /\$[\w]+/, token: "variable"}, + + // Constant + {regex: /\${[\w]+}/,token: "variable-2"}, + + // Language String + {regex: /\$\([\w]+\)/,token: "variable-3"} + ], + comment: [ + {regex: /.*?\*\//, token: "comment", next: "start"}, + {regex: /.*/, token: "comment"} + ], + meta: { + electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/, + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: ["#", ";"] + } +}); + +CodeMirror.defineMIME("text/x-nsis", "nsis"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/oz.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/oz.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/oz.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/oz.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,252 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("oz", function (conf) { + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/; + var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/; + var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/; + + var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch", + "finally", "with", "require", "prepare", "import", "export", "define", "do"]; + var end = ["end"]; + + var atoms = wordRegexp(["true", "false", "nil", "unit"]); + var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex", + "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]); + var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis", + "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]); + var middleKeywords = wordRegexp(middle); + var endKeywords = wordRegexp(end); + + // Tokenizers + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + // Brackets + if(stream.match(/[{}]/)) { + return "bracket"; + } + + // Special [] keyword + if (stream.match(/(\[])/)) { + return "keyword" + } + + // Operators + if (stream.match(tripleOperators) || stream.match(doubleOperators)) { + return "operator"; + } + + // Atoms + if(stream.match(atoms)) { + return 'atom'; + } + + // Opening keywords + var matched = stream.match(openingKeywords); + if (matched) { + if (!state.doInCurrentLine) + state.currentIndent++; + else + state.doInCurrentLine = false; + + // Special matching for signatures + if(matched[0] == "proc" || matched[0] == "fun") + state.tokenize = tokenFunProc; + else if(matched[0] == "class") + state.tokenize = tokenClass; + else if(matched[0] == "meth") + state.tokenize = tokenMeth; + + return 'keyword'; + } + + // Middle and other keywords + if (stream.match(middleKeywords) || stream.match(commonKeywords)) { + return "keyword" + } + + // End keywords + if (stream.match(endKeywords)) { + state.currentIndent--; + return 'keyword'; + } + + // Eat the next char for next comparisons + var ch = stream.next(); + + // Strings + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + + // Numbers + if (/[~\d]/.test(ch)) { + if (ch == "~") { + if(! /^[0-9]/.test(stream.peek())) + return null; + else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) + return "number"; + } + + if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) + return "number"; + + return null; + } + + // Comments + if (ch == "%") { + stream.skipToEnd(); + return 'comment'; + } + else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + } + + // Single operators + if(singleOperators.test(ch)) { + return "operator"; + } + + // If nothing match, we skip the entire alphanumerical block + stream.eatWhile(/\w/); + + return "variable"; + } + + function tokenClass(stream, state) { + if (stream.eatSpace()) { + return null; + } + stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/); + state.tokenize = tokenBase; + return "variable-3" + } + + function tokenMeth(stream, state) { + if (stream.eatSpace()) { + return null; + } + stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/); + state.tokenize = tokenBase; + return "def" + } + + function tokenFunProc(stream, state) { + if (stream.eatSpace()) { + return null; + } + + if(!state.hasPassedFirstStage && stream.eat("{")) { + state.hasPassedFirstStage = true; + return "bracket"; + } + else if(state.hasPassedFirstStage) { + stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/); + state.hasPassedFirstStage = false; + state.tokenize = tokenBase; + return "def" + } + else { + state.tokenize = tokenBase; + return null; + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(quote) { + return function (stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end || !escaped) + state.tokenize = tokenBase; + return "string"; + }; + } + + function buildElectricInputRegEx() { + // Reindentation should occur on [] or on a match of any of + // the block closing keywords, at the end of a line. + var allClosings = middle.concat(end); + return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$"); + } + + return { + + startState: function () { + return { + tokenize: tokenBase, + currentIndent: 0, + doInCurrentLine: false, + hasPassedFirstStage: false + }; + }, + + token: function (stream, state) { + if (stream.sol()) + state.doInCurrentLine = 0; + + return state.tokenize(stream, state); + }, + + indent: function (state, textAfter) { + var trueText = textAfter.replace(/^\s+|\s+$/g, ''); + + if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/)) + return conf.indentUnit * (state.currentIndent - 1); + + if (state.currentIndent < 0) + return 0; + + return state.currentIndent * conf.indentUnit; + }, + fold: "indent", + electricInput: buildElectricInputRegEx(), + lineComment: "%", + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +CodeMirror.defineMIME("text/x-oz", "oz"); + +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/pegjs.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/pegjs.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/pegjs.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/pegjs.js 2018-08-23 17:28:17.000000000 +0000 @@ -24,7 +24,7 @@ inString: false, stringType: null, inComment: false, - inChracterClass: false, + inCharacterClass: false, braced: 0, lhs: true, localState: null @@ -66,22 +66,22 @@ } } return "comment"; - } else if (state.inChracterClass) { - while (state.inChracterClass && !stream.eol()) { + } else if (state.inCharacterClass) { + while (state.inCharacterClass && !stream.eol()) { if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { - state.inChracterClass = false; + state.inCharacterClass = false; } } } else if (stream.peek() === '[') { stream.next(); - state.inChracterClass = true; + state.inCharacterClass = true; return 'bracket'; } else if (stream.match(/^\/\//)) { stream.skipToEnd(); return "comment"; } else if (state.braced || stream.peek() === '{') { if (state.localState === null) { - state.localState = jsMode.startState(); + state.localState = CodeMirror.startState(jsMode); } var token = jsMode.token(stream, state.localState); var text = stream.current(); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/perl.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/perl.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/perl.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/perl.js 2018-08-23 17:28:17.000000000 +0000 @@ -268,7 +268,7 @@ chmod :1, // - changes the permissions on a list of files chomp :1, // - remove a trailing record separator from a string chop :1, // - remove the last character from a string - chown :1, // - change the owership on a list of files + chown :1, // - change the ownership on a list of files chr :1, // - get character this number represents chroot :1, // - make directory new root for path lookups close :1, // - close file (or pipe or socket) handle diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/php.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/php.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/php.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/php.js 2018-08-23 17:28:17.000000000 +0000 @@ -86,7 +86,7 @@ "die echo empty exit eval include include_once isset list require require_once return " + "print unset __halt_compiler self static parent yield insteadof finally"; var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; - var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; + var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); CodeMirror.registerHelper("wordChars", "php", /[\w$]/); @@ -160,6 +160,7 @@ if (!isPHP) { if (stream.match(/^<\?\w*/)) { state.curMode = phpMode; + if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, "")) state.curState = state.php; return "meta"; } @@ -183,6 +184,7 @@ } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { state.curMode = htmlMode; state.curState = state.html; + if (!state.php.context.prev) state.php = null; return "meta"; } else { return phpMode.token(stream, state.curState); @@ -191,7 +193,8 @@ return { startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); + var html = CodeMirror.startState(htmlMode) + var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null return {html: html, php: php, curMode: parserConfig.startOpen ? phpMode : htmlMode, @@ -201,7 +204,7 @@ copyState: function(state) { var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; + php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur; if (state.curMode == htmlMode) cur = htmlNew; else cur = phpNew; return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/powershell.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/powershell.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/powershell.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/powershell.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,396 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + 'use strict'; + if (typeof exports == 'object' && typeof module == 'object') // CommonJS + mod(require('codemirror')); + else if (typeof define == 'function' && define.amd) // AMD + define(['codemirror'], mod); + else // Plain browser env + mod(window.CodeMirror); +})(function(CodeMirror) { +'use strict'; + +CodeMirror.defineMode('powershell', function() { + function buildRegexp(patterns, options) { + options = options || {}; + var prefix = options.prefix !== undefined ? options.prefix : '^'; + var suffix = options.suffix !== undefined ? options.suffix : '\\b'; + + for (var i = 0; i < patterns.length; i++) { + if (patterns[i] instanceof RegExp) { + patterns[i] = patterns[i].source; + } + else { + patterns[i] = patterns[i].replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + } + + return new RegExp(prefix + '(' + patterns.join('|') + ')' + suffix, 'i'); + } + + var notCharacterOrDash = '(?=[^A-Za-z\\d\\-_]|$)'; + var varNames = /[\w\-:]/ + var keywords = buildRegexp([ + /begin|break|catch|continue|data|default|do|dynamicparam/, + /else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/, + /param|process|return|switch|throw|trap|try|until|where|while/ + ], { suffix: notCharacterOrDash }); + + var punctuation = /[\[\]{},;`\.]|@[({]/; + var wordOperators = buildRegexp([ + 'f', + /b?not/, + /[ic]?split/, 'join', + /is(not)?/, 'as', + /[ic]?(eq|ne|[gl][te])/, + /[ic]?(not)?(like|match|contains)/, + /[ic]?replace/, + /b?(and|or|xor)/ + ], { prefix: '-' }); + var symbolOperators = /[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/; + var operators = buildRegexp([wordOperators, symbolOperators], { suffix: '' }); + + var numbers = /^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i; + + var identifiers = /^[A-Za-z\_][A-Za-z\-\_\d]*\b/; + + var symbolBuiltins = /[A-Z]:|%|\?/i; + var namedBuiltins = buildRegexp([ + /Add-(Computer|Content|History|Member|PSSnapin|Type)/, + /Checkpoint-Computer/, + /Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/, + /Compare-Object/, + /Complete-Transaction/, + /Connect-PSSession/, + /ConvertFrom-(Csv|Json|SecureString|StringData)/, + /Convert-Path/, + /ConvertTo-(Csv|Html|Json|SecureString|Xml)/, + /Copy-Item(Property)?/, + /Debug-Process/, + /Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/, + /Disconnect-PSSession/, + /Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/, + /(Enter|Exit)-PSSession/, + /Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/, + /ForEach-Object/, + /Format-(Custom|List|Table|Wide)/, + new RegExp('Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential' + + '|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job' + + '|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration' + + '|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)'), + /Group-Object/, + /Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/, + /ImportSystemModules/, + /Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/, + /Join-Path/, + /Limit-EventLog/, + /Measure-(Command|Object)/, + /Move-Item(Property)?/, + new RegExp('New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile' + + '|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)'), + /Out-(Default|File|GridView|Host|Null|Printer|String)/, + /Pause/, + /(Pop|Push)-Location/, + /Read-Host/, + /Receive-(Job|PSSession)/, + /Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/, + /Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/, + /Rename-(Computer|Item(Property)?)/, + /Reset-ComputerMachinePassword/, + /Resolve-Path/, + /Restart-(Computer|Service)/, + /Restore-Computer/, + /Resume-(Job|Service)/, + /Save-Help/, + /Select-(Object|String|Xml)/, + /Send-MailMessage/, + new RegExp('Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug' + + '|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)'), + /Show-(Command|ControlPanelItem|EventLog)/, + /Sort-Object/, + /Split-Path/, + /Start-(Job|Process|Service|Sleep|Transaction|Transcript)/, + /Stop-(Computer|Job|Process|Service|Transcript)/, + /Suspend-(Job|Service)/, + /TabExpansion2/, + /Tee-Object/, + /Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/, + /Trace-Command/, + /Unblock-File/, + /Undo-Transaction/, + /Unregister-(Event|PSSessionConfiguration)/, + /Update-(FormatData|Help|List|TypeData)/, + /Use-Transaction/, + /Wait-(Event|Job|Process)/, + /Where-Object/, + /Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/, + /cd|help|mkdir|more|oss|prompt/, + /ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/, + /echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/, + /group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/, + /measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/, + /rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/, + /sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/ + ], { prefix: '', suffix: '' }); + var variableBuiltins = buildRegexp([ + /[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/, + /FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/, + /MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/, + /PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/, + /PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/, + /WarningPreference|WhatIfPreference/, + + /Event|EventArgs|EventSubscriber|Sender/, + /Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/, + /true|false|null/ + ], { prefix: '\\$', suffix: '' }); + + var builtins = buildRegexp([symbolBuiltins, namedBuiltins, variableBuiltins], { suffix: notCharacterOrDash }); + + var grammar = { + keyword: keywords, + number: numbers, + operator: operators, + builtin: builtins, + punctuation: punctuation, + identifier: identifiers + }; + + // tokenizers + function tokenBase(stream, state) { + // Handle Comments + //var ch = stream.peek(); + + var parent = state.returnStack[state.returnStack.length - 1]; + if (parent && parent.shouldReturnFrom(state)) { + state.tokenize = parent.tokenize; + state.returnStack.pop(); + return state.tokenize(stream, state); + } + + if (stream.eatSpace()) { + return null; + } + + if (stream.eat('(')) { + state.bracketNesting += 1; + return 'punctuation'; + } + + if (stream.eat(')')) { + state.bracketNesting -= 1; + return 'punctuation'; + } + + for (var key in grammar) { + if (stream.match(grammar[key])) { + return key; + } + } + + var ch = stream.next(); + + // single-quote string + if (ch === "'") { + return tokenSingleQuoteString(stream, state); + } + + if (ch === '$') { + return tokenVariable(stream, state); + } + + // double-quote string + if (ch === '"') { + return tokenDoubleQuoteString(stream, state); + } + + if (ch === '<' && stream.eat('#')) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + + if (ch === '#') { + stream.skipToEnd(); + return 'comment'; + } + + if (ch === '@') { + var quoteMatch = stream.eat(/["']/); + if (quoteMatch && stream.eol()) { + state.tokenize = tokenMultiString; + state.startQuote = quoteMatch[0]; + return tokenMultiString(stream, state); + } else if (stream.peek().match(/[({]/)) { + return 'punctuation'; + } else if (stream.peek().match(varNames)) { + // splatted variable + return tokenVariable(stream, state); + } + } + return 'error'; + } + + function tokenSingleQuoteString(stream, state) { + var ch; + while ((ch = stream.peek()) != null) { + stream.next(); + + if (ch === "'" && !stream.eat("'")) { + state.tokenize = tokenBase; + return 'string'; + } + } + + return 'error'; + } + + function tokenDoubleQuoteString(stream, state) { + var ch; + while ((ch = stream.peek()) != null) { + if (ch === '$') { + state.tokenize = tokenStringInterpolation; + return 'string'; + } + + stream.next(); + if (ch === '`') { + stream.next(); + continue; + } + + if (ch === '"' && !stream.eat('"')) { + state.tokenize = tokenBase; + return 'string'; + } + } + + return 'error'; + } + + function tokenStringInterpolation(stream, state) { + return tokenInterpolation(stream, state, tokenDoubleQuoteString); + } + + function tokenMultiStringReturn(stream, state) { + state.tokenize = tokenMultiString; + state.startQuote = '"' + return tokenMultiString(stream, state); + } + + function tokenHereStringInterpolation(stream, state) { + return tokenInterpolation(stream, state, tokenMultiStringReturn); + } + + function tokenInterpolation(stream, state, parentTokenize) { + if (stream.match('$(')) { + var savedBracketNesting = state.bracketNesting; + state.returnStack.push({ + /*jshint loopfunc:true */ + shouldReturnFrom: function(state) { + return state.bracketNesting === savedBracketNesting; + }, + tokenize: parentTokenize + }); + state.tokenize = tokenBase; + state.bracketNesting += 1; + return 'punctuation'; + } else { + stream.next(); + state.returnStack.push({ + shouldReturnFrom: function() { return true; }, + tokenize: parentTokenize + }); + state.tokenize = tokenVariable; + return state.tokenize(stream, state); + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == '>') { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch === '#'); + } + return 'comment'; + } + + function tokenVariable(stream, state) { + var ch = stream.peek(); + if (stream.eat('{')) { + state.tokenize = tokenVariableWithBraces; + return tokenVariableWithBraces(stream, state); + } else if (ch != undefined && ch.match(varNames)) { + stream.eatWhile(varNames); + state.tokenize = tokenBase; + return 'variable-2'; + } else { + state.tokenize = tokenBase; + return 'error'; + } + } + + function tokenVariableWithBraces(stream, state) { + var ch; + while ((ch = stream.next()) != null) { + if (ch === '}') { + state.tokenize = tokenBase; + break; + } + } + return 'variable-2'; + } + + function tokenMultiString(stream, state) { + var quote = state.startQuote; + if (stream.sol() && stream.match(new RegExp(quote + '@'))) { + state.tokenize = tokenBase; + } + else if (quote === '"') { + while (!stream.eol()) { + var ch = stream.peek(); + if (ch === '$') { + state.tokenize = tokenHereStringInterpolation; + return 'string'; + } + + stream.next(); + if (ch === '`') { + stream.next(); + } + } + } + else { + stream.skipToEnd(); + } + + return 'string'; + } + + var external = { + startState: function() { + return { + returnStack: [], + bracketNesting: 0, + tokenize: tokenBase + }; + }, + + token: function(stream, state) { + return state.tokenize(stream, state); + }, + + blockCommentStart: '<#', + blockCommentEnd: '#>', + lineComment: '#', + fold: 'brace' + }; + return external; +}); + +CodeMirror.defineMIME('application/x-powershell', 'powershell'); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/properties.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/properties.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/properties.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/properties.js 2018-08-23 17:28:17.000000000 +0000 @@ -34,7 +34,7 @@ } if (sol) { - while(stream.eatSpace()); + while(stream.eatSpace()) {} } var ch = stream.next(); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/protobuf.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/protobuf.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/protobuf.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/protobuf.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,68 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + }; + + var keywordArray = [ + "package", "message", "import", "syntax", + "required", "optional", "repeated", "reserved", "default", "extensions", "packed", + "bool", "bytes", "double", "enum", "float", "string", + "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64" + ]; + var keywords = wordRegexp(keywordArray); + + CodeMirror.registerHelper("hintWords", "protobuf", keywordArray); + + var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); + + function tokenBase(stream) { + // whitespaces + if (stream.eatSpace()) return null; + + // Handle one line Comments + if (stream.match("//")) { + stream.skipToEnd(); + return "comment"; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.+-]/, false)) { + if (stream.match(/^[+-]?0x[0-9a-fA-F]+/)) + return "number"; + if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)) + return "number"; + if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/)) + return "number"; + } + + // Handle Strings + if (stream.match(/^"([^"]|(""))*"/)) { return "string"; } + if (stream.match(/^'([^']|(''))*'/)) { return "string"; } + + // Handle words + if (stream.match(keywords)) { return "keyword"; } + if (stream.match(identifiers)) { return "variable"; } ; + + // Handle non-detected items + stream.next(); + return null; + }; + + CodeMirror.defineMode("protobuf", function() { + return {token: tokenBase}; + }); + + CodeMirror.defineMIME("text/x-protobuf", "protobuf"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/puppet.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/puppet.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/puppet.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/puppet.js 2018-08-23 17:28:17.000000000 +0000 @@ -126,7 +126,7 @@ if (word && words.hasOwnProperty(word)) { // Negates the initial next() stream.backUp(1); - // Acutally move the stream + // rs move the stream stream.match(/[\w]+/); // We want to process these words differently // do to the importance they have in Puppet diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/python.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/python.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/python.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/python.js 2018-08-23 17:28:17.000000000 +0000 @@ -32,13 +32,6 @@ "sorted", "staticmethod", "str", "sum", "super", "tuple", "type", "vars", "zip", "__import__", "NotImplemented", "Ellipsis", "__debug__"]; - var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile", - "file", "intern", "long", "raw_input", "reduce", "reload", - "unichr", "unicode", "xrange", "False", "True", "None"], - keywords: ["exec", "print"]}; - var py3 = {builtins: ["ascii", "bytes", "exec", "print"], - keywords: ["nonlocal", "False", "True", "None", "async", "await"]}; - CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins)); function top(state) { @@ -48,36 +41,35 @@ CodeMirror.defineMode("python", function(conf, parserConf) { var ERRORCLASS = "error"; - var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"); - var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - - if (parserConf.version && parseInt(parserConf.version, 10) == 3){ - // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); - } else { - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - } + var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/; + var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/; + var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/; + var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/; var hangingIndent = parserConf.hangingIndent || conf.indentUnit; var myKeywords = commonKeywords, myBuiltins = commonBuiltins; - if(parserConf.extra_keywords != undefined){ + if (parserConf.extra_keywords != undefined) myKeywords = myKeywords.concat(parserConf.extra_keywords); - } - if(parserConf.extra_builtins != undefined){ + + if (parserConf.extra_builtins != undefined) myBuiltins = myBuiltins.concat(parserConf.extra_builtins); - } - if (parserConf.version && parseInt(parserConf.version, 10) == 3) { - myKeywords = myKeywords.concat(py3.keywords); - myBuiltins = myBuiltins.concat(py3.builtins); - var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); + + var py3 = parserConf.version && parseInt(parserConf.version, 10) == 3 + if (py3) { + // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator + var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/; + var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/; + myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]); + myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]); + var stringPrefixes = new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))", "i"); } else { - myKeywords = myKeywords.concat(py2.keywords); - myBuiltins = myBuiltins.concat(py2.builtins); + var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/; + var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/; + myKeywords = myKeywords.concat(["exec", "print"]); + myBuiltins = myBuiltins.concat(["apply", "basestring", "buffer", "cmp", "coerce", "execfile", + "file", "intern", "long", "raw_input", "reduce", "reload", + "unichr", "unicode", "xrange", "False", "True", "None"]); var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); } var keywords = wordRegexp(myKeywords); @@ -85,13 +77,14 @@ // tokenizers function tokenBase(stream, state) { + if (stream.sol()) state.indent = stream.indentation() // Handle scope changes if (stream.sol() && top(state).type == "py") { var scopeOffset = top(state).offset; if (stream.eatSpace()) { var lineOffset = stream.indentation(); if (lineOffset > scopeOffset) - pushScope(stream, state, "py"); + pushPyScope(state); else if (lineOffset < scopeOffset && dedent(stream, state)) state.errorToken = true; return null; @@ -160,13 +153,16 @@ // Handle operators and Delimiters if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) - return null; + return "punctuation"; if (stream.match(doubleOperators) || stream.match(singleOperators)) return "operator"; if (stream.match(singleDelimiters)) - return null; + return "punctuation"; + + if (state.lastToken == "." && stream.match(identifiers)) + return "property"; if (stream.match(keywords) || stream.match(wordOperators)) return "keyword"; @@ -221,16 +217,18 @@ return tokenString; } - function pushScope(stream, state, type) { - var offset = 0, align = null; - if (type == "py") { - while (top(state).type != "py") - state.scopes.pop(); - } - offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent); - if (type != "py" && !stream.match(/^(\s|#.*)*$/, false)) - align = stream.column() + 1; - state.scopes.push({offset: offset, type: type, align: align}); + function pushPyScope(state) { + while (top(state).type != "py") state.scopes.pop() + state.scopes.push({offset: top(state).offset + conf.indentUnit, + type: "py", + align: null}) + } + + function pushBracketScope(stream, state, type) { + var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1 + state.scopes.push({offset: state.indent + hangingIndent, + type: type, + align: align}) } function dedent(stream, state) { @@ -243,31 +241,19 @@ } function tokenLexer(stream, state) { + if (stream.sol()) state.beginningOfLine = true; + var style = state.tokenize(stream, state); var current = stream.current(); - // Handle '.' connected identifiers - if (current == ".") { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style == null && state.lastStyle == "meta") { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = "meta"; - } - return style; - } - // Handle decorators - if (current == "@"){ - if(parserConf.version && parseInt(parserConf.version, 10) == 3){ - return stream.match(identifiers, false) ? "meta" : "operator"; - } else { - return stream.match(identifiers, false) ? "meta" : ERRORCLASS; - } - } + if (state.beginningOfLine && current == "@") + return stream.match(identifiers, false) ? "meta" : py3 ? "operator" : ERRORCLASS; + + if (/\S/.test(current)) state.beginningOfLine = false; if ((style == "variable" || style == "builtin") - && state.lastStyle == "meta") + && state.lastToken == "meta") style = "meta"; // Handle scope changes. @@ -276,15 +262,15 @@ if (current == "lambda") state.lambda = true; if (current == ":" && !state.lambda && top(state).type == "py") - pushScope(stream, state, "py"); + pushPyScope(state); var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; if (delimiter_index != -1) - pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); + pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); delimiter_index = "])}".indexOf(current); if (delimiter_index != -1) { - if (top(state).type == current) state.scopes.pop(); + if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent else return ERRORCLASS; } if (state.dedent > 0 && stream.eol() && top(state).type == "py") { @@ -300,7 +286,7 @@ return { tokenize: tokenBase, scopes: [{offset: basecolumn || 0, type: "py", align: null}], - lastStyle: null, + indent: basecolumn || 0, lastToken: null, lambda: false, dedent: 0 @@ -312,11 +298,9 @@ if (addErr) state.errorToken = false; var style = tokenLexer(stream, state); - state.lastStyle = style; - - var current = stream.current(); - if (current && style) - state.lastToken = current; + if (style && style != "comment") + state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style; + if (style == "punctuation") style = null; if (stream.eol() && state.lambda) state.lambda = false; @@ -327,16 +311,14 @@ if (state.tokenize != tokenBase) return state.tokenize.isString ? CodeMirror.Pass : 0; - var scope = top(state); - var closing = textAfter && textAfter.charAt(0) == scope.type; + var scope = top(state), closing = scope.type == textAfter.charAt(0) if (scope.align != null) - return scope.align - (closing ? 1 : 0); - else if (closing && state.scopes.length > 1) - return state.scopes[state.scopes.length - 2].offset; + return scope.align - (closing ? 1 : 0) else - return scope.offset; + return scope.offset - (closing ? hangingIndent : 0) }, + electricInput: /^\s*[\}\]\)]$/, closeBrackets: {triples: "'\""}, lineComment: "#", fold: "indent" diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/r.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/r.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/r.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/r.js 2018-08-23 17:28:17.000000000 +0000 @@ -11,6 +11,8 @@ })(function(CodeMirror) { "use strict"; +CodeMirror.registerHelper("wordChars", "r", /[\w.]/); + CodeMirror.defineMode("r", function(config) { function wordObj(str) { var words = str.split(" "), res = {}; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/rpm.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/rpm.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/rpm.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/rpm.js 2018-08-23 17:28:17.000000000 +0000 @@ -34,10 +34,10 @@ // Quick and dirty spec file highlighting CodeMirror.defineMode("rpm-spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; + var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; + var preamble = /^[a-zA-Z0-9()]+:/; + var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/; var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros var control_flow_simple = /^%(else|endif)/; // rpm control flow macros var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros @@ -55,8 +55,8 @@ if (ch == "#") { stream.skipToEnd(); return "comment"; } if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } + if (stream.match(preamble)) { return "header"; } + if (stream.match(section)) { return "atom"; } } if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' @@ -73,21 +73,29 @@ if (stream.eol()) { state.controlFlow = false; } } - if (stream.match(arch)) { return "number"; } + if (stream.match(arch)) { + if (stream.eol()) { state.controlFlow = false; } + return "number"; + } // Macros like '%make_install' or '%attr(0775,root,root)' if (stream.match(/^%[\w]+/)) { if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; + return "keyword"; } if (state.macroParameters) { if (stream.match(/^\d+/)) { return "number";} if (stream.match(/^\)/)) { state.macroParameters = false; - return "macro"; + return "keyword"; } } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' + + // Macros like '%{defined fedora}' + if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) { + if (stream.eol()) { state.controlFlow = false; } + return "def"; + } //TODO: Include bash script sub-parser (CodeMirror supports that) stream.next(); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/ruby.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/ruby.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/ruby.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/ruby.js 2018-08-23 17:28:17.000000000 +0000 @@ -25,7 +25,7 @@ "caller", "lambda", "proc", "public", "protected", "private", "require", "load", "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then", + var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then", "catch", "loop", "proc", "begin"]); var dedentWords = wordObj(["end", "until"]); var matching = {"[": "]", "{": "}", "(": ")"}; @@ -275,7 +275,7 @@ (state.continuedLine ? config.indentUnit : 0); }, - electricChars: "}de", // enD and rescuE + electricInput: /^\s*(?:end|rescue|\})$/, lineComment: "#" }; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/rust.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/rust.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/rust.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/rust.js 2018-08-23 17:28:17.000000000 +0000 @@ -12,11 +12,12 @@ "use strict"; CodeMirror.defineSimpleMode("rust",{ - start:[ + start: [ // string and byte string - {regex: /b?"(?:[^\\]|\\.)*?"/, token: "string"}, + {regex: /b?"/, token: "string", next: "string"}, // raw string and raw byte string - {regex: /(b?r)(#*)(".*?)("\2)/, token: ["string", "string", "string", "string"]}, + {regex: /b?r"/, token: "string", next: "string_raw"}, + {regex: /b?r#+"/, token: "string", next: "string_raw_hash"}, // character {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"}, // byte @@ -39,6 +40,18 @@ {regex: /[\{\[\(]/, indent: true}, {regex: /[\}\]\)]/, dedent: true} ], + string: [ + {regex: /"/, token: "string", next: "start"}, + {regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"} + ], + string_raw: [ + {regex: /"/, token: "string", next: "start"}, + {regex: /[^"]*/, token: "string"} + ], + string_raw_hash: [ + {regex: /"#+/, token: "string", next: "start"}, + {regex: /(?:[^"]|"(?!#))*/, token: "string"} + ], comment: [ {regex: /.*?\*\//, token: "comment", next: "start"}, {regex: /.*/, token: "comment"} diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/sas.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/sas.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/sas.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/sas.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,315 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + + +// SAS mode copyright (c) 2016 Jared Dean, SAS Institute +// Created by Jared Dean + +// TODO +// indent and de-indent +// identify macro variables + + +//Definitions +// comment -- text withing * ; or /* */ +// keyword -- SAS language variable +// variable -- macro variables starts with '&' or variable formats +// variable-2 -- DATA Step, proc, or macro names +// string -- text within ' ' or " " +// operator -- numeric operator + / - * ** le eq ge ... and so on +// builtin -- proc %macro data run mend +// atom +// def + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("sas", function () { + var words = {}; + var isDoubleOperatorSym = { + eq: 'operator', + lt: 'operator', + le: 'operator', + gt: 'operator', + ge: 'operator', + "in": 'operator', + ne: 'operator', + or: 'operator' + }; + var isDoubleOperatorChar = /(<=|>=|!=|<>)/; + var isSingleOperatorChar = /[=\(:\),{}.*<>+\-\/^\[\]]/; + + // Takes a string of words separated by spaces and adds them as + // keys with the value of the first argument 'style' + function define(style, string, context) { + if (context) { + var split = string.split(' '); + for (var i = 0; i < split.length; i++) { + words[split[i]] = {style: style, state: context}; + } + } + } + //datastep + define('def', 'stack pgm view source debug nesting nolist', ['inDataStep']); + define('def', 'if while until for do do; end end; then else cancel', ['inDataStep']); + define('def', 'label format _n_ _error_', ['inDataStep']); + define('def', 'ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME', ['inDataStep']); + define('def', 'filevar finfo finv fipname fipnamel fipstate first firstobs floor', ['inDataStep']); + define('def', 'varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday', ['inDataStep']); + define('def', 'zipfips zipname zipnamel zipstate', ['inDataStep']); + define('def', 'put putc putn', ['inDataStep']); + define('builtin', 'data run', ['inDataStep']); + + + //proc + define('def', 'data', ['inProc']); + + // flow control for macros + define('def', '%if %end %end; %else %else; %do %do; %then', ['inMacro']); + + //everywhere + define('builtin', 'proc run; quit; libname filename %macro %mend option options', ['ALL']); + + define('def', 'footnote title libname ods', ['ALL']); + define('def', '%let %put %global %sysfunc %eval ', ['ALL']); + // automatic macro variables http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003167023.htm + define('variable', '&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext', ['ALL']); + + //footnote[1-9]? title[1-9]? + + //options statement + define('def', 'source2 nosource2 page pageno pagesize', ['ALL']); + + //proc and datastep + define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']); + define('operator', 'and not ', ['inDataStep', 'inProc']); + + // Main function + function tokenize(stream, state) { + // Finally advance the stream + var ch = stream.next(); + + // BLOCKCOMMENT + if (ch === '/' && stream.eat('*')) { + state.continueComment = true; + return "comment"; + } else if (state.continueComment === true) { // in comment block + //comment ends at the beginning of the line + if (ch === '*' && stream.peek() === '/') { + stream.next(); + state.continueComment = false; + } else if (stream.skipTo('*')) { //comment is potentially later in line + stream.skipTo('*'); + stream.next(); + if (stream.eat('/')) + state.continueComment = false; + } else { + stream.skipToEnd(); + } + return "comment"; + } + + // DoubleOperator match + var doubleOperator = ch + stream.peek(); + + // Match all line comments. + var myString = stream.string; + var myRegexp = /(?:^\s*|[;]\s*)(\*.*?);/ig; + var match = myRegexp.exec(myString); + if (match !== null) { + if (match.index === 0 && (stream.column() !== (match.index + match[0].length - 1))) { + stream.backUp(stream.column()); + stream.skipTo(';'); + stream.next(); + return 'comment'; + } else if (match.index + 1 < stream.column() && stream.column() < match.index + match[0].length - 1) { + // the ';' triggers the match so move one past it to start + // the comment block that is why match.index+1 + stream.backUp(stream.column() - match.index - 1); + stream.skipTo(';'); + stream.next(); + return 'comment'; + } + } else if (!state.continueString && (ch === '"' || ch === "'")) { + // Have we found a string? + state.continueString = ch; //save the matching quote in the state + return "string"; + } else if (state.continueString !== null) { + if (stream.skipTo(state.continueString)) { + // quote found on this line + stream.next(); + state.continueString = null; + } else { + stream.skipToEnd(); + } + return "string"; + } else if (state.continueString !== null && stream.eol()) { + stream.skipTo(state.continueString) || stream.skipToEnd(); + return "string"; + } else if (/[\d\.]/.test(ch)) { //find numbers + if (ch === ".") + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + else if (ch === "0") + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + else + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + return "number"; + } else if (isDoubleOperatorChar.test(ch + stream.peek())) { // TWO SYMBOL TOKENS + stream.next(); + return "operator"; + } else if (isDoubleOperatorSym.hasOwnProperty(doubleOperator)) { + stream.next(); + if (stream.peek() === ' ') + return isDoubleOperatorSym[doubleOperator.toLowerCase()]; + } else if (isSingleOperatorChar.test(ch)) { // SINGLE SYMBOL TOKENS + return "operator"; + } + + // Matches one whole word -- even if the word is a character + var word; + if (stream.match(/[%&;\w]+/, false) != null) { + word = ch + stream.match(/[%&;\w]+/, true); + if (/&/.test(word)) return 'variable' + } else { + word = ch; + } + // the word after DATA PROC or MACRO + if (state.nextword) { + stream.match(/[\w]+/); + // match memname.libname + if (stream.peek() === '.') stream.skipTo(' '); + state.nextword = false; + return 'variable-2'; + + } + + // Are we in a DATA Step? + if (state.inDataStep) { + if (word.toLowerCase() === 'run;' || stream.match(/run\s;/)) { + state.inDataStep = false; + return 'builtin'; + } + // variable formats + if ((word) && stream.next() === '.') { + //either a format or libname.memname + if (/\w/.test(stream.peek())) return 'variable-2'; + else return 'variable'; + } + // do we have a DATA Step keyword + if (word && words.hasOwnProperty(word.toLowerCase()) && + (words[word.toLowerCase()].state.indexOf("inDataStep") !== -1 || + words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { + //backup to the start of the word + if (stream.start < stream.pos) + stream.backUp(stream.pos - stream.start); + //advance the length of the word and return + for (var i = 0; i < word.length; ++i) stream.next(); + return words[word.toLowerCase()].style; + } + } + // Are we in an Proc statement? + if (state.inProc) { + if (word.toLowerCase() === 'run;' || word.toLowerCase() === 'quit;') { + state.inProc = false; + return 'builtin'; + } + // do we have a proc keyword + if (word && words.hasOwnProperty(word.toLowerCase()) && + (words[word.toLowerCase()].state.indexOf("inProc") !== -1 || + words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { + stream.match(/[\w]+/); + return words[word].style; + } + } + // Are we in a Macro statement? + if (state.inMacro) { + if (word.toLowerCase() === '%mend') { + if (stream.peek() === ';') stream.next(); + state.inMacro = false; + return 'builtin'; + } + if (word && words.hasOwnProperty(word.toLowerCase()) && + (words[word.toLowerCase()].state.indexOf("inMacro") !== -1 || + words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { + stream.match(/[\w]+/); + return words[word.toLowerCase()].style; + } + + return 'atom'; + } + // Do we have Keywords specific words? + if (word && words.hasOwnProperty(word.toLowerCase())) { + // Negates the initial next() + stream.backUp(1); + // Actually move the stream + stream.match(/[\w]+/); + if (word.toLowerCase() === 'data' && /=/.test(stream.peek()) === false) { + state.inDataStep = true; + state.nextword = true; + return 'builtin'; + } + if (word.toLowerCase() === 'proc') { + state.inProc = true; + state.nextword = true; + return 'builtin'; + } + if (word.toLowerCase() === '%macro') { + state.inMacro = true; + state.nextword = true; + return 'builtin'; + } + if (/title[1-9]/i.test(word)) return 'def'; + + if (word.toLowerCase() === 'footnote') { + stream.eat(/[1-9]/); + return 'def'; + } + + // Returns their value as state in the prior define methods + if (state.inDataStep === true && words[word.toLowerCase()].state.indexOf("inDataStep") !== -1) + return words[word.toLowerCase()].style; + if (state.inProc === true && words[word.toLowerCase()].state.indexOf("inProc") !== -1) + return words[word.toLowerCase()].style; + if (state.inMacro === true && words[word.toLowerCase()].state.indexOf("inMacro") !== -1) + return words[word.toLowerCase()].style; + if (words[word.toLowerCase()].state.indexOf("ALL") !== -1) + return words[word.toLowerCase()].style; + return null; + } + // Unrecognized syntax + return null; + } + + return { + startState: function () { + return { + inDataStep: false, + inProc: false, + inMacro: false, + nextword: false, + continueString: null, + continueComment: false + }; + }, + token: function (stream, state) { + // Strip the spaces, but regex will account for them either way + if (stream.eatSpace()) return null; + // Go through the main process + return tokenize(stream, state); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; + + }); + + CodeMirror.defineMIME("text/x-sas", "sas"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/slim.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/slim.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/slim.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/slim.js 2018-08-23 17:28:17.000000000 +0000 @@ -165,7 +165,7 @@ }; return function(stream, state) { rubyState = state.rubyState; - state.rubyState = rubyMode.startState(); + state.rubyState = CodeMirror.startState(rubyMode); state.tokenize = runSplat; return ruby(stream, state); }; @@ -317,7 +317,7 @@ function startSubMode(mode, state) { var subMode = getMode(mode); - var subState = subMode.startState && subMode.startState(); + var subState = CodeMirror.startState(subMode); state.subMode = subMode; state.subState = subState; @@ -507,8 +507,8 @@ var mode = { // default to html mode startState: function() { - var htmlState = htmlMode.startState(); - var rubyState = rubyMode.startState(); + var htmlState = CodeMirror.startState(htmlMode); + var rubyState = CodeMirror.startState(rubyMode); return { htmlState: htmlState, rubyState: rubyState, diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/soy.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/soy.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/soy.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/soy.js 2018-08-23 17:28:17.000000000 +0000 @@ -121,10 +121,11 @@ return tokenUntil(stream, state, /\{\/literal}/); case "string": - if (stream.match(/^.*?"/)) { - state.soyState.pop(); - } else { + var match = stream.match(/^.*?("|\\[\s\S])/); + if (!match) { stream.skipToEnd(); + } else if (match[1] == "\"") { + state.soyState.pop(); } return "string"; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/sparql.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/sparql.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/sparql.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/sparql.js 2018-08-23 17:28:17.000000000 +0000 @@ -25,7 +25,7 @@ "strbefore", "strafter", "year", "month", "day", "hours", "minutes", "seconds", "timezone", "tz", "now", "uuid", "struuid", "md5", "sha1", "sha256", "sha384", "sha512", "coalesce", "if", "strlang", "strdt", "isnumeric", "regex", "exists", - "isblank", "isliteral", "a"]); + "isblank", "isliteral", "a", "bind"]); var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", "graph", "by", "asc", "desc", "as", "having", "undef", "values", "group", @@ -135,7 +135,11 @@ else if (curPunc == "{") pushContext(state, "}", stream.column()); else if (/[\]\}\)]/.test(curPunc)) { while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); + if (state.context && curPunc == state.context.type) { + popContext(state); + if (curPunc == "}" && state.context && state.context.type == "pattern") + popContext(state); + } } else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); else if (/atom|string|variable/.test(style) && state.context) { @@ -165,7 +169,9 @@ return context.col + (closing ? 0 : 1); else return context.indent + (closing ? 0 : indentUnit); - } + }, + + lineComment: "#" }; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/spreadsheet.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/spreadsheet.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/spreadsheet.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/spreadsheet.js 2018-08-23 17:28:17.000000000 +0000 @@ -70,7 +70,10 @@ return "operator"; case "\\": if (stream.match(/\\[a-z]+/)) return "string-2"; - else return null; + else { + stream.next(); + return "atom"; + } case ".": case ",": case ";": diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/sql.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/sql.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/sql.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/sql.js 2018-08-23 17:28:17.000000000 +0000 @@ -65,7 +65,7 @@ // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html return "keyword"; } else if (/^[\(\),\;\[\]]/.test(ch)) { - // no highlightning + // no highlighting return null; } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { // 1-line comment @@ -257,7 +257,7 @@ } // these keywords are used by all SQL dialects (however, a mode can still overwrite it) - var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where "; + var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit "; // turn a space-separated list into an array function set(str) { @@ -341,7 +341,7 @@ name: "sql", client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), - builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), + builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), operatorChars: /^[*+\-%<>!=~]/, dateSQL: set("date time timestamp"), support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") @@ -357,6 +357,28 @@ dateSQL: set("date timestamp"), support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") }); + + CodeMirror.defineMIME("text/x-pgsql", { + name: "sql", + client: set("source"), + // http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html + keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"), + // http://www.postgresql.org/docs/9.5/static/datatype.html + builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast") + }); + + // Google's SQL-like query language, GQL + CodeMirror.defineMIME("text/x-gql", { + name: "sql", + keywords: set("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"), + atoms: set("false true"), + builtin: set("blob datetime first key __key__ string integer double boolean null"), + operatorChars: /^[*+\-%<>!=]/ + }); }()); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/swift.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/swift.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/swift.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/swift.js 2018-08-23 17:28:17.000000000 +0000 @@ -13,191 +13,190 @@ })(function(CodeMirror) { "use strict" - function trim(str) { return /^\s*(.*?)\s*$/.exec(str)[1] } + function wordSet(words) { + var set = {} + for (var i = 0; i < words.length; i++) set[words[i]] = true + return set + } + + var keywords = wordSet(["var","let","class","deinit","enum","extension","func","import","init","protocol", + "static","struct","subscript","typealias","as","dynamicType","is","new","super", + "self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case", + "continue","default","do","else","fallthrough","if","in","for","return","switch", + "where","while","associativity","didSet","get","infix","inout","left","mutating", + "none","nonmutating","operator","override","postfix","precedence","prefix","right", + "set","unowned","weak","willSet"]) + var definingKeywords = wordSet(["var","let","class","enum","extension","func","import","protocol","struct", + "typealias","dynamicType","for"]) + var atoms = wordSet(["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null", + "this","super"]) + var types = wordSet(["String","bool","int","string","double","Double","Int","Float","float","public", + "private","extension"]) + var operators = "+-/*%=|&<>#" + var punc = ";,.(){}[]" + var number = /^-?(?:(?:[\d_]+\.[_\d]*|\.[_\d]+|0o[0-7_\.]+|0b[01_\.]+)(?:e-?[\d_]+)?|0x[\d_a-f\.]+(?:p-?[\d_]+)?)/i + var identifier = /^[_A-Za-z$][_A-Za-z$0-9]*/ + var property = /^[@\.][_A-Za-z$][_A-Za-z$0-9]*/ + var regexp = /^\/(?!\s)(?:\/\/)?(?:\\.|[^\/])+\// + + function tokenBase(stream, state, prev) { + if (stream.sol()) state.indented = stream.indentation() + if (stream.eatSpace()) return null + + var ch = stream.peek() + if (ch == "/") { + if (stream.match("//")) { + stream.skipToEnd() + return "comment" + } + if (stream.match("/*")) { + state.tokenize.push(tokenComment) + return tokenComment(stream, state) + } + if (stream.match(regexp)) return "string-2" + } + if (operators.indexOf(ch) > -1) { + stream.next() + return "operator" + } + if (punc.indexOf(ch) > -1) { + stream.next() + stream.match("..") + return "punctuation" + } + if (ch == '"' || ch == "'") { + stream.next() + var tokenize = tokenString(ch) + state.tokenize.push(tokenize) + return tokenize(stream, state) + } + + if (stream.match(number)) return "number" + if (stream.match(property)) return "property" + + if (stream.match(identifier)) { + var ident = stream.current() + if (keywords.hasOwnProperty(ident)) { + if (definingKeywords.hasOwnProperty(ident)) + state.prev = "define" + return "keyword" + } + if (types.hasOwnProperty(ident)) return "variable-2" + if (atoms.hasOwnProperty(ident)) return "atom" + if (prev == "define") return "def" + return "variable" + } + + stream.next() + return null + } - var separators = [" ","\\\+","\\\-","\\\(","\\\)","\\\*","/",":","\\\?","\\\<","\\\>"," ","\\\."] - var tokens = new RegExp(separators.join("|"),"g") + function tokenUntilClosingParen() { + var depth = 0 + return function(stream, state, prev) { + var inner = tokenBase(stream, state, prev) + if (inner == "punctuation") { + if (stream.current() == "(") ++depth + else if (stream.current() == ")") { + if (depth == 0) { + stream.backUp(1) + state.tokenize.pop() + return state.tokenize[state.tokenize.length - 1](stream, state) + } + else --depth + } + } + return inner + } + } - function getWord(string, pos) { - var index = -1, count = 1 - var words = string.split(tokens) - for (var i = 0; i < words.length; i++) { - for(var j = 1; j <= words[i].length; j++) { - if (count==pos) index = i - count++ + function tokenString(quote) { + return function(stream, state) { + var ch, escaped = false + while (ch = stream.next()) { + if (escaped) { + if (ch == "(") { + state.tokenize.push(tokenUntilClosingParen()) + return "string" + } + escaped = false + } else if (ch == quote) { + break + } else { + escaped = ch == "\\" + } } - count++ + state.tokenize.pop() + return "string" + } + } + + function tokenComment(stream, state) { + stream.match(/^(?:[^*]|\*(?!\/))*/) + if (stream.match("*/")) state.tokenize.pop() + return "comment" + } + + function Context(prev, align, indented) { + this.prev = prev + this.align = align + this.indented = indented + } + + function pushContext(state, stream) { + var align = stream.match(/^\s*($|\/[\/\*])/, false) ? null : stream.column() + 1 + state.context = new Context(state.context, align, state.indented) + } + + function popContext(state) { + if (state.context) { + state.indented = state.context.indented + state.context = state.context.prev } - var ret = ["", ""] - if (pos == 0) { - ret[1] = words[0] - ret[0] = null - } else { - ret[1] = words[index] - ret[0] = words[index-1] - } - return ret - } - - CodeMirror.defineMode("swift", function() { - var keywords=["var","let","class","deinit","enum","extension","func","import","init","let","protocol","static","struct","subscript","typealias","var","as","dynamicType","is","new","super","self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case","continue","default","do","else","fallthrough","if","in","for","return","switch","where","while","associativity","didSet","get","infix","inout","left","mutating","none","nonmutating","operator","override","postfix","precedence","prefix","right","set","unowned","unowned(safe)","unowned(unsafe)","weak","willSet"] - var commonConstants=["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null","this","super"] - var types=["String","bool","int","string","double","Double","Int","Float","float","public","private","extension"] - var numbers=["0","1","2","3","4","5","6","7","8","9"] - var operators=["+","-","/","*","%","=","|","&","<",">"] - var punc=[";",",",".","(",")","{","}","[","]"] - var delimiters=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/ - var identifiers=/^[_A-Za-z$][_A-Za-z$0-9]*/ - var properties=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/ - var regexPrefixes=/^(\/{3}|\/)/ + } + CodeMirror.defineMode("swift", function(config) { return { startState: function() { return { - prev: false, - string: false, - escape: false, - inner: false, - comment: false, - num_left: 0, - num_right: 0, - doubleString: false, - singleString: false + prev: null, + context: null, + indented: 0, + tokenize: [] } }, + token: function(stream, state) { - if (stream.eatSpace()) return null + var prev = state.prev + state.prev = null + var tokenize = state.tokenize[state.tokenize.length - 1] || tokenBase + var style = tokenize(stream, state, prev) + if (!style || style == "comment") state.prev = prev + else if (!state.prev) state.prev = style + + if (style == "punctuation") { + var bracket = /[\(\[\{]|([\]\)\}])/.exec(stream.current()) + if (bracket) (bracket[1] ? popContext : pushContext)(state, stream) + } - var ch = stream.next() - if (state.string) { - if (state.escape) { - state.escape = false - return "string" - } else { - if ((ch == "\"" && (state.doubleString && !state.singleString) || - (ch == "'" && (!state.doubleString && state.singleString))) && - !state.escape) { - state.string = false - state.doubleString = false - state.singleString = false - return "string" - } else if (ch == "\\" && stream.peek() == "(") { - state.inner = true - state.string = false - return "keyword" - } else if (ch == "\\" && stream.peek() != "(") { - state.escape = true - state.string = true - return "string" - } else { - return "string" - } - } - } else if (state.comment) { - if (ch == "*" && stream.peek() == "/") { - state.prev = "*" - return "comment" - } else if (ch == "/" && state.prev == "*") { - state.prev = false - state.comment = false - return "comment" - } - return "comment" - } else { - if (ch == "/") { - if (stream.peek() == "/") { - stream.skipToEnd() - return "comment" - } - if (stream.peek() == "*") { - state.comment = true - return "comment" - } - } - if (ch == "(" && state.inner) { - state.num_left++ - return null - } - if (ch == ")" && state.inner) { - state.num_right++ - if (state.num_left == state.num_right) { - state.inner=false - state.string=true - } - return null - } + return style + }, - var ret = getWord(stream.string, stream.pos) - var the_word = ret[1] - var prev_word = ret[0] - - if (operators.indexOf(ch + "") > -1) return "operator" - if (punc.indexOf(ch) > -1) return "punctuation" - - if (typeof the_word != "undefined") { - the_word = trim(the_word) - if (typeof prev_word != "undefined") prev_word = trim(prev_word) - if (the_word.charAt(0) == "#") return null - - if (types.indexOf(the_word) > -1) return "def" - if (commonConstants.indexOf(the_word) > -1) return "atom" - if (numbers.indexOf(the_word) > -1) return "number" - - if ((numbers.indexOf(the_word.charAt(0) + "") > -1 || - operators.indexOf(the_word.charAt(0) + "") > -1) && - numbers.indexOf(ch) > -1) { - return "number" - } - - if (keywords.indexOf(the_word) > -1 || - keywords.indexOf(the_word.split(tokens)[0]) > -1) - return "keyword" - if (keywords.indexOf(prev_word) > -1) return "def" - } - if (ch == '"' && !state.doubleString) { - state.string = true - state.doubleString = true - return "string" - } - if (ch == "'" && !state.singleString) { - state.string = true - state.singleString = true - return "string" - } - if (ch == "(" && state.inner) - state.num_left++ - if (ch == ")" && state.inner) { - state.num_right++ - if (state.num_left == state.num_right) { - state.inner = false - state.string = true - } - return null - } - if (stream.match(/^-?[0-9\.]/, false)) { - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) || - stream.match(/^-?\d+\.\d*/) || - stream.match(/^-?\.\d+/)) { - if (stream.peek() == ".") stream.backUp(1) - return "number" - } - if (stream.match(/^-?0x[0-9a-f]+/i) || - stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) || - stream.match(/^-?0(?![\dx])/i)) - return "number" - } - if (stream.match(regexPrefixes)) { - if (stream.current()!="/" || stream.match(/^.*\//,false)) return "string" - else stream.backUp(1) - } - if (stream.match(delimiters)) return "punctuation" - if (stream.match(identifiers)) return "variable" - if (stream.match(properties)) return "property" - return "variable" - } - } + indent: function(state, textAfter) { + var cx = state.context + if (!cx) return 0 + var closing = /^[\]\}\)]/.test(textAfter) + if (cx.align != null) return cx.align - (closing ? 1 : 0) + return cx.indented + (closing ? 0 : config.indentUnit) + }, + + electricInput: /^\s*[\)\}\]]$/, + + lineComment: "//", + blockCommentStart: "/*", + blockCommentEnd: "*/" } }) CodeMirror.defineMIME("text/x-swift","swift") -}) +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/tcl.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/tcl.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/tcl.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/tcl.js 2018-08-23 17:28:17.000000000 +0000 @@ -42,42 +42,34 @@ var beforeParams = state.beforeParams; state.beforeParams = false; var ch = stream.next(); - if ((ch == '"' || ch == "'") && state.inParams) + if ((ch == '"' || ch == "'") && state.inParams) { return chain(stream, state, tokenString(ch)); - else if (/[\[\]{}\(\),;\.]/.test(ch)) { + } else if (/[\[\]{}\(\),;\.]/.test(ch)) { if (ch == "(" && beforeParams) state.inParams = true; else if (ch == ")") state.inParams = false; return null; - } - else if (/\d/.test(ch)) { + } else if (/\d/.test(ch)) { stream.eatWhile(/[\w\.]/); return "number"; - } - else if (ch == "#" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - return chain(stream, state, tokenUnparsed); - } - else if (ch == "#" && stream.eat("#")) { + } else if (ch == "#") { + if (stream.eat("*")) + return chain(stream, state, tokenComment); + if (ch == "#" && stream.match(/ *\[ *\[/)) + return chain(stream, state, tokenUnparsed); stream.skipToEnd(); return "comment"; - } - else if (ch == '"') { + } else if (ch == '"') { stream.skipTo(/"/); return "comment"; - } - else if (ch == "$") { + } else if (ch == "$") { stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); stream.eatWhile(/}/); state.beforeParams = true; return "builtin"; - } - else if (isOperatorChar.test(ch)) { + } else if (isOperatorChar.test(ch)) { stream.eatWhile(isOperatorChar); return "comment"; - } - else { + } else { stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); var word = stream.current().toLowerCase(); if (keywords && keywords.propertyIsEnumerable(word)) diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js 2018-08-23 17:28:17.000000000 +0000 @@ -16,7 +16,6 @@ ! Info CoreVersion parameter is needed for TiddlyWiki only! ***/ -//{{{ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS @@ -32,73 +31,60 @@ // Tokenizer var textwords = {}; - var keywords = function () { - function kw(type) { - return { type: type, style: "macro"}; - } - return { - "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), - "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), - "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), - "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), - "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), - "tiddler": kw('tiddler'), "timeline": kw('timeline'), - "today": kw('today'), "version": kw('version'), "option": kw('option'), - - "with": kw('with'), - "filter": kw('filter') - }; - }(); + var keywords = { + "allTags": true, "closeAll": true, "list": true, + "newJournal": true, "newTiddler": true, + "permaview": true, "saveChanges": true, + "search": true, "slider": true, "tabs": true, + "tag": true, "tagging": true, "tags": true, + "tiddler": true, "timeline": true, + "today": true, "version": true, "option": true, + "with": true, "filter": true + }; var isSpaceName = /[\w_\-]/i, - reHR = /^\-\-\-\-+$/, //
- reWikiCommentStart = /^\/\*\*\*$/, // /*** - reWikiCommentStop = /^\*\*\*\/$/, // ***/ - reBlockQuote = /^<<<$/, - - reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start - reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop - reXmlCodeStart = /^$/, // xml block start - reXmlCodeStop = /^$/, // xml stop + reHR = /^\-\-\-\-+$/, //
+ reWikiCommentStart = /^\/\*\*\*$/, // /*** + reWikiCommentStop = /^\*\*\*\/$/, // ***/ + reBlockQuote = /^<<<$/, + + reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start + reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop + reXmlCodeStart = /^$/, // xml block start + reXmlCodeStop = /^$/, // xml stop - reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start - reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop + reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start + reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop - reUntilCodeStop = /.*?\}\}\}/; + reUntilCodeStop = /.*?\}\}\}/; function chain(stream, state, f) { state.tokenize = f; return f(stream, state); } - function jsTokenBase(stream, state) { - var sol = stream.sol(), ch; + function tokenBase(stream, state) { + var sol = stream.sol(), ch = stream.peek(); state.block = false; // indicates the start of a code block. - ch = stream.peek(); // don't eat, to make matching simpler - // check start of blocks if (sol && /[<\/\*{}\-]/.test(ch)) { if (stream.match(reCodeBlockStart)) { state.block = true; return chain(stream, state, twTokenCode); } - if (stream.match(reBlockQuote)) { + if (stream.match(reBlockQuote)) return 'quote'; - } - if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { + if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) return 'comment'; - } - if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { + if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) return 'comment'; - } - if (stream.match(reHR)) { + if (stream.match(reHR)) return 'hr'; - } - } // sol - ch = stream.next(); + } + stream.next(); if (sol && /[\/\*!#;:>|]/.test(ch)) { if (ch == "!") { // tw header stream.skipToEnd(); @@ -124,95 +110,77 @@ stream.eatWhile(">"); return "quote"; } - if (ch == '|') { + if (ch == '|') return 'header'; - } } - if (ch == '{' && stream.match(/\{\{/)) { + if (ch == '{' && stream.match(/\{\{/)) return chain(stream, state, twTokenCode); - } // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch)) { - if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { - return "link"; - } - } + if (/[hf]/i.test(ch) && + /[ti]/i.test(stream.peek()) && + stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) + return "link"; + // just a little string indicator, don't want to have the whole string covered - if (ch == '"') { + if (ch == '"') return 'string'; - } - if (ch == '~') { // _no_ CamelCase indicator should be bold + + if (ch == '~') // _no_ CamelCase indicator should be bold return 'brace'; - } - if (/[\[\]]/.test(ch)) { // check for [[..]] - if (stream.peek() == ch) { - stream.next(); - return 'brace'; - } - } + + if (/[\[\]]/.test(ch) && stream.match(ch)) // check for [[..]] + return 'brace'; + if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting stream.eatWhile(isSpaceName); return "link"; } + if (/\d/.test(ch)) { // numbers stream.eatWhile(/\d/); return "number"; } + if (ch == "/") { // tw invisible comment if (stream.eat("%")) { return chain(stream, state, twTokenComment); - } - else if (stream.eat("/")) { // + } else if (stream.eat("/")) { // return chain(stream, state, twTokenEm); } } - if (ch == "_") { // tw underline - if (stream.eat("_")) { + + if (ch == "_" && stream.eat("_")) // tw underline return chain(stream, state, twTokenUnderline); - } - } + // strikethrough and mdash handling - if (ch == "-") { - if (stream.eat("-")) { - // if strikethrough looks ugly, change CSS. - if (stream.peek() != ' ') - return chain(stream, state, twTokenStrike); - // mdash - if (stream.peek() == ' ') - return 'brace'; - } - } - if (ch == "'") { // tw bold - if (stream.eat("'")) { - return chain(stream, state, twTokenStrong); - } - } - if (ch == "<") { // tw macro - if (stream.eat("<")) { - return chain(stream, state, twTokenMacro); - } - } - else { - return null; + if (ch == "-" && stream.eat("-")) { + // if strikethrough looks ugly, change CSS. + if (stream.peek() != ' ') + return chain(stream, state, twTokenStrike); + // mdash + if (stream.peek() == ' ') + return 'brace'; } + if (ch == "'" && stream.eat("'")) // tw bold + return chain(stream, state, twTokenStrong); + + if (ch == "<" && stream.eat("<")) // tw macro + return chain(stream, state, twTokenMacro); + // core macro handling stream.eatWhile(/[\w\$_]/); - var word = stream.current(), - known = textwords.propertyIsEnumerable(word) && textwords[word]; - - return known ? known.style : null; - } // jsTokenBase() + return textwords.propertyIsEnumerable(stream.current()) ? "keyword" : null + } // tw invisible comment function twTokenComment(stream, state) { - var maybeEnd = false, - ch; + var maybeEnd = false, ch; while (ch = stream.next()) { if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; break; } maybeEnd = (ch == "%"); @@ -226,7 +194,7 @@ ch; while (ch = stream.next()) { if (ch == "'" && maybeEnd) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; break; } maybeEnd = (ch == "'"); @@ -243,12 +211,12 @@ } if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; return "comment"; } if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; return "comment"; } @@ -262,7 +230,7 @@ ch; while (ch = stream.next()) { if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; break; } maybeEnd = (ch == "/"); @@ -276,7 +244,7 @@ ch; while (ch = stream.next()) { if (ch == "_" && maybeEnd) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; break; } maybeEnd = (ch == "_"); @@ -291,7 +259,7 @@ while (ch = stream.next()) { if (ch == "-" && maybeEnd) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; break; } maybeEnd = (ch == "-"); @@ -301,58 +269,40 @@ // macro function twTokenMacro(stream, state) { - var ch, word, known; - if (stream.current() == '<<') { return 'macro'; } - ch = stream.next(); + var ch = stream.next(); if (!ch) { - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; return null; } if (ch == ">") { if (stream.peek() == '>') { stream.next(); - state.tokenize = jsTokenBase; + state.tokenize = tokenBase; return "macro"; } } stream.eatWhile(/[\w\$_]/); - word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - if (known) { - return known.style, word; - } - else { - return null, word; - } + return keywords.propertyIsEnumerable(stream.current()) ? "keyword" : null } // Interface return { startState: function () { - return { - tokenize: jsTokenBase, - indented: 0, - level: 0 - }; + return {tokenize: tokenBase}; }, token: function (stream, state) { if (stream.eatSpace()) return null; var style = state.tokenize(stream, state); return style; - }, - - electricChars: "" + } }; }); CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); }); - -//}}} diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/troff.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/troff.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/troff.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/troff.js 2018-08-23 17:28:17.000000000 +0000 @@ -77,6 +77,8 @@ }; }); -CodeMirror.defineMIME('troff', 'troff'); +CodeMirror.defineMIME('text/troff', 'troff'); +CodeMirror.defineMIME('text/x-troff', 'troff'); +CodeMirror.defineMIME('application/x-troff', 'troff'); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/twig.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/twig.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/twig.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/twig.js 2018-08-23 17:28:17.000000000 +0000 @@ -3,15 +3,15 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); + mod(require("../../lib/codemirror"), require("../../addon/mode/multiplex")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); + define(["../../lib/codemirror", "../../addon/mode/multiplex"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; - CodeMirror.defineMode("twig", function() { + CodeMirror.defineMode("twig:inner", function() { var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"], operator = /^[+\-*&%=<>!?|~^]/, sign = /^[:\[\(\{]/, @@ -128,5 +128,14 @@ }; }); + CodeMirror.defineMode("twig", function(config, parserConfig) { + var twigInner = CodeMirror.getMode(config, "twig:inner"); + if (!parserConfig || !parserConfig.base) return twigInner; + return CodeMirror.multiplexingMode( + CodeMirror.getMode(config, parserConfig.base), { + open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true + } + ); + }); CodeMirror.defineMIME("text/x-twig", "twig"); }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/velocity.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/velocity.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/velocity.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/velocity.js 2018-08-23 17:28:17.000000000 +0000 @@ -34,7 +34,7 @@ state.beforeParams = false; var ch = stream.next(); // start of unparsed string? - if ((ch == "'") && state.inParams) { + if ((ch == "'") && !state.inString && state.inParams) { state.lastTokenWasBuiltin = false; return chain(stream, state, tokenString(ch)); } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/verilog.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/verilog.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/verilog.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/verilog.js 2018-08-23 17:28:17.000000000 +0000 @@ -250,7 +250,7 @@ if (text == contextClosing) { return true; } else { - // contextClosing may be mulitple keywords separated by ; + // contextClosing may be multiple keywords separated by ; var closingKeywords = contextClosing.split(";"); for (var i in closingKeywords) { if (text == closingKeywords[i]) { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/vhdl.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/vhdl.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/vhdl.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/vhdl.js 2018-08-23 17:28:17.000000000 +0000 @@ -1,7 +1,7 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE -// Originall written by Alf Nielsen, re-written by Michael Zhou +// Originally written by Alf Nielsen, re-written by Michael Zhou (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); @@ -36,7 +36,7 @@ multiLineStrings = parserConfig.multiLineStrings; var keywords = words("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block," + - "body,buffer,bus,case,component,configuration,constant,disconnent,downto,else,elsif,end,end block,end case," + + "body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case," + "end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for," + "function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage," + "literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map," + diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/vue.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/vue.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/vue.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/vue.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,69 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + "use strict"; + if (typeof exports === "object" && typeof module === "object") {// CommonJS + mod(require("../../lib/codemirror"), + require("../../addon/mode/overlay"), + require("../xml/xml"), + require("../javascript/javascript"), + require("../coffeescript/coffeescript"), + require("../css/css"), + require("../sass/sass"), + require("../stylus/stylus"), + require("../jade/jade"), + require("../handlebars/handlebars")); + } else if (typeof define === "function" && define.amd) { // AMD + define(["../../lib/codemirror", + "../../addon/mode/overlay", + "../xml/xml", + "../javascript/javascript", + "../coffeescript/coffeescript", + "../css/css", + "../sass/sass", + "../stylus/stylus", + "../jade/jade", + "../handlebars/handlebars"], mod); + } else { // Plain browser env + mod(CodeMirror); + } +})(function (CodeMirror) { + var tagLanguages = { + script: [ + ["lang", /coffee(script)?/, "coffeescript"], + ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"] + ], + style: [ + ["lang", /^stylus$/i, "stylus"], + ["lang", /^sass$/i, "sass"], + ["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"], + ["type", /^text\/sass/i, "sass"] + ], + template: [ + ["lang", /^vue-template$/i, "vue"], + ["lang", /^jade$/i, "jade"], + ["lang", /^handlebars$/i, "handlebars"], + ["type", /^(text\/)?(x-)?jade$/i, "jade"], + ["type", /^text\/x-handlebars-template$/i, "handlebars"], + [null, null, "vue-template"] + ] + }; + + CodeMirror.defineMode("vue-template", function (config, parserConfig) { + var mustacheOverlay = { + token: function (stream) { + if (stream.match(/^\{\{.*?\}\}/)) return "meta mustache"; + while (stream.next() && !stream.match("{{", false)) {} + return null; + } + }; + return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay); + }); + + CodeMirror.defineMode("vue", function (config) { + return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages}); + }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "jade", "handlebars"); + + CodeMirror.defineMIME("script/x-vue", "vue"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/webidl.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/webidl.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/webidl.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/webidl.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,195 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); +}; + +var builtinArray = [ + "Clamp", + "Constructor", + "EnforceRange", + "Exposed", + "ImplicitThis", + "Global", "PrimaryGlobal", + "LegacyArrayClass", + "LegacyUnenumerableNamedProperties", + "LenientThis", + "NamedConstructor", + "NewObject", + "NoInterfaceObject", + "OverrideBuiltins", + "PutForwards", + "Replaceable", + "SameObject", + "TreatNonObjectAsNull", + "TreatNullAs", + "EmptyString", + "Unforgeable", + "Unscopeable" +]; +var builtins = wordRegexp(builtinArray); + +var typeArray = [ + "unsigned", "short", "long", // UnsignedIntegerType + "unrestricted", "float", "double", // UnrestrictedFloatType + "boolean", "byte", "octet", // Rest of PrimitiveType + "Promise", // PromiseType + "ArrayBuffer", "DataView", "Int8Array", "Int16Array", "Int32Array", + "Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray", + "Float32Array", "Float64Array", // BufferRelatedType + "ByteString", "DOMString", "USVString", "sequence", "object", "RegExp", + "Error", "DOMException", "FrozenArray", // Rest of NonAnyType + "any", // Rest of SingleType + "void" // Rest of ReturnType +]; +var types = wordRegexp(typeArray); + +var keywordArray = [ + "attribute", "callback", "const", "deleter", "dictionary", "enum", "getter", + "implements", "inherit", "interface", "iterable", "legacycaller", "maplike", + "partial", "required", "serializer", "setlike", "setter", "static", + "stringifier", "typedef", // ArgumentNameKeyword except + // "unrestricted" + "optional", "readonly", "or" +]; +var keywords = wordRegexp(keywordArray); + +var atomArray = [ + "true", "false", // BooleanLiteral + "Infinity", "NaN", // FloatLiteral + "null" // Rest of ConstValue +]; +var atoms = wordRegexp(atomArray); + +CodeMirror.registerHelper("hintWords", "webidl", + builtinArray.concat(typeArray).concat(keywordArray).concat(atomArray)); + +var startDefArray = ["callback", "dictionary", "enum", "interface"]; +var startDefs = wordRegexp(startDefArray); + +var endDefArray = ["typedef"]; +var endDefs = wordRegexp(endDefArray); + +var singleOperators = /^[:<=>?]/; +var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/; +var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/; +var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/; +var identifiersEnd = /^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/; +var strings = /^"[^"]*"/; +var multilineComments = /^\/\*.*?\*\//; +var multilineCommentsStart = /^\/\*.*/; +var multilineCommentsEnd = /^.*?\*\//; + +function readToken(stream, state) { + // whitespace + if (stream.eatSpace()) return null; + + // comment + if (state.inComment) { + if (stream.match(multilineCommentsEnd)) { + state.inComment = false; + return "comment"; + } + stream.skipToEnd(); + return "comment"; + } + if (stream.match("//")) { + stream.skipToEnd(); + return "comment"; + } + if (stream.match(multilineComments)) return "comment"; + if (stream.match(multilineCommentsStart)) { + state.inComment = true; + return "comment"; + } + + // integer and float + if (stream.match(/^-?[0-9\.]/, false)) { + if (stream.match(integers) || stream.match(floats)) return "number"; + } + + // string + if (stream.match(strings)) return "string"; + + // identifier + if (state.startDef && stream.match(identifiers)) return "def"; + + if (state.endDef && stream.match(identifiersEnd)) { + state.endDef = false; + return "def"; + } + + if (stream.match(keywords)) return "keyword"; + + if (stream.match(types)) { + var lastToken = state.lastToken; + var nextToken = (stream.match(/^\s*(.+?)\b/, false) || [])[1]; + + if (lastToken === ":" || lastToken === "implements" || + nextToken === "implements" || nextToken === "=") { + // Used as identifier + return "builtin"; + } else { + // Used as type + return "variable-3"; + } + } + + if (stream.match(builtins)) return "builtin"; + if (stream.match(atoms)) return "atom"; + if (stream.match(identifiers)) return "variable"; + + // other + if (stream.match(singleOperators)) return "operator"; + + // unrecognized + stream.next(); + return null; +}; + +CodeMirror.defineMode("webidl", function() { + return { + startState: function() { + return { + // Is in multiline comment + inComment: false, + // Last non-whitespace, matched token + lastToken: "", + // Next token is a definition + startDef: false, + // Last token of the statement is a definition + endDef: false + }; + }, + token: function(stream, state) { + var style = readToken(stream, state); + + if (style) { + var cur = stream.current(); + state.lastToken = cur; + if (style === "keyword") { + state.startDef = startDefs.test(cur); + state.endDef = state.endDef || endDefs.test(cur); + } else { + state.startDef = false; + } + } + + return style; + } + }; +}); + +CodeMirror.defineMIME("text/x-webidl", "webidl"); +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/xml.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/xml.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/xml.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/xml.js 2018-08-23 17:28:17.000000000 +0000 @@ -11,54 +11,56 @@ })(function(CodeMirror) { "use strict"; -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; - var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag; - if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true; - - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true, 'menuitem': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true, - caseFold: true - } : { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false, - caseFold: false - }; - var alignCDATA = parserConfig.alignCDATA; +var htmlConfig = { + autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, + 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, + 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, + 'track': true, 'wbr': true, 'menuitem': true}, + implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, + 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, + 'th': true, 'tr': true}, + contextGrabbers: { + 'dd': {'dd': true, 'dt': true}, + 'dt': {'dd': true, 'dt': true}, + 'li': {'li': true}, + 'option': {'option': true, 'optgroup': true}, + 'optgroup': {'optgroup': true}, + 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, + 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, + 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, + 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, + 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, + 'rp': {'rp': true, 'rt': true}, + 'rt': {'rp': true, 'rt': true}, + 'tbody': {'tbody': true, 'tfoot': true}, + 'td': {'td': true, 'th': true}, + 'tfoot': {'tbody': true}, + 'th': {'td': true, 'th': true}, + 'thead': {'tbody': true, 'tfoot': true}, + 'tr': {'tr': true} + }, + doNotIndent: {"pre": true}, + allowUnquoted: true, + allowMissing: true, + caseFold: true +} + +var xmlConfig = { + autoSelfClosers: {}, + implicitlyClosed: {}, + contextGrabbers: {}, + doNotIndent: {}, + allowUnquoted: false, + allowMissing: false, + caseFold: false +} + +CodeMirror.defineMode("xml", function(editorConf, config_) { + var indentUnit = editorConf.indentUnit + var config = {} + var defaults = config_.htmlMode ? htmlConfig : xmlConfig + for (var prop in defaults) config[prop] = defaults[prop] + for (var prop in config_) config[prop] = config_[prop] // Return variables for tokenizers var type, setStyle; @@ -188,7 +190,7 @@ this.tagName = tagName; this.indent = state.indented; this.startOfLine = startOfLine; - if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) + if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) this.noIndent = true; } function popContext(state) { @@ -201,8 +203,8 @@ return; } parentTagName = state.context.tagName; - if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || - !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { + if (!config.contextGrabbers.hasOwnProperty(parentTagName) || + !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { return; } popContext(state); @@ -233,9 +235,9 @@ if (type == "word") { var tagName = stream.current(); if (state.context && state.context.tagName != tagName && - Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName)) + config.implicitlyClosed.hasOwnProperty(state.context.tagName)) popContext(state); - if (state.context && state.context.tagName == tagName) { + if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { setStyle = "tag"; return closeState; } else { @@ -269,7 +271,7 @@ var tagName = state.tagName, tagStart = state.tagStart; state.tagName = state.tagStart = null; if (type == "selfcloseTag" || - Kludges.autoSelfClosers.hasOwnProperty(tagName)) { + config.autoSelfClosers.hasOwnProperty(tagName)) { maybePopContext(state, tagName); } else { maybePopContext(state, tagName); @@ -282,12 +284,12 @@ } function attrEqState(type, stream, state) { if (type == "equals") return attrValueState; - if (!Kludges.allowMissing) setStyle = "error"; + if (!config.allowMissing) setStyle = "error"; return attrState(type, stream, state); } function attrValueState(type, stream, state) { if (type == "string") return attrContinuedState; - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;} + if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} setStyle = "error"; return attrState(type, stream, state); } @@ -297,12 +299,14 @@ } return { - startState: function() { - return {tokenize: inText, - state: baseState, - indented: 0, - tagName: null, tagStart: null, - context: null}; + startState: function(baseIndent) { + var state = {tokenize: inText, + state: baseState, + indented: baseIndent || 0, + tagName: null, tagStart: null, + context: null} + if (baseIndent != null) state.baseIndent = baseIndent + return state }, token: function(stream, state) { @@ -335,19 +339,19 @@ return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; // Indent the starts of attribute names. if (state.tagName) { - if (multilineTagIndentPastTag) + if (config.multilineTagIndentPastTag !== false) return state.tagStart + state.tagName.length + 2; else - return state.tagStart + indentUnit * multilineTagIndentFactor; + return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); } - if (alignCDATA && /$/, blockCommentStart: "", - configuration: parserConfig.htmlMode ? "html" : "xml", - helperType: parserConfig.htmlMode ? "html" : "xml" + configuration: config.htmlMode ? "html" : "xml", + helperType: config.htmlMode ? "html" : "xml", + + skipAttribute: function(state) { + if (state.state == attrValueState) + state.state = attrState + } }; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/xquery.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/xquery.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/xquery.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/xquery.js 2018-08-23 17:28:17.000000000 +0000 @@ -17,7 +17,7 @@ // function. Each keyword is a property of the keywords object whose // value is {type: atype, style: astyle} var keywords = function(){ - // conveinence functions used to build keywords object + // convenience functions used to build keywords object function kw(type) {return {type: type, style: "keyword"};} var A = kw("keyword a") , B = kw("keyword b") diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/yacas.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/yacas.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/yacas.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/yacas.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,204 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Yacas mode copyright (c) 2015 by Grzegorz Mazur +// Loosely based on mathematica mode by Calin Barbat + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('yacas', function(_config, _parserConfig) { + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var bodiedOps = words("Assert BackQuote D Defun Deriv For ForEach FromFile " + + "FromString Function Integrate InverseTaylor Limit " + + "LocalSymbols Macro MacroRule MacroRulePattern " + + "NIntegrate Rule RulePattern Subst TD TExplicitSum " + + "TSum Taylor Taylor1 Taylor2 Taylor3 ToFile " + + "ToStdout ToString TraceRule Until While"); + + // patterns + var pFloatForm = "(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)"; + var pIdentifier = "(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)"; + + // regular expressions + var reFloatForm = new RegExp(pFloatForm); + var reIdentifier = new RegExp(pIdentifier); + var rePattern = new RegExp(pIdentifier + "?_" + pIdentifier); + var reFunctionLike = new RegExp(pIdentifier + "\\s*\\("); + + function tokenBase(stream, state) { + var ch; + + // get next character + ch = stream.next(); + + // string + if (ch === '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + + // comment + if (ch === '/') { + if (stream.eat('*')) { + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + + // go back one character + stream.backUp(1); + + // update scope info + var m = stream.match(/^(\w+)\s*\(/, false); + if (m !== null && bodiedOps.hasOwnProperty(m[1])) + state.scopes.push('bodied'); + + var scope = currentScope(state); + + if (scope === 'bodied' && ch === '[') + state.scopes.pop(); + + if (ch === '[' || ch === '{' || ch === '(') + state.scopes.push(ch); + + scope = currentScope(state); + + if (scope === '[' && ch === ']' || + scope === '{' && ch === '}' || + scope === '(' && ch === ')') + state.scopes.pop(); + + if (ch === ';') { + while (scope === 'bodied') { + state.scopes.pop(); + scope = currentScope(state); + } + } + + // look for ordered rules + if (stream.match(/\d+ *#/, true, false)) { + return 'qualifier'; + } + + // look for numbers + if (stream.match(reFloatForm, true, false)) { + return 'number'; + } + + // look for placeholders + if (stream.match(rePattern, true, false)) { + return 'variable-3'; + } + + // match all braces separately + if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { + return 'bracket'; + } + + // literals looking like function calls + if (stream.match(reFunctionLike, true, false)) { + stream.backUp(1); + return 'variable'; + } + + // all other identifiers + if (stream.match(reIdentifier, true, false)) { + return 'variable-2'; + } + + // operators; note that operators like @@ or /; are matched separately for each symbol. + if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { + return 'operator'; + } + + // everything else is an error + return 'error'; + } + + function tokenString(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === '"' && !escaped) { + end = true; + break; + } + escaped = !escaped && next === '\\'; + } + if (end && !escaped) { + state.tokenize = tokenBase; + } + return 'string'; + }; + + function tokenComment(stream, state) { + var prev, next; + while((next = stream.next()) != null) { + if (prev === '*' && next === '/') { + state.tokenize = tokenBase; + break; + } + prev = next; + } + return 'comment'; + } + + function currentScope(state) { + var scope = null; + if (state.scopes.length > 0) + scope = state.scopes[state.scopes.length - 1]; + return scope; + } + + return { + startState: function() { + return { + tokenize: tokenBase, + scopes: [] + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + }, + indent: function(state, textAfter) { + if (state.tokenize !== tokenBase && state.tokenize !== null) + return CodeMirror.Pass; + + var delta = 0; + if (textAfter === ']' || textAfter === '];' || + textAfter === '}' || textAfter === '};' || + textAfter === ');') + delta = -1; + + return (state.scopes.length + delta) * _config.indentUnit; + }, + electricChars: "{}[]();", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME('text/x-yacas', { + name: 'yacas' +}); + +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,68 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../yaml/yaml")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../yaml/yaml"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + + var START = 0, FRONTMATTER = 1, BODY = 2 + + // a mixed mode for Markdown text with an optional YAML front matter + CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) { + var yamlMode = CodeMirror.getMode(config, "yaml") + var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm") + + function curMode(state) { + return state.state == BODY ? innerMode : yamlMode + } + + return { + startState: function () { + return { + state: START, + inner: CodeMirror.startState(yamlMode) + } + }, + copyState: function (state) { + return { + state: state.state, + inner: CodeMirror.copyState(curMode(state), state.inner) + } + }, + token: function (stream, state) { + if (state.state == START) { + if (stream.match(/---/, false)) { + state.state = FRONTMATTER + return yamlMode.token(stream, state.inner) + } else { + state.state = BODY + state.inner = CodeMirror.startState(innerMode) + return innerMode.token(stream, state.inner) + } + } else if (state.state == FRONTMATTER) { + var end = stream.sol() && stream.match(/---/, false) + var style = yamlMode.token(stream, state.inner) + if (end) { + state.state = BODY + state.inner = CodeMirror.startState(innerMode) + } + return style + } else { + return innerMode.token(stream, state.inner) + } + }, + innerMode: function (state) { + return {mode: curMode(state), state: state.inner} + }, + blankLine: function (state) { + var mode = curMode(state) + if (mode.blankLine) return mode.blankLine(state.inner) + } + } + }) +}); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror.js ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror.js --- ruby-codemirror-rails-5.6/vendor/assets/javascripts/codemirror.js 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/javascripts/codemirror.js 2018-08-23 17:28:17.000000000 +0000 @@ -13,7 +13,7 @@ else if (typeof define == "function" && define.amd) // AMD return define([], mod); else // Plain browser env - this.CodeMirror = mod(); + (this || window).CodeMirror = mod(); })(function() { "use strict"; @@ -21,27 +21,30 @@ // Kludges for bugs and behavior differences that can't be feature // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; - var gecko = /gecko\/\d/i.test(navigator.userAgent); - var ie_upto10 = /MSIE \d/.test(navigator.userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); var ie = ie_upto10 || ie_11up; var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); - var webkit = /WebKit\//.test(navigator.userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); - var chrome = /Chrome\//.test(navigator.userAgent); - var presto = /Opera\//.test(navigator.userAgent); + var webkit = /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); - var phantom = /PhantomJS/.test(navigator.userAgent); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); - var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); + var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); - var mac = ios || /Mac/.test(navigator.platform); - var windows = /win/i.test(navigator.platform); + var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); - var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); if (presto_version) presto_version = Number(presto_version[1]); if (presto_version && presto_version >= 15) { presto = false; webkit = true; } // Some browsers use the wrong event properties to signal cmd/ctrl on OS X @@ -408,7 +411,7 @@ if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); }); - this.checkedOverlay = false; + this.checkedZeroWidth = false; // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } @@ -443,29 +446,43 @@ this.horiz.firstChild.style.width = "0"; } - if (!this.checkedOverlay && measure.clientHeight > 0) { - if (sWidth == 0) this.overlayHack(); - this.checkedOverlay = true; + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) this.zeroWidthHack(); + this.checkedZeroWidth = true; } return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; }, setScrollLeft: function(pos) { if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; + if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz); }, setScrollTop: function(pos) { if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; + if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert); }, - overlayHack: function() { + zeroWidthHack: function() { var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.minHeight = this.vert.style.minWidth = w; - var self = this; - var barMouseDown = function(e) { - if (e_target(e) != self.vert && e_target(e) != self.horiz) - operation(self.cm, onMouseDown)(e); - }; - on(this.vert, "mousedown", barMouseDown); - on(this.horiz, "mousedown", barMouseDown); + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed; + this.disableVert = new Delayed; + }, + enableZeroWidthBar: function(bar, delay) { + bar.style.pointerEvents = "auto"; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // left corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt = document.elementFromPoint(box.left + 1, box.bottom - 1); + if (elt != bar) bar.style.pointerEvents = "none"; + else delay.set(1000, maybeDisable); + } + delay.set(1000, maybeDisable); }, clear: function() { var parent = this.horiz.parentNode; @@ -527,6 +544,7 @@ d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" if (sizes.right && sizes.bottom) { d.scrollbarFiller.style.display = "block"; @@ -730,6 +748,7 @@ function postUpdateDisplay(cm, update) { var viewport = update.viewport; + for (var first = true;; first = false) { if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { // Clip forced viewport to actual scrollable area. @@ -745,8 +764,8 @@ updateHeightsInViewport(cm); var barMeasure = measureForScrollbars(cm); updateSelection(cm); - setDocumentHeight(cm, barMeasure); updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); } update.signal(cm, "update", cm); @@ -763,17 +782,16 @@ postUpdateDisplay(cm, update); var barMeasure = measureForScrollbars(cm); updateSelection(cm); - setDocumentHeight(cm, barMeasure); updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); update.finish(); } } function setDocumentHeight(cm, measure) { cm.display.sizer.style.minHeight = measure.docHeight + "px"; - var total = measure.docHeight + cm.display.barHeight; - cm.display.heightForcer.style.top = total + "px"; - cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; } // Read the actual heights of the rendered lines, and update their @@ -807,7 +825,7 @@ // given line. function updateWidgetHeight(line) { if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) - line.widgets[i].height = line.widgets[i].node.offsetHeight; + line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } // Do a bulk-read of the DOM positions and sizes needed to draw the @@ -1078,13 +1096,9 @@ if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } } - function isReadOnly(cm) { - return cm.options.readOnly || cm.doc.cantEdit; - } - - // This will be set to an array of strings when copying, so that, - // when pasting, we know what kind of selections the copied text - // was made out of. + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. var lastCopied = null; function applyTextInput(cm, inserted, deleted, sel, origin) { @@ -1093,14 +1107,14 @@ if (!sel) sel = doc.sel; var paste = cm.state.pasteIncoming || origin == "paste"; - var textLines = doc.splitLines(inserted), multiPaste = null; + var textLines = doc.splitLines(inserted), multiPaste = null // When pasing N lines into N selections, insert one line per selection if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.length == 0) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { multiPaste = []; - for (var i = 0; i < lastCopied.length; i++) - multiPaste.push(doc.splitLines(lastCopied[i])); + for (var i = 0; i < lastCopied.text.length; i++) + multiPaste.push(doc.splitLines(lastCopied.text[i])); } } else if (textLines.length == sel.ranges.length) { multiPaste = map(textLines, function(l) { return [l]; }); @@ -1116,6 +1130,8 @@ from = Pos(from.line, from.ch - deleted); else if (cm.state.overwrite && !paste) // Handle overwrite to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + from = to = Pos(from.line, 0) } var updateInput = cm.curOp.updateInput; var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, @@ -1136,7 +1152,7 @@ var pasted = e.clipboardData && e.clipboardData.getData("text/plain"); if (pasted) { e.preventDefault(); - if (!isReadOnly(cm) && !cm.options.disableInput) + if (!cm.isReadOnly() && !cm.options.disableInput) runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); }); return true; } @@ -1239,26 +1255,27 @@ }); on(te, "paste", function(e) { - if (handlePaste(e, cm)) return true; + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return cm.state.pasteIncoming = true; input.fastPoll(); }); function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) return if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); + lastCopied = {lineWise: false, text: cm.getSelections()}; if (input.inaccurateSelection) { input.prevInput = ""; input.inaccurateSelection = false; - te.value = lastCopied.join("\n"); + te.value = lastCopied.text.join("\n"); selectInput(te); } } else if (!cm.options.lineWiseCopyCut) { return; } else { var ranges = copyableRanges(cm); - lastCopied = ranges.text; + lastCopied = {lineWise: true, text: ranges.text}; if (e.type == "cut") { cm.setSelections(ranges.ranges, null, sel_dontScroll); } else { @@ -1273,7 +1290,7 @@ on(te, "copy", prepareCopyCut); on(display.scroller, "paste", function(e) { - if (eventInWidget(display, e)) return; + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return; cm.state.pasteIncoming = true; input.focus(); }); @@ -1285,6 +1302,7 @@ on(te, "compositionstart", function() { var start = cm.getCursor("from"); + if (input.composing) input.composing.range.clear() input.composing = { start: start, range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) @@ -1406,7 +1424,7 @@ // in which case reading its value would be expensive. if (this.contextMenuPending || !cm.state.focused || (hasSelection(input) && !prevInput && !this.composing) || - isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) return false; var text = input.value; @@ -1468,10 +1486,11 @@ if (reset && cm.doc.sel.contains(pos) == -1) operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - var oldCSS = te.style.cssText; - input.wrapper.style.position = "absolute"; - te.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; + input.wrapper.style.cssText = "position: absolute" + var wrapperBox = input.wrapper.getBoundingClientRect() + te.style.cssText = "position: absolute; width: 30px; height: 30px; top: " + (e.clientY - wrapperBox.top - 5) + + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px; z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) @@ -1502,7 +1521,7 @@ } function rehide() { input.contextMenuPending = false; - input.wrapper.style.position = "relative"; + input.wrapper.style.cssText = oldWrapperCSS te.style.cssText = oldCSS; if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); @@ -1533,6 +1552,10 @@ } }, + readOnlyChanged: function(val) { + if (!val) this.reset(); + }, + setUneditable: nothing, needsContentAttribute: false @@ -1551,10 +1574,11 @@ init: function(display) { var input = this, cm = input.cm; var div = input.div = display.lineDiv; - div.contentEditable = "true"; disableBrowserMagic(div); - on(div, "paste", function(e) { handlePaste(e, cm); }) + on(div, "paste", function(e) { + if (!signalDOMEvent(cm, e)) handlePaste(e, cm); + }) on(div, "compositionstart", function(e) { var data = e.data; @@ -1592,19 +1616,20 @@ on(div, "input", function() { if (input.composing) return; - if (!input.pollContent()) + if (cm.isReadOnly() || !input.pollContent()) runInOp(input.cm, function() {regChange(cm);}); }); function onCopyCut(e) { + if (signalDOMEvent(cm, e)) return if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); + lastCopied = {lineWise: false, text: cm.getSelections()}; if (e.type == "cut") cm.replaceSelection("", null, "cut"); } else if (!cm.options.lineWiseCopyCut) { return; } else { var ranges = copyableRanges(cm); - lastCopied = ranges.text; + lastCopied = {lineWise: true, text: ranges.text}; if (e.type == "cut") { cm.operation(function() { cm.setSelections(ranges.ranges, 0, sel_dontScroll); @@ -1616,12 +1641,12 @@ if (e.clipboardData && !ios) { e.preventDefault(); e.clipboardData.clearData(); - e.clipboardData.setData("text/plain", lastCopied.join("\n")); + e.clipboardData.setData("text/plain", lastCopied.text.join("\n")); } else { // Old-fashioned briefly-focus-a-textarea hack var kludge = hiddenTextarea(), te = kludge.firstChild; cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.join("\n"); + te.value = lastCopied.text.join("\n"); var hadFocus = document.activeElement; selectInput(te); setTimeout(function() { @@ -1640,9 +1665,9 @@ return result; }, - showSelection: function(info) { + showSelection: function(info, takeFocus) { if (!info || !this.cm.display.view.length) return; - if (info.focus) this.showPrimarySelection(); + if (info.focus || takeFocus) this.showPrimarySelection(); this.showMultipleSelections(info); }, @@ -1672,8 +1697,13 @@ try { var rng = range(start.node, start.offset, end.offset, end.node); } catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible if (rng) { - sel.removeAllRanges(); - sel.addRange(rng); + if (!gecko && this.cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) sel.addRange(rng); + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } if (old && sel.anchorNode == null) sel.addRange(old); else if (gecko) this.startGracePeriod(); } @@ -1817,17 +1847,24 @@ this.div.focus(); }, applyComposition: function(composing) { - if (composing.data && composing.data != composing.startData) + if (this.cm.isReadOnly()) + operation(this.cm, regChange)(this.cm) + else if (composing.data && composing.data != composing.startData) operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); }, setUneditable: function(node) { - node.setAttribute("contenteditable", "false"); + node.contentEditable = "false" }, onKeyPress: function(e) { e.preventDefault(); - operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + if (!this.cm.isReadOnly()) + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + }, + + readOnlyChanged: function(val) { + this.div.contentEditable = String(val != "nocursor") }, onContextMenu: nothing, @@ -2127,7 +2164,7 @@ // Give beforeSelectionChange handlers a change to influence a // selection update. - function filterSelectionChange(doc, sel) { + function filterSelectionChange(doc, sel, options) { var obj = { ranges: sel.ranges, update: function(ranges) { @@ -2135,7 +2172,8 @@ for (var i = 0; i < ranges.length; i++) this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), clipPos(doc, ranges[i].head)); - } + }, + origin: options && options.origin }; signal(doc, "beforeSelectionChange", doc, obj); if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); @@ -2161,7 +2199,7 @@ function setSelectionNoUndo(doc, sel, options) { if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - sel = filterSelectionChange(doc, sel); + sel = filterSelectionChange(doc, sel, options); var bias = options && options.bias || (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); @@ -2195,8 +2233,9 @@ var out; for (var i = 0; i < sel.ranges.length; i++) { var range = sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, bias, mayClear); + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); if (out || newAnchor != range.anchor || newHead != range.head) { if (!out) out = sel.ranges.slice(0, i); out[i] = new Range(newAnchor, newHead); @@ -2205,54 +2244,61 @@ return out ? normalizeSelection(out, sel.primIndex) : sel; } - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, bias, mayClear) { - var flipped = false, curPos = pos; - var dir = bias || 1; - doc.cantEdit = false; - search: for (;;) { - var line = getLine(doc, curPos.line); - if (line.markedSpans) { - for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) break; - else {--i; continue;} - } - } - if (!m.atomic) continue; - var newPos = m.find(dir < 0 ? -1 : 1); - if (cmp(newPos, curPos) == 0) { - newPos.ch += dir; - if (newPos.ch < 0) { - if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); - else newPos = null; - } else if (newPos.ch > line.text.length) { - if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); - else newPos = null; - } - if (!newPos) { - if (flipped) { - // Driven in a corner -- no valid cursor position found at all - // -- try again *with* clearing, if we didn't already - if (!mayClear) return skipAtomic(doc, pos, bias, true); - // Otherwise, turn off editing until further notice, and return the start of the doc - doc.cantEdit = true; - return Pos(doc.first, 0); - } - flipped = true; newPos = pos; dir = -dir; - } - } - curPos = newPos; - continue search; + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} } } + if (!m.atomic) continue; + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff; + if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) + near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + return skipAtomicInner(doc, near, pos, dir, mayClear); + } + + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) + far = movePos(doc, far, dir, far.line == pos.line ? line : null); + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; } - return curPos; + } + return pos; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0); + } + return found; + } + + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1)); + else return null; + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) return Pos(pos.line + 1, 0); + else return null; + } else { + return new Pos(pos.line, pos.ch + dir); } } @@ -2270,6 +2316,7 @@ for (var i = 0; i < doc.sel.ranges.length; i++) { if (primary === false && i == doc.sel.primIndex) continue; var range = doc.sel.ranges[i]; + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue; var collapsed = range.empty(); if (collapsed || cm.options.showCursorWhenSelecting) drawSelectionCursor(cm, range.head, curFragment); @@ -2886,10 +2933,23 @@ for (;;) { if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { var ch = x < fromX || x - fromX <= toX - x ? from : to; + var outside = ch == from ? fromOutside : toOutside var xDiff = x - (ch == from ? fromX : toX); + // This is a kludge to handle the case where the coordinates + // are after a line-wrapped line. We should replace it with a + // more general handling of cursor positions around line + // breaks. (Issue #4078) + if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 && + ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) { + var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right"); + if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) { + outside = false + ch++ + xDiff = x - charSize.right + } + } while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; - var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, - xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); + var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); return pos; } var step = Math.ceil(dist / 2), middle = from + step; @@ -3056,7 +3116,7 @@ } if (op.updatedDisplay || op.selectionChanged) - op.preparedSelection = display.input.prepareSelection(); + op.preparedSelection = display.input.prepareSelection(op.focus); } function endOperation_W2(op) { @@ -3069,18 +3129,19 @@ cm.display.maxLineChanged = false; } + var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()) if (op.preparedSelection) - cm.display.input.showSelection(op.preparedSelection); - if (op.updatedDisplay) - setDocumentHeight(cm, op.barMeasure); + cm.display.input.showSelection(op.preparedSelection, takeFocus); if (op.updatedDisplay || op.startHeight != cm.doc.height) updateScrollbars(cm, op.barMeasure); + if (op.updatedDisplay) + setDocumentHeight(cm, op.barMeasure); if (op.selectionChanged) restartBlink(cm); if (cm.state.focused && op.updateInput) cm.display.input.reset(op.typing); - if (op.focus && op.focus == activeElt()) ensureFocus(op.cm); + if (takeFocus) ensureFocus(op.cm); } function endOperation_finish(op) { @@ -3099,7 +3160,7 @@ display.scroller.scrollTop = doc.scrollTop; } if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { - doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft)); + doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)); display.scrollbars.setScrollLeft(doc.scrollLeft); display.scroller.scrollLeft = doc.scrollLeft; alignHorizontally(cm); @@ -3395,7 +3456,7 @@ return dx * dx + dy * dy > 20 * 20; } on(d.scroller, "touchstart", function(e) { - if (!isMouseLikeTouchEvent(e)) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) { clearTimeout(touchFinished); var now = +new Date; d.activeTouch = {start: now, moved: false, @@ -3450,7 +3511,7 @@ over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, start: function(e){onDragStart(cm, e);}, drop: operation(cm, onDrop), - leave: function() {clearDragCursor(cm);} + leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} }; var inp = d.input.getField(); @@ -3524,7 +3585,7 @@ // not interfere with, such as a scrollbar or widget. function onMouseDown(e) { var cm = this, display = cm.display; - if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return; display.shift = e.shiftKey; if (eventInWidget(display, e)) { @@ -3580,7 +3641,7 @@ } var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && type == "single" && (contained = sel.contains(start)) > -1 && (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && (cmp(contained.to(), start) > 0 || start.xRel < 0)) @@ -3612,6 +3673,7 @@ // Let the drag handler handle this. if (webkit) display.scroller.draggable = true; cm.state.draggingText = dragEnd; + dragEnd.copy = mac ? e.altKey : e.ctrlKey // IE's approach to draggable if (display.scroller.dragDrop) display.scroller.dragDrop(); on(document, "mouseup", dragEnd); @@ -3635,7 +3697,7 @@ ourIndex = doc.sel.primIndex; } - if (e.altKey) { + if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) { type = "rect"; if (!addNew) ourRange = new Range(start, start); start = posFromMouse(cm, e, true, true); @@ -3765,7 +3827,7 @@ // Determines whether an event happened in the gutter, and fires the // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent, signalfn) { + function gutterEvent(cm, e, type, prevent) { try { var mX = e.clientX, mY = e.clientY; } catch(e) { return false; } if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; @@ -3782,14 +3844,14 @@ if (g && g.getBoundingClientRect().right >= mX) { var line = lineAtHeight(cm.doc, mY); var gutter = cm.options.gutters[i]; - signalfn(cm, type, cm, line, gutter, e); + signal(cm, type, cm, line, gutter, e); return e_defaultPrevented(e); } } } function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true, signalLater); + return gutterEvent(cm, e, "gutterClick", true); } // Kludge to work around strange IE behavior where it'll sometimes @@ -3804,15 +3866,21 @@ e_preventDefault(e); if (ie) lastDrop = +new Date; var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || isReadOnly(cm)) return; + if (!pos || cm.isReadOnly()) return; // Might be a file drop, in which case we simply extract the text // and insert it. if (files && files.length && window.FileReader && window.File) { var n = files.length, text = Array(n), read = 0; var loadFile = function(file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) + return; + var reader = new FileReader; reader.onload = operation(cm, function() { - text[i] = reader.result; + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = ""; + text[i] = content; if (++read == n) { pos = clipPos(cm.doc, pos); var change = {from: pos, to: pos, @@ -3836,7 +3904,7 @@ try { var text = e.dataTransfer.getData("Text"); if (text) { - if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) + if (cm.state.draggingText && !cm.state.draggingText.copy) var selected = cm.listSelections(); setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); if (selected) for (var i = 0; i < selected.length; ++i) @@ -3854,6 +3922,7 @@ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove" // Use dummy image instead of default browsers image. // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. @@ -3954,8 +4023,9 @@ var display = cm.display, scroll = display.scroller; // Quit if there's nothing to scroll here - if (!(dx && scroll.scrollWidth > scroll.clientWidth || - dy && scroll.scrollHeight > scroll.clientHeight)) return; + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) return; // Webkit browsers on OS X abort momentum scrolls when the target // of the scroll event is removed from the scrollable element. @@ -3979,10 +4049,15 @@ // scrolling entirely here. It'll be slightly off from native, but // better than glitching out. if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy) + if (dy && canScrollY) setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); - e_preventDefault(e); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + e_preventDefault(e); display.wheelStartX = null; // Abort measurement, if in progress return; } @@ -4031,7 +4106,7 @@ cm.display.input.ensurePolled(); var prevShift = cm.display.shift, done = false; try { - if (isReadOnly(cm)) cm.state.suppressEdits = true; + if (cm.isReadOnly()) cm.state.suppressEdits = true; if (dropShift) cm.display.shift = false; done = bound(cm) != Pass; } finally { @@ -4210,12 +4285,13 @@ // right-click take effect on it. function onContextMenu(cm, e) { if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; + if (signalDOMEvent(cm, e, "contextmenu")) return; cm.display.input.onContextMenu(e); } function contextMenuInGutter(cm, e) { if (!hasHandler(cm, "gutterContextMenu")) return false; - return gutterEvent(cm, e, "gutterContextMenu", false, signal); + return gutterEvent(cm, e, "gutterContextMenu", false); } // UPDATING @@ -4763,10 +4839,9 @@ function findPosH(doc, pos, dir, unit, visually) { var line = pos.line, ch = pos.ch, origDir = dir; var lineObj = getLine(doc, line); - var possible = true; function findNextLine() { var l = line + dir; - if (l < doc.first || l >= doc.first + doc.size) return (possible = false); + if (l < doc.first || l >= doc.first + doc.size) return false line = l; return lineObj = getLine(doc, l); } @@ -4776,14 +4851,16 @@ if (!boundToLine && findNextLine()) { if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); else ch = dir < 0 ? lineObj.text.length : 0; - } else return (possible = false); + } else return false } else ch = next; return true; } - if (unit == "char") moveOnce(); - else if (unit == "column") moveOnce(true); - else if (unit == "word" || unit == "group") { + if (unit == "char") { + moveOnce() + } else if (unit == "column") { + moveOnce(true) + } else if (unit == "word" || unit == "group") { var sawType = null, group = unit == "group"; var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); for (var first = true;; first = false) { @@ -4803,8 +4880,8 @@ if (dir > 0 && !moveOnce(!first)) break; } } - var result = skipAtomic(doc, Pos(line, ch), origDir, true); - if (!possible) result.hitSide = true; + var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true); + if (!cmp(pos, result)) result.hitSide = true; return result; } @@ -5191,6 +5268,7 @@ signal(this, "overwriteToggle", this, this.state.overwrite); }, hasFocus: function() { return this.display.input.getField() == activeElt(); }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); }, scrollTo: methodOp(function(x, y) { if (x != null || y != null) resolveScrollToPos(this); @@ -5330,7 +5408,7 @@ for (var i = newBreaks.length - 1; i >= 0; i--) replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }); - option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { + option("specialChars", /[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); if (old != CodeMirror.Init) cm.refresh(); }); @@ -5388,11 +5466,12 @@ cm.display.disabled = true; } else { cm.display.disabled = false; - if (!val) cm.display.input.reset(); } + cm.display.input.readOnlyChanged(val) }); option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); option("cursorBlinkRate", 530); option("cursorScrollMargin", 0); @@ -5658,7 +5737,7 @@ for (var i = 0; i < ranges.length; i++) { var pos = ranges[i].from(); var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); + spaces.push(spaceStr(tabSize - col % tabSize)); } cm.replaceSelections(spaces); }, @@ -5697,10 +5776,11 @@ var range = cm.listSelections()[i]; cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input"); cm.indentLine(range.from().line + 1, null, true); - ensureCursorVisible(cm); } + ensureCursorVisible(cm); }); }, + openLine: function(cm) {cm.replaceSelection("\n", "start")}, toggleOverwrite: function(cm) {cm.toggleOverwrite();} }; @@ -5735,7 +5815,8 @@ "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" }; keyMap.macDefault = { "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", @@ -6497,8 +6578,8 @@ var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; - if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || - fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) return true; } } @@ -6626,7 +6707,7 @@ parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); } - return widget.height = widget.node.offsetHeight; + return widget.height = widget.node.parentNode.offsetHeight; } function addLineWidget(doc, handle, node, options) { @@ -6900,8 +6981,11 @@ } // See issue #2901 - if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className)) - builder.content.className = "cm-tab-wrap-hack"; + if (webkit) { + var last = builder.content.lastChild + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + builder.content.className = "cm-tab-wrap-hack"; + } signal(cm, "renderLine", cm, lineView.line, builder.pre); if (builder.pre.className) @@ -6952,7 +7036,7 @@ txt.setAttribute("cm-text", "\t"); builder.col += tabWidth; } else if (m[0] == "\r" || m[0] == "\n") { - var txt = content.appendChild(elt("span", m[0] == "\r" ? "␍" : "␤", "cm-invalidchar")); + var txt = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); txt.setAttribute("cm-text", m[0]); builder.col += 1; } else { @@ -7036,7 +7120,7 @@ if (nextChange == pos) { // Update current marker set spanStyle = spanEndStyle = spanStartStyle = title = css = ""; collapsed = null; nextChange = Infinity; - var foundBookmarks = []; + var foundBookmarks = [], endStyles for (var j = 0; j < spans.length; ++j) { var sp = spans[j], m = sp.marker; if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { @@ -7047,9 +7131,9 @@ spanEndStyle = ""; } if (m.className) spanStyle += " " + m.className; - if (m.css) css = m.css; + if (m.css) css = (css ? css + ";" : "") + m.css; if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; - if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; + if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to) if (m.title && !title) title = m.title; if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) collapsed = sp; @@ -7057,14 +7141,17 @@ nextChange = sp.from; } } + if (endStyles) for (var j = 0; j < endStyles.length; j += 2) + if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j] + + if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j) + buildCollapsedSpan(builder, 0, foundBookmarks[j]); if (collapsed && (collapsed.from || 0) == pos) { buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); if (collapsed.to == null) return; if (collapsed.to == pos) collapsed = false; } - if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) - buildCollapsedSpan(builder, 0, foundBookmarks[j]); } if (pos >= len) break; @@ -7250,13 +7337,16 @@ if (at <= sz) { child.insertInner(at, lines, height); if (child.lines && child.lines.length > 50) { - while (child.lines.length > 50) { - var spilled = child.lines.splice(child.lines.length - 25, 25); - var newleaf = new LeafChunk(spilled); - child.height -= newleaf.height; - this.children.splice(i + 1, 0, newleaf); - newleaf.parent = this; + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25 + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this.children.splice(++i, 0, leaf); + leaf.parent = this; } + child.lines = child.lines.slice(0, remaining); this.maybeSpill(); } break; @@ -7276,7 +7366,7 @@ copy.parent = me; me.children = [copy, sibling]; me = copy; - } else { + } else { me.size -= sibling.size; me.height -= sibling.height; var myIndex = indexOf(me.parent.children, me); @@ -7316,6 +7406,7 @@ this.id = ++nextDocId; this.modeOption = mode; this.lineSep = lineSep; + this.extend = false; if (typeof text == "string") text = this.splitLines(text); updateDoc(this, {from: start, to: start, text: text}); @@ -7403,10 +7494,11 @@ extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); }), extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads, options)); + extendSelections(this, clipPosArray(this, heads), options); }), extendSelectionsBy: docMethodOp(function(f, options) { - extendSelections(this, map(this.sel.ranges, f), options); + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); }), setSelections: docMethodOp(function(ranges, primary, options) { if (!ranges.length) return; @@ -7531,7 +7623,7 @@ removeLineWidget: function(widget) { widget.clear(); }, markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); }, setBookmark: function(pos, options) { var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), @@ -7559,9 +7651,9 @@ var spans = line.markedSpans; if (spans) for (var i = 0; i < spans.length; i++) { var span = spans[i]; - if (!(lineNo == from.line && from.ch > span.to || - span.from == null && lineNo != from.line|| - lineNo == to.line && span.from > to.ch) && + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || + span.from == null && lineNo != from.line || + span.from != null && lineNo == to.line && span.from >= to.ch) && (!filter || filter(span.marker))) found.push(span.marker.parent || span.marker); } @@ -7580,9 +7672,9 @@ }, posFromIndex: function(off) { - var ch, lineNo = this.first; + var ch, lineNo = this.first, sepSize = this.lineSeparator().length; this.iter(function(line) { - var sz = line.text.length + 1; + var sz = line.text.length + sepSize; if (sz > off) { ch = off; return true; } off -= sz; ++lineNo; @@ -7593,8 +7685,9 @@ coords = clipPos(this, coords); var index = coords.ch; if (coords.line < this.first || coords.ch < 0) return 0; + var sepSize = this.lineSeparator().length; this.iter(this.first, coords.line, function (line) { - index += line.text.length + 1; + index += line.text.length + sepSize; }); return index; }, @@ -8092,24 +8185,30 @@ } }; + var noHandlers = [] + function getHandlers(emitter, type, copy) { + var arr = emitter._handlers && emitter._handlers[type] + if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers + else return arr || noHandlers + } + var off = CodeMirror.off = function(emitter, type, f) { if (emitter.removeEventListener) emitter.removeEventListener(type, f, false); else if (emitter.detachEvent) emitter.detachEvent("on" + type, f); else { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - for (var i = 0; i < arr.length; ++i) - if (arr[i] == f) { arr.splice(i, 1); break; } + var handlers = getHandlers(emitter, type, false) + for (var i = 0; i < handlers.length; ++i) + if (handlers[i] == f) { handlers.splice(i, 1); break; } } }; var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; + var handlers = getHandlers(emitter, type, true) + if (!handlers.length) return; var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); + for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args); }; var orphanDelayedCallbacks = null; @@ -8122,8 +8221,8 @@ // them to be executed when the last operation ends, or, if no // operation is active, when a timeout fires. function signalLater(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; + var arr = getHandlers(emitter, type, false) + if (!arr.length) return; var args = Array.prototype.slice.call(arguments, 2), list; if (operationGroup) { list = operationGroup.delayedCallbacks; @@ -8163,8 +8262,7 @@ } function hasHandler(emitter, type) { - var arr = emitter._handlers && emitter._handlers[type]; - return arr && arr.length > 0; + return getHandlers(emitter, type).length > 0 } // Add on and off methods to a constructor's prototype, to make @@ -8211,7 +8309,7 @@ // The inverse of countColumn -- find the offset that corresponds to // a particular column. - function findColumn(string, goal, tabSize) { + var findColumn = CodeMirror.findColumn = function(string, goal, tabSize) { for (var pos = 0, col = 0;;) { var nextTab = string.indexOf("\t", pos); if (nextTab == -1) nextTab = string.length; @@ -8504,14 +8602,16 @@ // KEY NAMES - var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; - CodeMirror.keyNames = keyNames; + var keyNames = CodeMirror.keyNames = { + 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" + }; (function() { // Number keys for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); @@ -8816,7 +8916,7 @@ // THE END - CodeMirror.version = "5.6.0"; + CodeMirror.version = "5.16.0"; return CodeMirror; }); diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/addons/hint/show-hint.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/addons/hint/show-hint.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/addons/hint/show-hint.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/addons/hint/show-hint.css 2018-08-23 17:28:17.000000000 +0000 @@ -16,6 +16,7 @@ background: white; font-size: 90%; font-family: monospace; + max-width: 19em; max-height: 20em; overflow-y: auto; @@ -25,8 +26,6 @@ margin: 0; padding: 0 4px; border-radius: 2px; - max-width: 19em; - overflow: hidden; white-space: pre; color: black; cursor: pointer; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/addons/lint/lint.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/addons/lint/lint.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/addons/lint/lint.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/addons/lint/lint.css 2018-08-23 17:28:17.000000000 +0000 @@ -4,10 +4,10 @@ } .CodeMirror-lint-tooltip { - background-color: infobackground; + background-color: #ffd; border: 1px solid black; border-radius: 4px 4px 4px 4px; - color: infotext; + color: black; font-family: monospace; font-size: 10pt; overflow: hidden; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/addons/merge/merge.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/addons/merge/merge.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/addons/merge/merge.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/addons/merge/merge.css 2018-08-23 17:28:17.000000000 +0000 @@ -60,6 +60,7 @@ position: absolute; cursor: pointer; color: #44c; + z-index: 3; } .CodeMirror-merge-copy-reverse { diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/modes/tiki.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/modes/tiki.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/modes/tiki.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/modes/tiki.css 2018-08-23 17:28:17.000000000 +0000 @@ -15,7 +15,7 @@ } .cm-tw-box { - border-top-width: 0px ! important; + border-top-width: 0px !important; border-style: solid; border-width: 1px; border-color: inherit; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/abcdef.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/abcdef.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/abcdef.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/abcdef.css 2018-08-23 17:28:17.000000000 +0000 @@ -27,6 +27,6 @@ .cm-s-abcdef span.cm-attribute { color: #DDFF00; } .cm-s-abcdef span.cm-error { color: #FF0000; } .cm-s-abcdef span.cm-header { color: aquamarine; font-weight: bold; } -.cm-s-abcdef span.cm-link { color: blue; } +.cm-s-abcdef span.cm-link { color: blueviolet; } .cm-s-abcdef .CodeMirror-activeline-background { background: #314151; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/base16-dark.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/base16-dark.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/base16-dark.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/base16-dark.css 2018-08-23 17:28:17.000000000 +0000 @@ -3,7 +3,7 @@ Name: Base16 Default Dark Author: Chris Kempson (http://chriskempson.com) - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/base16-light.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/base16-light.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/base16-light.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/base16-light.css 2018-08-23 17:28:17.000000000 +0000 @@ -3,7 +3,7 @@ Name: Base16 Default Light Author: Chris Kempson (http://chriskempson.com) - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/bespin.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/bespin.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/bespin.css 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/bespin.css 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + + Name: Bespin + Author: Mozilla / Jan T. Sott + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-bespin.CodeMirror {background: #28211c; color: #9d9b97;} +.cm-s-bespin div.CodeMirror-selected {background: #36312e !important;} +.cm-s-bespin .CodeMirror-gutters {background: #28211c; border-right: 0px;} +.cm-s-bespin .CodeMirror-linenumber {color: #666666;} +.cm-s-bespin .CodeMirror-cursor {border-left: 1px solid #797977 !important;} + +.cm-s-bespin span.cm-comment {color: #937121;} +.cm-s-bespin span.cm-atom {color: #9b859d;} +.cm-s-bespin span.cm-number {color: #9b859d;} + +.cm-s-bespin span.cm-property, .cm-s-bespin span.cm-attribute {color: #54be0d;} +.cm-s-bespin span.cm-keyword {color: #cf6a4c;} +.cm-s-bespin span.cm-string {color: #f9ee98;} + +.cm-s-bespin span.cm-variable {color: #54be0d;} +.cm-s-bespin span.cm-variable-2 {color: #5ea6ea;} +.cm-s-bespin span.cm-def {color: #cf7d34;} +.cm-s-bespin span.cm-error {background: #cf6a4c; color: #797977;} +.cm-s-bespin span.cm-bracket {color: #9d9b97;} +.cm-s-bespin span.cm-tag {color: #cf6a4c;} +.cm-s-bespin span.cm-link {color: #9b859d;} + +.cm-s-bespin .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-bespin .CodeMirror-activeline-background { background: #404040; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/hopscotch.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/hopscotch.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/hopscotch.css 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/hopscotch.css 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + + Name: Hopscotch + Author: Jan T. Sott + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-hopscotch.CodeMirror {background: #322931; color: #d5d3d5;} +.cm-s-hopscotch div.CodeMirror-selected {background: #433b42 !important;} +.cm-s-hopscotch .CodeMirror-gutters {background: #322931; border-right: 0px;} +.cm-s-hopscotch .CodeMirror-linenumber {color: #797379;} +.cm-s-hopscotch .CodeMirror-cursor {border-left: 1px solid #989498 !important;} + +.cm-s-hopscotch span.cm-comment {color: #b33508;} +.cm-s-hopscotch span.cm-atom {color: #c85e7c;} +.cm-s-hopscotch span.cm-number {color: #c85e7c;} + +.cm-s-hopscotch span.cm-property, .cm-s-hopscotch span.cm-attribute {color: #8fc13e;} +.cm-s-hopscotch span.cm-keyword {color: #dd464c;} +.cm-s-hopscotch span.cm-string {color: #fdcc59;} + +.cm-s-hopscotch span.cm-variable {color: #8fc13e;} +.cm-s-hopscotch span.cm-variable-2 {color: #1290bf;} +.cm-s-hopscotch span.cm-def {color: #fd8b19;} +.cm-s-hopscotch span.cm-error {background: #dd464c; color: #989498;} +.cm-s-hopscotch span.cm-bracket {color: #d5d3d5;} +.cm-s-hopscotch span.cm-tag {color: #dd464c;} +.cm-s-hopscotch span.cm-link {color: #c85e7c;} + +.cm-s-hopscotch .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-hopscotch .CodeMirror-activeline-background { background: #302020; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/icecoder.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/icecoder.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/icecoder.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/icecoder.css 2018-08-23 17:28:17.000000000 +0000 @@ -2,7 +2,7 @@ ICEcoder default theme by Matt Pass, used in code editor available at https://icecoder.net */ -.cm-s-icecoder { color: #666; background: #141612; } +.cm-s-icecoder { color: #666; background: #1d1d1b; } .cm-s-icecoder span.cm-keyword { color: #eee; font-weight:bold; } /* off-white 1 */ .cm-s-icecoder span.cm-atom { color: #e1c76e; } /* yellow */ @@ -37,6 +37,7 @@ .cm-s-icecoder .CodeMirror-cursor { border-left: 1px solid white; } .cm-s-icecoder div.CodeMirror-selected { color: #fff; background: #037; } -.cm-s-icecoder .CodeMirror-gutters { background: #141612; min-width: 41px; border-right: 0; } +.cm-s-icecoder .CodeMirror-gutters { background: #1d1d1b; min-width: 41px; border-right: 0; } .cm-s-icecoder .CodeMirror-linenumber { color: #555; cursor: default; } -.cm-s-icecoder .CodeMirror-matchingbracket { border: 1px solid grey; color: black !important; } +.cm-s-icecoder .CodeMirror-matchingbracket { color: #fff !important; background: #555 !important; } +.cm-s-icecoder .CodeMirror-activeline-background { background: #000; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/isotope.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/isotope.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/isotope.css 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/isotope.css 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + + Name: Isotope + Author: David Desandro / Jan T. Sott + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-isotope.CodeMirror {background: #000000; color: #e0e0e0;} +.cm-s-isotope div.CodeMirror-selected {background: #404040 !important;} +.cm-s-isotope .CodeMirror-gutters {background: #000000; border-right: 0px;} +.cm-s-isotope .CodeMirror-linenumber {color: #808080;} +.cm-s-isotope .CodeMirror-cursor {border-left: 1px solid #c0c0c0 !important;} + +.cm-s-isotope span.cm-comment {color: #3300ff;} +.cm-s-isotope span.cm-atom {color: #cc00ff;} +.cm-s-isotope span.cm-number {color: #cc00ff;} + +.cm-s-isotope span.cm-property, .cm-s-isotope span.cm-attribute {color: #33ff00;} +.cm-s-isotope span.cm-keyword {color: #ff0000;} +.cm-s-isotope span.cm-string {color: #ff0099;} + +.cm-s-isotope span.cm-variable {color: #33ff00;} +.cm-s-isotope span.cm-variable-2 {color: #0066ff;} +.cm-s-isotope span.cm-def {color: #ff9900;} +.cm-s-isotope span.cm-error {background: #ff0000; color: #c0c0c0;} +.cm-s-isotope span.cm-bracket {color: #e0e0e0;} +.cm-s-isotope span.cm-tag {color: #ff0000;} +.cm-s-isotope span.cm-link {color: #cc00ff;} + +.cm-s-isotope .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-isotope .CodeMirror-activeline-background { background: #202020; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/liquibyte.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/liquibyte.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/liquibyte.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/liquibyte.css 2018-08-23 17:28:17.000000000 +0000 @@ -4,17 +4,17 @@ line-height: 1.2em; font-size: 1em; } -.CodeMirror-focused .cm-matchhighlight { +.cm-s-liquibyte .CodeMirror-focused .cm-matchhighlight { text-decoration: underline; text-decoration-color: #0f0; text-decoration-style: wavy; } -.cm-trailingspace { +.cm-s-liquibyte .cm-trailingspace { text-decoration: line-through; text-decoration-color: #f00; text-decoration-style: dotted; } -.cm-tab { +.cm-s-liquibyte .cm-tab { text-decoration: line-through; text-decoration-color: #404040; text-decoration-style: dotted; @@ -54,42 +54,42 @@ .cm-s-liquibyte .CodeMirror-activeline-background { background-color: rgba(0, 255, 0, 0.15); } /* Default styles for common addons */ -div.CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } -div.CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } +.cm-s-liquibyte .CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } +.cm-s-liquibyte .CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } .CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); } /* Scrollbars */ /* Simple */ -div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { background-color: rgba(80, 80, 80, .7); } -div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { background-color: rgba(80, 80, 80, .3); border: 1px solid #404040; border-radius: 5px; } -div.CodeMirror-simplescroll-vertical div { +.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div { border-top: 1px solid #404040; border-bottom: 1px solid #404040; } -div.CodeMirror-simplescroll-horizontal div { +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div { border-left: 1px solid #404040; border-right: 1px solid #404040; } -div.CodeMirror-simplescroll-vertical { +.cm-s-liquibyte div.CodeMirror-simplescroll-vertical { background-color: #262626; } -div.CodeMirror-simplescroll-horizontal { +.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal { background-color: #262626; border-top: 1px solid #404040; } /* Overlay */ -div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { +.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { background-color: #404040; border-radius: 5px; } -div.CodeMirror-overlayscroll-vertical div { +.cm-s-liquibyte div.CodeMirror-overlayscroll-vertical div { border: 1px solid #404040; } -div.CodeMirror-overlayscroll-horizontal div { +.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div { border: 1px solid #404040; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/material.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/material.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/material.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/material.css 2018-08-23 17:28:17.000000000 +0000 @@ -32,10 +32,6 @@ .cm-s-material .cm-atom { color: #F77669; } .cm-s-material .cm-number { color: #F77669; } .cm-s-material .cm-def { color: rgba(233, 237, 237, 1); } -.cm-s-material .cm-error { - color: rgba(255, 255, 255, 1.0); - background-color: #EC5F67; -} .cm-s-material .cm-string { color: #C3E88D; } .cm-s-material .cm-string-2 { color: #80CBC4; } .cm-s-material .cm-comment { color: #546E7A; } @@ -47,6 +43,10 @@ .cm-s-material .cm-qualifier { color: #DECB6B; } .cm-s-material .cm-variable-3 { color: #DECB6B; } .cm-s-material .cm-tag { color: rgba(255, 83, 112, 1); } +.cm-s-material .cm-error { + color: rgba(255, 255, 255, 1.0); + background-color: #EC5F67; +} .cm-s-material .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/mbo.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/mbo.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/mbo.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/mbo.css 2018-08-23 17:28:17.000000000 +0000 @@ -33,5 +33,5 @@ .cm-s-mbo span.cm-qualifier { color: #ffffec; } .cm-s-mbo .CodeMirror-activeline-background { background: #494b41; } -.cm-s-mbo .CodeMirror-matchingbracket { color: #222 !important; } +.cm-s-mbo .CodeMirror-matchingbracket { color: #ffb928 !important; } .cm-s-mbo .CodeMirror-matchingtag { background: rgba(255, 255, 255, .37); } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/monokai.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/monokai.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/monokai.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/monokai.css 2018-08-23 17:28:17.000000000 +0000 @@ -16,6 +16,7 @@ .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; } .cm-s-monokai span.cm-keyword { color: #f92672; } +.cm-s-monokai span.cm-builtin { color: #66d9ef; } .cm-s-monokai span.cm-string { color: #e6db74; } .cm-s-monokai span.cm-variable { color: #f8f8f2; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/night.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/night.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/night.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/night.css 2018-08-23 17:28:17.000000000 +0000 @@ -10,7 +10,7 @@ .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } .cm-s-night .CodeMirror-cursor { border-left: 1px solid white; } -.cm-s-night span.cm-comment { color: #6900a1; } +.cm-s-night span.cm-comment { color: #8900d1; } .cm-s-night span.cm-atom { color: #845dc4; } .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } .cm-s-night span.cm-keyword { color: #599eff; } @@ -19,7 +19,6 @@ .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } .cm-s-night span.cm-bracket { color: #8da6ce; } -.cm-s-night span.cm-comment { color: #6900a1; } .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } .cm-s-night span.cm-link { color: #845dc4; } .cm-s-night span.cm-error { color: #9d1e15; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/railscasts.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/railscasts.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/railscasts.css 1970-01-01 00:00:00.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/railscasts.css 2018-08-23 17:28:17.000000000 +0000 @@ -0,0 +1,34 @@ +/* + + Name: Railscasts + Author: Ryan Bates (http://railscasts.com) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-railscasts.CodeMirror {background: #2b2b2b; color: #f4f1ed;} +.cm-s-railscasts div.CodeMirror-selected {background: #272935 !important;} +.cm-s-railscasts .CodeMirror-gutters {background: #2b2b2b; border-right: 0px;} +.cm-s-railscasts .CodeMirror-linenumber {color: #5a647e;} +.cm-s-railscasts .CodeMirror-cursor {border-left: 1px solid #d4cfc9 !important;} + +.cm-s-railscasts span.cm-comment {color: #bc9458;} +.cm-s-railscasts span.cm-atom {color: #b6b3eb;} +.cm-s-railscasts span.cm-number {color: #b6b3eb;} + +.cm-s-railscasts span.cm-property, .cm-s-railscasts span.cm-attribute {color: #a5c261;} +.cm-s-railscasts span.cm-keyword {color: #da4939;} +.cm-s-railscasts span.cm-string {color: #ffc66d;} + +.cm-s-railscasts span.cm-variable {color: #a5c261;} +.cm-s-railscasts span.cm-variable-2 {color: #6d9cbe;} +.cm-s-railscasts span.cm-def {color: #cc7833;} +.cm-s-railscasts span.cm-error {background: #da4939; color: #d4cfc9;} +.cm-s-railscasts span.cm-bracket {color: #f4f1ed;} +.cm-s-railscasts span.cm-tag {color: #da4939;} +.cm-s-railscasts span.cm-link {color: #b6b3eb;} + +.cm-s-railscasts .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-railscasts .CodeMirror-activeline-background { background: #303040; } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/solarized.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/solarized.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror/themes/solarized.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror/themes/solarized.css 2018-08-23 17:28:17.000000000 +0000 @@ -4,7 +4,7 @@ */ /* -Solarized color pallet +Solarized color palette http://ethanschoonover.com/solarized/img/solarized-palette.png */ @@ -34,7 +34,7 @@ } .cm-s-solarized.cm-s-dark { color: #839496; - background-color: #002b36; + background-color: #002b36; text-shadow: #002b36 0 1px; } .cm-s-solarized.cm-s-light { @@ -113,32 +113,34 @@ box-shadow: inset 7px 0 12px -6px #000; } -/* Gutter border and some shadow from it */ +/* Remove gutter border */ .cm-s-solarized .CodeMirror-gutters { - border-right: 1px solid; + border-right: 0; } /* Gutter colors and line number styling based of color scheme (dark / light) */ /* Dark */ .cm-s-solarized.cm-s-dark .CodeMirror-gutters { - background-color: #002b36; - border-color: #00232c; + background-color: #073642; } .cm-s-solarized.cm-s-dark .CodeMirror-linenumber { + color: #586e75; text-shadow: #021014 0 -1px; } /* Light */ .cm-s-solarized.cm-s-light .CodeMirror-gutters { - background-color: #fdf6e3; - border-color: #eee8d5; + background-color: #eee8d5; +} + +.cm-s-solarized.cm-s-light .CodeMirror-linenumber { + color: #839496; } /* Common */ .cm-s-solarized .CodeMirror-linenumber { - color: #586e75; padding: 0 5px; } .cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; } @@ -149,15 +151,19 @@ color: #586e75; } +/* Cursor */ .cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; } -/* -Active line. Negative margin compensates left padding of the text in the -view-port -*/ +/* Fat cursor */ +.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #fdf6e3; } +.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #fdf6e3; } +.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; } +.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; } + +/* Active line */ .cm-s-solarized.cm-s-dark .CodeMirror-activeline-background { - background: rgba(255, 255, 255, 0.10); + background: rgba(255, 255, 255, 0.06); } .cm-s-solarized.cm-s-light .CodeMirror-activeline-background { - background: rgba(0, 0, 0, 0.10); + background: rgba(0, 0, 0, 0.06); } diff -Nru ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror.css ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror.css --- ruby-codemirror-rails-5.6/vendor/assets/stylesheets/codemirror.css 2015-09-15 15:40:19.000000000 +0000 +++ ruby-codemirror-rails-5.16.0/vendor/assets/stylesheets/codemirror.css 2018-08-23 17:28:17.000000000 +0000 @@ -52,7 +52,7 @@ } .cm-fat-cursor .CodeMirror-cursor { width: auto; - border: 0; + border: 0 !important; background: #7e7; } .cm-fat-cursor div.CodeMirror-cursors { @@ -88,8 +88,14 @@ .cm-tab { display: inline-block; text-decoration: inherit; } +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: -20px; + overflow: hidden; +} .CodeMirror-ruler { border-left: 1px solid #ccc; + top: 0; bottom: 0; position: absolute; } @@ -165,7 +171,7 @@ } /* The fake, visible scrollbars. Used to force redraw during scrolling - before actuall scrolling happens, thus preventing shaking and + before actual scrolling happens, thus preventing shaking and flickering artifacts. */ .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { position: absolute; @@ -191,12 +197,14 @@ .CodeMirror-gutters { position: absolute; left: 0; top: 0; + min-height: 100%; z-index: 3; } .CodeMirror-gutter { white-space: normal; height: 100%; display: inline-block; + vertical-align: top; margin-bottom: -30px; /* Hack to make IE7 behave */ *zoom:1; @@ -244,6 +252,8 @@ position: relative; overflow: visible; -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; } .CodeMirror-wrap pre { word-wrap: break-word; @@ -287,7 +297,10 @@ visibility: hidden; } -.CodeMirror-cursor { position: absolute; } +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} .CodeMirror-measure pre { position: static; } div.CodeMirror-cursors {