User forums > Help

Tabs-to-Spaces

<< < (2/4) > >>

rickg22:

--- Quote from: takeshimiya on August 07, 2005, 01:08:12 pm ---Well, I found that this bug was a Yiannis's TODO :) in sdk/cbeditor.cpp @ cbEditor::OnEditorCharAdded():

In if (smartIndent) block ...


--- Code: ---// Original code:
if (b == '{')
    indent << '\t'; // TODO: decide between spaces/tabs

--- End code ---


--- Code: ---// Must be something like this:
if (b == '{')
{
    if(m_pControl->GetUseTabs())
        indent << '\t'; // 1 tab
    else
        indent << wxString(' ', m_pControl->GetTabWidth()); // n spaces
}

--- End code ---

2) This other bug is very ugly (and it took me a while to reproduce it)
How to reproduce it: Press "{" and ENTER and ENTER (without writting anything more than ENTER).
You can continue pressing ENTER and the indentation goes forever.

I guess that the bug this time is also in cbEditor::OnEditorCharAdded()'s @ else if (ch == '\n').


--- End quote ---

Hey, why not submit a PATCH about it? Just say "in line #nnn of filename.cpp:
is: (code)
should be: (code)

That would make our job MUCH EASIER, thank you :P

takeshimiya:
Sorry, that was because I'm using C::B CVS and probably you'll want a patch for VERSION_1, and I'm trying to add a little functionality.
And more important, I don't have the patch tool (I never used it) :oops:

I'll send a patch later.

takeshimiya:
Patch submitted here


--- Code: ---1227c1227,1232
<                     indent << _T('\t'); // TODO: decide between spaces/tabs
---
>                 {
>                     if(m_pControl->GetUseTabs())
>                         indent << _T('\t'); // 1 tab
>                     else
>                         indent << wxString(_T(' '), m_pControl->GetTabWidth()); // n spaces
>                 }

--- End code ---

About the diff app, the best is to use diff -u (unified format) right?
I mean the more secure, the less likely to mess if the files changes too much

rickg22:
Actually, when I say patch I mean "the modified files". I've never used the patch tool :P

takeshimiya:
:D, well, from what I understand:

For creating a diff/patch file in Windows:
download the diff utils at http://gnuwin32.sourceforge.net/packages/diffutils.htm

--- Code: ---diff -u oldfile.cpp newfile.cpp > oldnew.diff
--- End code ---

For applying a diff/patch file in Windows:
download the patch util at http://gnuwin32.sourceforge.net/packages/patch.htm

--- Code: ---patch < oldnew.diff
--- End code ---


I'm not going to upload the separated files, SourceForge Grandfather :) reccommends diff for text patches and xdelta for binary patches. Although I found bsdiff that appears to compress better than xdelta.
We'll need binary patchs for devpacks upgrading and C::B minor upgradings (ie. non-cumulative).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version