Skip to content

Commit 19886d6

Browse files
committed
refactor: simplify coding function by removing redundant context checks
- Remove the check for loaded contexts in the `coding` function, as it is no longer necessary. - Simplify the `coding` function by directly fetching added file content without prior validation. Signed-off-by: codiing-hui <wecoding@yeah.net>
1 parent 2d0c16b commit 19886d6

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

internal/ui/coders/commands.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ func (c *CommandExecutor) dropFiles(_ context.Context, _ ...string) error {
296296
}
297297

298298
func (c *CommandExecutor) coding(ctx context.Context, args ...string) error {
299-
if len(c.coder.loadedContexts) == 0 {
300-
return errbook.New("No files added. Please use /add to add files first")
301-
}
302-
303299
addedFiles, err := c.getAddedFileContent()
304300
if err != nil {
305301
return err

0 commit comments

Comments
 (0)