Last modified: 2013-09-24 23:14:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56141, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54141 - CodeEditor: change to using tabs breaks existing Lua module indentation
CodeEditor: change to using tabs breaks existing Lua module indentation
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
CodeEditor (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Alex Monk
:
Depends on: 39616
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-15 06:27 UTC by Mr. Stradivarius
Modified: 2013-09-24 23:14 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mr. Stradivarius 2013-09-15 06:27:42 UTC
As a result of bug 39616, CodeEditor has switched from indenting using four spaces to indenting using tabs. This is a problem when editing existing Lua modules, because with the default settings it creates an unholy mixture of tabs and spaces. See for example this change:

Permanent link: https://en.wikipedia.org/w/index.php?title=Module:User:Mr._Stradivarius/whitespacebug&oldid=572981484
Diff: https://en.wikipedia.org/w/index.php?title=Module%3AUser%3AMr._Stradivarius%2Fwhitespacebug&action=view&diff=572981484

Note the indentation level of the tab before "local ret = ''", and the mix of tabs and spaces before "ret = ret .. '*' .. v .. '\n'".

This change is extra-nasty because when typing in text, CodeEditor behaves exactly as it previously did, except now it is inserting tabs instead of groups of four spaces. In addition, when deleting existing groups of four spaces, editors are now required to hit backspace four times rather than just once.

Probably the answer is to set pages in the module namespace to use four spaces, and other pages to use tabs. Going through and changing all the existing module code to use tabs for indentation would require some skillful bot work and a big hit to the job queue.
Comment 1 Alex Monk 2013-09-23 16:10:20 UTC
(In reply to comment #0)
> As a result of bug 39616, CodeEditor has switched from indenting using four
> spaces to indenting using tabs. This is a problem when editing existing Lua
> modules, because with the default settings it creates an unholy mixture of
> tabs and spaces.

Only if you're already using four spaces. If you were using real tabs already then the patch for that bug should end the issue (new lines being automatically indented with four spaces when you're supposed to be using real tabs) for you. Resolved invalid.
Comment 2 Mr. Stradivarius 2013-09-24 23:14:21 UTC
Should we switch all the existing modules to using tabs then? I know that it will work for writing new modules, but the point is that we have 6-months-worth of module code that is indented using four spaces, and people are going to make incremental changes to those modules. This means that from now we'll be seeing lots of these existing modules move to using both tabs and spaces. This isn't so bad if it is easy to tell that you've just inserted a tab rather than a set of four spaces, but in CodeEditor these two actions look exactly the same on the screen, and the indentation looks the same as it previously did. You can only tell that you've inserted tabs rather than spaces when you save the page and the code is displayed in geSHi. Many users might not even look closely at the code in geSHi, and not even realise their mistake. This doesn't seem like an ideal situation to me.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links