Avatar for neshanjo

neshanjo

Member since May 2021 • Last active May 2022
  • 2 conversations
  • 13 comments

Most recent activity

  • in Bangle.js
    Avatar for neshanjo

    FYI: I noticed two (unrelated) things:

    1. Bangle 2 is only listing the cutting edge.
    2. Bangle 1 list also includes the Bangle 2 cutting edge.
  • in Bangle.js
    Avatar for neshanjo

    Firmware: https://www.espruino.com/Download

    Update instructions: https://www.espruino.com/Bangle.js2#firm­ware-updates

    Now that the linked video is still from Bangle 1, but the description is correct.

  • in Bangle.js
    Avatar for neshanjo

    I have to press the button to activate the backlight. Is this the intended behaviour?

    No - actually it was already fixed in a firmware update :) If you update to a 'cutting edge' build, or 2v11 when it's released, the backlight will turn on for watch twists as well.

    I updated to the cutting edge, and not it works! Thanks!

  • in Bangle.js
    Avatar for neshanjo

    My Bangle 2 has arrived, yeah! Thanks so much, Gordon, for all the effort you put into this great project!

    I have a question regarding the LCD backlight: No matter which wake up method I choose (Face up, Touch or Twist), when I execute this action, the display does not light up. I have to press the button to activate the backlight. Is this the intended behaviour? Note that the little lock disappears, so I guess, the action is detected correctly.

    I'd highly appreciate an option for also enabling the backlight during wake up, since there are lots of situations where the passive lighting isn't enough to read the display.

    Kind regards,
    Johannes

  • in Bangle.js
    Avatar for neshanjo

    I also find it annoying, particularly, when you start an app that also displays "loading..." behind it (as, e.g., the Anton Clock, or almost any other app that is installed per default on the device).
    I'd appreciate if it was configurable in the settings. It was probably introduced to give the user feedback that something is about to happen, but the only long delay I have noticed, is after pressing the button to enter the menu (Bangle 2). Here, a short vibration as feedback would be sufficient.

  • in General
    Avatar for neshanjo

    @JumJum code.replace(selected, ... is dangerous since it may also override other places that, by accident, contain the same code as the selection. There are better ways by using start and end of the selection and replacing only this part - but, again, let us leave this to another PR (that we'd be happy to receive from you!).

    Edit: Have a look at https://codemirror.net/doc/manual.html#a­pi and try using Espruino.Core.EditorJavaScript.getCodeMi­rror().replaceSelection(...). This should do the trick.

  • in General
    Avatar for neshanjo

    https://prettier.io/docs/en/ignore.html#­javascript

    You can ignore certain lines/parts of the code with this special comment.

    Implemeting "format only the selected code" is possible by using the Editor properties. This could be the next feature in another PR.

  • in General
    Avatar for neshanjo
      function formatCode() {
        var code = Espruino.Core.EditorJavaScript.getCode()­;
        var cursor = Espruino.Core.EditorJavaScript.getCodeMi­rror().getCursor();
        code = prettier.format(code, {
          parser: "babel",
          plugins: prettierPlugins,
          tabWidth: parseInt(Espruino.Config.TAB_SIZE),
          useTabs: Espruino.Config.INDENTATION_TYPE == "tabs",
          semi: true,
          singleQuote: true
        });
        Espruino.Core.EditorJavaScript.setCode(c­ode);
        Espruino.Core.EditorJavaScript.getCodeMi­rror().setCursor(cursor);
      }
    

    get/setCursor principally seems to do the trick, however, it changes the scrolling position. The line with the cursor becomes the last line in the editor window. You can try this by e.g. using large app code like https://github.com/espruino/BangleApps/b­lob/master/apps/trex/trex.js
    Any ideas how to fix this?

  • in General
    Avatar for neshanjo

    @JumJum Sorry for the delay and thanks very much for your code. This is exactly the kind of starting point I needed.

    Prettier doesn't need an internet connection, either. Here is what I did based on your initial example using prettier: https://github.com/neshanjo/EspruinoWebI­DE/tree/code-formatting-prettier
    Anybody here interested in this, can just checkout my fork and run npm install followed by npm start.

    My code also respects the indentation settings (tab width and tabs versus spaces).

    Indeed, there is still some work to do:

    1. Save the current cursor position
    2. Hide the icon in Blockly mode
    3. Add a keyboard shortcut
    4. Maybe another icon.

    I don't think, we need a settings page, though. I even think we should not have one in order to follow one code style. That's the idea behind prettier.

    I also made another branch using js-beautify: https://github.com/neshanjo/EspruinoWebI­DE/tree/code-formatting-js-beautify

    IMO, the main (only?) advantage of js-beautify over prettier is the smaller size. Prettier is more or less THE standard in modern JS development and available in many code editors and even from the command line. This is a nice feature, especially for BangleJS where every app uses its own code formatting style. Furthermore, it is actively developed by a large team, while js-beautify claims on their Github page that they are in need of more contributors.

    Just my 2ct. I'd be very happy to have any kind of code formatting soon.

    My next steps are to work on point 1 (see list above) and submit a MR. 2+3 should be done very easily by someone more familiar with the project.

Actions