mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: per-package setting of tabsize
git-svn-id: svn://ultimatepp.org/upp/trunk@10872 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
252647efce
commit
d7077f7af0
5 changed files with 27 additions and 14 deletions
|
|
@ -317,6 +317,7 @@ public:
|
|||
String param;
|
||||
};
|
||||
byte charset;
|
||||
int tabsize;
|
||||
bool noblitz;
|
||||
bool nowarnings;
|
||||
String description;
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ void Package::Reset()
|
|||
bold = italic = false;
|
||||
ink = Null;
|
||||
spellcheck_comments = Null;
|
||||
tabsize = Null;
|
||||
}
|
||||
|
||||
Package::Package()
|
||||
|
|
@ -241,6 +242,9 @@ bool Package::Load(const char *path)
|
|||
if(p.Id("charset"))
|
||||
charset = CharsetByNameX(p.ReadString());
|
||||
else
|
||||
if(p.Id("tabsize"))
|
||||
tabsize = minmax(p.ReadInt(), 1, 20);
|
||||
else
|
||||
if(p.Id("description")) {
|
||||
description = p.ReadString();
|
||||
const char *q = strchr(description, 255);
|
||||
|
|
@ -450,6 +454,8 @@ bool Package::Save(const char *path) const {
|
|||
}
|
||||
if(charset > 0)
|
||||
out << "charset " << AsCString(IdeCharsetName(charset)) << ";\n\n";
|
||||
if(!IsNull(tabsize))
|
||||
out << "tabsize " << tabsize << ";\n\n";
|
||||
if(noblitz)
|
||||
out << "noblitz;\n\n";
|
||||
if(nowarnings)
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ void PackageEditor::SaveOptions() {
|
|||
actual.bold = ~bold;
|
||||
actual.italic = ~italic;
|
||||
actual.charset = (byte)(int)~charset;
|
||||
actual.tabsize = ~tabsize;
|
||||
actual.spellcheck_comments = ~spellcheck_comments;
|
||||
actual.accepts = Split(accepts.GetText().ToString(), ' ');
|
||||
actual.noblitz = noblitz;
|
||||
|
|
@ -117,6 +118,7 @@ void PackageEditor::Empty()
|
|||
{
|
||||
FileEmpty();
|
||||
charset.Disable();
|
||||
tabsize.Disable();
|
||||
spellcheck_comments.Disable();
|
||||
noblitz.Disable();
|
||||
nowarnings.Disable();
|
||||
|
|
@ -176,6 +178,7 @@ void PackageEditor::PackageCursor()
|
|||
bold <<= actual.bold;
|
||||
italic <<= actual.italic;
|
||||
charset <<= (int)actual.charset;
|
||||
tabsize <<= actual.tabsize;
|
||||
spellcheck_comments <<= actual.spellcheck_comments;
|
||||
noblitz = actual.noblitz;
|
||||
nowarnings = actual.nowarnings;
|
||||
|
|
@ -190,6 +193,7 @@ void PackageEditor::PackageCursor()
|
|||
bold.Enable();
|
||||
italic.Enable();
|
||||
charset.Enable();
|
||||
tabsize.Enable();
|
||||
spellcheck_comments.Enable();
|
||||
noblitz.Enable();
|
||||
nowarnings.Enable();
|
||||
|
|
@ -591,7 +595,7 @@ PackageEditor::PackageEditor()
|
|||
filelist.Disable();
|
||||
spellcheck_comments.Disable();
|
||||
accepts.SetFilter(FlagFilter);
|
||||
accepts ^= spellcheck_comments ^= charset ^= THISFN(SaveOptions);
|
||||
accepts ^= spellcheck_comments ^= charset ^= tabsize ^= THISFN(SaveOptions);
|
||||
noblitz <<=
|
||||
nowarnings <<=
|
||||
pch_file <<=
|
||||
|
|
|
|||
|
|
@ -110,19 +110,19 @@ END_LAYOUT
|
|||
LAYOUT(UppLayout, 936, 576)
|
||||
UNTYPED(package, LeftPosZ(4, 240).VSizePosZ(4, 196))
|
||||
ITEM(Label, dv___1, SetLabel(t_("Description")).LeftPosZ(248, 64).TopPosZ(4, 19))
|
||||
ITEM(DataPusher, description, HSizePosZ(308, 224).TopPosZ(4, 20))
|
||||
ITEM(Label, dv___3, SetLabel(t_("Highlight")).RightPosZ(144, 68).TopPosZ(4, 19))
|
||||
ITEM(ColorPusher, ink, RightPosZ(100, 52).TopPosZ(4, 19))
|
||||
ITEM(Option, bold, SetLabel(t_("Bold")).RightPosZ(52, 44).TopPosZ(4, 20))
|
||||
ITEM(Option, italic, SetLabel(t_("Italic")).RightPosZ(4, 44).TopPosZ(4, 20))
|
||||
ITEM(DataPusher, description, HSizePosZ(308, 356).TopPosZ(4, 20))
|
||||
ITEM(Label, dv___3, SetLabel(t_("Highlight")).RightPosZ(280, 68).TopPosZ(4, 19))
|
||||
ITEM(ColorPusher, ink, RightPosZ(252, 40).TopPosZ(4, 19))
|
||||
ITEM(Option, bold, SetLabel(t_("Bold")).RightPosZ(204, 44).TopPosZ(4, 20))
|
||||
ITEM(Option, italic, SetLabel(t_("Italic")).RightPosZ(156, 44).TopPosZ(4, 20))
|
||||
ITEM(Label, dv___7, SetLabel(t_("&Accepts")).LeftPosZ(248, 44).TopPosZ(28, 19))
|
||||
ITEM(EditString, accepts, HSizePosZ(308, 548).TopPosZ(28, 19))
|
||||
ITEM(Label, dv___9, SetLabel(t_("Spellcheck comments")).RightPosZ(420, 120).TopPosZ(28, 19))
|
||||
ITEM(DropList, spellcheck_comments, RightPosZ(356, 68).TopPosZ(28, 19))
|
||||
ITEM(Label, dv___11, SetLabel(t_("Encoding")).RightPosZ(300, 48).TopPosZ(28, 19))
|
||||
ITEM(DropList, charset, RightPosZ(184, 112).TopPosZ(28, 19))
|
||||
ITEM(Option, noblitz, SetLabel(t_("No BLITZ")).RightPosZ(98, 76).TopPosZ(28, 20))
|
||||
ITEM(Option, nowarnings, SetLabel(t_("No warnings")).RightPosZ(4, 88).TopPosZ(28, 20))
|
||||
ITEM(EditString, accepts, HSizePosZ(308, 480).TopPosZ(28, 19))
|
||||
ITEM(Label, dv___9, SetLabel(t_("Spellcheck comments")).RightPosZ(348, 120).TopPosZ(28, 19))
|
||||
ITEM(DropList, spellcheck_comments, RightPosZ(284, 68).TopPosZ(28, 19))
|
||||
ITEM(Label, dv___11, SetLabel(t_("Encoding")).RightPosZ(228, 48).TopPosZ(28, 19))
|
||||
ITEM(DropList, charset, RightPosZ(112, 112).TopPosZ(28, 19))
|
||||
ITEM(Option, noblitz, SetLabel(t_("No BLITZ")).RightPosZ(-8, 76).TopPosZ(4, 20))
|
||||
ITEM(Option, nowarnings, SetLabel(t_("No warnings")).RightPosZ(64, 88).TopPosZ(4, 20))
|
||||
ITEM(ArrayCtrl, option, HSizePosZ(248, 4).VSizePosZ(52, 152))
|
||||
UNTYPED(filelist, LeftPosZ(4, 240).BottomPosZ(4, 188))
|
||||
ITEM(ArrayCtrl, fileoption, HSizePosZ(248, 4).BottomPosZ(36, 112))
|
||||
|
|
@ -132,6 +132,8 @@ LAYOUT(UppLayout, 936, 576)
|
|||
ITEM(Option, noblitz_file, SetLabel(t_("Exclude from BLITZ")).LeftPosZ(672, 132).BottomPosZ(9, 19))
|
||||
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(76, 64).BottomPosZ(6, 22))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(6, 22))
|
||||
ITEM(Label, dv___24, SetLabel(t_("T&ab size")).RightPosZ(60, 48).TopPosZ(28, 19))
|
||||
ITEM(EditIntSpin, tabsize, RightPosZ(6, 50).TopPosZ(28, 19))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(NewPackageLayout, 892, 560)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ void Ide::FileCursor()
|
|||
if(IsActiveFile() && !filelist[filelist.GetCursor()].isdir) {
|
||||
Package::File& f = ActiveFile();
|
||||
editor.SetEditable(!f.readonly);
|
||||
editor.TabSize(f.tabsize > 0 ? f.tabsize : editortabsize);
|
||||
editor.TabSize(f.tabsize > 0 ? f.tabsize : actual.tabsize > 0 ? actual.tabsize : editortabsize);
|
||||
SetupEditor();
|
||||
String headername;
|
||||
if(insert_include)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue