Bug 24497 - CodeMirror indentation problems
Summary: CodeMirror indentation problems
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-23 15:29 UTC by Lucas Gass
Modified: 2020-06-03 15:31 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03, 19.05.08, 18.11.14


Attachments
Bug 24497: Turn off smartIndent for SQL (1.13 KB, patch)
2020-01-24 18:19 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 24497: Turn off smartIndent for SQL (1.19 KB, patch)
2020-01-24 21:10 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24497: Turn off smartIndent for SQL (1.25 KB, patch)
2020-01-25 17:50 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2020-01-23 15:29:56 UTC
Some librarians would like the ability to turn CodeMirror off in the sys prefs like OPACUserJS, IntranetUserCSS, etc.

An option to disable it via syspref would be nice.
Comment 1 Owen Leonard 2020-01-23 15:44:46 UTC
I would like to know more about why they want to disable it. Wanting to turn it off may mean it's not working well in a way that we can address.
Comment 2 Katrin Fischer 2020-01-23 22:53:36 UTC
Was going to ask the same - since it doesn't affect your input like the wysiwyg editor does, but only adds some formatting.
Comment 3 Nick Clemens 2020-01-24 16:09:30 UTC
We had a report of indentation woes, it seems CodeMirror doesn't like mismatched combined parentheses. I.e.

Enter below and go to new line:
SELECT CONCAT( CONCAT('a','b') )

No indent

Enter below and go to new line:
SELECT CONCAT( CONCAT('a','b'))
                        
                  Extreme indent
Comment 4 Lucas Gass 2020-01-24 18:19:54 UTC
Created attachment 97893 [details] [review]
Bug 24497: Turn off smartIndent for SQL

This only seems to effect SQL CodeMirror inputs and I belive it to be the smartIndent feature. This patch turns that off for SQL only.
TEST PLAN:
1. Enter 'SELECT CONCAT( CONCAT('a','b'))' into a SQL Report and press Enter
2. Extreme indent
3. Apply patch.
4. Enter 'SELECT CONCAT( CONCAT('a','b'))' into a SQL Report and press Enter
5. No indent.
6. Check that other indenting still works proper.
Comment 5 ByWater Sandboxes 2020-01-24 21:10:21 UTC
Created attachment 97929 [details] [review]
Bug 24497: Turn off smartIndent for SQL

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 6 Christopher Brannon 2020-01-24 21:11:18 UTC
Yes!  You are a life saver!  Works much better!
Comment 7 Katrin Fischer 2020-01-25 17:50:17 UTC
Created attachment 97941 [details] [review]
Bug 24497: Turn off smartIndent for SQL

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Martin Renvoize 2020-01-27 10:17:27 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 9 Joy Nelson 2020-02-10 22:32:26 UTC
Pushed to 19.11.x for 19.11.03
Comment 10 Lucas Gass 2020-02-14 18:16:31 UTC
backported to 19.05.x for 19.05.08
Comment 11 Hayley Mapley 2020-02-17 03:46:48 UTC
Backported to 18.11.x for 18.11.14.