aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-13 22:26:53 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-13 22:45:59 +0800
commit4111530806741bc25bd426ec9b7e9340bdd57991 (patch)
treeef31a246f7979e4eb8f3892dab6e27a284733f61 /src/nvim/edit.c
parentc8dc34795b552ac69183e803bfff474ba4e595b6 (diff)
downloadrneovim-4111530806741bc25bd426ec9b7e9340bdd57991.tar.gz
rneovim-4111530806741bc25bd426ec9b7e9340bdd57991.tar.bz2
rneovim-4111530806741bc25bd426ec9b7e9340bdd57991.zip
vim-patch:9.0.0218: reading before the start of the line
Problem: Reading before the start of the line. Solution: When displaying "$" check the column is not negative. https://github.com/vim/vim/commit/e98c88c44c308edaea5994b8ad4363e65030968c Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 7670d6754f..e3321a8b99 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1528,8 +1528,9 @@ void edit_unputchar(void)
// Called when p_dollar is set: display a '$' at the end of the changed text
// Only works when cursor is in the line that changes.
-void display_dollar(colnr_T col)
+void display_dollar(colnr_T col_arg)
{
+ colnr_T col = col_arg < 0 ? 0 : col_arg;
colnr_T save_col;
if (!redrawing()) {