I'd find this feature useful, even for coding. Personally I wouldn't want it to span files, or if it did, have the ability to disable that.
I also wouldn't want it to re-purpose the existing bookmarks system, which I already use for navigating.
But there's a lot of talk about how to detect line changes, and when to push a position onto the stack. It seems to me the easiest way would be just to backscan through the undo buffer, which can already tell us which lines have been changed on what line.
Personally I would just keep it really simple, and have a key combo which backtraces through the undo buffer jumping to lines which were changed (without undoing anything obviously).
As soon as you start adding timers, or refusing to jump to lines which are already visible, these things tend to just become unpredictable for the user, and end up being an annoyance rather than something useful.
On 22 September 2014 21:05, Eduardo Francos efrancos@efrancos.com wrote:
On 22 sept. 2014, at 18:50, Allan Odgaard mailinglist@textmate.org wrote:
On 22 Sep 2014, at 18:30, Eduardo Francos wrote:
I developed a bundle I called "Navigator" for TM 1.5 that does that. Actually it does a lot more. Among others it implements a position
stack with push/pop position, navigation within the stack
Sounds like this could be tackled by extended the current bookmark
system with a “go back to last bookmark added and remove it (and make it work accross files)”-action, and we would have this push/pop system.
I agree. As long as you have a push/pop type of mechanism you have the functionality. However, current bookmarks are document based so if the document has been closed then the pop cannot work as is. Positioning bookmarks need to be kept available all the time. I use a file to keep the stack information between bundle calls. I guess this information could be managed more efficiently inside TM. The "push" could be done automatically to save the extra keystroke but as mentioned by others it's not easy to determine when a push must be done. For what it's worth, when I tried to implement automatic pushes I decided on two relatively simplistic conditions:
- Whenever you edit a line its position is pushed. Previous pushed
positions are poped and discarded while they are located within a number of lines of the current one. This in order to avoid the pain of going back to each one of them separately. 2) Whenever the caret stays on the same line or group of lines for longer than a given number of seconds the position is pushed. I translate this as "the position is interesting".
[…] TMTOOLS is not supported anymore and I used it for precise
positioning when documents have changed since the position was saved.
Curious, how was TMTOOLS able to help with that?
It's related to the issue of files being modified after the position has been pushed so the stored position is not exactly right. After determining the file and position to jump to, and telling TM (via mate) to open the file at the position, I then use TMTOOLS to call a bundle command that would check that the line is still there. If it's not then search a (configurable) number of lines up and down to try to find it. This gives me precise positioning almost always. In a more general way I use TMTOOLS to be able to call back into TM and continue a logic that is dependent on TM doing something in between. It would be nice if the command line "mate" could do that type of things... but that's a different story :p
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate