cogent icon indicating copy to clipboard operation
cogent copied to clipboard

Symbols view not using current text position if you edit file

Open rohrlich opened this issue 5 years ago • 2 comments

SymbolsView is not jumping to the correct location if the file is edited after SymbolsView is first opened or refreshed. Clicking refresh before clicking on a symbol resolves the issue but you shouldn't need to. Calling ConfigTree in the code on each symbol select works but the cursor first jumps to the wrong position and it doesn't seem you should need to rebuild the entire tree.

rohrlich avatar May 14 '20 05:05 rohrlich

need to pass the position through the position updater. symbolsview positions need time stamps for that to work -- should be if they are texbuf.Pos

rcoreilly avatar May 14 '20 06:05 rcoreilly

I looked at AdjustReg (very cool using the undo stack) but I think it may not work in this case because the position information is coming from lex. I found these commented out lines in GideView.OpenFileURL() and I wonder if it is the same issue. // todo: need some way of tagging the time stamp for adjusting! // reg = tv.Buf.AdjustReg(reg)

rohrlich avatar May 14 '20 15:05 rohrlich