From 6904f9fc4596d144c66b9ce66b235d10c79e1bda Mon Sep 17 00:00:00 2001 From: Vladimir Surguchev Date: Wed, 27 Jun 2012 11:43:47 +0000 Subject: [PATCH] M#0821, M#0011 --- far/changelog | 11 +++++++++++ far/config.cpp | 6 ++++++ far/config.hpp | 2 ++ far/configdb.cpp | 4 ++-- far/configdb.hpp | 2 +- far/farlang.templ.m4 | 36 ++++++++++++++++++++++++++++-------- far/poscache.cpp | 12 ++++++------ far/poscache.hpp | 4 ++-- far/vbuild.m4 | 2 +- far/viewer.cpp | 44 +++++++++++++++++++++++++++----------------- 10 files changed, 86 insertions(+), 37 deletions(-) diff --git a/far/changelog b/far/changelog index a09080b7f6..85e7fcf16b 100644 --- a/far/changelog +++ b/far/changelog @@ -1,3 +1,14 @@ +w17 27.06.2012 15:43:12 +0400 - build 2748 + +1. "Use case sensitive sort" + . + +2. M#0821: " " + ( ) , . + +3. M#0011: wrar/wwrap/unwrap + 2 . + drkns 24.06.2012 16:21:55 +0200 - build 2747 1. 2738. diff --git a/far/config.cpp b/far/config.cpp index 3c82fa3314..b281a0f29e 100644 --- a/far/config.cpp +++ b/far/config.cpp @@ -720,6 +720,7 @@ void ViewerConfig(ViewerOptions &ViOpt,bool Local) Builder.StartColumns(); Builder.AddCheckbox(MViewConfigPersistentSelection, ViOpt.PersistentBlocks); DialogItemEx *SavePos = Builder.AddCheckbox(MViewConfigSavePos, Opt.ViOpt.SavePos); // can't be local + Builder.AddCheckbox(MViewConfigSaveCodepage, ViOpt.SaveCodepage); Builder.AddCheckbox(MViewConfigEditAutofocus, ViOpt.SearchEditFocus); DialogItemEx *TabSize = Builder.AddIntEditField(ViOpt.TabSize, 3); Builder.AddTextAfter(TabSize, MViewConfigTabSize); @@ -727,6 +728,7 @@ void ViewerConfig(ViewerOptions &ViOpt,bool Local) Builder.AddCheckbox(MViewConfigArrows, ViOpt.ShowArrows); DialogItemEx *SaveShortPos = Builder.AddCheckbox(MViewConfigSaveShortPos, Opt.ViOpt.SaveShortPos); // can't be local Builder.LinkFlags(SavePos, SaveShortPos, DIF_DISABLE); + Builder.AddCheckbox(MViewConfigSaveWrapMode, ViOpt.SaveWrapMode); Builder.AddCheckbox(MViewConfigVisible0x00, ViOpt.Visible0x00); Builder.AddCheckbox(MViewConfigScrollbar, ViOpt.ShowScrollbar); Builder.EndColumns(); @@ -742,6 +744,8 @@ void ViewerConfig(ViewerOptions &ViOpt,bool Local) Builder.AddOKCancel(); if (Builder.ShowDialog()) { + if (Opt.ViOpt.SavePos) + ViOpt.SaveCodepage = true; // codepage is part of saved position if (ViOpt.TabSize<1 || ViOpt.TabSize>512) ViOpt.TabSize = DefaultTabSize; if (!Opt.ViOpt.MaxLineSize) @@ -1172,6 +1176,8 @@ static struct FARConfig {FSSF_PRIVATE, NKeyViewer,L"PersistentBlocks", AddressAndType(Opt.ViOpt.PersistentBlocks), Default(0)}, {FSSF_PRIVATE, NKeyViewer,L"SaveViewerPos", AddressAndType(Opt.ViOpt.SavePos), Default(1)}, {FSSF_PRIVATE, NKeyViewer,L"SaveViewerShortPos", AddressAndType(Opt.ViOpt.SaveShortPos), Default(1)}, + {FSSF_PRIVATE, NKeyViewer,L"SaveViewerCodepage", AddressAndType(Opt.ViOpt.SaveCodepage), Default(1)}, + {FSSF_PRIVATE, NKeyViewer,L"SaveViewerWrapMode", AddressAndType(Opt.ViOpt.SaveWrapMode), Default(0)}, {FSSF_PRIVATE, NKeyViewer,L"SearchEditFocus", AddressAndType(Opt.ViOpt.SearchEditFocus), Default(0)}, {FSSF_PRIVATE, NKeyViewer,L"SearchRegexp", AddressAndType(Opt.ViOpt.SearchRegexp), Default(0)}, {FSSF_PRIVATE, NKeyViewer,L"ShowArrows", AddressAndType(Opt.ViOpt.ShowArrows), Default(1)}, diff --git a/far/config.hpp b/far/config.hpp index c989f45562..e57cbba2be 100644 --- a/far/config.hpp +++ b/far/config.hpp @@ -376,6 +376,8 @@ struct ViewerOptions BoolOption ViewerIsWrap; // (Wrap|WordWarp)=1 | UnWrap=0 BoolOption ViewerWrap; // Wrap=0|WordWarp=1 BoolOption SavePos; + BoolOption SaveCodepage; + BoolOption SaveWrapMode; BoolOption SaveShortPos; BoolOption UseExternalViewer; BoolOption ShowKeyBar; // $ 15.07.2000 tran + ShowKeyBar diff --git a/far/configdb.cpp b/far/configdb.cpp index 7d436c9217..c2d0685c35 100644 --- a/far/configdb.cpp +++ b/far/configdb.cpp @@ -2452,9 +2452,9 @@ class HistoryConfigCustom: public HistoryConfig, public SQLiteDb { return b; } - unsigned __int64 SetViewerPos(const wchar_t *Name, __int64 FilePos, __int64 LeftPos, int Hex, UINT CodePage) + unsigned __int64 SetViewerPos(const wchar_t *Name, __int64 FilePos, __int64 LeftPos, int Hex_Wrap, UINT CodePage) { - if (stmtSetViewerPos.Bind(Name).Bind(GetCurrentUTCTimeInUI64()).Bind(FilePos).Bind(LeftPos).Bind(Hex).Bind((int)CodePage).StepAndReset()) + if (stmtSetViewerPos.Bind(Name).Bind(GetCurrentUTCTimeInUI64()).Bind(FilePos).Bind(LeftPos).Bind(Hex_Wrap).Bind((int)CodePage).StepAndReset()) return LastInsertRowID(); return 0; } diff --git a/far/configdb.hpp b/far/configdb.hpp index 6fa8d467a2..3deed78768 100644 --- a/far/configdb.hpp +++ b/far/configdb.hpp @@ -229,7 +229,7 @@ class HistoryConfig: public Transactional { virtual unsigned __int64 GetEditorPos(const wchar_t *Name, int *Line, int *LinePos, int *ScreenLine, int *LeftPos, UINT *CodePage) = 0; virtual bool SetEditorBookmark(unsigned __int64 id, int i, int Line, int LinePos, int ScreenLine, int LeftPos) = 0; virtual bool GetEditorBookmark(unsigned __int64 id, int i, int *Line, int *LinePos, int *ScreenLine, int *LeftPos) = 0; - virtual unsigned __int64 SetViewerPos(const wchar_t *Name, __int64 FilePos, __int64 LeftPos, int Hex, UINT CodePage) = 0; + virtual unsigned __int64 SetViewerPos(const wchar_t *Name, __int64 FilePos, __int64 LeftPos, int Hex_Wrap, UINT CodePage) = 0; virtual unsigned __int64 GetViewerPos(const wchar_t *Name, __int64 *FilePos, __int64 *LeftPos, int *Hex, UINT *CodePage) = 0; virtual bool SetViewerBookmark(unsigned __int64 id, int i, __int64 FilePos, __int64 LeftPos) = 0; virtual bool GetViewerBookmark(unsigned __int64 id, int i, __int64 *FilePos, __int64 *LeftPos) = 0; diff --git a/far/farlang.templ.m4 b/far/farlang.templ.m4 index ce95826e40..8676c8a9e1 100644 --- a/far/farlang.templ.m4 +++ b/far/farlang.templ.m4 @@ -2668,6 +2668,26 @@ MViewConfigSaveShortPos "Guardar &marcadores" "Ukladať &záložky" +MViewConfigSaveCodepage +"Сохранять ко&довую страницу" +"Save file &codepage" +upd:"Save file &codepage" +upd:"Save file &codepage" +upd:"Save file &codepage" +upd:"Save file &codepage" +upd:"Save file &codepage" +upd:"Save file &codepage" + +MViewConfigSaveWrapMode +"Сохранять &режим переноса" +"Save w&rap mode" +upd:"Save w&rap mode" +upd:"Save w&rap mode" +upd:"Save w&rap mode" +upd:"Save w&rap mode" +upd:"Save w&rap mode" +upd:"Save w&rap mode" + MViewAutoDetectCodePage "&Автоопределение кодовой страницы" "&Autodetect code page" @@ -12947,14 +12967,14 @@ MMenuSortUseNumeric "Použiť čí&selné triedenie" MMenuSortUseCaseSensitive -"Сортировка с учётом регистра" -"Use case sensitive sort" -"Použít řazení citlivé na velikost písmen" -"Sortierung abhängig von Groß-/Kleinschreibung" -"Nagy/kisbetű érzékeny rendezés" -"Sortuj uwzględniając wielkość liter" -"Usar orden sensible min/mayúsc." -"Triediť podľa malých a VEĽKÝCH písmen" +"Прописные буквы раньше строчных" #"Верхний регистр раньше нижнего" +"Uppercase before lowercase" +upd:"Použít řazení citlivé na velikost písmen" +upd:"Sortierung abhängig von Groß-/Kleinschreibung" +upd:"Nagy/kisbetű érzékeny rendezés" +upd:"Sortuj uwzględniając wielkość liter" +upd:"Usar orden sensible min/mayúsc." +upd:"Triediť podľa malých a VEĽKÝCH písmen" MMaskGroupBottom "Редактирование: Ins, Del, F4, F7, Ctrl-R" diff --git a/far/poscache.cpp b/far/poscache.cpp index 2825322361..2ffea2fd4c 100644 --- a/far/poscache.cpp +++ b/far/poscache.cpp @@ -116,7 +116,7 @@ bool FilePositionCache::GetPosition(const wchar_t *Name, EditorPosCache& poscach bool FilePositionCache::AddPosition(const wchar_t *Name, const ViewerPosCache& poscache) { - if (!Opt.ViOpt.SavePos) + if (!Opt.ViOpt.SavePos && !Opt.ViOpt.SaveCodepage && !Opt.ViOpt.SaveWrapMode) return false; string strFullName; @@ -125,11 +125,11 @@ bool FilePositionCache::AddPosition(const wchar_t *Name, const ViewerPosCache& p HistoryCfg->BeginTransaction(); bool ret = false; - unsigned __int64 id = HistoryCfg->SetViewerPos(strFullName, poscache.FilePos, poscache.LeftPos, poscache.Hex, poscache.CodePage); + unsigned __int64 id = HistoryCfg->SetViewerPos(strFullName, poscache.FilePos, poscache.LeftPos, poscache.Hex_Wrap, poscache.CodePage); if (id) { - if (Opt.ViOpt.SaveShortPos) + if (Opt.ViOpt.SavePos && Opt.ViOpt.SaveShortPos) { for (int i=0; iGetViewerPos(strFullName, &poscache.FilePos, &poscache.LeftPos, &poscache.Hex, &poscache.CodePage); + unsigned __int64 id = HistoryCfg->GetViewerPos(strFullName, &poscache.FilePos, &poscache.LeftPos, &poscache.Hex_Wrap, &poscache.CodePage); if (id) { - if (!Opt.ViOpt.SaveShortPos) + if (!Opt.ViOpt.SavePos || !Opt.ViOpt.SaveShortPos) return true; for (int i=0; i