On 22 sept. 2014, at 18:50, Allan Odgaard <email@example.com> 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:
1) 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