Skip to content

Commit

Permalink
Merge pull request #908 from DeinAlptraum/fix-editor-dirty
Browse files Browse the repository at this point in the history
Do not mark edited file as dirty when selecting note
  • Loading branch information
barbeque-squared authored Oct 7, 2024
2 parents 6ea9db7 + 2037f1f commit ef99cc2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/screens/UScreenEditSub.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,6 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
SDLK_RIGHT:
begin
// right
CopyToUndo;
if SDL_ModState = 0 then
begin
// clear debug text
Expand All @@ -1905,6 +1904,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// ctrl + right
if SDL_ModState = KMOD_LCTRL then
begin
CopyToUndo;
if Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Duration > 1 then
begin
Dec(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Duration);
Expand All @@ -1921,6 +1921,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// shift + right
if SDL_ModState = KMOD_LSHIFT then
begin
CopyToUndo;
Inc(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].StartBeat);
if CurrentNote[CurrentTrack] = 0 then
begin
Expand All @@ -1935,6 +1936,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// alt + right
if SDL_ModState = KMOD_LALT then
begin
CopyToUndo;
Inc(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Duration);
if CurrentNote[CurrentTrack] = Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote then
begin
Expand All @@ -1947,6 +1949,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// alt + ctrl + shift + right = move all from cursor to right
if SDL_ModState = KMOD_LALT + KMOD_LCTRL + KMOD_LSHIFT then
begin
CopyToUndo;
MoveAllToEnd(1);
Text[TextInfo].Text := Language.Translate('EDIT_INFO_NOTES_SHIFTED_RIGHT');
GoldenRec.KillAll;
Expand All @@ -1957,7 +1960,6 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
SDLK_LEFT:
begin
// left
CopyToUndo;
if SDL_ModState = 0 then
begin
// clear debug text
Expand All @@ -1983,6 +1985,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// ctrl + left
if SDL_ModState = KMOD_LCTRL then
begin
CopyToUndo;
Dec(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].StartBeat);
Inc(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Duration);
if CurrentNote[CurrentTrack] = 0 then
Expand All @@ -1994,6 +1997,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// shift + left
if SDL_ModState = KMOD_LSHIFT then
begin
CopyToUndo;
Dec(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].StartBeat);

// resizing sentences
Expand All @@ -2011,6 +2015,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// alt + left
if SDL_ModState = KMOD_LALT then
begin
CopyToUndo;
if Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Duration > 1 then
begin
Dec(Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Duration);
Expand All @@ -2026,6 +2031,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre
// alt + ctrl + shift + right = move all from cursor to left
if SDL_ModState = KMOD_LALT + KMOD_LCTRL + KMOD_LSHIFT then
begin
CopyToUndo;
MoveAllToEnd(-1);
Text[TextInfo].Text := Language.Translate('EDIT_INFO_NOTES_SHIFTED_LEFT');
GoldenRec.KillAll;
Expand Down

0 comments on commit ef99cc2

Please sign in to comment.