After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785425 - Smart-indent is not working properly for JavaScript
Smart-indent is not working properly for JavaScript
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-26 04:08 UTC by Giovanni Campagna
Modified: 2017-07-26 04:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sourceview: remove chain-up of indentation to GtkSourceView (1.78 KB, patch)
2017-07-26 04:56 UTC, Christian Hergert
committed Details | Review

Description Giovanni Campagna 2017-07-26 04:08:44 UTC
As of a few days ago, auto-indent/smart-indent is double identing all new lines in JavaScript.
To be precise, when the right indentation would be X tabs (or tab stops), the indenter puts the cursor on 2*X tabs.

I can reproduce this with space ident, 4 char tabs (which is the recommended config for JS). The new identation is properly composed of spaces, just double the right number.

This is occurring in the latest Flatpak (build cb943a1bb1c3, source GNOME_BUILDER_3_25_5-62-g2d0274b).
Comment 1 Christian Hergert 2017-07-26 04:56:14 UTC
Created attachment 356394 [details] [review]
sourceview: remove chain-up of indentation to GtkSourceView

Now that we mimic GtkSourceView, we do not need to setup the base class
to do it's own indentation.
Comment 2 Christian Hergert 2017-07-26 04:57:36 UTC
Yup, looks like when we started mimicing GtkSourceView indentation to fix some
other bugs, we forgot to disable GtkSourceView's indentation under certain
scenarios.

Fixed in commit 356394.

Attachment 356394 [details] pushed as b087c87 - sourceview: remove chain-up of indentation to GtkSourceView
Comment 3 Christian Hergert 2017-07-26 04:58:29 UTC
Oops, that was the attachment id not the commit id, but you get the idea.