Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Cursor x position is miscalculated in certain situations #1036

Closed

Description

@nathansobo

@benogle: Is something going wrong with the caching for editors that can be created in a hidden/detached state?

screen shot 2013-10-25 at 11 43 43 am

Activity

  1. benogle commented on Oct 25, 2013

    @benogle
    Contributor

    They all use the same cache. It may have been effed by some other editor.

    • What were you trying to type? Just the 'a'?
    • Can you get the width of it for me + width of others from that scope in the cache. It's going to be in here: require('atom').Editor.characterWidthCache
  2. benogle commented on Oct 25, 2013

    @benogle
    Contributor

    If the issue were about caching in a hidden/detatched state, the widths would be 0.

  3. probablycorey commented on Oct 29, 2013

    @probablycorey

    @nathansobo what font were you using in this bug?

  4. nathansobo commented on Nov 1, 2013

    @nathansobo
    ContributorAuthor

    Whatever the standard one is.

  5. nathansobo commented on Nov 1, 2013

    @nathansobo
    ContributorAuthor

    It's happening again... looks like "s" and "v" for plain text grammars have a width of 14 where everything else has 9.

    screen shot 2013-11-01 at 12 37 08 pm

    screen shot 2013-11-01 at 12 35 46 pm

  6. probablycorey commented on Nov 14, 2013

    @probablycorey

    This just happened to me for the first time

    The values for null-grammar.text.plain are all sorts of weird.

    Results from copy(JSON.stringify(require('atom').Editor.characterWidthCache, null, 2))

    {
      "source.coffee": {
        "·": 12,
        "e": 12,
        "x": 12,
        "p": 12,
        "c": 12,
        "t": 12,
        "meta.brace.round.coffee": {
          "(": 12,
          ")": 12
        },
        "m": 12,
        "a": 12,
        "i": 12,
        "n": 12,
        "g": 12,
        "s": 12,
        "meta.delimiter.method.period.coffee": {
          ".": 12
        },
        "o": 12,
        "H": 12,
        "¬": 12,
        "v": 12,
        "B": 12,
        "C": 12,
        "l": 12,
        "d": 12,
        "L": 12,
        "h": 12,
        " ": 12,
        "constant.numeric.coffee": {
          "0": 12,
          "1": 12,
          "2": 12,
          "3": 12
        },
        "b": 12,
        "meta.brace.square.coffee": {
          "[": 12,
          "]": 12
        },
        "string.quoted.single.coffee": {
          "punctuation.definition.string.begin.coffee": {
            "'": 12
          },
          "g": 12,
          "punctuation.definition.string.end.coffee": {
            "'": 12
          }
        },
        "E": 12,
        "q": 12,
        "u": 12,
        "string.quoted.double.coffee": {
          "punctuation.definition.string.begin.coffee": {
            "\"": 12
          },
          "c": 12,
          "o": 12,
          "m": 12,
          "a": 12,
          "n": 12,
          "d": 12,
          "-": 12,
          "g": 12,
          "r": 12,
          "h": 12,
          "i": 12,
          "l": 12,
          "e": 12,
          "punctuation.definition.string.end.coffee": {
            "\"": 12
          }
        },
        "variable.assignment.coffee": {
          "variable.assignment.coffee": {
            "m": 12,
            "a": 12,
            "p": 12,
            "i": 12,
            "n": 12,
            "g": 12,
            "s": 12,
            " ": 12,
            "keyword.operator.coffee": {
              "=": 12
            }
          }
        },
        "variable.other.readwrite.instance.coffee": {
          "@": 12,
          "m": 12,
          "a": 12,
          "p": 12,
          "i": 12,
          "n": 12,
          "g": 12,
          "s": 12,
          "M": 12,
          "t": 12,
          "c": 12,
          "h": 12,
          "E": 12,
          "l": 12,
          "e": 12
        },
        "meta.delimiter.object.comma.coffee": {
          ",": 12,
          " ": 12
        },
        "meta.function.coffee": {
          "entity.name.function.coffee": {
            "b": 12,
            "i": 12,
            "n": 12,
            "d": 12,
            "g": 12,
            "s": 12,
            "F": 12,
            "o": 12,
            "r": 12,
            "E": 12,
            "l": 12,
            "e": 12,
            "m": 12,
            "entity.name.function.coffee": {
              "t": 12
            }
          }
        },
        "keyword.operator.coffee": {
          ":": 12
        },
        "meta.inline.function.coffee": {
          "variable.parameter.function.coffee": {
            "(": 12,
            "e": 12,
            "l": 12,
            "m": 12,
            "n": 12,
            "t": 12,
            ")": 12
          },
          " ": 12,
          "storage.type.function.coffee": {
            "-": 12,
            ">": 12
          }
        }
      },
      "null-grammar.text.plain": {
        "a": 17,
        "b": 12,
        "i": 12,
        "n": 12,
        "d": 12,
        "g": 12,
        "s": 12,
        "F": 12,
        "o": 12,
        "r": 12,
        "v": 12,
        "e": 12,
        "l": 12,
        "m": 12,
        "p": 7,
        "f": 2,
        "k": 12,
        "j": 12,
        ";": 7,
        "·": 22,
        " ": 22
      }
    }
    
    
  7. probablycorey commented on May 1, 2014

    @probablycorey

    Just ran into this again running on 3d2dedb

    services js - _users_corey_code_mine_issues

    The cursor position is only screwed up when it is on a line with bold text.

  8. nathansobo commented on May 2, 2014

    @nathansobo
    ContributorAuthor

    Should be fixed in the new React editor. Were you using the old one?

  9. probablycorey commented on May 2, 2014

    @probablycorey

    I have React off on my laptop. I'll try turning it on to see if I can reproduce it.

  10. nathansobo commented on May 2, 2014

    @nathansobo
    ContributorAuthor

    Good, you're confirming my assumption. I doubt you'll be able to reproduce it in React if my mental model is correct.

  11. nathansobo commented on May 2, 2014

    @nathansobo
    ContributorAuthor

    You probably haven't used the light theme in a while, I'm guessing.

  12. probablycorey commented on May 2, 2014

    @probablycorey

    Being outside forced me to the light side.

  13. nathansobo commented on Jul 25, 2014

    @nathansobo
    ContributorAuthor

    @izuzak This should be fixed when we default to React for the mini editors. Still ironing out some issues there.

  14. kevinsawicki commented on Oct 31, 2014

    @kevinsawicki
    Contributor

    Closing this out, React is now being used in the mini editors.

  15. lock commented on Jan 25, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  16. locked as resolved and limited conversation to collaborators on Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions