@openui5/sap.ui.codeeditor 1.94.0 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +12 -12
- package/THIRDPARTY.txt +21 -17
- package/package.json +2 -2
- package/src/sap/ui/codeeditor/.library +6 -6
- package/src/sap/ui/codeeditor/CodeEditor.js +41 -15
- package/src/sap/ui/codeeditor/js/ace/ace.js +1705 -1669
- package/src/sap/ui/codeeditor/js/ace/css/ace.css +1025 -0
- package/src/sap/ui/codeeditor/js/ace/css/ambiance-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/ambiance-2.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/chrome-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/clouds-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/clouds_midnight-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/cobalt-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/crimson_editor-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/dawn-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/dracula-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/dreamweaver-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/eclipse-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/github-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/gob-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/gruvbox-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/idle_fingers-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/iplastic-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/iplastic-2.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/kr_theme-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-10.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-11.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-12.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-13.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-14.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-15.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-16.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-2.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-3.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-4.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-5.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-6.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-7.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-8.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/main-9.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/merbivore-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/merbivore_soft-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/mono_industrial-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/monokai-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/one_dark-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/pastel_on_dark-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/solarized_dark-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/solarized_light-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/sqlserver-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/terminal-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/textmate-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/ambiance.css +168 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/chaos.css +146 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/chrome.css +119 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/clouds.css +87 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/clouds_midnight.css +88 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/cobalt.css +104 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/crimson_editor.css +110 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/dawn.css +100 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/dracula.css +119 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/dreamweaver.css +134 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/eclipse.css +88 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/github.css +95 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/gob.css +103 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/gruvbox.css +73 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/idle_fingers.css +88 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/iplastic.css +113 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/katzenmilch.css +113 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/kr_theme.css +96 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/kuroir.css +52 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/merbivore.css +87 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/merbivore_soft.css +88 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/mono_industrial.css +99 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/monokai.css +97 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/nord_dark.css +85 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/one_dark.css +123 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/pastel_on_dark.css +100 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/solarized_dark.css +80 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/solarized_light.css +83 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/sqlserver.css +129 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/terminal.css +105 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/textmate.css +119 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/tomorrow.css +100 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/tomorrow_night.css +100 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/tomorrow_night_blue.css +98 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/tomorrow_night_bright.css +113 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/tomorrow_night_eighties.css +100 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/twilight.css +100 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/vibrant_ink.css +86 -0
- package/src/sap/ui/codeeditor/js/ace/css/theme/xcode.css +80 -0
- package/src/sap/ui/codeeditor/js/ace/css/tomorrow-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/tomorrow_night-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/tomorrow_night_blue-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/tomorrow_night_bright-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/tomorrow_night_eighties-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/twilight-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/vibrant_ink-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/css/xcode-1.png +0 -0
- package/src/sap/ui/codeeditor/js/ace/ext-beautify.js +17 -10
- package/src/sap/ui/codeeditor/js/ace/ext-code_lens.js +238 -0
- package/src/sap/ui/codeeditor/js/ace/ext-elastic_tabstops_lite.js +1 -1
- package/src/sap/ui/codeeditor/js/ace/ext-emmet.js +343 -238
- package/src/sap/ui/codeeditor/js/ace/ext-hardwrap.js +85 -0
- package/src/sap/ui/codeeditor/js/ace/ext-keybinding_menu.js +26 -11
- package/src/sap/ui/codeeditor/js/ace/ext-language_tools.js +435 -272
- package/src/sap/ui/codeeditor/js/ace/ext-linking.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/ext-modelist.js +22 -11
- package/src/sap/ui/codeeditor/js/ace/ext-options.js +85 -35
- package/src/sap/ui/codeeditor/js/ace/ext-prompt.js +510 -299
- package/src/sap/ui/codeeditor/js/ace/ext-rtl.js +1 -3
- package/src/sap/ui/codeeditor/js/ace/ext-searchbox.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/ext-settings_menu.js +89 -39
- package/src/sap/ui/codeeditor/js/ace/ext-spellcheck.js +1 -2
- package/src/sap/ui/codeeditor/js/ace/ext-split.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/ext-static_highlight.js +3 -229
- package/src/sap/ui/codeeditor/js/ace/ext-statusbar.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/ext-textarea.js +3 -563
- package/src/sap/ui/codeeditor/js/ace/ext-themelist.js +4 -2
- package/src/sap/ui/codeeditor/js/ace/ext-whitespace.js +1 -1
- package/src/sap/ui/codeeditor/js/ace/keybinding-emacs.js +29 -30
- package/src/sap/ui/codeeditor/js/ace/keybinding-sublime.js +2 -5
- package/src/sap/ui/codeeditor/js/ace/keybinding-vim.js +718 -184
- package/src/sap/ui/codeeditor/js/ace/keybinding-vscode.js +262 -0
- package/src/sap/ui/codeeditor/js/ace/mode-abap.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-abc.js +6 -3
- package/src/sap/ui/codeeditor/js/ace/mode-actionscript.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-ada.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-alda.js +311 -0
- package/src/sap/ui/codeeditor/js/ace/mode-apache_conf.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-apex.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-applescript.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-aql.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-asciidoc.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-asl.js +21 -20
- package/src/sap/ui/codeeditor/js/ace/mode-assembly_x86.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-autohotkey.js +6 -4
- package/src/sap/ui/codeeditor/js/ace/mode-batchfile.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-c9search.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-c_cpp.js +7 -6
- package/src/sap/ui/codeeditor/js/ace/mode-cirru.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-clojure.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-cobol.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-coffee.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/mode-coldfusion.js +22 -19
- package/src/sap/ui/codeeditor/js/ace/mode-crystal.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-csharp.js +6 -6
- package/src/sap/ui/codeeditor/js/ace/mode-csound_document.js +178 -61
- package/src/sap/ui/codeeditor/js/ace/mode-csound_orchestra.js +162 -51
- package/src/sap/ui/codeeditor/js/ace/mode-csound_score.js +34 -25
- package/src/sap/ui/codeeditor/js/ace/mode-csp.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-css.js +7 -6
- package/src/sap/ui/codeeditor/js/ace/mode-curly.js +22 -19
- package/src/sap/ui/codeeditor/js/ace/mode-d.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-dart.js +10 -8
- package/src/sap/ui/codeeditor/js/ace/mode-diff.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-django.js +22 -18
- package/src/sap/ui/codeeditor/js/ace/mode-dockerfile.js +6 -5
- package/src/sap/ui/codeeditor/js/ace/mode-dot.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-drools.js +7 -6
- package/src/sap/ui/codeeditor/js/ace/mode-edifact.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-eiffel.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-ejs.js +692 -184
- package/src/sap/ui/codeeditor/js/ace/mode-elixir.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-elm.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-erlang.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-forth.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-fortran.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-fsharp.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-fsl.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-ftl.js +7 -7
- package/src/sap/ui/codeeditor/js/ace/mode-gcode.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-gherkin.js +2 -4
- package/src/sap/ui/codeeditor/js/ace/mode-gitignore.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-glsl.js +9 -8
- package/src/sap/ui/codeeditor/js/ace/mode-gobstones.js +259 -99
- package/src/sap/ui/codeeditor/js/ace/mode-golang.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-graphqlschema.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-groovy.js +8 -7
- package/src/sap/ui/codeeditor/js/ace/mode-haml.js +428 -113
- package/src/sap/ui/codeeditor/js/ace/mode-handlebars.js +23 -20
- package/src/sap/ui/codeeditor/js/ace/mode-haskell.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-haskell_cabal.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-haxe.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-hjson.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-html.js +20 -17
- package/src/sap/ui/codeeditor/js/ace/mode-html_elixir.js +25 -22
- package/src/sap/ui/codeeditor/js/ace/mode-html_ruby.js +693 -185
- package/src/sap/ui/codeeditor/js/ace/mode-ini.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-io.js +5 -10
- package/src/sap/ui/codeeditor/js/ace/mode-jack.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-jade.js +13 -13
- package/src/sap/ui/codeeditor/js/ace/mode-java.js +11 -9
- package/src/sap/ui/codeeditor/js/ace/mode-javascript.js +6 -5
- package/src/sap/ui/codeeditor/js/ace/mode-json.js +7 -4
- package/src/sap/ui/codeeditor/js/ace/mode-json5.js +360 -0
- package/src/sap/ui/codeeditor/js/ace/mode-jsoniq.js +6 -5
- package/src/sap/ui/codeeditor/js/ace/mode-jsp.js +12 -11
- package/src/sap/ui/codeeditor/js/ace/mode-jssm.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-jsx.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-julia.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-kotlin.js +5 -3
- package/src/sap/ui/codeeditor/js/ace/mode-latex.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-latte.js +2708 -0
- package/src/sap/ui/codeeditor/js/ace/mode-less.js +7 -7
- package/src/sap/ui/codeeditor/js/ace/mode-liquid.js +24 -20
- package/src/sap/ui/codeeditor/js/ace/mode-lisp.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-livescript.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-logiql.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-logtalk.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-lsl.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/mode-lua.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-luapage.js +26 -22
- package/src/sap/ui/codeeditor/js/ace/mode-lucene.js +78 -10
- package/src/sap/ui/codeeditor/js/ace/mode-makefile.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/mode-markdown.js +30 -24
- package/src/sap/ui/codeeditor/js/ace/mode-mask.js +12 -12
- package/src/sap/ui/codeeditor/js/ace/mode-matlab.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-maze.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-mediawiki.js +592 -0
- package/src/sap/ui/codeeditor/js/ace/mode-mel.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/{mode-mipsassembler.js → mode-mips.js} +99 -31
- package/src/sap/ui/codeeditor/js/ace/mode-mixal.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-mushcode.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-mysql.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-nginx.js +13 -12
- package/src/sap/ui/codeeditor/js/ace/mode-nim.js +10 -9
- package/src/sap/ui/codeeditor/js/ace/mode-nix.js +9 -8
- package/src/sap/ui/codeeditor/js/ace/mode-nsis.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-nunjucks.js +2698 -0
- package/src/sap/ui/codeeditor/js/ace/mode-objectivec.js +6 -6
- package/src/sap/ui/codeeditor/js/ace/mode-ocaml.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-pascal.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-perl.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/mode-pgsql.js +9 -9
- package/src/sap/ui/codeeditor/js/ace/mode-php.js +513 -302
- package/src/sap/ui/codeeditor/js/ace/mode-php_laravel_blade.js +515 -304
- package/src/sap/ui/codeeditor/js/ace/mode-pig.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-plain_text.js +1 -1
- package/src/sap/ui/codeeditor/js/ace/mode-powershell.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-praat.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-prisma.js +489 -0
- package/src/sap/ui/codeeditor/js/ace/mode-prolog.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-properties.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-protobuf.js +9 -8
- package/src/sap/ui/codeeditor/js/ace/mode-puppet.js +12 -13
- package/src/sap/ui/codeeditor/js/ace/mode-python.js +6 -5
- package/src/sap/ui/codeeditor/js/ace/mode-qml.js +381 -0
- package/src/sap/ui/codeeditor/js/ace/mode-r.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/{mode-perl6.js → mode-raku.js} +13 -13
- package/src/sap/ui/codeeditor/js/ace/mode-razor.js +25 -21
- package/src/sap/ui/codeeditor/js/ace/mode-rdoc.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-red.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-redshift.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-rhtml.js +24 -21
- package/src/sap/ui/codeeditor/js/ace/mode-rst.js +3 -2
- package/src/sap/ui/codeeditor/js/ace/mode-ruby.js +672 -167
- package/src/sap/ui/codeeditor/js/ace/mode-rust.js +9 -8
- package/src/sap/ui/codeeditor/js/ace/mode-sass.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-scad.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/mode-scala.js +8 -7
- package/src/sap/ui/codeeditor/js/ace/mode-scheme.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-scrypt.js +364 -0
- package/src/sap/ui/codeeditor/js/ace/mode-scss.js +7 -7
- package/src/sap/ui/codeeditor/js/ace/mode-sh.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-sjs.js +8 -7
- package/src/sap/ui/codeeditor/js/ace/mode-slim.js +745 -146
- package/src/sap/ui/codeeditor/js/ace/mode-smarty.js +22 -19
- package/src/sap/ui/codeeditor/js/ace/mode-smithy.js +507 -0
- package/src/sap/ui/codeeditor/js/ace/mode-snippets.js +3 -2
- package/src/sap/ui/codeeditor/js/ace/mode-soy_template.js +22 -19
- package/src/sap/ui/codeeditor/js/ace/mode-space.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-sparql.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-sql.js +163 -2
- package/src/sap/ui/codeeditor/js/ace/mode-sqlserver.js +7 -6
- package/src/sap/ui/codeeditor/js/ace/mode-stylus.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-svg.js +13 -12
- package/src/sap/ui/codeeditor/js/ace/mode-swift.js +10 -4
- package/src/sap/ui/codeeditor/js/ace/mode-tcl.js +8 -4
- package/src/sap/ui/codeeditor/js/ace/mode-terraform.js +18 -15
- package/src/sap/ui/codeeditor/js/ace/mode-tex.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-textile.js +4 -3
- package/src/sap/ui/codeeditor/js/ace/mode-toml.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-tsx.js +9 -8
- package/src/sap/ui/codeeditor/js/ace/mode-turtle.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/mode-twig.js +22 -19
- package/src/sap/ui/codeeditor/js/ace/mode-typescript.js +8 -7
- package/src/sap/ui/codeeditor/js/ace/mode-vala.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/mode-vbscript.js +445 -16
- package/src/sap/ui/codeeditor/js/ace/mode-velocity.js +24 -20
- package/src/sap/ui/codeeditor/js/ace/mode-verilog.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/mode-vhdl.js +7 -8
- package/src/sap/ui/codeeditor/js/ace/mode-visualforce.js +22 -19
- package/src/sap/ui/codeeditor/js/ace/mode-wollok.js +9 -7
- package/src/sap/ui/codeeditor/js/ace/mode-xml.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-xquery.js +6 -5
- package/src/sap/ui/codeeditor/js/ace/mode-yaml.js +4 -4
- package/src/sap/ui/codeeditor/js/ace/mode-zeek.js +539 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/abap.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/abc.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/actionscript.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/ada.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/alda.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/apache_conf.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/apex.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/applescript.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/aql.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/asciidoc.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/asl.js +1 -6
- package/src/sap/ui/codeeditor/js/ace/snippets/assembly_x86.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/autohotkey.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/batchfile.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/c9search.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/c_cpp.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/cirru.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/clojure.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/cobol.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/coffee.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/coldfusion.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/crystal.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/csharp.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/csound_document.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/csound_orchestra.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/csound_score.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/csp.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/css.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/curly.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/d.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/dart.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/diff.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/django.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/dockerfile.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/dot.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/drools.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/edifact.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/eiffel.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/ejs.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/elixir.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/elm.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/erlang.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/forth.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/fortran.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/fsharp.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/fsl.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/snippets/ftl.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/gcode.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/gherkin.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/gitignore.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/glsl.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/gobstones.js +1695 -26
- package/src/sap/ui/codeeditor/js/ace/snippets/golang.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/graphqlschema.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/groovy.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/haml.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/handlebars.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/haskell.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/haskell_cabal.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/haxe.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/hjson.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/html.js +4 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/html_elixir.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/html_ruby.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/ini.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/io.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/jack.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/jade.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/java.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/javascript.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/json.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/json5.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/jsoniq.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/jsp.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/jssm.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/jsx.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/julia.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/kotlin.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/latex.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/latte.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/less.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/liquid.js +884 -4
- package/src/sap/ui/codeeditor/js/ace/snippets/lisp.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/livescript.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/logiql.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/logtalk.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/lsl.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/lua.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/luapage.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/lucene.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/makefile.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/markdown.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/mask.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/matlab.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/maze.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/mediawiki.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/mel.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/mips.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/mixal.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/mushcode.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/mysql.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/nginx.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/nim.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/nix.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/nsis.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/nunjucks.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/objectivec.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/ocaml.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/pascal.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/perl.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/pgsql.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/php.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/php_laravel_blade.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/pig.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/plain_text.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/powershell.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/praat.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/prisma.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/prolog.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/properties.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/protobuf.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/puppet.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/python.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/qml.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/r.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/raku.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/razor.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/rdoc.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/red.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/redshift.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/rhtml.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/rst.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/ruby.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/rust.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/sass.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/scad.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/scala.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/scheme.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/scrypt.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/scss.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/sh.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/sjs.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/slim.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/smarty.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/smithy.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/snippets/snippets.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/soy_template.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/space.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/sparql.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/sql.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/sqlserver.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/stylus.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/svg.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/swift.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/tcl.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/terraform.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/tex.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/text.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/textile.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/toml.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/tsx.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/turtle.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/twig.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/typescript.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/vala.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/vbscript.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/velocity.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/verilog.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/vhdl.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/visualforce.js +2 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/wollok.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/xml.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/xquery.js +2 -3
- package/src/sap/ui/codeeditor/js/ace/snippets/yaml.js +1 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/zeek.js +9 -0
- package/src/sap/ui/codeeditor/js/ace/theme-ambiance.js +5 -4
- package/src/sap/ui/codeeditor/js/ace/theme-chaos.js +3 -3
- package/src/sap/ui/codeeditor/js/ace/theme-chrome.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-clouds.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-clouds_midnight.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-cobalt.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-crimson_editor.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-dawn.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-dracula.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-dreamweaver.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-eclipse.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-github.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-gob.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-gruvbox.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-idle_fingers.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-iplastic.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-katzenmilch.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-kr_theme.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-kuroir.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-merbivore.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-merbivore_soft.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-mono_industrial.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-monokai.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-nord_dark.js +102 -0
- package/src/sap/ui/codeeditor/js/ace/theme-one_dark.js +139 -0
- package/src/sap/ui/codeeditor/js/ace/theme-pastel_on_dark.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-solarized_dark.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-solarized_light.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-sqlserver.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-terminal.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-textmate.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-tomorrow.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night_blue.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night_bright.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-tomorrow_night_eighties.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-twilight.js +5 -5
- package/src/sap/ui/codeeditor/js/ace/theme-vibrant_ink.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/theme-xcode.js +2 -2
- package/src/sap/ui/codeeditor/js/ace/worker-base.js +1421 -0
- package/src/sap/ui/codeeditor/js/ace/worker-coffee.js +17 -703
- package/src/sap/ui/codeeditor/js/ace/worker-css.js +3629 -3396
- package/src/sap/ui/codeeditor/js/ace/worker-html.js +17 -703
- package/src/sap/ui/codeeditor/js/ace/worker-javascript.js +7831 -5361
- package/src/sap/ui/codeeditor/js/ace/worker-json.js +17 -703
- package/src/sap/ui/codeeditor/js/ace/worker-lua.js +973 -1001
- package/src/sap/ui/codeeditor/js/ace/worker-php.js +859 -1477
- package/src/sap/ui/codeeditor/js/ace/worker-xml.js +26 -707
- package/src/sap/ui/codeeditor/js/ace/worker-xquery.js +17 -703
- package/src/sap/ui/codeeditor/library.js +2 -2
- package/ui5.yaml +4 -1
- package/src/sap/ui/codeeditor/js/ace/LICENSE.txt +0 -24
- package/src/sap/ui/codeeditor/js/ace/ext-chromevox.js +0 -540
- package/src/sap/ui/codeeditor/js/ace/ext-old_ie.js +0 -502
- package/src/sap/ui/codeeditor/js/ace/mode-bro.js +0 -334
- package/src/sap/ui/codeeditor/js/ace/mode-lean.js +0 -281
- package/src/sap/ui/codeeditor/js/ace/mode-live_script.js +0 -481
- package/src/sap/ui/codeeditor/js/ace/mode-mavens_mate_log.js +0 -160
- package/src/sap/ui/codeeditor/js/ace/mode-mips_assembler.js +0 -235
- package/src/sap/ui/codeeditor/js/ace/mode-swig.js +0 -1099
- package/src/sap/ui/codeeditor/js/ace/snippets/bro.js +0 -15
- package/src/sap/ui/codeeditor/js/ace/snippets/lean.js +0 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/live_script.js +0 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/mips_assembler.js +0 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/mipsassembler.js +0 -7
- package/src/sap/ui/codeeditor/js/ace/snippets/perl6.js +0 -14
- package/src/sap/ui/codeeditor/js/ace/snippets/swig.js +0 -7
|
@@ -1,4 +1,83 @@
|
|
|
1
|
-
ace.define("ace/
|
|
1
|
+
ace.define("ace/ext/hardwrap",[], function(require, exports, module) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var Range = require("../range").Range;
|
|
5
|
+
|
|
6
|
+
function hardWrap(editor, options) {
|
|
7
|
+
var max = options.column || editor.getOption("printMarginColumn");
|
|
8
|
+
|
|
9
|
+
var row = Math.min(options.startRow, options.endRow);
|
|
10
|
+
var endRow = Math.max(options.startRow, options.endRow);
|
|
11
|
+
|
|
12
|
+
var session = editor.session;
|
|
13
|
+
|
|
14
|
+
while (row <= endRow) {
|
|
15
|
+
var line = session.getLine(row);
|
|
16
|
+
if (line.length > max) {
|
|
17
|
+
var space = findSpace(line, max, 5);
|
|
18
|
+
if (space) {
|
|
19
|
+
session.replace(new Range(row,space.start,row,space.end), "\n");
|
|
20
|
+
}
|
|
21
|
+
endRow++;
|
|
22
|
+
} else if (/\S/.test(line) && row != endRow) {
|
|
23
|
+
var nextLine = session.getLine(row + 1);
|
|
24
|
+
if (nextLine && /\S/.test(nextLine)) {
|
|
25
|
+
var trimmedLine = line.replace(/\s+$/, "");
|
|
26
|
+
var trimmedNextLine = nextLine.replace(/^\s+/, "");
|
|
27
|
+
var mergedLine = trimmedLine + " " + trimmedNextLine;
|
|
28
|
+
|
|
29
|
+
var space = findSpace(mergedLine, max, 5);
|
|
30
|
+
if (space && space.start > trimmedLine.length || mergedLine.length < max) {
|
|
31
|
+
var replaceRange = new Range(row,trimmedLine.length,row + 1,nextLine.length - trimmedNextLine.length);
|
|
32
|
+
session.replace(replaceRange, " ");
|
|
33
|
+
row--;
|
|
34
|
+
endRow--;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
row++;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function findSpace(line, max, min) {
|
|
42
|
+
if (line.length < max)
|
|
43
|
+
return;
|
|
44
|
+
var before = line.slice(0, max);
|
|
45
|
+
var after = line.slice(max);
|
|
46
|
+
var spaceAfter = /^(?:(\s+)|(\S+)(\s+))/.exec(after);
|
|
47
|
+
var spaceBefore = /(?:(\s+)|(\s+)(\S+))$/.exec(before);
|
|
48
|
+
var start = 0;
|
|
49
|
+
var end = 0;
|
|
50
|
+
if (spaceBefore && !spaceBefore[2]) {
|
|
51
|
+
start = max - spaceBefore[1].length;
|
|
52
|
+
end = max;
|
|
53
|
+
}
|
|
54
|
+
if (spaceAfter && !spaceAfter[2]) {
|
|
55
|
+
if (!start)
|
|
56
|
+
start = max;
|
|
57
|
+
end = max + spaceAfter[1].length;
|
|
58
|
+
}
|
|
59
|
+
if (start) {
|
|
60
|
+
return {
|
|
61
|
+
start: start,
|
|
62
|
+
end: end
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (spaceBefore && spaceBefore[2] && spaceBefore.index > min) {
|
|
66
|
+
return {
|
|
67
|
+
start: spaceBefore.index,
|
|
68
|
+
end: spaceBefore.index + spaceBefore[3].length
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
exports.hardWrap = hardWrap;
|
|
77
|
+
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
ace.define("ace/keyboard/vim",[], function(require, exports, module) {
|
|
2
81
|
'use strict';
|
|
3
82
|
|
|
4
83
|
function log() {
|
|
@@ -36,6 +115,7 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
36
115
|
var SearchHighlight = require("../search_highlight").SearchHighlight;
|
|
37
116
|
var multiSelectCommands = require("../commands/multi_select_commands");
|
|
38
117
|
var TextModeTokenRe = require("../mode/text").Mode.prototype.tokenRe;
|
|
118
|
+
var hardWrap = require("../ext/hardwrap").hardWrap;
|
|
39
119
|
require("../multi_select");
|
|
40
120
|
|
|
41
121
|
var CodeMirror = function(ace) {
|
|
@@ -78,6 +158,7 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
78
158
|
};
|
|
79
159
|
};
|
|
80
160
|
CodeMirror.lookupKey = function lookupKey(key, map, handle) {
|
|
161
|
+
if (!map) map = "default";
|
|
81
162
|
if (typeof map == "string")
|
|
82
163
|
map = CodeMirror.keyMap[map];
|
|
83
164
|
var found = typeof map == "function" ? map(key) : map[key];
|
|
@@ -95,6 +176,11 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
95
176
|
}
|
|
96
177
|
};
|
|
97
178
|
|
|
179
|
+
|
|
180
|
+
CodeMirror.findMatchingTag = function(cm, head) {
|
|
181
|
+
|
|
182
|
+
};
|
|
183
|
+
|
|
98
184
|
CodeMirror.signal = function(o, name, e) { return o._signal(name, e) };
|
|
99
185
|
CodeMirror.on = event.addListener;
|
|
100
186
|
CodeMirror.off = event.removeListener;
|
|
@@ -103,10 +189,10 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
103
189
|
TextModeTokenRe.lastIndex = 0;
|
|
104
190
|
return TextModeTokenRe.test(ch);
|
|
105
191
|
};
|
|
106
|
-
|
|
192
|
+
|
|
107
193
|
(function() {
|
|
108
194
|
oop.implement(CodeMirror.prototype, EventEmitter);
|
|
109
|
-
|
|
195
|
+
|
|
110
196
|
this.destroy = function() {
|
|
111
197
|
this.ace.off('change', this.onChange);
|
|
112
198
|
this.ace.off('changeSelection', this.onSelectionChange);
|
|
@@ -193,10 +279,15 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
193
279
|
ch = line.ch;
|
|
194
280
|
line = line.line;
|
|
195
281
|
}
|
|
282
|
+
var shouldScroll = !this.curOp && !this.ace.inVirtualSelectionMode;
|
|
196
283
|
if (!this.ace.inVirtualSelectionMode)
|
|
197
284
|
this.ace.exitMultiSelectMode();
|
|
198
285
|
this.ace.session.unfold({row: line, column: ch});
|
|
199
286
|
this.ace.selection.moveTo(line, ch);
|
|
287
|
+
if (shouldScroll) {
|
|
288
|
+
this.ace.renderer.scrollCursorIntoView();
|
|
289
|
+
this.ace.endOperation();
|
|
290
|
+
}
|
|
200
291
|
};
|
|
201
292
|
this.getCursor = function(p) {
|
|
202
293
|
var sel = this.ace.selection;
|
|
@@ -226,7 +317,7 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
226
317
|
r.cursor = Range.comparePoints(r.start, head) ? r.end : r.start;
|
|
227
318
|
return r;
|
|
228
319
|
});
|
|
229
|
-
|
|
320
|
+
|
|
230
321
|
if (this.ace.inVirtualSelectionMode) {
|
|
231
322
|
this.ace.selection.fromOrientedRange(ranges[0]);
|
|
232
323
|
return;
|
|
@@ -258,6 +349,9 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
258
349
|
var pos = this.ace.session.$clipPositionToDocument(p.line, p.ch);
|
|
259
350
|
return toCmPos(pos);
|
|
260
351
|
};
|
|
352
|
+
this.foldCode = function(pos) {
|
|
353
|
+
this.ace.session.$toggleFoldWidget(pos.line, {});
|
|
354
|
+
};
|
|
261
355
|
this.markText = function(cursor) {
|
|
262
356
|
return {clear: function() {}, find: function() {}};
|
|
263
357
|
};
|
|
@@ -268,7 +362,7 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
268
362
|
var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);
|
|
269
363
|
var colShift = (end.column - start.column) * (isInsert ? 1 : -1);
|
|
270
364
|
if (isInsert) end = start;
|
|
271
|
-
|
|
365
|
+
|
|
272
366
|
for (var i in this.marks) {
|
|
273
367
|
var point = this.marks[i];
|
|
274
368
|
var cmp = Range.comparePoints(point, start);
|
|
@@ -373,6 +467,7 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
373
467
|
query = query.source;
|
|
374
468
|
isRegexp = true;
|
|
375
469
|
}
|
|
470
|
+
if (query == "\\n") { query = "\n"; isRegexp = false; }
|
|
376
471
|
var search = new Search();
|
|
377
472
|
if (pos.ch == undefined) pos.ch = Number.MAX_VALUE;
|
|
378
473
|
var acePos = {row: pos.line, column: pos.ch};
|
|
@@ -391,14 +486,8 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
391
486
|
start: last || acePos
|
|
392
487
|
});
|
|
393
488
|
var range = search.find(cm.ace.session);
|
|
394
|
-
if (range && range.isEmpty()) {
|
|
395
|
-
if (cm.getLine(range.start.row).length == range.start.column) {
|
|
396
|
-
search.$options.start = range;
|
|
397
|
-
range = search.find(cm.ace.session);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
489
|
last = range;
|
|
401
|
-
return last;
|
|
490
|
+
return last && [!last.isEmpty()];
|
|
402
491
|
},
|
|
403
492
|
from: function() { return last && toCmPos(last.start) },
|
|
404
493
|
to: function() { return last && toCmPos(last.end) },
|
|
@@ -432,8 +521,11 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
432
521
|
};
|
|
433
522
|
this.replaceRange = function(text, s, e) {
|
|
434
523
|
if (!e) e = s;
|
|
435
|
-
|
|
524
|
+
var range = new Range(s.line, s.ch, e.line, e.ch);
|
|
525
|
+
this.ace.session.$clipRangeToDocument(range);
|
|
526
|
+
return this.ace.session.replace(range, text);
|
|
436
527
|
};
|
|
528
|
+
this.replaceSelection =
|
|
437
529
|
this.replaceSelections = function(p) {
|
|
438
530
|
var sel = this.ace.selection;
|
|
439
531
|
if (this.ace.inVirtualSelectionMode) {
|
|
@@ -475,6 +567,10 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
475
567
|
name = optMap[name];
|
|
476
568
|
val = !val;
|
|
477
569
|
break;
|
|
570
|
+
case 'keyMap':
|
|
571
|
+
this.state.$keyMap = val;
|
|
572
|
+
return;
|
|
573
|
+
break;
|
|
478
574
|
default:
|
|
479
575
|
name = optMap[name];
|
|
480
576
|
}
|
|
@@ -489,6 +585,8 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
489
585
|
case 'indentWithTabs':
|
|
490
586
|
name = optMap[name];
|
|
491
587
|
return !val;
|
|
588
|
+
case 'keyMap':
|
|
589
|
+
return this.state.$keyMap;
|
|
492
590
|
}
|
|
493
591
|
return aceOpt ? val : this.state[name];
|
|
494
592
|
};
|
|
@@ -542,7 +640,7 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
542
640
|
return this.ace.getValue();
|
|
543
641
|
};
|
|
544
642
|
this.setValue = function(v) {
|
|
545
|
-
return this.ace.setValue(v);
|
|
643
|
+
return this.ace.setValue(v, -1);
|
|
546
644
|
};
|
|
547
645
|
this.getTokenTypeAt = function(pos) {
|
|
548
646
|
var token = this.ace.session.getTokenAt(pos.line, pos.ch);
|
|
@@ -588,6 +686,16 @@ ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib
|
|
|
588
686
|
};
|
|
589
687
|
this.getMode = function() {
|
|
590
688
|
return { name : this.getOption("mode") };
|
|
689
|
+
};
|
|
690
|
+
this.execCommand = function(name) {
|
|
691
|
+
if (name == "indentAuto") this.ace.execCommand("autoindent");
|
|
692
|
+
else console.log(name + " is not implemented");
|
|
693
|
+
};
|
|
694
|
+
this.getLineNumber = function(handle) {
|
|
695
|
+
return handle.row;
|
|
696
|
+
}
|
|
697
|
+
this.getLineHandle = function(row) {
|
|
698
|
+
return {text: this.ace.session.getLine(row), row: row};
|
|
591
699
|
}
|
|
592
700
|
}).call(CodeMirror.prototype);
|
|
593
701
|
function toAcePos(cmPos) {
|
|
@@ -699,7 +807,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
699
807
|
width: 20em;\
|
|
700
808
|
color: inherit;\
|
|
701
809
|
font-family: monospace;\
|
|
702
|
-
}", "vimMode");
|
|
810
|
+
}", "vimMode", false);
|
|
703
811
|
(function() {
|
|
704
812
|
function dialogDiv(cm, template, bottom) {
|
|
705
813
|
var wrap = cm.ace.container;
|
|
@@ -711,7 +819,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
711
819
|
dialog.className = "ace_dialog ace_dialog-top";
|
|
712
820
|
|
|
713
821
|
if (typeof template == "string") {
|
|
714
|
-
|
|
822
|
+
// ##### BEGIN MODIFIED BY SAP
|
|
823
|
+
throw new Error("Can not use string template for the dialog. This is required to avoid CSP inline styles violations");
|
|
824
|
+
// ##### END MODIFIED BY SAP
|
|
715
825
|
} else { // Assuming it's a detached DOM element.
|
|
716
826
|
dialog.appendChild(template);
|
|
717
827
|
}
|
|
@@ -738,18 +848,24 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
738
848
|
inp.value = newVal;
|
|
739
849
|
} else {
|
|
740
850
|
if (closed) return;
|
|
741
|
-
|
|
851
|
+
|
|
742
852
|
if (newVal && newVal.type == "blur") {
|
|
743
853
|
if (document.activeElement === inp)
|
|
744
854
|
return;
|
|
745
855
|
}
|
|
746
|
-
|
|
856
|
+
|
|
747
857
|
me.state.dialog = null;
|
|
748
858
|
closed = true;
|
|
749
859
|
dialog.parentNode.removeChild(dialog);
|
|
750
860
|
me.focus();
|
|
751
861
|
|
|
752
862
|
if (options.onClose) options.onClose(dialog);
|
|
863
|
+
var cm = me;
|
|
864
|
+
if (cm.state.vim) {
|
|
865
|
+
cm.state.vim.status = null;
|
|
866
|
+
cm.ace._signal("changeStatus");
|
|
867
|
+
cm.ace.renderer.$loop.schedule(cm.ace.renderer.CHANGE_CURSOR);
|
|
868
|
+
}
|
|
753
869
|
}
|
|
754
870
|
}
|
|
755
871
|
|
|
@@ -817,7 +933,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
817
933
|
});
|
|
818
934
|
})();
|
|
819
935
|
|
|
820
|
-
|
|
936
|
+
|
|
821
937
|
var defaultKeymap = [
|
|
822
938
|
{ keys: '<Left>', type: 'keyToKey', toKeys: 'h' },
|
|
823
939
|
{ keys: '<Right>', type: 'keyToKey', toKeys: 'l' },
|
|
@@ -825,6 +941,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
825
941
|
{ keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
|
|
826
942
|
{ keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
|
|
827
943
|
{ keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'},
|
|
944
|
+
{ keys: '<Del>', type: 'keyToKey', toKeys: 'x', context: 'normal'},
|
|
828
945
|
{ keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' },
|
|
829
946
|
{ keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },
|
|
830
947
|
{ keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' },
|
|
@@ -835,6 +952,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
835
952
|
{ keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>' },
|
|
836
953
|
{ keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
|
|
837
954
|
{ keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
|
|
955
|
+
{ keys: '<C-Esc>', type: 'keyToKey', toKeys: '<Esc>' }, // ace_patch ipad keyboard sends C-Esc instead of C-[
|
|
956
|
+
{ keys: '<C-Esc>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
|
|
838
957
|
{ keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },
|
|
839
958
|
{ keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'},
|
|
840
959
|
{ keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },
|
|
@@ -864,6 +983,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
864
983
|
{ keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }},
|
|
865
984
|
{ keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }},
|
|
866
985
|
{ keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }},
|
|
986
|
+
{ keys: '(', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: false }},
|
|
987
|
+
{ keys: ')', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: true }},
|
|
867
988
|
{ keys: '<C-f>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }},
|
|
868
989
|
{ keys: '<C-b>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }},
|
|
869
990
|
{ keys: '<C-d>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }},
|
|
@@ -899,6 +1020,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
899
1020
|
{ keys: 'd', type: 'operator', operator: 'delete' },
|
|
900
1021
|
{ keys: 'y', type: 'operator', operator: 'yank' },
|
|
901
1022
|
{ keys: 'c', type: 'operator', operator: 'change' },
|
|
1023
|
+
{ keys: '=', type: 'operator', operator: 'indentAuto' },
|
|
902
1024
|
{ keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }},
|
|
903
1025
|
{ keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }},
|
|
904
1026
|
{ keys: 'g~', type: 'operator', operator: 'changeCase' },
|
|
@@ -906,17 +1028,20 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
906
1028
|
{ keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true },
|
|
907
1029
|
{ keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }},
|
|
908
1030
|
{ keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }},
|
|
1031
|
+
{ keys: 'gn', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: true }},
|
|
1032
|
+
{ keys: 'gN', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: false }},
|
|
909
1033
|
{ keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }},
|
|
910
1034
|
{ keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }},
|
|
911
1035
|
{ keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
|
|
912
1036
|
{ keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'},
|
|
913
|
-
{ keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: '
|
|
1037
|
+
{ keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'expandToLine', motionArgs: { linewise: true }, context: 'normal'},
|
|
914
1038
|
{ keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'},
|
|
915
1039
|
{ keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
|
|
916
1040
|
{ keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'},
|
|
917
1041
|
{ keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'},
|
|
918
1042
|
{ keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'},
|
|
919
1043
|
{ keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
|
|
1044
|
+
{ keys: '<C-w>', type: 'idle', context: 'normal' },
|
|
920
1045
|
{ keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }},
|
|
921
1046
|
{ keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }},
|
|
922
1047
|
{ keys: '<C-e>', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }},
|
|
@@ -925,7 +1050,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
925
1050
|
{ keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' },
|
|
926
1051
|
{ keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' },
|
|
927
1052
|
{ keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' },
|
|
1053
|
+
{ keys: 'gi', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'lastEdit' }, context: 'normal' },
|
|
928
1054
|
{ keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' },
|
|
1055
|
+
{ keys: 'gI', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'bol'}, context: 'normal' },
|
|
929
1056
|
{ keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' },
|
|
930
1057
|
{ keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' },
|
|
931
1058
|
{ keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' },
|
|
@@ -935,12 +1062,14 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
935
1062
|
{ keys: '<C-q>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }},
|
|
936
1063
|
{ keys: 'gv', type: 'action', action: 'reselectLastSelection' },
|
|
937
1064
|
{ keys: 'J', type: 'action', action: 'joinLines', isEdit: true },
|
|
1065
|
+
{ keys: 'gJ', type: 'action', action: 'joinLines', actionArgs: { keepSpaces: true }, isEdit: true },
|
|
938
1066
|
{ keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }},
|
|
939
1067
|
{ keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }},
|
|
940
1068
|
{ keys: 'r<character>', type: 'action', action: 'replace', isEdit: true },
|
|
941
1069
|
{ keys: '@<character>', type: 'action', action: 'replayMacro' },
|
|
942
1070
|
{ keys: 'q<character>', type: 'action', action: 'enterMacroRecordMode' },
|
|
943
|
-
{ keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }},
|
|
1071
|
+
{ keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }, context: 'normal'},
|
|
1072
|
+
{ keys: 'R', type: 'operator', operator: 'change', operatorArgs: { linewise: true, fullLine: true }, context: 'visual', exitVisualBlock: true},
|
|
944
1073
|
{ keys: 'u', type: 'action', action: 'undo', context: 'normal' },
|
|
945
1074
|
{ keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true },
|
|
946
1075
|
{ keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true },
|
|
@@ -968,6 +1097,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
968
1097
|
{ keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }},
|
|
969
1098
|
{ keys: ':', type: 'ex' }
|
|
970
1099
|
];
|
|
1100
|
+
var defaultKeymapLength = defaultKeymap.length;
|
|
971
1101
|
var defaultExCommandMap = [
|
|
972
1102
|
{ name: 'colorscheme', shortName: 'colo' },
|
|
973
1103
|
{ name: 'map' },
|
|
@@ -979,7 +1109,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
979
1109
|
{ name: 'undo', shortName: 'u' },
|
|
980
1110
|
{ name: 'redo', shortName: 'red' },
|
|
981
1111
|
{ name: 'set', shortName: 'se' },
|
|
982
|
-
{ name: 'set', shortName: 'se' },
|
|
983
1112
|
{ name: 'setlocal', shortName: 'setl' },
|
|
984
1113
|
{ name: 'setglobal', shortName: 'setg' },
|
|
985
1114
|
{ name: 'sort', shortName: 'sor' },
|
|
@@ -988,6 +1117,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
988
1117
|
{ name: 'yank', shortName: 'y' },
|
|
989
1118
|
{ name: 'delmarks', shortName: 'delm' },
|
|
990
1119
|
{ name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
|
|
1120
|
+
{ name: 'vglobal', shortName: 'v' },
|
|
991
1121
|
{ name: 'global', shortName: 'g' }
|
|
992
1122
|
];
|
|
993
1123
|
|
|
@@ -1009,7 +1139,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1009
1139
|
CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
|
|
1010
1140
|
cm.state.vim = null;
|
|
1011
1141
|
}
|
|
1012
|
-
|
|
1013
1142
|
function detachVimMap(cm, next) {
|
|
1014
1143
|
if (this == CodeMirror.keyMap.vim)
|
|
1015
1144
|
CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
|
|
@@ -1045,7 +1174,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1045
1174
|
return cmd;
|
|
1046
1175
|
}
|
|
1047
1176
|
|
|
1048
|
-
var modifiers = {
|
|
1177
|
+
var modifiers = {Shift:'S',Ctrl:'C',Alt:'A',Cmd:'D',Mod:'A',CapsLock:''};
|
|
1049
1178
|
var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del',Insert:'Ins'};
|
|
1050
1179
|
function cmKeyToVimKey(key) {
|
|
1051
1180
|
if (key.charAt(0) == '\'') {
|
|
@@ -1104,7 +1233,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1104
1233
|
var lowerCaseAlphabet = makeKeyRange(97, 26);
|
|
1105
1234
|
var numbers = makeKeyRange(48, 10);
|
|
1106
1235
|
var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
|
|
1107
|
-
var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']);
|
|
1236
|
+
var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '_', '/']);
|
|
1237
|
+
var upperCaseChars;
|
|
1238
|
+
try { upperCaseChars = new RegExp("^[\\p{Lu}]$", "u"); }
|
|
1239
|
+
catch (_) { upperCaseChars = /^[A-Z]$/; }
|
|
1108
1240
|
|
|
1109
1241
|
function isLine(cm, line) {
|
|
1110
1242
|
return line >= cm.firstLine() && line <= cm.lastLine();
|
|
@@ -1119,11 +1251,14 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1119
1251
|
return numberRegex.test(k);
|
|
1120
1252
|
}
|
|
1121
1253
|
function isUpperCase(k) {
|
|
1122
|
-
return
|
|
1254
|
+
return upperCaseChars.test(k);
|
|
1123
1255
|
}
|
|
1124
1256
|
function isWhiteSpaceString(k) {
|
|
1125
1257
|
return (/^\s*$/).test(k);
|
|
1126
1258
|
}
|
|
1259
|
+
function isEndOfSentenceSymbol(k) {
|
|
1260
|
+
return '.?!'.indexOf(k) != -1;
|
|
1261
|
+
}
|
|
1127
1262
|
function inArray(val, arr) {
|
|
1128
1263
|
for (var i = 0; i < arr.length; i++) {
|
|
1129
1264
|
if (arr[i] == val) {
|
|
@@ -1276,9 +1411,16 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1276
1411
|
}
|
|
1277
1412
|
return mark;
|
|
1278
1413
|
}
|
|
1414
|
+
function find(cm, offset) {
|
|
1415
|
+
var oldPointer = pointer;
|
|
1416
|
+
var mark = move(cm, offset);
|
|
1417
|
+
pointer = oldPointer;
|
|
1418
|
+
return mark && mark.find();
|
|
1419
|
+
}
|
|
1279
1420
|
return {
|
|
1280
1421
|
cachedCursor: undefined, //used for # and * jumps
|
|
1281
1422
|
add: add,
|
|
1423
|
+
find: find,
|
|
1282
1424
|
move: move
|
|
1283
1425
|
};
|
|
1284
1426
|
};
|
|
@@ -1320,7 +1462,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1320
1462
|
this.latestRegister = registerName;
|
|
1321
1463
|
if (cm.openDialog) {
|
|
1322
1464
|
this.onRecordingDone = cm.openDialog(
|
|
1323
|
-
'(recording)['+registerName+']', null, {bottom:true});
|
|
1465
|
+
document.createTextNode('(recording)['+registerName+']'), null, {bottom:true});
|
|
1324
1466
|
}
|
|
1325
1467
|
this.isRecording = true;
|
|
1326
1468
|
}
|
|
@@ -1392,6 +1534,62 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1392
1534
|
unmap: function(lhs, ctx) {
|
|
1393
1535
|
exCommandDispatcher.unmap(lhs, ctx);
|
|
1394
1536
|
},
|
|
1537
|
+
noremap: function(lhs, rhs, ctx) {
|
|
1538
|
+
function toCtxArray(ctx) {
|
|
1539
|
+
return ctx ? [ctx] : ['normal', 'insert', 'visual'];
|
|
1540
|
+
}
|
|
1541
|
+
var ctxsToMap = toCtxArray(ctx);
|
|
1542
|
+
var actualLength = defaultKeymap.length, origLength = defaultKeymapLength;
|
|
1543
|
+
for (var i = actualLength - origLength;
|
|
1544
|
+
i < actualLength && ctxsToMap.length;
|
|
1545
|
+
i++) {
|
|
1546
|
+
var mapping = defaultKeymap[i];
|
|
1547
|
+
if (mapping.keys == rhs &&
|
|
1548
|
+
(!ctx || !mapping.context || mapping.context === ctx) &&
|
|
1549
|
+
mapping.type.substr(0, 2) !== 'ex' &&
|
|
1550
|
+
mapping.type.substr(0, 3) !== 'key') {
|
|
1551
|
+
var newMapping = {};
|
|
1552
|
+
for (var key in mapping) {
|
|
1553
|
+
newMapping[key] = mapping[key];
|
|
1554
|
+
}
|
|
1555
|
+
newMapping.keys = lhs;
|
|
1556
|
+
if (ctx && !newMapping.context) {
|
|
1557
|
+
newMapping.context = ctx;
|
|
1558
|
+
}
|
|
1559
|
+
this._mapCommand(newMapping);
|
|
1560
|
+
var mappedCtxs = toCtxArray(mapping.context);
|
|
1561
|
+
ctxsToMap = ctxsToMap.filter(function(el) { return mappedCtxs.indexOf(el) === -1; });
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
},
|
|
1565
|
+
mapclear: function(ctx) {
|
|
1566
|
+
var actualLength = defaultKeymap.length,
|
|
1567
|
+
origLength = defaultKeymapLength;
|
|
1568
|
+
var userKeymap = defaultKeymap.slice(0, actualLength - origLength);
|
|
1569
|
+
defaultKeymap = defaultKeymap.slice(actualLength - origLength);
|
|
1570
|
+
if (ctx) {
|
|
1571
|
+
for (var i = userKeymap.length - 1; i >= 0; i--) {
|
|
1572
|
+
var mapping = userKeymap[i];
|
|
1573
|
+
if (ctx !== mapping.context) {
|
|
1574
|
+
if (mapping.context) {
|
|
1575
|
+
this._mapCommand(mapping);
|
|
1576
|
+
} else {
|
|
1577
|
+
var contexts = ['normal', 'insert', 'visual'];
|
|
1578
|
+
for (var j in contexts) {
|
|
1579
|
+
if (contexts[j] !== ctx) {
|
|
1580
|
+
var newMapping = {};
|
|
1581
|
+
for (var key in mapping) {
|
|
1582
|
+
newMapping[key] = mapping[key];
|
|
1583
|
+
}
|
|
1584
|
+
newMapping.context = contexts[j];
|
|
1585
|
+
this._mapCommand(newMapping);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1395
1593
|
setOption: setOption,
|
|
1396
1594
|
getOption: getOption,
|
|
1397
1595
|
defineOption: defineOption,
|
|
@@ -1488,7 +1686,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1488
1686
|
if (!keysMatcher) { clearInputState(cm); return false; }
|
|
1489
1687
|
var context = vim.visualMode ? 'visual' :
|
|
1490
1688
|
'normal';
|
|
1491
|
-
var
|
|
1689
|
+
var mainKey = keysMatcher[2] || keysMatcher[1];
|
|
1690
|
+
if (vim.inputState.operatorShortcut && vim.inputState.operatorShortcut.slice(-1) == mainKey) {
|
|
1691
|
+
mainKey = vim.inputState.operatorShortcut;
|
|
1692
|
+
}
|
|
1693
|
+
var match = commandDispatcher.matchCommand(mainKey, defaultKeymap, vim.inputState, context);
|
|
1492
1694
|
if (match.type == 'none') { clearInputState(cm); return false; }
|
|
1493
1695
|
else if (match.type == 'partial') { return true; }
|
|
1494
1696
|
|
|
@@ -1504,7 +1706,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1504
1706
|
if (vim.insertMode) { command = handleKeyInsertMode(); }
|
|
1505
1707
|
else { command = handleKeyNonInsertMode(); }
|
|
1506
1708
|
if (command === false) {
|
|
1507
|
-
return undefined;
|
|
1709
|
+
return undefined; //ace_patch
|
|
1508
1710
|
} else if (command === true) {
|
|
1509
1711
|
return function() { return true; };
|
|
1510
1712
|
} else {
|
|
@@ -1639,6 +1841,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1639
1841
|
}
|
|
1640
1842
|
RegisterController.prototype = {
|
|
1641
1843
|
pushText: function(registerName, operator, text, linewise, blockwise) {
|
|
1844
|
+
if (registerName === '_') return;
|
|
1642
1845
|
if (linewise && text.charAt(text.length - 1) !== '\n'){
|
|
1643
1846
|
text += '\n';
|
|
1644
1847
|
}
|
|
@@ -1742,7 +1945,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1742
1945
|
}
|
|
1743
1946
|
if (bestMatch.keys.slice(-11) == '<character>') {
|
|
1744
1947
|
var character = lastChar(keys);
|
|
1745
|
-
if (/<C-.>/.test(character)) return {type: 'none'};
|
|
1948
|
+
if (/<C-.>/.test(character) || !character) return {type: 'none'}; //ace_patch
|
|
1746
1949
|
inputState.selectedCharacter = character;
|
|
1747
1950
|
}
|
|
1748
1951
|
return {type: 'full', command: bestMatch};
|
|
@@ -1792,6 +1995,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1792
1995
|
}
|
|
1793
1996
|
inputState.operator = command.operator;
|
|
1794
1997
|
inputState.operatorArgs = copyArgs(command.operatorArgs);
|
|
1998
|
+
if (command.keys.length > 1) {
|
|
1999
|
+
inputState.operatorShortcut = command.keys;
|
|
2000
|
+
}
|
|
2001
|
+
if (command.exitVisualBlock) {
|
|
2002
|
+
vim.visualBlock = false;
|
|
2003
|
+
updateCmSelection(cm);
|
|
2004
|
+
}
|
|
1795
2005
|
if (vim.visualMode) {
|
|
1796
2006
|
this.evalInput(cm, vim);
|
|
1797
2007
|
}
|
|
@@ -1924,7 +2134,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
1924
2134
|
showPrompt(cm, {
|
|
1925
2135
|
onClose: onPromptClose,
|
|
1926
2136
|
prefix: promptPrefix,
|
|
1927
|
-
desc:
|
|
2137
|
+
desc: '(JavaScript regexp)',
|
|
1928
2138
|
onKeyUp: onPromptKeyUp,
|
|
1929
2139
|
onKeyDown: onPromptKeyDown
|
|
1930
2140
|
});
|
|
@@ -2038,7 +2248,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2038
2248
|
motionArgs.repeat = repeat;
|
|
2039
2249
|
clearInputState(cm);
|
|
2040
2250
|
if (motion) {
|
|
2041
|
-
var motionResult = motions[motion](cm, origHead, motionArgs, vim);
|
|
2251
|
+
var motionResult = motions[motion](cm, origHead, motionArgs, vim, inputState);
|
|
2042
2252
|
vim.lastMotion = motions[motion];
|
|
2043
2253
|
if (!motionResult) {
|
|
2044
2254
|
return;
|
|
@@ -2066,10 +2276,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2066
2276
|
}
|
|
2067
2277
|
if (vim.visualMode) {
|
|
2068
2278
|
if (!(vim.visualBlock && newHead.ch === Infinity)) {
|
|
2069
|
-
newHead = clipCursorToContent(cm, newHead
|
|
2279
|
+
newHead = clipCursorToContent(cm, newHead);
|
|
2070
2280
|
}
|
|
2071
2281
|
if (newAnchor) {
|
|
2072
|
-
newAnchor = clipCursorToContent(cm, newAnchor
|
|
2282
|
+
newAnchor = clipCursorToContent(cm, newAnchor);
|
|
2073
2283
|
}
|
|
2074
2284
|
newAnchor = newAnchor || oldAnchor;
|
|
2075
2285
|
sel.anchor = newAnchor;
|
|
@@ -2183,6 +2393,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2183
2393
|
vim.lastEditActionCommand = actionCommand;
|
|
2184
2394
|
macroModeState.lastInsertModeChanges.changes = [];
|
|
2185
2395
|
macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
|
|
2396
|
+
macroModeState.lastInsertModeChanges.visualBlock = vim.visualBlock ? vim.sel.head.line - vim.sel.anchor.line : 0;
|
|
2186
2397
|
}
|
|
2187
2398
|
};
|
|
2188
2399
|
var motions = {
|
|
@@ -2214,6 +2425,58 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2214
2425
|
highlightSearchMatches(cm, query);
|
|
2215
2426
|
return findNext(cm, prev/** prev */, query, motionArgs.repeat);
|
|
2216
2427
|
},
|
|
2428
|
+
findAndSelectNextInclusive: function(cm, _head, motionArgs, vim, prevInputState) {
|
|
2429
|
+
var state = getSearchState(cm);
|
|
2430
|
+
var query = state.getQuery();
|
|
2431
|
+
|
|
2432
|
+
if (!query) {
|
|
2433
|
+
return;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
var prev = !motionArgs.forward;
|
|
2437
|
+
prev = (state.isReversed()) ? !prev : prev;
|
|
2438
|
+
var next = findNextFromAndToInclusive(cm, prev, query, motionArgs.repeat, vim);
|
|
2439
|
+
if (!next) {
|
|
2440
|
+
return;
|
|
2441
|
+
}
|
|
2442
|
+
if (prevInputState.operator) {
|
|
2443
|
+
return next;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
var from = next[0];
|
|
2447
|
+
var to = Pos(next[1].line, next[1].ch - 1);
|
|
2448
|
+
|
|
2449
|
+
if (vim.visualMode) {
|
|
2450
|
+
if (vim.visualLine || vim.visualBlock) {
|
|
2451
|
+
vim.visualLine = false;
|
|
2452
|
+
vim.visualBlock = false;
|
|
2453
|
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: ""});
|
|
2454
|
+
}
|
|
2455
|
+
var anchor = vim.sel.anchor;
|
|
2456
|
+
if (anchor) {
|
|
2457
|
+
if (state.isReversed()) {
|
|
2458
|
+
if (motionArgs.forward) {
|
|
2459
|
+
return [anchor, from];
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
return [anchor, to];
|
|
2463
|
+
} else {
|
|
2464
|
+
if (motionArgs.forward) {
|
|
2465
|
+
return [anchor, to];
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
return [anchor, from];
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
} else {
|
|
2472
|
+
vim.visualMode = true;
|
|
2473
|
+
vim.visualLine = false;
|
|
2474
|
+
vim.visualBlock = false;
|
|
2475
|
+
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: ""});
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
return prev ? [to, from] : [from, to];
|
|
2479
|
+
},
|
|
2217
2480
|
goToMark: function(cm, _head, motionArgs, vim) {
|
|
2218
2481
|
var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);
|
|
2219
2482
|
if (pos) {
|
|
@@ -2293,8 +2556,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2293
2556
|
var last = cm.lastLine();
|
|
2294
2557
|
if (line < first && cur.line == first){
|
|
2295
2558
|
return this.moveToStartOfLine(cm, head, motionArgs, vim);
|
|
2296
|
-
}else if (line > last && cur.line == last){
|
|
2297
|
-
return
|
|
2559
|
+
} else if (line > last && cur.line == last){
|
|
2560
|
+
return moveToEol(cm, head, motionArgs, vim, true);
|
|
2298
2561
|
}
|
|
2299
2562
|
var fold = cm.ace.session.getFoldLine(line);
|
|
2300
2563
|
if (fold) {
|
|
@@ -2349,6 +2612,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2349
2612
|
var dir = motionArgs.forward ? 1 : -1;
|
|
2350
2613
|
return findParagraph(cm, head, motionArgs.repeat, dir);
|
|
2351
2614
|
},
|
|
2615
|
+
moveBySentence: function(cm, head, motionArgs) {
|
|
2616
|
+
var dir = motionArgs.forward ? 1 : -1;
|
|
2617
|
+
return findSentence(cm, head, motionArgs.repeat, dir);
|
|
2618
|
+
},
|
|
2352
2619
|
moveByScroll: function(cm, head, motionArgs, vim) {
|
|
2353
2620
|
var scrollbox = cm.getScrollInfo();
|
|
2354
2621
|
var curEnd = null;
|
|
@@ -2398,13 +2665,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2398
2665
|
return moveToColumn(cm, repeat);
|
|
2399
2666
|
},
|
|
2400
2667
|
moveToEol: function(cm, head, motionArgs, vim) {
|
|
2401
|
-
|
|
2402
|
-
vim.lastHPos = Infinity;
|
|
2403
|
-
var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
|
|
2404
|
-
var end=cm.clipPos(retval);
|
|
2405
|
-
end.ch--;
|
|
2406
|
-
vim.lastHSPos = cm.charCoords(end,'div').left;
|
|
2407
|
-
return retval;
|
|
2668
|
+
return moveToEol(cm, head, motionArgs, vim, false);
|
|
2408
2669
|
},
|
|
2409
2670
|
moveToFirstNonWhiteSpaceCharacter: function(cm, head) {
|
|
2410
2671
|
var cursor = head;
|
|
@@ -2417,17 +2678,18 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2417
2678
|
var ch = cursor.ch;
|
|
2418
2679
|
var lineText = cm.getLine(line);
|
|
2419
2680
|
var symbol;
|
|
2420
|
-
|
|
2421
|
-
symbol = lineText.charAt(ch
|
|
2681
|
+
for (; ch < lineText.length; ch++) {
|
|
2682
|
+
symbol = lineText.charAt(ch);
|
|
2422
2683
|
if (symbol && isMatchableSymbol(symbol)) {
|
|
2423
|
-
var style = cm.getTokenTypeAt(Pos(line, ch));
|
|
2684
|
+
var style = cm.getTokenTypeAt(Pos(line, ch + 1));
|
|
2424
2685
|
if (style !== "string" && style !== "comment") {
|
|
2425
2686
|
break;
|
|
2426
2687
|
}
|
|
2427
2688
|
}
|
|
2428
|
-
}
|
|
2429
|
-
if (
|
|
2430
|
-
var
|
|
2689
|
+
}
|
|
2690
|
+
if (ch < lineText.length) {
|
|
2691
|
+
var re = /[<>]/.test(lineText[ch]) ? /[(){}[\]<>]/ : /[(){}[\]]/; //ace_patch?
|
|
2692
|
+
var matched = cm.findMatchingBracket(Pos(line, ch+1), {bracketRegex: re});
|
|
2431
2693
|
return matched.to;
|
|
2432
2694
|
} else {
|
|
2433
2695
|
return cursor;
|
|
@@ -2480,6 +2742,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2480
2742
|
if (operatorArgs) { operatorArgs.linewise = true; }
|
|
2481
2743
|
tmp.end.line--;
|
|
2482
2744
|
}
|
|
2745
|
+
} else if (character === 't') {
|
|
2746
|
+
tmp = expandTagUnderCursor(cm, head, inclusive);
|
|
2483
2747
|
} else {
|
|
2484
2748
|
return null;
|
|
2485
2749
|
}
|
|
@@ -2523,10 +2787,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2523
2787
|
change: function(cm, args, ranges) {
|
|
2524
2788
|
var finalHead, text;
|
|
2525
2789
|
var vim = cm.state.vim;
|
|
2526
|
-
|
|
2790
|
+
var anchor = ranges[0].anchor,
|
|
2791
|
+
head = ranges[0].head;
|
|
2527
2792
|
if (!vim.visualMode) {
|
|
2528
|
-
var anchor = ranges[0].anchor,
|
|
2529
|
-
head = ranges[0].head;
|
|
2530
2793
|
text = cm.getRange(anchor, head);
|
|
2531
2794
|
var lastState = vim.lastEditInputState || {};
|
|
2532
2795
|
if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) {
|
|
@@ -2551,6 +2814,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2551
2814
|
anchor.ch = Number.MAX_VALUE;
|
|
2552
2815
|
}
|
|
2553
2816
|
finalHead = anchor;
|
|
2817
|
+
} else if (args.fullLine) {
|
|
2818
|
+
head.ch = Number.MAX_VALUE;
|
|
2819
|
+
head.line--;
|
|
2820
|
+
cm.setSelection(anchor, head)
|
|
2821
|
+
text = cm.getSelection();
|
|
2822
|
+
cm.replaceSelection("");
|
|
2823
|
+
finalHead = anchor;
|
|
2554
2824
|
} else {
|
|
2555
2825
|
text = cm.getSelection();
|
|
2556
2826
|
var replacement = fillArray('', ranges.length);
|
|
@@ -2593,8 +2863,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2593
2863
|
vimGlobalState.registerController.pushText(
|
|
2594
2864
|
args.registerName, 'delete', text,
|
|
2595
2865
|
args.linewise, vim.visualBlock);
|
|
2596
|
-
|
|
2597
|
-
return clipCursorToContent(cm, finalHead, includeLineBreak);
|
|
2866
|
+
return clipCursorToContent(cm, finalHead);
|
|
2598
2867
|
},
|
|
2599
2868
|
indent: function(cm, args, ranges) {
|
|
2600
2869
|
var vim = cm.state.vim;
|
|
@@ -2613,6 +2882,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2613
2882
|
}
|
|
2614
2883
|
return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
|
|
2615
2884
|
},
|
|
2885
|
+
indentAuto: function(cm, _args, ranges) {
|
|
2886
|
+
if (ranges.length > 1) {
|
|
2887
|
+
cm.setSelection(ranges[0].anchor, ranges[ranges.length - 1].head);
|
|
2888
|
+
}
|
|
2889
|
+
cm.execCommand("indentAuto");
|
|
2890
|
+
return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
|
|
2891
|
+
},
|
|
2616
2892
|
changeCase: function(cm, args, ranges, oldAnchor, newHead) {
|
|
2617
2893
|
var selections = cm.getSelections();
|
|
2618
2894
|
var swapped = [];
|
|
@@ -2720,9 +2996,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2720
2996
|
switch (actionArgs.position) {
|
|
2721
2997
|
case 'center': y = y - (height / 2) + lineHeight;
|
|
2722
2998
|
break;
|
|
2723
|
-
case 'bottom': y = y - height + lineHeight
|
|
2724
|
-
break;
|
|
2725
|
-
case 'top': y = y + lineHeight*0.4;
|
|
2999
|
+
case 'bottom': y = y - height + lineHeight;
|
|
2726
3000
|
break;
|
|
2727
3001
|
}
|
|
2728
3002
|
cm.scrollTo(null, y);
|
|
@@ -2733,6 +3007,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2733
3007
|
var macroModeState = vimGlobalState.macroModeState;
|
|
2734
3008
|
if (registerName == '@') {
|
|
2735
3009
|
registerName = macroModeState.latestRegister;
|
|
3010
|
+
} else {
|
|
3011
|
+
macroModeState.latestRegister = registerName;
|
|
2736
3012
|
}
|
|
2737
3013
|
while(repeat--){
|
|
2738
3014
|
executeMacroRegister(cm, vim, macroModeState, registerName);
|
|
@@ -2766,11 +3042,15 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2766
3042
|
var height = cm.listSelections().length;
|
|
2767
3043
|
if (insertAt == 'eol') {
|
|
2768
3044
|
head = Pos(head.line, lineLength(cm, head.line));
|
|
3045
|
+
} else if (insertAt == 'bol') {
|
|
3046
|
+
head = Pos(head.line, 0);
|
|
2769
3047
|
} else if (insertAt == 'charAfter') {
|
|
2770
3048
|
head = offsetCursor(head, 0, 1);
|
|
2771
3049
|
} else if (insertAt == 'firstNonBlank') {
|
|
2772
3050
|
head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head);
|
|
2773
3051
|
} else if (insertAt == 'startOfSelectedArea') {
|
|
3052
|
+
if (!vim.visualMode)
|
|
3053
|
+
return;
|
|
2774
3054
|
if (!vim.visualBlock) {
|
|
2775
3055
|
if (sel.head.line < sel.anchor.line) {
|
|
2776
3056
|
head = sel.head;
|
|
@@ -2784,6 +3064,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2784
3064
|
height = Math.abs(sel.head.line - sel.anchor.line) + 1;
|
|
2785
3065
|
}
|
|
2786
3066
|
} else if (insertAt == 'endOfSelectedArea') {
|
|
3067
|
+
if (!vim.visualMode)
|
|
3068
|
+
return;
|
|
2787
3069
|
if (!vim.visualBlock) {
|
|
2788
3070
|
if (sel.head.line >= sel.anchor.line) {
|
|
2789
3071
|
head = offsetCursor(sel.head, 0, 1);
|
|
@@ -2800,6 +3082,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2800
3082
|
if (vim.visualMode){
|
|
2801
3083
|
return;
|
|
2802
3084
|
}
|
|
3085
|
+
} else if (insertAt == 'lastEdit') {
|
|
3086
|
+
head = getLastEditPos(cm) || head;
|
|
2803
3087
|
}
|
|
2804
3088
|
cm.setOption('disableInput', false);
|
|
2805
3089
|
if (actionArgs && actionArgs.replace) {
|
|
@@ -2829,8 +3113,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2829
3113
|
vim.visualLine = !!actionArgs.linewise;
|
|
2830
3114
|
vim.visualBlock = !!actionArgs.blockwise;
|
|
2831
3115
|
head = clipCursorToContent(
|
|
2832
|
-
cm, Pos(anchor.line, anchor.ch + repeat - 1)
|
|
2833
|
-
true /** includeLineBreak */);
|
|
3116
|
+
cm, Pos(anchor.line, anchor.ch + repeat - 1));
|
|
2834
3117
|
vim.sel = {
|
|
2835
3118
|
anchor: anchor,
|
|
2836
3119
|
head: head
|
|
@@ -2899,7 +3182,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2899
3182
|
var tmp = Pos(curStart.line + 1,
|
|
2900
3183
|
lineLength(cm, curStart.line + 1));
|
|
2901
3184
|
var text = cm.getRange(curStart, tmp);
|
|
2902
|
-
text =
|
|
3185
|
+
text = actionArgs.keepSpaces
|
|
3186
|
+
? text.replace(/\n\r?/g, '')
|
|
3187
|
+
: text.replace(/\n\s*/g, ' ');
|
|
2903
3188
|
cm.replaceRange(text, curStart, tmp);
|
|
2904
3189
|
}
|
|
2905
3190
|
var curFinalPos = Pos(curStart.line, finalCh);
|
|
@@ -2965,7 +3250,17 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2965
3250
|
}
|
|
2966
3251
|
var linewise = register.linewise;
|
|
2967
3252
|
var blockwise = register.blockwise;
|
|
2968
|
-
if (
|
|
3253
|
+
if (blockwise) {
|
|
3254
|
+
text = text.split('\n');
|
|
3255
|
+
if (linewise) {
|
|
3256
|
+
text.pop();
|
|
3257
|
+
}
|
|
3258
|
+
for (var i = 0; i < text.length; i++) {
|
|
3259
|
+
text[i] = (text[i] == '') ? ' ' : text[i];
|
|
3260
|
+
}
|
|
3261
|
+
cur.ch += actionArgs.after ? 1 : 0;
|
|
3262
|
+
cur.ch = Math.min(lineLength(cm, cur.line), cur.ch);
|
|
3263
|
+
} else if (linewise) {
|
|
2969
3264
|
if(vim.visualMode) {
|
|
2970
3265
|
text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n';
|
|
2971
3266
|
} else if (actionArgs.after) {
|
|
@@ -2975,12 +3270,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
2975
3270
|
cur.ch = 0;
|
|
2976
3271
|
}
|
|
2977
3272
|
} else {
|
|
2978
|
-
if (blockwise) {
|
|
2979
|
-
text = text.split('\n');
|
|
2980
|
-
for (var i = 0; i < text.length; i++) {
|
|
2981
|
-
text[i] = (text[i] == '') ? ' ' : text[i];
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
3273
|
cur.ch += actionArgs.after ? 1 : 0;
|
|
2985
3274
|
}
|
|
2986
3275
|
var curPosFinal;
|
|
@@ -3173,10 +3462,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3173
3462
|
function defineAction(name, fn) {
|
|
3174
3463
|
actions[name] = fn;
|
|
3175
3464
|
}
|
|
3176
|
-
function clipCursorToContent(cm, cur
|
|
3465
|
+
function clipCursorToContent(cm, cur) {
|
|
3466
|
+
var vim = cm.state.vim;
|
|
3467
|
+
var includeLineBreak = vim.insertMode || vim.visualMode;
|
|
3177
3468
|
var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
|
|
3178
|
-
var maxCh = lineLength(cm, line) - 1;
|
|
3179
|
-
maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;
|
|
3469
|
+
var maxCh = lineLength(cm, line) - 1 + !!includeLineBreak;
|
|
3180
3470
|
var ch = Math.min(Math.max(0, cur.ch), maxCh);
|
|
3181
3471
|
return Pos(line, ch);
|
|
3182
3472
|
}
|
|
@@ -3196,12 +3486,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3196
3486
|
}
|
|
3197
3487
|
return Pos(cur.line + offsetLine, cur.ch + offsetCh);
|
|
3198
3488
|
}
|
|
3199
|
-
function getOffset(anchor, head) {
|
|
3200
|
-
return {
|
|
3201
|
-
line: head.line - anchor.line,
|
|
3202
|
-
ch: head.line - anchor.line
|
|
3203
|
-
};
|
|
3204
|
-
}
|
|
3205
3489
|
function commandMatches(keys, keyMap, context, inputState) {
|
|
3206
3490
|
var match, partial = [], full = [];
|
|
3207
3491
|
for (var i = 0; i < keyMap.length; i++) {
|
|
@@ -3517,10 +3801,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3517
3801
|
vim.visualMode = false;
|
|
3518
3802
|
vim.visualLine = false;
|
|
3519
3803
|
vim.visualBlock = false;
|
|
3520
|
-
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
|
|
3521
|
-
|
|
3522
|
-
vim.fakeCursor.clear();
|
|
3523
|
-
}
|
|
3804
|
+
if (!vim.insertMode) CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
|
|
3805
|
+
clearFakeCursor(vim);
|
|
3524
3806
|
}
|
|
3525
3807
|
function clipToLine(cm, curStart, curEnd) {
|
|
3526
3808
|
var selection = cm.getRange(curStart, curEnd);
|
|
@@ -3589,6 +3871,22 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3589
3871
|
}
|
|
3590
3872
|
return { start: Pos(cur.line, start), end: Pos(cur.line, end) };
|
|
3591
3873
|
}
|
|
3874
|
+
function expandTagUnderCursor(cm, head, inclusive) {
|
|
3875
|
+
var cur = head;
|
|
3876
|
+
if (!CodeMirror.findMatchingTag || !CodeMirror.findEnclosingTag) {
|
|
3877
|
+
return { start: cur, end: cur };
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
var tags = CodeMirror.findMatchingTag(cm, head) || CodeMirror.findEnclosingTag(cm, head);
|
|
3881
|
+
if (!tags || !tags.open || !tags.close) {
|
|
3882
|
+
return { start: cur, end: cur };
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3885
|
+
if (inclusive) {
|
|
3886
|
+
return { start: tags.open.from, end: tags.close.to };
|
|
3887
|
+
}
|
|
3888
|
+
return { start: tags.open.to, end: tags.close.from };
|
|
3889
|
+
}
|
|
3592
3890
|
|
|
3593
3891
|
function recordJumpPosition(cm, oldCur, newCur) {
|
|
3594
3892
|
if (!cursorEqual(oldCur, newCur)) {
|
|
@@ -3653,7 +3951,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3653
3951
|
},
|
|
3654
3952
|
isComplete: function(state) {
|
|
3655
3953
|
if (state.nextCh === '#') {
|
|
3656
|
-
var token = state.lineText.match(
|
|
3954
|
+
var token = state.lineText.match(/^#(\w+)/)[1];
|
|
3657
3955
|
if (token === 'endif') {
|
|
3658
3956
|
if (state.forward && state.depth === 0) {
|
|
3659
3957
|
return true;
|
|
@@ -3813,6 +4111,18 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3813
4111
|
}
|
|
3814
4112
|
}
|
|
3815
4113
|
|
|
4114
|
+
function moveToEol(cm, head, motionArgs, vim, keepHPos) {
|
|
4115
|
+
var cur = head;
|
|
4116
|
+
var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
|
|
4117
|
+
var end=cm.clipPos(retval);
|
|
4118
|
+
end.ch--;
|
|
4119
|
+
if (!keepHPos) {
|
|
4120
|
+
vim.lastHPos = Infinity;
|
|
4121
|
+
vim.lastHSPos = cm.charCoords(end,'div').left;
|
|
4122
|
+
}
|
|
4123
|
+
return retval;
|
|
4124
|
+
}
|
|
4125
|
+
|
|
3816
4126
|
function moveToCharacter(cm, repeat, forward, character) {
|
|
3817
4127
|
var cur = cm.getCursor();
|
|
3818
4128
|
var start = cur.ch;
|
|
@@ -3914,6 +4224,142 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3914
4224
|
start = new Pos(i, 0);
|
|
3915
4225
|
return { start: start, end: end };
|
|
3916
4226
|
}
|
|
4227
|
+
|
|
4228
|
+
function findSentence(cm, cur, repeat, dir) {
|
|
4229
|
+
function nextChar(cm, idx) {
|
|
4230
|
+
if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) {
|
|
4231
|
+
idx.ln += idx.dir;
|
|
4232
|
+
if (!isLine(cm, idx.ln)) {
|
|
4233
|
+
idx.line = null;
|
|
4234
|
+
idx.ln = null;
|
|
4235
|
+
idx.pos = null;
|
|
4236
|
+
return;
|
|
4237
|
+
}
|
|
4238
|
+
idx.line = cm.getLine(idx.ln);
|
|
4239
|
+
idx.pos = (idx.dir > 0) ? 0 : idx.line.length - 1;
|
|
4240
|
+
}
|
|
4241
|
+
else {
|
|
4242
|
+
idx.pos += idx.dir;
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
function forward(cm, ln, pos, dir) {
|
|
4246
|
+
var line = cm.getLine(ln);
|
|
4247
|
+
var stop = (line === "");
|
|
4248
|
+
|
|
4249
|
+
var curr = {
|
|
4250
|
+
line: line,
|
|
4251
|
+
ln: ln,
|
|
4252
|
+
pos: pos,
|
|
4253
|
+
dir: dir,
|
|
4254
|
+
}
|
|
4255
|
+
|
|
4256
|
+
var last_valid = {
|
|
4257
|
+
ln: curr.ln,
|
|
4258
|
+
pos: curr.pos,
|
|
4259
|
+
}
|
|
4260
|
+
|
|
4261
|
+
var skip_empty_lines = (curr.line === "");
|
|
4262
|
+
nextChar(cm, curr);
|
|
4263
|
+
|
|
4264
|
+
while (curr.line !== null) {
|
|
4265
|
+
last_valid.ln = curr.ln;
|
|
4266
|
+
last_valid.pos = curr.pos;
|
|
4267
|
+
|
|
4268
|
+
if (curr.line === "" && !skip_empty_lines) {
|
|
4269
|
+
return { ln: curr.ln, pos: curr.pos, };
|
|
4270
|
+
}
|
|
4271
|
+
else if (stop && curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) {
|
|
4272
|
+
return { ln: curr.ln, pos: curr.pos, };
|
|
4273
|
+
}
|
|
4274
|
+
else if (isEndOfSentenceSymbol(curr.line[curr.pos])
|
|
4275
|
+
&& !stop
|
|
4276
|
+
&& (curr.pos === curr.line.length - 1
|
|
4277
|
+
|| isWhiteSpaceString(curr.line[curr.pos + 1]))) {
|
|
4278
|
+
stop = true;
|
|
4279
|
+
}
|
|
4280
|
+
|
|
4281
|
+
nextChar(cm, curr);
|
|
4282
|
+
}
|
|
4283
|
+
var line = cm.getLine(last_valid.ln);
|
|
4284
|
+
last_valid.pos = 0;
|
|
4285
|
+
for(var i = line.length - 1; i >= 0; --i) {
|
|
4286
|
+
if (!isWhiteSpaceString(line[i])) {
|
|
4287
|
+
last_valid.pos = i;
|
|
4288
|
+
break;
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
|
|
4292
|
+
return last_valid;
|
|
4293
|
+
|
|
4294
|
+
}
|
|
4295
|
+
function reverse(cm, ln, pos, dir) {
|
|
4296
|
+
var line = cm.getLine(ln);
|
|
4297
|
+
|
|
4298
|
+
var curr = {
|
|
4299
|
+
line: line,
|
|
4300
|
+
ln: ln,
|
|
4301
|
+
pos: pos,
|
|
4302
|
+
dir: dir,
|
|
4303
|
+
}
|
|
4304
|
+
|
|
4305
|
+
var last_valid = {
|
|
4306
|
+
ln: curr.ln,
|
|
4307
|
+
pos: null,
|
|
4308
|
+
};
|
|
4309
|
+
|
|
4310
|
+
var skip_empty_lines = (curr.line === "");
|
|
4311
|
+
nextChar(cm, curr);
|
|
4312
|
+
|
|
4313
|
+
while (curr.line !== null) {
|
|
4314
|
+
|
|
4315
|
+
if (curr.line === "" && !skip_empty_lines) {
|
|
4316
|
+
if (last_valid.pos !== null) {
|
|
4317
|
+
return last_valid;
|
|
4318
|
+
}
|
|
4319
|
+
else {
|
|
4320
|
+
return { ln: curr.ln, pos: curr.pos };
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
else if (isEndOfSentenceSymbol(curr.line[curr.pos])
|
|
4324
|
+
&& last_valid.pos !== null
|
|
4325
|
+
&& !(curr.ln === last_valid.ln && curr.pos + 1 === last_valid.pos)) {
|
|
4326
|
+
return last_valid;
|
|
4327
|
+
}
|
|
4328
|
+
else if (curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) {
|
|
4329
|
+
skip_empty_lines = false;
|
|
4330
|
+
last_valid = { ln: curr.ln, pos: curr.pos }
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
nextChar(cm, curr);
|
|
4334
|
+
}
|
|
4335
|
+
var line = cm.getLine(last_valid.ln);
|
|
4336
|
+
last_valid.pos = 0;
|
|
4337
|
+
for(var i = 0; i < line.length; ++i) {
|
|
4338
|
+
if (!isWhiteSpaceString(line[i])) {
|
|
4339
|
+
last_valid.pos = i;
|
|
4340
|
+
break;
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4343
|
+
return last_valid;
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
var curr_index = {
|
|
4347
|
+
ln: cur.line,
|
|
4348
|
+
pos: cur.ch,
|
|
4349
|
+
};
|
|
4350
|
+
|
|
4351
|
+
while (repeat > 0) {
|
|
4352
|
+
if (dir < 0) {
|
|
4353
|
+
curr_index = reverse(cm, curr_index.ln, curr_index.pos, dir);
|
|
4354
|
+
}
|
|
4355
|
+
else {
|
|
4356
|
+
curr_index = forward(cm, curr_index.ln, curr_index.pos, dir);
|
|
4357
|
+
}
|
|
4358
|
+
repeat--;
|
|
4359
|
+
}
|
|
4360
|
+
|
|
4361
|
+
return Pos(curr_index.ln, curr_index.pos);
|
|
4362
|
+
}
|
|
3917
4363
|
function selectCompanionObject(cm, head, symb, inclusive) {
|
|
3918
4364
|
var cur = head, start, end;
|
|
3919
4365
|
|
|
@@ -3930,8 +4376,8 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
3930
4376
|
var curChar = cm.getLine(cur.line).charAt(cur.ch);
|
|
3931
4377
|
var offset = curChar === openSym ? 1 : 0;
|
|
3932
4378
|
|
|
3933
|
-
start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1,
|
|
3934
|
-
end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1,
|
|
4379
|
+
start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, undefined, {'bracketRegex': bracketRegexp});
|
|
4380
|
+
end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, undefined, {'bracketRegex': bracketRegexp});
|
|
3935
4381
|
|
|
3936
4382
|
if (!start || !end) {
|
|
3937
4383
|
return { start: cur, end: cur };
|
|
@@ -4028,26 +4474,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4028
4474
|
var vim = cm.state.vim;
|
|
4029
4475
|
return vim.searchState_ || (vim.searchState_ = new SearchState());
|
|
4030
4476
|
}
|
|
4031
|
-
function dialog(cm, template, shortText, onClose, options) {
|
|
4032
|
-
if (cm.openDialog) {
|
|
4033
|
-
cm.openDialog(template, onClose, { bottom: true, value: options.value,
|
|
4034
|
-
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
|
|
4035
|
-
selectValueOnOpen: false, onClose: function() {
|
|
4036
|
-
if (cm.state.vim) {
|
|
4037
|
-
cm.state.vim.status = "";
|
|
4038
|
-
cm.ace.renderer.$loop.schedule(cm.ace.renderer.CHANGE_CURSOR);
|
|
4039
|
-
}
|
|
4040
|
-
}});
|
|
4041
|
-
}
|
|
4042
|
-
else {
|
|
4043
|
-
onClose(prompt(shortText, ''));
|
|
4044
|
-
}
|
|
4045
|
-
}
|
|
4046
|
-
|
|
4047
4477
|
function splitBySlash(argString) {
|
|
4048
4478
|
return splitBySeparator(argString, '/');
|
|
4049
4479
|
}
|
|
4050
|
-
|
|
4480
|
+
|
|
4051
4481
|
function findUnescapedSlashes(argString) {
|
|
4052
4482
|
return findUnescapedSeparators(argString, '/');
|
|
4053
4483
|
}
|
|
@@ -4146,7 +4576,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4146
4576
|
}
|
|
4147
4577
|
return out.join('');
|
|
4148
4578
|
}
|
|
4149
|
-
var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'};
|
|
4579
|
+
var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t', '\\&':'&'};
|
|
4150
4580
|
function unescapeRegexReplace(str) {
|
|
4151
4581
|
var stream = new CodeMirror.StringStream(str);
|
|
4152
4582
|
var output = [];
|
|
@@ -4192,30 +4622,56 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4192
4622
|
ignoreCase = (/^[^A-Z]*$/).test(regexPart);
|
|
4193
4623
|
}
|
|
4194
4624
|
var regexp = new RegExp(regexPart,
|
|
4195
|
-
(ignoreCase || forceIgnoreCase) ? '
|
|
4625
|
+
(ignoreCase || forceIgnoreCase) ? 'im' : 'm');
|
|
4196
4626
|
return regexp;
|
|
4197
4627
|
}
|
|
4198
|
-
function
|
|
4628
|
+
function hdom(n) {
|
|
4629
|
+
if (typeof n === 'string') n = document.createElement(n);
|
|
4630
|
+
for (var a, i = 1; i < arguments.length; i++) {
|
|
4631
|
+
if (!(a = arguments[i])) continue;
|
|
4632
|
+
if (typeof a !== 'object') a = document.createTextNode(a);
|
|
4633
|
+
if (a.nodeType) n.appendChild(a);
|
|
4634
|
+
else for (var key in a) {
|
|
4635
|
+
if (!Object.prototype.hasOwnProperty.call(a, key)) continue;
|
|
4636
|
+
if (key[0] === '$') n.style[key.slice(1)] = a[key];
|
|
4637
|
+
else n.setAttribute(key, a[key]);
|
|
4638
|
+
}
|
|
4639
|
+
}
|
|
4640
|
+
return n;
|
|
4641
|
+
}
|
|
4642
|
+
|
|
4643
|
+
function showConfirm(cm, template) {
|
|
4644
|
+
var pre = hdom('span', {$color: 'red', $whiteSpace: 'pre'}, template); //ace_patch span instead of pre
|
|
4199
4645
|
if (cm.openNotification) {
|
|
4200
|
-
cm.openNotification(
|
|
4201
|
-
{bottom: true, duration: 5000});
|
|
4646
|
+
cm.openNotification(pre, {bottom: true, duration: 5000});
|
|
4202
4647
|
} else {
|
|
4203
|
-
alert(
|
|
4648
|
+
alert(pre.innerText);
|
|
4204
4649
|
}
|
|
4205
4650
|
}
|
|
4651
|
+
|
|
4206
4652
|
function makePrompt(prefix, desc) {
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4653
|
+
return hdom(document.createDocumentFragment(),
|
|
4654
|
+
hdom('span', {$fontFamily: 'monospace', $whiteSpace: 'pre'},
|
|
4655
|
+
prefix,
|
|
4656
|
+
hdom('input', {type: 'text', autocorrect: 'off',
|
|
4657
|
+
autocapitalize: 'off', spellcheck: 'false'})),
|
|
4658
|
+
desc && hdom('span', {$color: '#888'}, desc));
|
|
4212
4659
|
}
|
|
4213
|
-
|
|
4660
|
+
|
|
4214
4661
|
function showPrompt(cm, options) {
|
|
4215
4662
|
var shortText = (options.prefix || '') + ' ' + (options.desc || '');
|
|
4216
|
-
var
|
|
4217
|
-
|
|
4663
|
+
var template = makePrompt(options.prefix, options.desc);
|
|
4664
|
+
if (cm.openDialog) {
|
|
4665
|
+
cm.openDialog(template, options.onClose, {
|
|
4666
|
+
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
|
|
4667
|
+
bottom: true, selectValueOnOpen: false, value: options.value
|
|
4668
|
+
});
|
|
4669
|
+
}
|
|
4670
|
+
else {
|
|
4671
|
+
options.onClose(prompt(shortText, ''));
|
|
4672
|
+
}
|
|
4218
4673
|
}
|
|
4674
|
+
|
|
4219
4675
|
function regexEqual(r1, r2) {
|
|
4220
4676
|
if (r1 instanceof RegExp && r2 instanceof RegExp) {
|
|
4221
4677
|
var props = ['global', 'multiline', 'ignoreCase', 'source'];
|
|
@@ -4304,7 +4760,14 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4304
4760
|
var cursor = cm.getSearchCursor(query, pos);
|
|
4305
4761
|
for (var i = 0; i < repeat; i++) {
|
|
4306
4762
|
var found = cursor.find(prev);
|
|
4307
|
-
if (i == 0 && found && cursorEqual(cursor.from(), pos)) {
|
|
4763
|
+
if (i == 0 && found && cursorEqual(cursor.from(), pos)) {
|
|
4764
|
+
var lastEndPos = prev ? cursor.from() : cursor.to();
|
|
4765
|
+
found = cursor.find(prev);
|
|
4766
|
+
if (found && !found[0] && cursorEqual(cursor.from(), lastEndPos)) {
|
|
4767
|
+
if (cm.getLine(lastEndPos.line).length == lastEndPos.ch)
|
|
4768
|
+
found = cursor.find(prev);
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4308
4771
|
if (!found) {
|
|
4309
4772
|
cursor = cm.getSearchCursor(query,
|
|
4310
4773
|
(prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );
|
|
@@ -4316,6 +4779,29 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4316
4779
|
return cursor.from();
|
|
4317
4780
|
});
|
|
4318
4781
|
}
|
|
4782
|
+
function findNextFromAndToInclusive(cm, prev, query, repeat, vim) {
|
|
4783
|
+
if (repeat === undefined) { repeat = 1; }
|
|
4784
|
+
return cm.operation(function() {
|
|
4785
|
+
var pos = cm.getCursor();
|
|
4786
|
+
var cursor = cm.getSearchCursor(query, pos);
|
|
4787
|
+
var found = cursor.find(!prev);
|
|
4788
|
+
if (!vim.visualMode && found && cursorEqual(cursor.from(), pos)) {
|
|
4789
|
+
cursor.find(!prev);
|
|
4790
|
+
}
|
|
4791
|
+
|
|
4792
|
+
for (var i = 0; i < repeat; i++) {
|
|
4793
|
+
found = cursor.find(prev);
|
|
4794
|
+
if (!found) {
|
|
4795
|
+
cursor = cm.getSearchCursor(query,
|
|
4796
|
+
(prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );
|
|
4797
|
+
if (!cursor.find(prev)) {
|
|
4798
|
+
return;
|
|
4799
|
+
}
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
return [cursor.from(), cursor.to()];
|
|
4803
|
+
});
|
|
4804
|
+
}
|
|
4319
4805
|
function clearSearchHighlight(cm) {
|
|
4320
4806
|
var state = getSearchState(cm);
|
|
4321
4807
|
cm.removeOverlay(getSearchState(cm).getOverlay());
|
|
@@ -4332,7 +4818,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4332
4818
|
if (start instanceof Array) {
|
|
4333
4819
|
return inArray(pos, start);
|
|
4334
4820
|
} else {
|
|
4335
|
-
if (end) {
|
|
4821
|
+
if (typeof end == 'number') {
|
|
4336
4822
|
return (pos >= start && pos <= end);
|
|
4337
4823
|
} else {
|
|
4338
4824
|
return pos == start;
|
|
@@ -4348,11 +4834,22 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4348
4834
|
}
|
|
4349
4835
|
|
|
4350
4836
|
function getMarkPos(cm, vim, markName) {
|
|
4837
|
+
if (markName == '\'' || markName == '`') {
|
|
4838
|
+
return vimGlobalState.jumpList.find(cm, -1) || Pos(0, 0);
|
|
4839
|
+
} else if (markName == '.') {
|
|
4840
|
+
return getLastEditPos(cm);
|
|
4841
|
+
}
|
|
4351
4842
|
|
|
4352
4843
|
var mark = vim.marks[markName];
|
|
4353
4844
|
return mark && mark.find();
|
|
4354
4845
|
}
|
|
4355
4846
|
|
|
4847
|
+
function getLastEditPos(cm) {
|
|
4848
|
+
var undoManager = cm.ace.session.$undoManager;
|
|
4849
|
+
if (undoManager && undoManager.$lastDelta)
|
|
4850
|
+
return toCmPos(undoManager.$lastDelta.end);
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4356
4853
|
var ExCommandDispatcher = function() {
|
|
4357
4854
|
this.buildCommandMap_();
|
|
4358
4855
|
};
|
|
@@ -4378,7 +4875,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4378
4875
|
try {
|
|
4379
4876
|
this.parseInput_(cm, inputStream, params);
|
|
4380
4877
|
} catch(e) {
|
|
4381
|
-
showConfirm(cm, e);
|
|
4878
|
+
showConfirm(cm, e.toString());
|
|
4382
4879
|
throw e;
|
|
4383
4880
|
}
|
|
4384
4881
|
var command;
|
|
@@ -4416,7 +4913,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4416
4913
|
params.callback();
|
|
4417
4914
|
}
|
|
4418
4915
|
} catch(e) {
|
|
4419
|
-
showConfirm(cm, e);
|
|
4916
|
+
showConfirm(cm, e.toString());
|
|
4420
4917
|
throw e;
|
|
4421
4918
|
}
|
|
4422
4919
|
},
|
|
@@ -4431,7 +4928,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4431
4928
|
result.lineEnd = this.parseLineSpec_(cm, inputStream);
|
|
4432
4929
|
}
|
|
4433
4930
|
}
|
|
4434
|
-
var commandMatch = inputStream.match(/^(\w
|
|
4931
|
+
var commandMatch = inputStream.match(/^(\w+|!!|@@|[!#&*<=>@~])/);
|
|
4435
4932
|
if (commandMatch) {
|
|
4436
4933
|
result.commandName = commandMatch[1];
|
|
4437
4934
|
} else {
|
|
@@ -4661,12 +5158,12 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4661
5158
|
registers: function(cm, params) {
|
|
4662
5159
|
var regArgs = params.args;
|
|
4663
5160
|
var registers = vimGlobalState.registerController.registers;
|
|
4664
|
-
var regInfo = '----------Registers
|
|
5161
|
+
var regInfo = '----------Registers----------\n\n';
|
|
4665
5162
|
if (!regArgs) {
|
|
4666
5163
|
for (var registerName in registers) {
|
|
4667
5164
|
var text = registers[registerName].toString();
|
|
4668
5165
|
if (text.length) {
|
|
4669
|
-
regInfo += '"' + registerName + ' ' + text + '
|
|
5166
|
+
regInfo += '"' + registerName + ' ' + text + '\n'
|
|
4670
5167
|
}
|
|
4671
5168
|
}
|
|
4672
5169
|
} else {
|
|
@@ -4678,7 +5175,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4678
5175
|
continue;
|
|
4679
5176
|
}
|
|
4680
5177
|
var register = registers[registerName] || new Register();
|
|
4681
|
-
regInfo += '"' + registerName + ' ' + register.toString() + '
|
|
5178
|
+
regInfo += '"' + registerName + ' ' + register.toString() + '\n'
|
|
4682
5179
|
}
|
|
4683
5180
|
}
|
|
4684
5181
|
showConfirm(cm, regInfo);
|
|
@@ -4773,12 +5270,16 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4773
5270
|
}
|
|
4774
5271
|
cm.replaceRange(text.join('\n'), curStart, curEnd);
|
|
4775
5272
|
},
|
|
5273
|
+
vglobal: function(cm, params) {
|
|
5274
|
+
this.global(cm, params);
|
|
5275
|
+
},
|
|
4776
5276
|
global: function(cm, params) {
|
|
4777
5277
|
var argString = params.argString;
|
|
4778
5278
|
if (!argString) {
|
|
4779
5279
|
showConfirm(cm, 'Regular Expression missing from global');
|
|
4780
5280
|
return;
|
|
4781
5281
|
}
|
|
5282
|
+
var inverted = params.commandName[0] === 'v';
|
|
4782
5283
|
var lineStart = (params.line !== undefined) ? params.line : cm.firstLine();
|
|
4783
5284
|
var lineEnd = params.lineEnd || params.line || cm.lastLine();
|
|
4784
5285
|
var tokens = splitBySlash(argString);
|
|
@@ -4797,27 +5298,32 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4797
5298
|
}
|
|
4798
5299
|
}
|
|
4799
5300
|
var query = getSearchState(cm).getQuery();
|
|
4800
|
-
var matchedLines = []
|
|
5301
|
+
var matchedLines = [];
|
|
4801
5302
|
for (var i = lineStart; i <= lineEnd; i++) {
|
|
4802
|
-
var
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
5303
|
+
var line = cm.getLineHandle(i);
|
|
5304
|
+
var matched = query.test(line.text);
|
|
5305
|
+
if (matched !== inverted) {
|
|
5306
|
+
matchedLines.push(cmd ? line : line.text);
|
|
4806
5307
|
}
|
|
4807
5308
|
}
|
|
4808
5309
|
if (!cmd) {
|
|
4809
|
-
showConfirm(cm,
|
|
5310
|
+
showConfirm(cm, matchedLines.join('\n'));
|
|
4810
5311
|
return;
|
|
4811
5312
|
}
|
|
4812
5313
|
var index = 0;
|
|
4813
5314
|
var nextCommand = function() {
|
|
4814
5315
|
if (index < matchedLines.length) {
|
|
4815
|
-
var
|
|
5316
|
+
var line = matchedLines[index++];
|
|
5317
|
+
var lineNum = cm.getLineNumber(line);
|
|
5318
|
+
if (lineNum == null) {
|
|
5319
|
+
nextCommand();
|
|
5320
|
+
return;
|
|
5321
|
+
}
|
|
5322
|
+
var command = (lineNum + 1) + cmd;
|
|
4816
5323
|
exCommandDispatcher.processCommand(cm, command, {
|
|
4817
5324
|
callback: nextCommand
|
|
4818
5325
|
});
|
|
4819
5326
|
}
|
|
4820
|
-
index++;
|
|
4821
5327
|
};
|
|
4822
5328
|
nextCommand();
|
|
4823
5329
|
},
|
|
@@ -4833,14 +5339,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4833
5339
|
var global = false; // True to replace all instances on a line, false to replace only 1.
|
|
4834
5340
|
if (tokens.length) {
|
|
4835
5341
|
regexPart = tokens[0];
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n';
|
|
4839
|
-
replacePart = replacePart ? replacePart + '\n' : '\n';
|
|
5342
|
+
if (getOption('pcre') && regexPart !== '') {
|
|
5343
|
+
regexPart = new RegExp(regexPart).source; //normalize not escaped characters
|
|
4840
5344
|
}
|
|
5345
|
+
replacePart = tokens[1];
|
|
4841
5346
|
if (replacePart !== undefined) {
|
|
4842
5347
|
if (getOption('pcre')) {
|
|
4843
|
-
replacePart = unescapeRegexReplace(replacePart);
|
|
5348
|
+
replacePart = unescapeRegexReplace(replacePart.replace(/([^\\])&/g,"$1$$&"));
|
|
4844
5349
|
} else {
|
|
4845
5350
|
replacePart = translateRegexReplace(replacePart);
|
|
4846
5351
|
}
|
|
@@ -4860,13 +5365,15 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4860
5365
|
if (flagsPart) {
|
|
4861
5366
|
if (flagsPart.indexOf('c') != -1) {
|
|
4862
5367
|
confirm = true;
|
|
4863
|
-
flagsPart.replace('c', '');
|
|
4864
5368
|
}
|
|
4865
5369
|
if (flagsPart.indexOf('g') != -1) {
|
|
4866
5370
|
global = true;
|
|
4867
|
-
flagsPart.replace('g', '');
|
|
4868
5371
|
}
|
|
4869
|
-
|
|
5372
|
+
if (getOption('pcre')) {
|
|
5373
|
+
regexPart = regexPart + '/' + flagsPart;
|
|
5374
|
+
} else {
|
|
5375
|
+
regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
|
|
5376
|
+
}
|
|
4870
5377
|
}
|
|
4871
5378
|
}
|
|
4872
5379
|
if (regexPart) {
|
|
@@ -4971,7 +5478,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4971
5478
|
replaceWith, callback) {
|
|
4972
5479
|
cm.state.vim.exMode = true;
|
|
4973
5480
|
var done = false;
|
|
4974
|
-
var lastPos
|
|
5481
|
+
var lastPos, modifiedLineNumber, joined;
|
|
4975
5482
|
function replaceAll() {
|
|
4976
5483
|
cm.operation(function() {
|
|
4977
5484
|
while (!done) {
|
|
@@ -4984,12 +5491,24 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
4984
5491
|
function replace() {
|
|
4985
5492
|
var text = cm.getRange(searchCursor.from(), searchCursor.to());
|
|
4986
5493
|
var newText = text.replace(query, replaceWith);
|
|
5494
|
+
var unmodifiedLineNumber = searchCursor.to().line;
|
|
4987
5495
|
searchCursor.replace(newText);
|
|
5496
|
+
modifiedLineNumber = searchCursor.to().line;
|
|
5497
|
+
lineEnd += modifiedLineNumber - unmodifiedLineNumber;
|
|
5498
|
+
joined = modifiedLineNumber < unmodifiedLineNumber;
|
|
5499
|
+
}
|
|
5500
|
+
function findNextValidMatch() {
|
|
5501
|
+
var lastMatchTo = lastPos && copyCursor(searchCursor.to());
|
|
5502
|
+
var match = searchCursor.findNext();
|
|
5503
|
+
if (match && !match[0] && lastMatchTo && cursorEqual(searchCursor.from(), lastMatchTo)) {
|
|
5504
|
+
match = searchCursor.findNext();
|
|
5505
|
+
}
|
|
5506
|
+
return match;
|
|
4988
5507
|
}
|
|
4989
5508
|
function next() {
|
|
4990
|
-
while(
|
|
5509
|
+
while(findNextValidMatch() &&
|
|
4991
5510
|
isInRange(searchCursor.from(), lineStart, lineEnd)) {
|
|
4992
|
-
if (!global &&
|
|
5511
|
+
if (!global && searchCursor.from().line == modifiedLineNumber && !joined) {
|
|
4993
5512
|
continue;
|
|
4994
5513
|
}
|
|
4995
5514
|
cm.scrollIntoView(searchCursor.from(), 30);
|
|
@@ -5048,7 +5567,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5048
5567
|
return;
|
|
5049
5568
|
}
|
|
5050
5569
|
showPrompt(cm, {
|
|
5051
|
-
prefix: 'replace with
|
|
5570
|
+
prefix: hdom('span', 'replace with ', hdom('strong', replaceWith), ' (y/n/a/q/l)'),
|
|
5052
5571
|
onKeyDown: onPromptKeyDown
|
|
5053
5572
|
});
|
|
5054
5573
|
}
|
|
@@ -5102,13 +5621,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5102
5621
|
defineOption('insertModeEscKeysTimeout', 200, 'number');
|
|
5103
5622
|
|
|
5104
5623
|
CodeMirror.keyMap['vim-insert'] = {
|
|
5105
|
-
'Ctrl-N': 'autocomplete',
|
|
5106
|
-
'Ctrl-P': 'autocomplete',
|
|
5107
|
-
'Enter': function(cm) {
|
|
5108
|
-
var fn = CodeMirror.commands.newlineAndIndentContinueComment ||
|
|
5109
|
-
CodeMirror.commands.newlineAndIndent;
|
|
5110
|
-
fn(cm);
|
|
5111
|
-
},
|
|
5112
5624
|
fallthrough: ['default'],
|
|
5113
5625
|
attach: attachVimMap,
|
|
5114
5626
|
detach: detachVimMap,
|
|
@@ -5200,10 +5712,12 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5200
5712
|
lastChange.changes = [];
|
|
5201
5713
|
lastChange.maybeReset = false;
|
|
5202
5714
|
}
|
|
5203
|
-
if (
|
|
5715
|
+
if (text) {
|
|
5716
|
+
if (cm.state.overwrite && !/\n/.test(text)) {
|
|
5204
5717
|
lastChange.changes.push([text]);
|
|
5205
|
-
|
|
5718
|
+
} else {
|
|
5206
5719
|
lastChange.changes.push(text);
|
|
5720
|
+
}
|
|
5207
5721
|
}
|
|
5208
5722
|
}
|
|
5209
5723
|
changeObj = changeObj.next;
|
|
@@ -5229,15 +5743,10 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5229
5743
|
}
|
|
5230
5744
|
}
|
|
5231
5745
|
function updateFakeCursor(cm) {
|
|
5232
|
-
var vim = cm.state.vim;
|
|
5233
|
-
var from = clipCursorToContent(cm, copyCursor(vim.sel.head));
|
|
5234
|
-
var to = offsetCursor(from, 0, 1);
|
|
5235
|
-
if (vim.fakeCursor) {
|
|
5236
|
-
vim.fakeCursor.clear();
|
|
5237
|
-
}
|
|
5238
|
-
vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'});
|
|
5239
5746
|
}
|
|
5240
|
-
function
|
|
5747
|
+
function clearFakeCursor(vim) {
|
|
5748
|
+
}
|
|
5749
|
+
function handleExternalSelection(cm, vim, keepHPos) {
|
|
5241
5750
|
var anchor = cm.getCursor('anchor');
|
|
5242
5751
|
var head = cm.getCursor('head');
|
|
5243
5752
|
if (vim.visualMode && !cm.somethingSelected()) {
|
|
@@ -5258,7 +5767,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5258
5767
|
};
|
|
5259
5768
|
updateMark(cm, vim, '<', cursorMin(head, anchor));
|
|
5260
5769
|
updateMark(cm, vim, '>', cursorMax(head, anchor));
|
|
5261
|
-
} else if (!vim.insertMode) {
|
|
5770
|
+
} else if (!vim.insertMode && !keepHPos) {
|
|
5262
5771
|
vim.lastHPos = cm.getCursor().ch;
|
|
5263
5772
|
}
|
|
5264
5773
|
}
|
|
@@ -5330,17 +5839,14 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5330
5839
|
return true;
|
|
5331
5840
|
}
|
|
5332
5841
|
var head = cm.getCursor('head');
|
|
5333
|
-
var
|
|
5334
|
-
if (
|
|
5335
|
-
|
|
5336
|
-
var lastSel = vim.lastSelection;
|
|
5337
|
-
var offset = getOffset(lastSel.anchor, lastSel.head);
|
|
5338
|
-
selectForInsert(cm, head, offset.line + 1);
|
|
5842
|
+
var visualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.visualBlock;
|
|
5843
|
+
if (visualBlock) {
|
|
5844
|
+
selectForInsert(cm, head, visualBlock + 1);
|
|
5339
5845
|
repeat = cm.listSelections().length;
|
|
5340
5846
|
cm.setCursor(head);
|
|
5341
5847
|
}
|
|
5342
5848
|
for (var i = 0; i < repeat; i++) {
|
|
5343
|
-
if (
|
|
5849
|
+
if (visualBlock) {
|
|
5344
5850
|
cm.setCursor(offsetCursor(head, i, 0));
|
|
5345
5851
|
}
|
|
5346
5852
|
for (var j = 0; j < changes.length; j++) {
|
|
@@ -5357,7 +5863,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5357
5863
|
}
|
|
5358
5864
|
}
|
|
5359
5865
|
}
|
|
5360
|
-
if (
|
|
5866
|
+
if (visualBlock) {
|
|
5361
5867
|
cm.setCursor(offsetCursor(head, 0, 1));
|
|
5362
5868
|
}
|
|
5363
5869
|
}
|
|
@@ -5413,15 +5919,17 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5413
5919
|
var isHandled = false;
|
|
5414
5920
|
var vim = Vim.maybeInitVimState_(cm);
|
|
5415
5921
|
var visualBlock = vim.visualBlock || vim.wasInVisualBlock;
|
|
5416
|
-
|
|
5922
|
+
|
|
5923
|
+
var wasMultiselect = cm.ace.inMultiSelectMode;
|
|
5924
|
+
if (vim.wasInVisualBlock && !wasMultiselect) {
|
|
5417
5925
|
vim.wasInVisualBlock = false;
|
|
5418
|
-
} else if (
|
|
5926
|
+
} else if (wasMultiselect && vim.visualBlock) {
|
|
5419
5927
|
vim.wasInVisualBlock = true;
|
|
5420
5928
|
}
|
|
5421
|
-
|
|
5422
|
-
if (key == '<Esc>' && !vim.insertMode && !vim.visualMode &&
|
|
5929
|
+
|
|
5930
|
+
if (key == '<Esc>' && !vim.insertMode && !vim.visualMode && wasMultiselect) {
|
|
5423
5931
|
cm.ace.exitMultiSelectMode();
|
|
5424
|
-
} else if (visualBlock || !
|
|
5932
|
+
} else if (visualBlock || !wasMultiselect || cm.ace.inVirtualSelectionMode) {
|
|
5425
5933
|
isHandled = Vim.handleKey(cm, key, origin);
|
|
5426
5934
|
} else {
|
|
5427
5935
|
var old = cloneVimState(vim);
|
|
@@ -5437,7 +5945,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5437
5945
|
anchor = offsetCursor(anchor, 0, anchorOffset);
|
|
5438
5946
|
cm.state.vim.sel.head = head;
|
|
5439
5947
|
cm.state.vim.sel.anchor = anchor;
|
|
5440
|
-
|
|
5948
|
+
|
|
5441
5949
|
isHandled = handleKey(cm, key, origin);
|
|
5442
5950
|
sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos;
|
|
5443
5951
|
if (cm.virtualSelectionMode()) {
|
|
@@ -5448,8 +5956,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5448
5956
|
cm.curOp.cursorActivity = false;
|
|
5449
5957
|
}, true);
|
|
5450
5958
|
}
|
|
5451
|
-
if (isHandled && !vim.visualMode && !vim.insert)
|
|
5452
|
-
handleExternalSelection(cm, vim);
|
|
5959
|
+
if (isHandled && !vim.visualMode && !vim.insert && vim.visualMode != cm.somethingSelected()) {
|
|
5960
|
+
handleExternalSelection(cm, vim, true);
|
|
5961
|
+
}
|
|
5453
5962
|
return isHandled;
|
|
5454
5963
|
}
|
|
5455
5964
|
exports.CodeMirror = CodeMirror;
|
|
@@ -5463,12 +5972,12 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5463
5972
|
var top = pixelPos.top;
|
|
5464
5973
|
var left = pixelPos.left;
|
|
5465
5974
|
if (!vim.insertMode) {
|
|
5466
|
-
var isbackwards = !sel.cursor
|
|
5975
|
+
var isbackwards = !sel.cursor
|
|
5467
5976
|
? session.selection.isBackwards() || session.selection.isEmpty()
|
|
5468
5977
|
: Range.comparePoints(sel.cursor, sel.start) <= 0;
|
|
5469
5978
|
if (!isbackwards && left > w)
|
|
5470
5979
|
left -= w;
|
|
5471
|
-
}
|
|
5980
|
+
}
|
|
5472
5981
|
if (!vim.insertMode && vim.status) {
|
|
5473
5982
|
h = h / 2;
|
|
5474
5983
|
top += h;
|
|
@@ -5516,13 +6025,13 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5516
6025
|
return {command: "null", passEvent: true};
|
|
5517
6026
|
}
|
|
5518
6027
|
}
|
|
5519
|
-
|
|
6028
|
+
|
|
5520
6029
|
if (key == "esc" && !vim.insertMode && !vim.visualMode && !cm.ace.inMultiSelectMode) {
|
|
5521
6030
|
var searchState = getSearchState(cm);
|
|
5522
6031
|
var overlay = searchState.getOverlay();
|
|
5523
6032
|
if (overlay) cm.removeOverlay(overlay);
|
|
5524
6033
|
}
|
|
5525
|
-
|
|
6034
|
+
|
|
5526
6035
|
if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) {
|
|
5527
6036
|
var insertMode = vim.insertMode;
|
|
5528
6037
|
var name = lookupKey(hashId, key, e || {});
|
|
@@ -5620,7 +6129,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5620
6129
|
{ keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } },
|
|
5621
6130
|
{ keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } },
|
|
5622
6131
|
{ keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } },
|
|
5623
|
-
|
|
6132
|
+
|
|
5624
6133
|
{ keys: '<C-A-k>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAbove" } },
|
|
5625
6134
|
{ keys: '<C-A-j>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelow" } },
|
|
5626
6135
|
{ keys: '<C-A-S-k>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAboveSkipCurrent" } },
|
|
@@ -5630,6 +6139,34 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5630
6139
|
{ keys: '<C-A-S-h>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextBefore" } },
|
|
5631
6140
|
{ keys: '<C-A-S-l>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextAfter" } }
|
|
5632
6141
|
);
|
|
6142
|
+
|
|
6143
|
+
defaultKeymap.push({
|
|
6144
|
+
keys: 'gq',
|
|
6145
|
+
type: 'operator',
|
|
6146
|
+
operator: 'hardWrap'
|
|
6147
|
+
});
|
|
6148
|
+
Vim.defineOperator("hardWrap", function(cm, operatorArgs, ranges, oldAnchor, newHead) {
|
|
6149
|
+
var anchor = ranges[0].anchor.line;
|
|
6150
|
+
var head = ranges[0].head.line;
|
|
6151
|
+
if (operatorArgs.linewise) head--;
|
|
6152
|
+
hardWrap(cm.ace, {startRow: anchor, endRow: head});
|
|
6153
|
+
return Pos(head, 0);
|
|
6154
|
+
});
|
|
6155
|
+
defineOption('textwidth', undefined, 'number', ['tw'], function(width, cm) {
|
|
6156
|
+
if (cm === undefined) {
|
|
6157
|
+
return;
|
|
6158
|
+
}
|
|
6159
|
+
if (width === undefined) {
|
|
6160
|
+
var value = cm.ace.getOption('printMarginColumn');
|
|
6161
|
+
return value;
|
|
6162
|
+
} else {
|
|
6163
|
+
var column = Math.round(width);
|
|
6164
|
+
if (column > 1) {
|
|
6165
|
+
cm.ace.setOption('printMarginColumn', column);
|
|
6166
|
+
}
|
|
6167
|
+
}
|
|
6168
|
+
});
|
|
6169
|
+
|
|
5633
6170
|
actions.aceCommand = function(cm, actionArgs, vim) {
|
|
5634
6171
|
cm.vimCmd = actionArgs;
|
|
5635
6172
|
if (cm.ace.inVirtualSelectionMode)
|
|
@@ -5653,8 +6190,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5653
6190
|
exports.handler.defaultKeymap = defaultKeymap;
|
|
5654
6191
|
exports.handler.actions = actions;
|
|
5655
6192
|
exports.Vim = Vim;
|
|
5656
|
-
|
|
5657
|
-
Vim.map("Y", "yy", "normal");
|
|
5658
6193
|
}); (function() {
|
|
5659
6194
|
ace.require(["ace/keyboard/vim"], function(m) {
|
|
5660
6195
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
@@ -5662,4 +6197,3 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|
|
5662
6197
|
}
|
|
5663
6198
|
});
|
|
5664
6199
|
})();
|
|
5665
|
-
|