Sublime Forum

File split in several panes

#1

When we must edit big code files, it would be very good to have several panes spliting the file and the scroll of them synchronized.

By synchronized, I mean to have the file contents divided in the 2 or 3 panes and when you scroll the pane 1 content the othes panes scrolls contents in sync with the pane 1 (it works also for the other 2 panes).

Let’s say whe have lines 1 - 30 in first pane, then second pane would have lines from 31 to 60 and pane 3 lines from 61 to 90.
When I scroll 1 line in pane 1, it would change to lines 2 - 31, and lines 32 to 61 in pane 2 and lines 62 to 91 in pane 3, and so on…

The same is valid if we scrool the content in pane 2 or pane 3 (the other panes would be updated).

This would be great to edit any code file so we can view more code in the same screen.

0 Likes

#2

You wouldn’t necessarily be seeing more code - just snapshots of different locations… Additionally with this scrolling the way it is, and synced, then if you found something on panel 1 you wanted to look at but wanted to scroll a little on panel 2 without 1 scrolling you’d need a way to desync…

Another problem with having a system like that is a lot of coders, myself included, prefer to have a larger overview of what we’re working on and slicing up the file into 3 or more chunks in 3 panels would feel like you’re wearing blinders and would feel constrained…

There are some viable alternatives I’d like to suggest first – if you still want to go that route then… yes… it is possible… You will lose some space because of the tab bar when you open the file although you may be able to hide it using the settings object for the last 2… Since you’re splitting up the file you’d need to reassemble so it’d be similar to atom saving where the 3 views act as one - on save of any of them you’d reassemble the 3 views into 1, and write that data to the file you original opened… You’d need a special on activated hook so when a view is clicked, it splits it into the 3…

It wouldn’t be overly difficult to create - but there are other solutions you should look at first…

I would suggest this as a viable solution if the files were split naturally into these parts to make it easier to edit rather than scrolling around, etc… ie say you had a file with names, etc… setting up panels like a spreadsheet where each time you scroll a different set of names would be loaded and the other would be unloaded depending on where you scroll… but for code / programming - I’d feel odd coding in this type of environment because I wouldn’t be able to see anything beyond the few lines around what I’m working on, so no quick / easy access to the scope variables without scrolling, etc… it would slow me down… especially with what I have available to me.

There is a bookmark system in Sublime Text which can help tracking important file spots…

Or you could look at my addon which lets you set up your own code maps ie what is important such as class declarations, function declarations, etc… and decide how to output them with double-clicking on a line in the output window ( also sorted alphabetically in order or reverse or by line found asc or desc ) will jump you to the line in code…,

This gives you a much much broader view of your code and it lets you bind accessor func calls ( functions which when called create 2 or more functions for you - getter and setter typically ) to actually create the getter / setter function as they would’ve been generated by the call in the output entry log…

Here are some screenshots: https://www.dropbox.com/s/2ov6prv7cfn7sca/Screenshots.zip?dl=0

or: https://www.dropbox.com/s/y3w4iqytelqd1u5/sublime_text_unregistered__screenshot_20180111130239_9770.png?dl=0 with different ways to look at the same file: https://www.dropbox.com/s/y2epp63smzedk72/sublime_text_unregistered__screenshot_20180111130414_2558.png?dl=0

Right now to use it you’d need to download CodeMap and then install mine, manually, over the top… https://bitbucket.org/Acecool/acecooldev_sublimetext3

However I am working on a 100% standalone version which has been created but I’m adding more features and better output options before I release it on Package Control - but maybe I’ll go ahead and release it now or in the next few days before everything is 100% done ( it’ll still work but not all of the features will be in place ) and package control will auto update when done…

Edit:


I went ahead and uploaded it for now so you could see it as is…

Add this repo using package control: https://bitbucket.org/Acecool/AcecoolCodeMappingSystem
Then go to install package and choose AcecoolCodeMappingSystem

You’ll need to manually update it using Package Control - Update Package - as updates come out ( or maybe package control does this manually when you start Sublime Text with repo packages - not sure… )…

This will give you an idea of what it is what’s possible when you have a nice overview of your code without splitting the view into separate snapshots… and custom mappers can be made… Drop them into Packages\User\AcecoolCodeMappingSystem\maps\ using the filename of ext.py for now… they will replace the defaults… I’m remapping so it won’t use that naming system anymore for the most part however I may still make it available as a last resort later on…

A lot of changes are being worked on so expect changes in the callbacks, and some are going to be removed ( such as the OnSetupConfig )

0 Likes