From 4661d1dec484fecd93348bb6987f0d303e89fdf1 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 2 Aug 2017 13:19:38 +0400 Subject: [PATCH] enable preserve-inline option for jsbeautify --- plugins/c9.ide.ace.statusbar/statusbar.js | 2 +- plugins/c9.ide.format/formatters/jsbeautify.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/c9.ide.ace.statusbar/statusbar.js b/plugins/c9.ide.ace.statusbar/statusbar.js index 4bb9ee73..51400fda 100644 --- a/plugins/c9.ide.ace.statusbar/statusbar.js +++ b/plugins/c9.ide.ace.statusbar/statusbar.js @@ -417,7 +417,7 @@ define(function(require, exports, module) { var cursor = ace.selection.lead; var columnText = (cursor.row + 1) + ":" + (cursor.column + 1); if (ace.selection.rangeCount) - columnText += " [" + ace.selection.rangeCount + "\u202f]"; + columnText += " [\u202f" + ace.selection.rangeCount + "\u202f]"; setCaption(lblRowCol, columnText); } diff --git a/plugins/c9.ide.format/formatters/jsbeautify.js b/plugins/c9.ide.format/formatters/jsbeautify.js index 58b4c5b3..2f02302b 100644 --- a/plugins/c9.ide.format/formatters/jsbeautify.js +++ b/plugins/c9.ide.format/formatters/jsbeautify.js @@ -44,6 +44,7 @@ define(function(require, exports, module) { ["keeparrayindentation", "false"], ["jslinthappy", "false"], ["braces", "end-expand"], + ["preserve-inline", true], ["space_before_conditional", "true"], ["unescape_strings", "true"], ["indent_inner_html", false], @@ -109,6 +110,11 @@ define(function(require, exports, module) { { value: "end-expand", caption: "End braces on own line" } ] }, + "Preserve Inline Blocks": { + type: "checkbox", + path: "project/format/jsbeautify/@preserve-inline", + position: 353.5, + }, "Space Before Conditionals": { type: "checkbox", path: "project/format/jsbeautify/@space_before_conditional", @@ -240,9 +246,11 @@ define(function(require, exports, module) { if (!options.hasOwnProperty("jslint_happy")) options.jslint_happy = settings.getBool("project/format/jsbeautify/@jslinthappy"); - if (!options.hasOwnProperty("brace_style")) + if (!options.hasOwnProperty("brace_style")) { options.brace_style = - settings.get("project/format/jsbeautify/@braces"); + settings.get("project/format/jsbeautify/@braces") + + (settings.get("project/format/jsbeautify/@preserve-inline") ? ",preserve-inline" : ""); + } if (!options.hasOwnProperty("indent_inner_html")) options.indent_inner_html = settings.get("project/format/jsbeautify/@indent_inner_html");