Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capslock on iOS #3403

Open
D-32 opened this issue Jul 21, 2015 · 27 comments
Open

Capslock on iOS #3403

D-32 opened this issue Jul 21, 2015 · 27 comments

Comments

@D-32
Copy link

D-32 commented Jul 21, 2015

When focusing onto an empty line on an iOS device inside WKWebview or Safari the keyboard switches to all caps mode.
This can be reproduced easily in the example on http://codemirror.net. Just tap somewhere next to the last line, the cursor will focus as seen on the attached screenshot and the keyboard goes into all caps mode.

img_0048

@marijnh
Copy link
Member

marijnh commented Jul 21, 2015

It goes into 'capitalize the next letter' mode, which is what mobile keyboards tend to do when at the start of what looks like a sentence. I don't think there is a way for CodeMirror to suppress this, but if you do know of one, tell me.

@D-32
Copy link
Author

D-32 commented Jul 21, 2015

That would make sense, but it stays in caps lock. So if I type A the next character is still upper case. Which is annoying, as the user manually has to get out of that mode.
This surely isn't an intended behavior.

@marijnh
Copy link
Member

marijnh commented Jul 21, 2015

That is indeed odd. I'll see if I can figure out what is happening the next time I have my iPad in my hand.

@D-32
Copy link
Author

D-32 commented Jul 21, 2015

Thanks :)

@boucher
Copy link

boucher commented Sep 23, 2015

Seems related to this bug filed against WebKit:
https://bugs.webkit.org/show_bug.cgi?id=148503

@boucher
Copy link

boucher commented Sep 23, 2015

Switching to inputStyle: "textarea" resolves this issue, but produces the issue where the native cursor is displayed in addition to the codemirror cursor. I might be willing to live with that by disabling the codemirror cursor, but perhaps there are other problems I haven't discovered yet since textarea is not the default on mobile?

edit: at least one thing that stops working correctly in mobile with "textarea" mode is text selection.

@denisoby
Copy link

denisoby commented Apr 7, 2016

I've met same issue. The problem is that if e.preventDefault is called - then iOS will skip internal callbacks and will NOT switch case to lower.

For CM4 I've made a workaround for CM keypress event like this

    onKeyPress: function(e) {
      if (capitalizationHack.isPreventDefaultNeeded(e)){ // if uppercase -> not needed
        e.preventDefault();
      }
      operation(....)
    },

And after this - we have two events of adding letter. The extra letter should be removed

  if (cm.capitalizationHack.isHackEnabled()) {
    CodeMirror.on(cm.doc, 'change', function (instance, change) {
      var capHack = this.editor.capitalizationHack;
        if (capHack.isDuplicateChange() && (change.text.length == 1)) {
          console.log("Line BF: " + cm.getLine(change.from.line));

          var realFrom = {
            line: change.from.line,
            ch: change.from.ch - 1
          };
          var realTo = {
            line: change.from.line,
            ch: change.from.ch + 1
          };
          cm.replaceRange(change.text[0], realFrom, realTo);

          console.log("Line AF: " + cm.getLine(change.from.line));
     }
    }.bind(this));
  }

This is definitely ugly hack. But first seems to be working ok for user.
I hope that CM authors will think how to process this situation in a more beautiful way.

If necessary - I can provide full code of workaround. Most likely in CM5 - the situation is the same.

@boucher @marijnh @D-32 FYI

@sassywebgal
Copy link

@denis-aes Would it be possible for you to provide the full code workaround for this issue? This has become a very problematic bug for a current project and we're attempting to patch. Any further code snippets/file would be much appreciated.

@denisoby
Copy link

@sassywebgal it has changed a little. We removed preventing. But now always remove duplicate symbols:

Main logic in codemirror.js

var isSafariOrWebview = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);

  if (_isCapsHackEnabled) {
    var capitalizationHack = (new function capitalizationHack() {
      var changeNum = 0;
      var eventPressed;

      this.isHackEnabled = function () {return _isCapsHackEnabled;};

      this.processKeyUp = function () {
        changeNum = 0;
        eventPressed = false;
      };

      this.isDuplicateChange = function () {
        if (eventPressed) {
          changeNum++;
          return changeNum == 2;
        }
      };
    }());
  }
  else{
    var capitalizationHack = {
      isHackEnabled: function () {return _isCapsHackEnabled;},
      processKeyUp: function () {},
      isDuplicateChange: function () {},
      isPreventDefaultNeeded: function () {return true}
    }
  }

Also you should fix onKeyUp:

  function onKeyUp(e) {
    if (e.keyCode == 16) this.doc.sel.shift = false;
    capitalizationHack.processKeyUp(e); //this line added
    signalDOMEvent(this, e);
  }

And in client code, where you create CodeMirror instance, do:

    CodeMirror.on(cm.doc, 'beforeChange', function(instance, e) {

        if (cm.capitalizationHack && cm.capitalizationHack.isHackEnabled()) {
            var capHack = this.editor.capitalizationHack;

            if (capHack.isDuplicateChange() && (e.text.length == 1)) {
                e.update({
                    ch: e.from.ch - 1,
                    line: e.from.line
                },{
                    ch: e.from.ch,
                    line: e.from.line
                },'');
            }
        }
    });

Try it. I hope will help.

@facundomedica
Copy link

@denis-aes do you have any CodeMirror.js for me to take a look? I can't get it to work. Thanks!

@louisatome
Copy link
Contributor

I have the same problem, i didn't find how to make the @denis-aes's patch work but I find another ugly way by re-focus the editor after the user type the first character on a line :

editor.on('change', function(instance, change) {
  var line = editor.getLine(change.from.line);
  if(line.length === 1 && change.text.length === 1 && (/^[A-Z]$/).test(change.text[0])){
    var focused = $(':focus');
    focused.blur();
    focused.focus();
  }
});

@marijnh
Copy link
Member

marijnh commented Dec 15, 2016

See also this ProseMirror issue for context. There we ended up half-fixing it by letting native edit events go through, and patching up the DOM after the fact. We might also eventually want to do something like that in CodeMirror, but I'm not sure when I'll have time for it. Also, this still won't solve the problem of the keyboard case being stuck when programatically moving the cursor. And the blur/focus hack is too slow to apply it every time it'd be needed.

In the end, this is a really stupid bug in Mobile Safari, and because Apple doesn't appear to have an open bug tracker for stuff like this, it's rather hard to figure out whether they are aware of the issue and intend to look into it. If you have an Apple account and some time on your hands, firing more bug reports their way might help: https://developer.apple.com/bug-reporting/ (the precise issue, which can easily be reproduced outside of CodeMirror, is that if you change the DOM selection with JavaScript, as opposed to the user doing it directly, that doesn't cause the keyboard state -- such as default case -- to update)

@firasdib
Copy link

firasdib commented Dec 9, 2017

This seems fixed now?

@seidtgeist
Copy link

Does someone who participated in this thread have a stable solution that works with the latest version of CodeMirror and that they can recommend?

@adrianheine
Copy link
Contributor

adrianheine commented Sep 6, 2018

We are working on a rewrite (CodeMirror 6) that will probably address this issue, and we are currently raising money for this work: See the announcement for more information about the rewrite and a demo.

Note that CodeMirror 6 is by no means stable or usable in production, yet. It's highly unlikely that we pick up this issue for CodeMirror 5, though.

@marijnh
Copy link
Member

marijnh commented Sep 6, 2018

Note that, unless this was fixed in the meantime, Mobile Safari is pretty awful about syncing up the automatic capitalization with programmatic selection updates—it tends to leave that in the state it was at the last user-driven cursor change or user input. So this'll work much better in version 6 than it does now (tapping or typing gives the expected result), but if yours scripts move the cursor somewhere, there might still be flakiness.

@Jetski5822
Copy link

Yeah - been using this recently, and the ios experience is not great

@adrianheine
Copy link
Contributor

Just to clarify: You tried out the CodeMirror 6 demo and found issues under iOS?

@Jetski5822
Copy link

Darn no - version 5. Is the dsl of 5 wildly different in 6?

@adrianheine
Copy link
Contributor

CodeMirror 6 is a complete rewrite, and it's currently under development. You can have a look at the announcement with embedded demo, and I would like to know how it works in iOS :)

@kimbtech
Copy link

Just checked the Demo on my iPhone and it seems to work fine.

@seidtgeist
Copy link

seidtgeist commented Oct 24, 2018

For the maintainers, might it make sense to have a label and/or title/description blurb to mark issues that are addressed by version 6 to improve clarity?

Edit: Just noticed the “Fixed in rewrite (hopefully)” milestone 🙏

@ashvin777
Copy link

ashvin777 commented Apr 10, 2019

[SOLVED]

I have fixed this issue in one of my project. We just need to set autocapitalize to off for the input field which is used by codemirror. Here is how it can be done -

let editor = CodeMirror($el, { options });
let $input = editor.getInputField();
$input.setAttribute('autocapitalize', 'off');

If you want to turn off auto correct-

$input.setAttribute('autocorrect', 'off');

Enjoy !! 🥂

marijnh added a commit that referenced this issue Apr 11, 2019
@marijnh
Copy link
Member

marijnh commented Apr 11, 2019

Oh, wow, CodeMirror was setting these to "false", which is apparently ignored because the attribute expects "off" (contrary to spellcheck or contenteditable, which do use "false" 🙄).

Attached patch fixes this.

@jackycute
Copy link
Contributor

I think this issue can be closed as well?
#4865

cone56 pushed a commit to cone56/CodeMirror that referenced this issue Jan 6, 2020
fidelo-developer pushed a commit to fidelo-software/CodeMirror that referenced this issue Jan 21, 2020
* [lint demo] Changed script links to use unpkg

* [css] support double dash css variable (codemirror#5687)

* [vim bindings] Allow selecting text enclosed in angled brackets

* [python mode] Fix nested braces in FString expression

Closes codemirror#5691

* Fix use of let in mode

* Remove debug statement

* [sql mode] Add GETTOKEN, HEADLINE and LEXTYPES for postgresql

see https://www.postgresql.org/docs/10/sql-createtsparser.html

* [soy mode] Improve namespace highlighting

- highlighted the namespace itself as a variable. This is
  in line with how Java packages are highlighted.  I believe
  this is a close approximation.
- added 2 tests to verify new highlighting.

* [sql mode] Add LEXIZE and INIT keywords for postgresql

see https://www.postgresql.org/docs/11/sql-createtstemplate.html

* [soy mode] Classify param type as type

- changed classification of param-def-type to "type" instead of using "variable-3"
- updated tests to match this expectation

* [soy mode] Updated {call /} and .template token

- updated "templ-ref" to match namespaced templates e.g.
my.namespaced.component.element. The existing regex matches the first
word and nothing after the "."

- updated "templ-ref" to treat all "." templates as variable-2.
Local templates are the only ones capable of starting with a dot and
because a template earlier in the file can reference a local template
later in the file, there are no guarantees of it being in the variable
list. Treating all .templates as local is more consistent and
predictable for syntax highlighting.

* [soy mode] tokenize soy functions

- added tokenization for soy functions. Assigned to variable & callee
- added tests to verify it works within expressions

* [soy mode] tokenize property names in {param}

- added token "property" to `name` in `{param name: '' /}`
- adjusted nested-kind-test for this change.

* [yaml-lint addon] Allow linting of multi-document yaml stream

* [sql mode] Add PUBLICATION postgres keyword

see https://www.postgresql.org/docs/10/sql-createpublication.html

* [vim bindings] Fix/keymap/vim ctrl w idle

* Fix issue where bracket matching was unintentionally including <> by default

Closes codemirror/google-modes#233

* [python mode] Fix bug that could cause crashes with some format strings

Closes codemirror#5713

* [sql mode] Treat / as an operator char

See https://discuss.codemirror.net/t/division-operator-in-text-x-sql-mode/1941

* [sql mode] Don't override operatorChars in base sql mime type

* Remove debug statement

* [matchbrackets addon] More thoroughly disable matching of <> by default

Issue codemirror/google-modes#233

* [soy mode] added token for unknown type "?"

- added token "type" for ?
- added test for single type
- added test for ? as a template type parameter

* [soy mode] Boolean and number tokenization in expressions


- added tokenization for decimals
- added tokenization for hexidecimals
- added tokenization for true/false
- added test cases for those new atom tokens

* [soy mode] tokenize operators in expressions

- tokenize arithmetic and equality operators as "operator"
- added tests to validate this

* Fix issue in IE where the context menu hack might stay visible

Because JS seems to be frozen entirely while the context menu is
open, the next open might happen before the timeout was able to
fire. This forces the previous context menu kludge to be cleared
before starting a new one.

* Improve positioning of context menu hack

It sometimes went wrong due to the textarea wrapper being moved
when the cursor was placed under the mouse.

* [show-hint addon] Define a closeHint method

Issue codemirror#5682

* [sql mode] Add SUBSCRIPTION postgres keyword

See https://www.postgresql.org/docs/10/sql-createsubscription.html

* [panel demo] Prevent editor from losing focus when closing a panel

See https://discuss.codemirror.net/t/codemirror-panel-demo-cursor-disappears-on-closing-panel/1946

* Mark version 5.42.2

* Bump version number post-5.42.2

* [soy mode] added null literal and null propogation operator

- added null as atom
- added null propogator as operator
- changed [=] to = in operator regex
- added tests to validate new highlighting

* [soy mode] add support for scientific notation

- modified the decimal expression to support scientific notation
- added tests to verify new highlighting behavior

* [show-hint addon]: bind Ctrl-P/Ctrl-N to up/down on macOS

* [css mode] more consistent css function tokens

- created a css function regexp with a positive lookahead for (. There
are still a few cases with IE functions that have . and : in it that
this does not catch.
- folded url/domain/regexp into that css function regexp including the
special string tokenization that was in place already
- updated css, less, and scss tests to reflect this new tokenization

* [ruby mode] Support indented heredoc end token

Closes codemirror#5727
Closes codemirror#5728

* [ruby mode] Only allow indented heredoc end markers when a - was present

Issue codemirror#5728

* [javascript mode] Improve support for syntactic corner cases in TypeScript

Closes codemirror#5734

* [javascript] Don't expect function bodies in interface declarations

Issue codemirror#5734

* Add options for autocorrect, autocapitalize

* [sql mode] Fall make sure there are keywords and builtins defined when no config is provided

Closes codemirror#5740

* Make sure indent is always passed three arguments

Closes codemirror/google-modes#235

* [julia mode] Don't autoclose single quotes in Julia code

Closes codemirror#5742

* [jinja2 mode] Add MIME type

* [javascript mode] Improve TypeScript support

Add type conditionals, fix parenthesized types, support quoted property
names, fix handling of type parameters in type definitions, and handle
call signatures in interfaces and object types.

Closes codemirror#5737

* [javascript mode] Accept commas as separators in TypeScript interfaces

Issue codemirror#5734

* Mark version 5.43.0

* [real-world uses] Add Colon

* Bump version number post-5.43.0

* Fix middle-click paste on Firefox.

The current solution consists in focusing the
input when the scroll container capture a paste
event, which does not work on Firefox.

In order to fix this, creating a new paste event,
copying the clipboardData and dispatching it
on the textarea seems to do the trick.

This works on Firefox 64, with the
config set to true.

* [continuelist addon] Support nested modes

* [julia mode] Fix some indentation issues

* Prevent text-less paste from messing up the origin of the next text input

Closes codemirror#5764

* [javascript mode] Support TypeScript this parameter declarations

Closes codemirror#5769

* [javascript mode] Allow TS prefixed | or & operators

Closes codemirror#5771

* [javascript mode] Simplify parsing of for loop specs

Closes codemirror#5774

* [soy mode] Update @prop to @State

The name change was made in Soy recently.

* [soy mode] Add {element} as valid indenting tag.

* [lesser-dark and vibrant-ink themes] Improve contrast

* [nord theme] Add

* [vim bindings] Add proper emulation for forward-delete

In Vim's command mode, forward-delete (Delete on PC or fn-delete on Mac) should
behave the same as 'x': delete the character under the cursor. Due to a bug in
CodeMirror's emulation, this wasn't happening before.

This change adds the proper support, along with tests for forward-delete.

* Remove kludge in line height measuring

Which was introduced in 6ac8c13, for unclear reasons

Issue codemirror#5755

* Fix lint error

* Typo: s/npm build/npm run build/g

* [show-hint addon] Move variable into module scope

* Mark version 5.44.0

* Bump version number post-5.44.0

* [swift mode] Drop all-rights-reserved example code

* [julia mode] Fix failure to advance on mismatched closing brace

Closes codemirror#5797

* [vim bindings] Only scan for <> when matching angle brackets

To avoid treating <> as brackets when they aren't used as such

* Handle scanning for user provided brackets, e.g. "

* [panda-syntax theme] Use monospaced Source Code Pro instead of Source Sans Pro

https://adobe-fonts.github.io/source-sans-pro/ is a proportional font
family by Adobe (the "Source" in the name refers to being open source).
https://adobe-fonts.github.io/source-code-pro/ is a matching monospace
font family.

* [sublime keymap] Bind sortLines to F5 on macOS

* [sql mode] Update keywords and builtin symbols for x-pgsql

Added pgsql keywords which were missing.

* [closebrackets addon] More refined check for when to close a bracket

Improves the current behavior which auto closes every opening bracket.

- hardcodes a closeBefore list of characters that if the next character is in the list, opening a bracket should be auto-closed.
The list is : ")]}'\":;>"
Basically the closing characters in pairs  ; : and >.

- when opening a bracket, it will be auto-closed if:
1. there is no next character,
2. the next character is a white space character.
3. the next character is in the shouldClose list.

* [clike mode] Only match "_t" at the end of an identifier

* [yonce theme] Add

* [sql-hint addon] Add tests and fix codemirror#5817

* [xml-hint addon] Optionally match in middle

For example, "happy" to match "very-happy", "not-so-happy", "happy".

* Mark version 5.45.0

* Bump version number post-5.45.0

* Recursively compute innerMode in continuelist addon

When creating an overlay mode from e.g. `gfm`, which has `markdown` as an
`innerMode`, we need to recursively compute `innerMode` via
`CodeMirror.innerMode` to correctly determine `markdown` descendant mode.

* Cancel mouse selection before swapping document

To avoid the mouse handling code getting confused

* [xml-hint addon] Prevent extraneous quote

If typing attribute=" and by closetag it becomes attribute="" and user
presses Ctrl-Space to autocomplete and the completion is "x" then by
this fix instead of obnoxious attribute="x"" it becomes nice attribute="x".

* [closetag addon] Optionally prefer empty-element tags

When user types <atomic> substitute <atomic/> if so configured.

* [yonce theme] Update colors

* Do not consider key-127 (F16) to be Delete

As per codemirror#5829

* [html-lint addon] Adding compatibilty with HTMLHint 0.11.0

* Allow CSS styles to be passed for gutter backgrounds

Issue codemirror#5834

* [matchesonscrollbar addon] Fix possible discrepancy with search query

The scrollbar annotations may fail to match search query under
certain circumstances. This happens when the search cursor is
`multiline: false`.

The matchesonscrollbar addon does not have a way to indicate
`multiline: false`, the multiline status is heuristically
determined and because of this it may end up being opposite
of the status of the search cursor.

* Correctly use the string 'off' for autocapitalize and autocorrect

Rather than 'false', which is ignored

Issue codemirror#3403

* [swift mode] Properly handle empty strings

* [vb mode] Update vb.net keywords

* Mark version 5.46.0

* Bump version number post-5.46.0

* Add missing header to change log

* Fix a small typo in the CHANGELOG.md

* [real-world uses] Add RackTables

* [hint addon] Offset the hint to position it correctly when hintOptions.container is given

* [python mode] Parse ... as an operator

To avoid treating it like 3 separate dot tokens

Closes codemirror#5861

* [clojure mode] Treat commas as whitespace

Closes codemirror#5582

* [soy mode] Add a config object for tags and a tag context

* Added support for restoring previous local modes by using a stack for the states.

* The indentation was previously added to the first token of the inner mode.

* Add tag config object

* [vim] fix repeat for changes made with C-v I

* [vim] add support for ` text object

* [vim] do not reset desired column at eof

* [vim] cleanup old fatCursorMarks after C-v c Esc

* [vim] fix @@ to rerun last run macro (codemirror#5868)

`vimGlobalState.macroModeState.latestRegister` was only ever updated when defining a macro. This change updates it when running a macro too so that `@@` actually repeats the last macro as it does in vim

* [midnight theme] Fix class name for cm-matchhighlight

Issue codemirror#5866

* [ruby mode] Require dash or tilde at start of heredoc strings

Closes codemirror#5871

* Add EXLskills Live Coding Interviews as real-world use case

* [midnight theme] Drop custom matchhighlight styles

Issue codemirror#5866

* [vim] remove unnecessary uses of replace from vim test

* [vim] fix broken option tests

* [vim] fix fat cursor staying after O

* [vim] fix blockwise yank

* [ruby mode] Fix matching of closing brackets during indentation

Closes codemirror#5881

* [emacs] Add "redo" keybinding in Emacs keymap

Since "redo" is generally assigned to Ctrl+Y, we lose this binding
when using the Emacs keymap. The Emacs default for "redo" is a bit
complicated, but since we're using Ctrl-Z for "undo", it makes sense
to have Ctrl+Shift-Z for "redo".

* Mark version 5.47.0

* Bump version number post-5.47.0

* [mode metadata] Add "cs" as alias for C#

Other places like discord, github and gitlab supports this.

* [merge addon] Fix typo in hasMarker()

This was causing exceptions to be thrown when using custom
markers.

* Add U+FFFC as a default replaced special character

* Also add u+fff9-u+fffb as special characters

Browser don't display anything for them either

Issue codemirror#5900

* [clike mode] Remove 'float' as Java keyword

* [mode metadata[ Add meta entry for PostgreSQ

* Add selectLeft/selectRight marker options

* [groovy mode] Add comment metadata

Closes codemirror#5906

* [real-world uses] Add LiveUML

* [vim] throttle highlightSearchMatches

This should prevent it from falling behind trying to highlight previous queries while you're typing.

* [hint addon] Handle scrolling containers

* [javascript mode] Remove strange handling of 'in' in TypeScript mode

Closes codemirror#5909

* [javascript mode] Fix typescript [key in ...] syntax (again)

Issue codemirror#5737
Issue codemirror#5909

* [real-world uses] Added Coderba GWT wrapper

We implemented a wrapper to CodeMirror for GWT (base on JSINTEROP)

* [real-world uses] Fixed link to GWT wrapper extension

* Mark version 5.48.0

* Bump version number post-5.48.0

* [javascript mode] Fix computed property TS syntax for object types

Issue codemirror#5909

* [javascript mode] Support numeric separators

Note that the new regular expression is more permissive than
the spec proposal, e.g. 0_._1 or 1__2 are not valid numbers.

However, filtering out these cases would make the tokenizer
unnecessarily complex.

* [vim mode] match vim char escape substitution behavior

* [vim mode] codemirror#5753 Feature request: Support &/$0 in vim substitute replacements

* [search addon] Escape sequence only for \n, \r, \t and \\

When `\` is followed by any other character, it will not be
interpreted as an escape sequence, i.e. `\3` will be
interpreted as literal `\3`, not as `3`.

Fixes codemirror#5428

* [sparql mode] Non-ASCII variable names

This regex is ES3-compliant but it misses non-BMP characters specified in SPARQL standard.

Closes codemirror#5935

* [javascript mode] Handle string defaults in arrow function param lists

Closes codemirror#5934

* [javascript mode] Fix use of let

* [javascript mode] don't detect backtick-enclosed fatarrows

cf. codemirror#2993 and 27fe44c which fixed the analogous issue for single-quotes, double-quotes and regex literals.

* [javascript mode] fix tokenizing of underscore properties

The regexp for parsing numbers with numeric separators is too
broad. This way, we mistake properties starting with underscore
to be numbers.

* Mark version 5.48.2

* Bump version number post-5.48.2

* [clike mode] Style Dart class names as variable-2

* [real-world uses] remove unmaintained codev.it

The domain http://codev.it is Inaccessible,  the [latest twitter](https://twitter.com/codevit) was post on Sep 2015.
It's better to remove it.

* [soy mode] Add {select} and {plural}

* fix scrolling with rulers

* [foldgutter addon] Pass all options to the `foldCode` method

... to enable redefinition of the `widget` prop (codemirror#5955)

* [julia mode] Support undescore digit separator

Closes codemirror#5958

* [handlebars mode] add support for triple mustache tags

* [asterisk mode] Add block-comment support

* [asterisk mode] Add comment syntax metadata

* [asterisk mode] Fix bogus patch

* Make ".CodeMirror pre" selector more specific

* Fix bug in coordsChar when there's a collapsed range at start of line

Issue codemirror#5966

* significant speed optimisation when large amount of lines are folded

* Make sure the cantEdit flag is reset when setValue is called

Closes codemirror#5974

* Update PR to use .CodeMirror-line-like class

* Properly detect changes that should reset cantEdit flag

Issue codemirror#5974

* Fix forgotten import

* [yonce theme] Don't use rgb with four arguments

Closes codemirror#5951

* Mark version 5.48.4

* [soy mode] Fix setting kind on invalid tags

* [clike] support nested comments in kotlin mode

* [material theme] Update to the official version, add darker, palenight, ocean variants

* [moxer theme] Add

* Prevent removing textarea.form.submit handler with opts.leaveSubmitMethodAlone

* [octave mode] Don't mark period chars as invalid

Closes codemirror#5987

* [javascript mode] Add support for HTML-style comments

Closes codemirror#5988

* [clike] fix kotlin indent for first line in lambda with params

* [foldgutter and annotatescrollbar addon] Schedule update on changes instead of change

The setTimeout/clearTimeout overhead of re-scheduling on every change in a large operation can be significant. This cuts the time of a particularly large operation I was testing from 5s to 2.5s (replacing some text in ~5000 lines). The majority of the rest of the time coming from rescheduling of the highlight worker inside the startWorker call.

* [mode/meta] Add wl and wls file extensions

* [xml mode] Add an indirection to XML mode state inspection

Issue codemirror/google-modes#266

* Mark version 5.49.0

* Bump version number post-5.49.0

* [real world] add Tistory

Tistory is blog service in South Korea.
Tistory uses CodeMirror at post markdown/html editor and skin editor.

* [markdown demo] Include javascript mode

Closes codemirror#6011

* [markdown mode] Don't reset inline styles at start of continued list item

Closes codemirror#6012

* [foldgutter] reuse old markers if indicatorOpen/Folded is string

* [darcula theme] Improve contrast of search/matching highlighting

* Add alt attribute to codemirror logo images

* [pug mode] Remove superfluous function arguments

* [yaml-frontmatter mode] Allow pandoc-style closing with `...`

This allows to end yaml-frontmatters with either `---` or `...`, as
suggested [on the discussion board][1]. The old behaviour was to just
accept `---`.

[1]: https://discuss.codemirror.net/t/pandoc-markdown-style-yaml-frontmatter/2182

* [sublime bindings] Fix selectNextOccurrence to do nothing when all instances are selected

Closes codemirror#6024

* [continuecomment] skip some edge cases, respect indentWithTabs

* line comment:
  - if both cursor and line comment are at pos 0
  - if cursor is at EOL or in trailing space at EOL, but always continue if the next line is a line comment
* block comment:
  - if it's inside a line comment e.g. // /*

* Reduce setTimeout/clearTimeout calls from Delayed

This reduces the time the operation I mentioned in codemirror#5992 takes to ~450ms.

* Switch to +new Date

* Reduce chance of needlessly rescheduled Delayed calls

Issue codemirror#5993

* [clike mode] Add text/x-objectivec++ type (codemirror#6027)

Pull out some of the ObjC and C++ info into vars so they can easily be reused and add a text/x-obejctivec++ type that's effectively the union of the C++ and ObjC definitions.

* [mode/meta] Add Objective-C++

* [dart mode] Add "extension" and "on" keywords

This is for Dart 2.6 extension method syntax

* Mention null mode in docs for mode option

Closes codemirror#6034

* Mark version 5.49.2

* Bump version number post-5.49.2

* [closetag addon] Fix behavior when typing > after /

Closes codemirror#6038

* [sublime keymap] Pass local token type to scanForBracket when appropriate

Closes codemirror#6042

* [handlebars mode] Fix support for triple braces

Closes codemirror#6052

* Upgrade some dev dependencies

* Codemirror: Replaced PhantomJS Dependency with Puppeteer

Signed-off-by: ossdev <ossdev@puresoftware.com>

* Make puppeteer-based test runner work

Issue codemirror#6051

* [searchcursor addon] Properly match $ in reverse regexp search

Closes codemirror#6056

* [searchcursor addon] Fix behavior in overlapping reverse regexp searches

* [mode meta] Make findModeByExtension case insensitive

* [css mode] Add more pseudo-class names

Added new CSS Pseudo Selector from https://www.w3schools.com/cssref/css_selectors.asp

* [panel addon] Support dynamic size changes

Closes issue codemirror#5995

* [ayu-dark and ayu-mirage themes] Add

* Wire up shift-delete to fire a cut event on Gecko

Issue codemirror#6061

* [julia mode] Fix getting stuck on integers with leading zeroes

Closes codemirror#6064

* [continuecomment addon] Continue comments when a newline is inserted before them

Fix issue where lastIndexOff was accidentally passed a negative
start position, which causes it to search from the end of the string.

Closes codemirror#6065

* Adjust posFromMouse to handle arbitrary xRel field values

Closes codemirror#6067

* [vim bindings] Skip folded code when moving with j/k

* [elm mode] Sync with upstream implementation

Modifies this module to reflect changes made to this mode found in https://github.com/elm/elm-lang.org/blob/master/editor/cm/mode/elm.js

* [cypher mode] Added keywords for system commands

Includes multi database and privilege management commands

* Support functions as fold widget argument

So that the widgets can be dynamic with regards to their content.

Expand the fold demo with a JSON editor that shows the number of
elements in folded regions.

* [sql mode] Support  backslash and escape constants in pgsql

Add support for escape constant as mentioned here:
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE

* [sql mode] Simplify patch 3e6aafd

Issue codemirror#6081

* Add a className option to addLineWidget

Issue codemirror#5952

* [javascript-hint addon] Properly iterate over local scopes

See https://discuss.codemirror.net/t/function-parameter-autocomplete/2240/1

* [sublime bindings] Make by-sub-word motion more conformant to Sublime

Closes codemirror#6091

* [sublime bindings] Fix sub-word motion at start of word

* Mark version 5.50.0

* [sublime bindings] Add shortcut Ctrl-K Ctrl-D: find_under_expand_skip

* [soy mode] Add support for default param value

* Fix indentation after a {literal{/literal} block.

* Fix: Broken line widget removal

Removal of line widgets is broken in 5.50.0 due to invalid classname check

* [nsis mode] Add commands up to NSIS v3.05

* Restore indentation when closing an array or generator.

* Mark version 5.50.2

* If valid and invalid files are drag n dropped, paste all valid files

* [rust mode] Fixed type names in demo code

* Fix broken link in manual

The external link to the ternjs.net demo page returns a 404 error; this PR corrects it.

* [elm mode] Remove tab character

* [show-hint addon] Scroll initially selected hint into view

See https://discuss.codemirror.net/t/show-selectedhint-in-very-long-list-of-hints/2255

* [real-world uses] Add Adnuntius

* Make sure clearHistory clears all linked histories

Closes codemirror#6108

* [vim] fix R key in visual mode

* [vim] fix behavior of ' and ` marks

* [vim] implement gi gI gJ

* Make sure contextmenu event is also forwarded when fired on the input field

Since Firefox, as of patch a21ea6f, seems to fire it on the
textarea.

Closes codemirror#6116

* When direction=rtl, fix home/end and arrow motion across line boundaries

Closes codemirror#6117

* Mark version 5.51.0

* Update CHANGELOG.md

* Fix confused markup in releases.html

* [javascript mode] Don't get confused by trailing commas in parentheses

Closes codemirror#6120

Co-authored-by: István Király <LaKing@D250.hu>
Co-authored-by: Joel Einbinder <joel.einbinder@gmail.com>
Co-authored-by: yoongu <yoongu.kim@gmail.com>
Co-authored-by: Marijn Haverbeke <marijnh@gmail.com>
Co-authored-by: Neil Anderson <neil.t.anderson+sqlmigrate@gmail.com>
Co-authored-by: Christopher Wallis <christopher.j.wallis@gmail.com>
Co-authored-by: Germain Chazot <g.chazot@gmail.com>
Co-authored-by: fraxx001 <alexander.fratzer@gmail.com>
Co-authored-by: FUJI Goro <gfuji@cpan.org>
Co-authored-by: Joe Walsh <joewalsh@users.noreply.github.com>
Co-authored-by: Michael Wadman <8885966+mwadman@users.noreply.github.com>
Co-authored-by: Chhekur <820121223505e@gmail.com>
Co-authored-by: Nicolas Chevobbe <nchevobbe@users.noreply.github.com>
Co-authored-by: Tom McLaughlin <pyro777@gmail.com>
Co-authored-by: Pablo Zubieta <8410335+pabloferz@users.noreply.github.com>
Co-authored-by: Joy Zhong <joyzhong@google.com>
Co-authored-by: Stryder Crown <stryder.c@gmail.com>
Co-authored-by: Kenan Christian Dimas <christian.dimas.94@gmail.com>
Co-authored-by: Robert Martin <rdmartin3@gmail.com>
Co-authored-by: Jan Keromnes <jan.keromnes@typefox.io>
Co-authored-by: Travis Heppe <heppe@google.com>
Co-authored-by: Torgeir Thoresen <torgeir.thoresen@gmail.com>
Co-authored-by: Beni Cherniavsky-Paskin <cben@redhat.com>
Co-authored-by: Kees de Kooter <kees@boplicity.nl>
Co-authored-by: Aditya Toshniwal <aditya.toshniwal14@gmail.com>
Co-authored-by: Hanzhao Deng <hanzhaodeng@gmail.com>
Co-authored-by: Vincent Woo <me@vincentwoo.com>
Co-authored-by: Thomas MacLean <thomasmaclean@google.com>
Co-authored-by: William Desportes <williamdes@wdes.fr>
Co-authored-by: Leo Baschy <srguiwiz@users.noreply.github.com>
Co-authored-by: Erik Demaine <edemaine@mit.edu>
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Co-authored-by: Vadim ‮oknehcayD <yellowafterlife@ymail.com>
Co-authored-by: Luciano Santana <contato@lucianosantana.net>
Co-authored-by: Raymond Hill <gorhill@users.noreply.github.com>
Co-authored-by: Scott Feeney <scott@oceanbase.org>
Co-authored-by: clso <694743+clso@users.noreply.github.com>
Co-authored-by: Max Wu <jackymaxj@gmail.com>
Co-authored-by: Denis Ovsienko <denis@ovsienko.info>
Co-authored-by: Benjamin Amelot <bam@activeviam.com>
Co-authored-by: Axel Lewenhaupt <axel@x2d.org>
Co-authored-by: Harutyun Amirjanyan <amirjanyan@gmail.com>
Co-authored-by: Evan Minsk <evanminsk@google.com>
Co-authored-by: Sasha Varlamov <sasha@sashavarlamov.com>
Co-authored-by: Diego Fernández Giraldo <aiguo.fernandez@gmail.com>
Co-authored-by: Bruno Logerfo <bclogerfo@hotmail.com>
Co-authored-by: mtaran-google <mtaran@google.com>
Co-authored-by: Duncan Lilley <dklilley95@gmail.com>
Co-authored-by: Konrad Cwiakala <konrad.cwiakala@gmail.com>
Co-authored-by: Erik Welander <erik@welander.us>
Co-authored-by: stockiNail <stocki.nail@gmail.com>
Co-authored-by: Yang Guo <yangguo@chromium.org>
Co-authored-by: Ilya Kharlamov <502372+ilyakharlamov@users.noreply.github.com>
Co-authored-by: Sébastien Beyou <seb35@seb35.fr>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Co-authored-by: John Ryan <ryjohn@google.com>
Co-authored-by: Guang Li <1152164+g5li@users.noreply.github.com>
Co-authored-by: Jakub Vrána <jakub@vrana.cz>
Co-authored-by: Tyler Makaro <t-makaro@users.noreply.github.com>
Co-authored-by: edoroshenko <doroshenkoes@gmail.com>
Co-authored-by: Nils Knappmeier <npm@knappi.org>
Co-authored-by: Lonnie Abelbeck <lonnie@abelbeck.com>
Co-authored-by: Alexander Prendota <Prendota@mail.ru>
Co-authored-by: Mattia Astorino <astorino.mattia@gmail.com>
Co-authored-by: Mark Hamstra <hamstra.mark@gmail.com>
Co-authored-by: kb.chernenko <kb.chernenko@gmail.com>
Co-authored-by: Arnoud Buzing <arnoudbuzing@users.noreply.github.com>
Co-authored-by: Joo <joo@joostory.net>
Co-authored-by: tophf <tophf@gmx.com>
Co-authored-by: Oleksandr Yakovenko <alex.jakovenko@gmail.com>
Co-authored-by: oscar.lofwenhamn <44643697+oscarlofwenhamn@users.noreply.github.com>
Co-authored-by: seifferth <43514227+seifferth@users.noreply.github.com>
Co-authored-by: Ryan Pangrle <RPangrle@users.noreply.github.com>
Co-authored-by: ossdev07 <39188636+ossdev07@users.noreply.github.com>
Co-authored-by: johannes <jh@maschinensehen.de>
Co-authored-by: Hasan Delibaş <hasan.delibas94@gmail.com>
Co-authored-by: Nikolaj Kappler <Nikolaj-Kappler@web.de>
Co-authored-by: Igor Petruk <ipetruk@google.com>
Co-authored-by: leaf <node_github@163.com>
Co-authored-by: T. Brandon Ashley <tbash@users.noreply.github.com>
Co-authored-by: Olivia Ytterbrink <olivia@ytterbrink.com>
Co-authored-by: Opender Singh <opender94@gmail.com>
Co-authored-by: Hanno Fellmann <fellmann@users.noreply.github.com>
Co-authored-by: Jan T. Sott <jan@idleberg.com>
Co-authored-by: elpnt <39664774+elpnt@users.noreply.github.com>
Co-authored-by: James Cockshull <james.cockshull@gmail.com>
Co-authored-by: antosarho <tsarhanis@gmail.com>
Co-authored-by: David Rodrigues <david.proweb@gmail.com>
@bushev
Copy link

bushev commented Apr 21, 2021

Hey guys, how to apply this fix to version 6?

@marijnh
Copy link
Member

marijnh commented Apr 22, 2021

An extension like EditorView.contentAttributes.of({autocapitalize: "off", autocorrect: "off"}) should work I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests