Last modified: 2013-09-24 23:14:21 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.
(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.
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.