rename existing 'MakeNormalDelete.deleteLine' function to 'MakeNormalDelete.deleteLineDown', make 'dj' and 'ydj' commands use the renamed function, and add a new 'MakeNormalDelete.deleteLine' function (which has no implementation yet). We do this because we want to distinguish between 'dd' and 'dj' commands, allowing 'dd' to delete to the end of the file despite any count, while stoppinhg 'dj' from deleting the file when on the last line.

This commit is contained in:
2025-09-25 04:56:25 +01:00
parent 1255238d6c
commit e24230834e
2 changed files with 6 additions and 4 deletions

View File

@@ -256,7 +256,7 @@ struct
* but 'dj' or 'dk' delete whole lines
* so their implementation differs from
* other cursor motions *)
| #"j" => NormalDelete.deleteLine (app, count + 1, time)
| #"j" => NormalDelete.deleteLineDown (app, count, time)
| #"k" => NormalDelete.deleteLineBack (app, count, time)
| #"w" => NormalDelete.deleteByDfa (app, count, Cursor.nextWord, time)
| #"W" => NormalDelete.deleteByDfa (app, count, Cursor.nextWORD, time)
@@ -352,7 +352,7 @@ struct
* but 'dj' or 'dk' delete whole lines
* so their implementation differs from
* other cursor motions *)
| #"j" => NormalYankDelete.deleteLine (app, count + 1, time)
| #"j" => NormalYankDelete.deleteLineDown (app, count, time)
| #"k" => NormalYankDelete.deleteLineBack (app, count, time)
| #"w" => NormalYankDelete.deleteByDfa (app, count, Cursor.nextWord, time)
| #"W" => NormalYankDelete.deleteByDfa (app, count, Cursor.nextWORD, time)