~ubuntu-branches/ubuntu/maverick/codelite/maverick

« back to all changes in this revision

Viewing changes to LiteEditor/cl_editor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-04-30 02:46:27 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090430024627-7xp71gerfvw00xtt
Tags: 1.0.2822+dfsg-0ubuntu1
* New upstream release (LP: #369466)
* debian/copyright:
  + Added Files section for sdk/wxpropgrid
  + Made license text RFC compliant (add . for empty lines)
* debian/control:
  + Bump Standards-Version to 3.8.1
* debian/patches/02_fix-desktop.patch,
  + Refreshed to patch cleanly
* debian/*.install,
  debian/codelite.dirs,
  debian/codelite.links,
  debian/patches/03_fix-sh.patch,
  debian/patches/04_change-installpath.patch,
  + Updated for new upstream directory structure
  + Patches dropped, no longer needed.
* debian/patches/03_cstdio-include.patch,
  + Include cstdio for C++ and stdio.h for C, since it seems to be missing
* debian/codelite.menu,
  debian/*.1,
  debian/codelite.manpages:
  + Updated to reflect change in command names
    - CodeLite    => codelite
    - le_exec     => codelite_exec
    - le_dos2unix => codelite_fix_files
    - le_killproc => codelite_kill_children
* debian/README.source,
  debian/rules,
  debian/copyright:
  + Remove sdk/curl from the list of excluded files, since it doesn't exist
    any more

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
 
165
165
        // Initialise the breakpt-marker array
166
166
        FillBPtoMarkerArray();
 
167
 
 
168
        // set EOL mode for the newly created file
 
169
        int eol = GetEOLByOS();
 
170
        int alternate_eol = GetEOLByContent();
 
171
        if (alternate_eol != wxNOT_FOUND) {
 
172
                eol = alternate_eol;
 
173
        }
 
174
        SetEOLMode(eol);
167
175
}
168
176
 
169
177
LEditor::~LEditor()
909
917
        m_rightClickMenu->AppendSeparator(); // separates plugins
910
918
        SetProperties();
911
919
        UpdateColours();
 
920
 
 
921
        SetEOL();
912
922
        m_context->SetActive();
913
923
}
914
924
 
1922
1932
        DelAllBreakpointMarkers();
1923
1933
 
1924
1934
        UpdateColours();
1925
 
 
1926
 
        // set the EOL mode
1927
 
        int eol = GetEOLByContent();
1928
 
        if (eol == wxNOT_FOUND) {
1929
 
                eol = GetEOLByOS();
1930
 
        }
1931
 
        SetEOLMode(eol);
 
1935
        SetEOL();
1932
1936
 
1933
1937
        int doclen = GetLength();
1934
1938
        int lastLine = LineFromPosition(doclen);
2742
2746
 
2743
2747
int LEditor::GetEOLByOS()
2744
2748
{
 
2749
        OptionsConfigPtr options = EditorConfigST::Get()->GetOptions();
 
2750
        if (options->GetEolMode() == wxT("Unix (LF)")) {
 
2751
                return wxSCI_EOL_LF;
 
2752
        } else if (options->GetEolMode() == wxT("Mac (CR)")) {
 
2753
                return wxSCI_EOL_CR;
 
2754
        } else if (options->GetEolMode() == wxT("Windows (CRLF)")) {
 
2755
                return wxSCI_EOL_CRLF;
 
2756
        } else {
 
2757
                // set the EOL by the hosting OS
2745
2758
#if defined(__WXMAC__)
2746
 
        return wxSCI_EOL_CR;
 
2759
                return wxSCI_EOL_CR;
2747
2760
#elif defined(__WXGTK__)
2748
 
        return wxSCI_EOL_LF;
 
2761
                return wxSCI_EOL_LF;
2749
2762
#else
2750
 
        return wxSCI_EOL_CRLF;
 
2763
                return wxSCI_EOL_CRLF;
2751
2764
#endif
 
2765
        }
2752
2766
}
2753
2767
 
2754
2768
void LEditor::ShowFunctionTipFromCurrentPos()
3066
3080
        }
3067
3081
        return wxNOT_FOUND;
3068
3082
}
 
3083
 
 
3084
void LEditor::SetEOL()
 
3085
{
 
3086
        // set the EOL mode
 
3087
        int eol = GetEOLByOS();
 
3088
        int alternate_eol = GetEOLByContent();
 
3089
        if (alternate_eol != wxNOT_FOUND) {
 
3090
                eol = alternate_eol;
 
3091
        }
 
3092
        SetEOLMode(eol);
 
3093
 
 
3094
}