Author Topic: Strange JavaScript indenting  (Read 2331 times)

jmccaskill

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Strange JavaScript indenting
« on: July 21, 2016, 06:15:13 PM »
Hello

I recently upgraded from SlickEdit 18.0.1 to SlickEdit 20.0.3.  I am on Windows 7 64 bit.  I have noticed some strangeness with JavaScript indenting.  I started with a brand new config to make sure this wasn't due to any config changes I might have made.

Code: [Select]
var strange_indent = {
    function1: function() {
        // the indent is here as expected.
    },
    function2: function() {
         // the indent is slightly off.
    },
    property: 'some value, does not seem to matter what it is',
    function3: function() {
                  // the indent is quite a bit off.
    },
    function4: function() {
         // the indent back to being slightly off.
    },
    longer_property_name: 'the length of the property name seems to make a difference',
    function5: function() {
                              // because the indent is even further off.
    },
    now_an_even_longer_property_name: 'the longer the preceding property name...',
    function6: function() {
                                          // ...the further off the indent is.
    }
};

If I then execute Tools > Beautify > Beautify (Default), everything is indented as expected.

This isn't a big deal for me right now.  If I manually move to the correct indent location and type a ';', everything after it seems to indent correctly.  I was just hoping maybe someone else had seen this before and knew of a way to fix it.

Thanks,
Joseph

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Strange JavaScript indenting
« Reply #1 on: July 21, 2016, 06:29:52 PM »
I can reproduce that.  That's pretty strange, I'll take a look at it and see what I can figure out.  Seems hot-fixable.