chipsenkbeil / chipsenkbeil/remote.nvim
Send file contents to server upon change
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Listen to the following autocmds to know when a file has been written:
- __BufWritePost__ writing the whole buffer
- __FilterWritePost__ writing to filter temp file
- __FileAppendPost__ appending to a file
- __FileWritePost__ any other file write
Upon receiving an event, attempt to stream file and send chunks of data as UDP.
### Optimization 1
Need to be able to understand if a followup sync request from the server is received indicating certain chunks were not received in time. If that's the case, attempt to resend the chunks.
Could potentially cache the file to speed up resends, but if the file is large - assume it's not - this would be terrible.
### Optimization 2
Potentially could try to get a smaller amount of data to send by getting the ranges using the following markers:
> The '[ and '] marks have a special position:
> - Before the *ReadPre event the '[ mark is set to the line just above where
> the new lines will be inserted.
> - Before the *ReadPost event the '[ mark is set to the first line that was
> just read, the '] mark to the last line.
> - Before executing the *WriteCmd, *WritePre and *AppendPre autocommands the '[
> mark is set to the first line that will be written, the '] mark to the last
> line.
> Careful: '[ and '] change when using commands that change the buffer.
In case the data changes again for a write, could adjust the line ranges based on current min/max. However, need to see if the optimization is even needed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.