XVimProject / XVim2

Vim key-bindings for Xcode 9
MIT License
2.31k stars 181 forks source link

wired jump when enables Xcode trim trailing whitespace settings and whitespace-only lines #351

Closed yam-liu closed 3 years ago

yam-liu commented 3 years ago

2021-01-12 01 08 55

r-plus commented 3 years ago

NOTE: {<CR><Esc>j will happen this issue. {<CR><Esc>k will not happen.

move cursor position will be calculated by character count so removing whitespace characters by xcode is change the characters count we expect. From this reason, "Automatically trim trailing whitespace" Xcode option also will occur same issue.

I'm thinking invoke xcode trimming feature before or after evaluate motion to get correct characters count is workaround this. xcode trimming feature is implemented in DVTSourceTextView instance method, but i'm not sure how to access its instance.

... or delay the motion execution after trimming. (simple performSelector is not enough for this)