editor, allow temporarily column selection even if option eoScrollPastEol not enabled

This commit is contained in:
Basile Burg 2016-01-24 03:22:11 +01:00
parent e3656f0d54
commit 619c169024
3 changed files with 23 additions and 7 deletions

View File

@ -203,7 +203,7 @@ begin
// //
FreeAndNil(fJSON); FreeAndNil(fJSON);
parser := TJSONParser.Create(loader, true); parser := TJSONParser.Create(loader, true);
//TODO-cDUB: uses parser.options to allow trailing comma (from FPC 3.02) //TODO-cgonnawork: from FPC 3.02, uses parser.options to allow trailing comma in DUB descriptions
// http://bugs.freepascal.org/view.php?id=29357 // http://bugs.freepascal.org/view.php?id=29357
try try
try try

View File

@ -1025,7 +1025,7 @@ begin
try try
DockMaster.SaveLayoutToConfig(xcfg); DockMaster.SaveLayoutToConfig(xcfg);
xcfg.WriteToDisk; xcfg.WriteToDisk;
// TODO: remove this when AnchorDocking wont save anymore invalid layout // TODO-cdocking: remove this when AnchorDocking wont save anymore invalid layout
with TMemoryStream.Create do try with TMemoryStream.Create do try
LoadFromFile(getCoeditDocPath + 'docking.xml.tmp'); LoadFromFile(getCoeditDocPath + 'docking.xml.tmp');
if Size < 10000 then if Size < 10000 then
@ -1148,7 +1148,7 @@ begin
LoadLastDocsAndProj; LoadLastDocsAndProj;
// http://bugs.freepascal.org/view.php?id=29475 // http://bugs.freepascal.org/view.php?id=29475
// TODO-cbugfix: activate this when Laz 1.6 released. // TODO-cgonnawork: activate this when Laz 1.6 released.
// DockMaster.ResetSplitter; // DockMaster.ResetSplitter;
fFirstShown := true; fFirstShown := true;
@ -2098,7 +2098,7 @@ begin
DockMaster.SaveLayoutToConfig(xcfg); DockMaster.SaveLayoutToConfig(xcfg);
xcfg.WriteToDisk; xcfg.WriteToDisk;
// prevent any invalid layout to be saved (AnchorDocking bug) // prevent any invalid layout to be saved (AnchorDocking bug)
// TODO: remove this when AnchorDocking wont save anymore invalid layout // TODO-cdocking: remove this when AnchorDocking wont save anymore invalid layout
with TMemoryStream.Create do try with TMemoryStream.Create do try
LoadFromFile(aFilename + '.tmp'); LoadFromFile(aFilename + '.tmp');
if Size < 10000 then if Size < 10000 then
@ -2176,7 +2176,7 @@ begin
widg.Parent.Parent.isNil and widg.isDockable then widg.Parent.Parent.isNil and widg.isDockable then
begin begin
TForm(widg.Parent).FormStyle := fstyle[onTop]; TForm(widg.Parent).FormStyle := fstyle[onTop];
//TODO-bugfix: floating widg on top from true to false, widg remains on top //TODO-cbugfix: floating widg on top from true to false, widg remains on top
if TForm(widg.Parent).Visible then if not onTop then if TForm(widg.Parent).Visible then if not onTop then
TForm(widg.Parent).SendToBack; TForm(widg.Parent).SendToBack;
end; end;

View File

@ -130,6 +130,7 @@ type
fMatchIdentOpts: TSynSearchOptions; fMatchIdentOpts: TSynSearchOptions;
fMatchOpts: TIdentifierMatchOptions; fMatchOpts: TIdentifierMatchOptions;
fCallTipStrings: TStringList; fCallTipStrings: TStringList;
fOverrideColMode: boolean;
procedure setMatchOpts(value: TIdentifierMatchOptions); procedure setMatchOpts(value: TIdentifierMatchOptions);
function getMouseFileBytePos: Integer; function getMouseFileBytePos: Integer;
procedure changeNotify(Sender: TObject); procedure changeNotify(Sender: TObject);
@ -309,7 +310,7 @@ begin
fFontSize := fMemo.Font.Size; fFontSize := fMemo.Font.Size;
TCEEditorHintWindow.FontSize := fMemo.Font.Size; TCEEditorHintWindow.FontSize := fMemo.Font.Size;
// //
// TODO-cEditor Cache: >nested< folding persistence // TODO-cimprovment: handle nested folding in TCESynMemoCache
// cf. other ways: http://forum.lazarus.freepascal.org/index.php?topic=26748.msg164722#msg164722 // cf. other ways: http://forum.lazarus.freepascal.org/index.php?topic=26748.msg164722#msg164722
prev := fMemo.Lines.Count-1; prev := fMemo.Lines.Count-1;
for i := fMemo.Lines.Count-1 downto 0 do for i := fMemo.Lines.Count-1 downto 0 do
@ -766,6 +767,11 @@ begin
showCallTips; showCallTips;
end; end;
end; end;
if fOverrideColMode and not SelAvail then
begin
fOverrideColMode := false;
Options := Options - [eoScrollPastEol];
end;
end; end;
{$ENDREGIOn} {$ENDREGIOn}
@ -1243,6 +1249,12 @@ begin
fCanShowHint := false; fCanShowHint := false;
hideCallTips; hideCallTips;
hideDDocs; hideDDocs;
if (emAltSetsColumnMode in MouseOptions) and not (eoScrollPastEol in Options)
and (ssLeft in shift) and (ssAlt in Shift) then
begin
fOverrideColMode := true;
Options := Options + [eoScrollPastEol];
end;
end; end;
procedure TCESynMemo.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y:Integer); procedure TCESynMemo.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y:Integer);
@ -1251,11 +1263,15 @@ begin
case Button of case Button of
mbMiddle: if (Shift = [ssCtrl]) then mbMiddle: if (Shift = [ssCtrl]) then
Font.Size := fDefaultFontSize; Font.Size := fDefaultFontSize;
// linux, kde: mbExtra are never called
mbExtra1: fPositions.back; mbExtra1: fPositions.back;
mbExtra2: fPositions.next; mbExtra2: fPositions.next;
mbLeft: fPositions.store; mbLeft: fPositions.store;
end; end;
if fOverrideColMode and not SelAvail then
begin
fOverrideColMode := false;
Options := Options - [eoScrollPastEol];
end;
end; end;
function TCESynMemo.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; function TCESynMemo.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean;