View previous topic :: View next topic |
Author |
Message |
obijohn
Joined: 07 Feb 2006 Posts: 24
|
Posted: Sun Jan 13, 2008 12:28 pm Post subject: auto-indent doesn't quite work |
|
|
using the 0.221 build (and actually going back a few releases) no matter what the Tab Width and Tab Indents are set to, when a new code section is created with curly brackets and the Enter key pressed, the editor auto-indents 4 spaces instead of what the setting is. The "indention guide mark" does show a mark where it's supposed to, but the cursor is placed at the 4-space indent point, whether tabs are set to 2 or 8.
Here's what I mean:
Code: | int main(char[][] args)
{ |
Now pressing Enter right after the curly brace, if Tab Width and Tab Indents are both set to 2, I get:
Code: | int main(char[][] args)
{
| | |
The first "|" above is the "indentation guide" mark, and the second where the cursor is placed. I've triple-checked the settings, and it doesn't matter if Replace Tab By Space is checked or not, and Tab Width and Tab Indents don't matter either. It always auto-indents 4.
I can offer to dig around the source to find where to fix this, but someone who's familiar with the source already could probably have the fix done by the time I found the source file. |
|
Back to top |
|
|
obijohn
Joined: 07 Feb 2006 Posts: 24
|
Posted: Sun Jan 13, 2008 1:11 pm Post subject: |
|
|
I just downloaded the svn trunk, which evidently contains a newly-built .exe and it still shows the same behavior.
Incidentally, the most recent svn revision is 211, but the download on the project page says 0.221. In the svn downloads folder it says the 0.221 build is from 6 months ago, so it's not as recent as the 211 revision. I guess I'm just confused about the numbering.
Anyway, the new 211 build still does the same thing with auto-indent (always auto-indenting 4 spaces regardless of the settings). |
|
Back to top |
|
|
obijohn
Joined: 07 Feb 2006 Posts: 24
|
Posted: Sun Jan 13, 2008 2:16 pm Post subject: |
|
|
Alright, I think I found the problem. It seems that way back in revision 70, the autoindent was hard-coded into the scintilla lexer dll as a const 4. The problem is that the files needed to rebuild it are no longer in the source tree, from what I can tell. Here's the original offending file: link (see lines 166 and following).
However, I think a work-around might be to add a special case to onCharAdded() in dstyle.d since it seems that function handles auto-complete stuff that isn't in the scintilla dll. Does anyone more familiar with the source think this might be a solution? |
|
Back to top |
|
|
Kuan Hsu
Joined: 15 Apr 2006 Posts: 143 Location: Taiwan
|
Posted: Sun Jan 13, 2008 8:40 pm Post subject: |
|
|
obijohn wrote: | Alright, I think I found the problem. It seems that way back in revision 70, the autoindent was hard-coded into the scintilla lexer dll as a const 4. The problem is that the files needed to rebuild it are no longer in the source tree, from what I can tell. Here's the original offending file: link (see lines 166 and following).
However, I think a work-around might be to add a special case to onCharAdded() in dstyle.d since it seems that function handles auto-complete stuff that isn't in the scintilla dll. Does anyone more familiar with the source think this might be a solution? |
Thank you very much for your report! It is very clear that I can modify the bug easily!
I've commit rev.212, I wish that it can solve the problem. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|