Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lua/CopilotChat/config/prompts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,26 @@ Steps for presenting code changes:
```

2. Examples:
```lua path=lua/CopilotChat/init.lua start_line=40 end_line=50
```lua path={DIR}/lua/CopilotChat/init.lua start_line=40 end_line=50
local function example()
print("This is an example function.")
end
```

```python path=scripts/example.py start_line=10 end_line=15
```python path={DIR}/scripts/example.py start_line=10 end_line=15
def example_function():
print("This is an example function.")
```

```json path=config/settings.json start_line=5 end_line=8
```json path={DIR}/config/settings.json start_line=5 end_line=8
{
"setting": "value",
"enabled": true
}
```

3. Requirements for code content:
- Always use the absolute file path in the code block header. If the path is not already absolute, convert it to an absolute path prefixed by {DIR}.
- Keep changes minimal and focused to produce short diffs
- Include complete replacement code for the specified line range
- Proper indentation matching the source
Expand Down
2 changes: 1 addition & 1 deletion lua/CopilotChat/utils/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function M.filename_same(file1, file2)
if not file1 or not file2 then
return false
end
return vim.fn.fnamemodify(file1, ':p') == vim.fn.fnamemodify(file2, ':p')
return vim.fs.normalize(file1) == vim.fs.normalize(file2)
end

--- Get the filetype of a file
Expand Down
Loading