Sublime Forum

Minimap, editing space history, spaces to tab

#1

Hi Jon

  1. Love the minimap, but when there are very long lines (I do not use wrap), it becomes unusable. I think it’s b/c you try to fit the entire horizontal buffer into the minimap.

Vertically, you seem to impose a maximum zoom out level. On long documents, the minimap will scroll up and down. I think you should consider doing the same horizontally.

In fact, make the maximum zoom out configurable. This way, the user can control exactly how readable he wants the minimap to be, including infinite zoom, which tries to fit the entire document into the minimap.

Personally, I think the zoom out should always be dictated by the length (height) of the document, regardless of how wide the longest line may be. Make the minimap pan left and right if necessary. But maybe others disagree, so you can make that configurable, too. (minimap tries to fit height | minimap tries to fit height or width, whichever is greater)

  1. I don’t know if this is a feature, but I’d like to have sublime remember WHERE my edits are. Very often, I want to go back/forth between the spots I recently made edits to. Sometimes, I would hit undo edit just so I can go back to the previous spot(s) and hit redo to go back to where I am. I know I can set bookmark but I never remember to do that.

Speaking of bookmarks, can you show them in the minimap?

  1. Is there a convert leading spaces to tabs plugin? I did not see it on sublimetextwiki. It’s actually a non trivial problem if you want to be smart about it and not just replace, say 4 spaces with 1 tab. I don’t want to tackle it, considering I don’t even know python :smile:

thanks

0 Likes

#2

Good suggestions. Especially want to support the display of bookmarks in the minimap.

0 Likes

#3

+1 to show bookmarks on the minimap

That would be a very useful feature.
In the meantime, check out the CTags plugin. There is a “jumpBack toLastModification” command that you’ll find useful. It only goes back though, not forward. And I don’t think it works on new files (has to be saved at least once).

The minimap is much better at handling long lines now. Is there a chance we’ll ever be able to manually zoom it in/out or have more control over the zoom level somehow? I’d like to be able to have its width in proportion to my vertical ruler

0 Likes

#4

You can change minimapMaxWidth in Application.sublime-options, does that satisfy what you want for the second point? I’m not planning on adding manual zoom control, but I’ve got nothing against adding a setting to control the maximum zoom amount.

0 Likes

#5

When I zoom the text in or out, it will also affect the minimap. What would be nice to have is to be able to zoom the document text and the minimap separately.
I can live without it, but the minimap is the most obvious, coolest Sublime feature (that new users see) yet it’s also the least configurable.

By the way the minimap click-to-scroll doesn’t work on large documents (when it’s large enough that the minimap itself has to scroll)

I also just found another small ‘bug’, that I don’t care about :smile: : you can change the font size separately for each opened documents, but not for two views of the same document, even though the font size is changed through the “view” API (which, to me, would mean that it should only apply to the current view)

0 Likes

#6

It should be working, just perhaps not how you expect. This is a fundamental issue, there’s no way click-to-scroll can be in implemented in a manner that satisfies all reasonable expectations when the minimap itself has to scroll. This is why click-to-scroll used to be disabled. I think there are older posts on the forum that explain the issues in more detail.

Yeah, I’m aware of this, and I’m planning to just leave it - assuming that all views into a buffer use the same font allow a few things to be more efficient, which is a worthwhile trade off in my eyes. I’m glad you don’t care about it :slight_smile:

0 Likes

#7

I found the thread, I understand now.

Right now the minimap is very useful to me but only for one thing: seeing Find results.

I’m trying to get more mileage out of it…

0 Likes

#8

Maybe if I had 20/20 vision I could make out enough details in the minimap to actually use it as a map, but as it is I use it mainly to a) jump around quickly and b) see where findall results are approximately. (as it it, if I could I would make the minimap vertically fit the entire buffer length.)

Now maybe if the minimap text were brighter. I have white text on dark background and the text in the minimap is about half as bright as the main text. Is that something you (Jon) do deliberately, or is it an artifact of the zoom.

I agree with gpfsmurf, it’s a cool and obviously unique feature that should be exploited to the fullest.

Btw, from what gpfsmurf said above, you can zoom in/out the main text and have two views on the same file? How do you do that? thanks.

0 Likes

#9

personally, i think the minimap is ok, otherwise i wouldn’t have use it. i tried switching on and off the mini-map (alt+m) and realized that for most of my files it gives me the ‘feel’ for my location on the code, and the ‘feel’ of the edited code structure. i say ‘feel’ because even with sharp eyesight you don’t really see anything detailed there, but it gives something very important - a ‘feel’. so, i like it (even) as it is.

from what i have read here, i am curious about how it was if i was able to zoom in and out of the minimap, or better of the main view - if i was able to do this ,you can say, there is no need for minimap, i can open the file on 2 views and to zoom out on one of them (like the minimap) and zoom in/out as much as want on the other view (in which i edit the code), if i could also ‘lock’ the views to scroll together… (again, like the minimap). anyway, it worth thinking if those abilities are worth it, and if people here see any actual/productive advantage of having it.

vim.

0 Likes

#10

You can zoomIn and ZoomOut in main view :smile:
I added that to the PowerUser package, so u can download that and use it or just copy and paste code from it… really I just found it in forums so u can search for that if you like.

Also in the comments I added an autohotkey script so u can zoomin/zoomout with ctrl+mwheelup/down :smile:

now the mainview is my minimap :smiley: and I can zoomIn/ZoomOut whenever I want :smile: (I need to add “restore to default zoom” function tho lol)

0 Likes

#11

Nice, EJ12N

I nodded your code a little to take into account the :noantialias option

class ZoomInCommand(sublimeplugin.TextCommand):
   def run(self, view, args):
      current_font = view.options().get('font')
      (font, aa, dummy) = current_font.partition(":noantialias")
      (font, dummy, size) = font.partition(" ")
      new_size = int(size) + 1
      new_font = font + " " + str(new_size) + aa
      view.options().set('font', new_font)
      print "set new font to: " + new_font

class ZoomOutCommand(sublimeplugin.TextCommand):
   def run(self, view, args):
      current_font = view.options().get('font')
      (font, aa, dummy) = current_font.partition(":noantialias")
      (font, dummy, size) = font.partition(" ")
      new_size = int(size) - 1
      new_font = font + " " + str(new_size) + aa
      view.options().set('font', new_font)
      print "set new font to: " + new_font
0 Likes

#12

GJ man :smiley:

[quote=“barty”]Nice, EJ12N

I nodded your code a little to take into account the :noantialias option

[code]
class ZoomInCommand(sublimeplugin.TextCommand):
def run(self, view, args):
current_font = view.options().get(‘font’)
(font, aa, dummy) = current_font.partition(":noantialias")
(font, dummy, size) = font.partition(" ")
new_size = int(size) + 1
new_font = font + " " + str(new_size) + aa
view.options().set(‘font’, new_font)
print "set new font to: " + new_font

class ZoomOutCommand(sublimeplugin.TextCommand):
def run(self, view, args):
current_font = view.options().get(‘font’)
(font, aa, dummy) = current_font.partition(":noantialias")
(font, dummy, size) = font.partition(" ")
new_size = int(size) - 1
new_font = font + " " + str(new_size) + aa
view.options().set(‘font’, new_font)
print "set new font to: " + new_font
[/code][/quote]

0 Likes

#13

it’d be really cool if you can somehow keep the current viewport fixed as much as possible. for ex, as I zoom out, my current line moves up and the viewport on the minimap moves down. I’d like to have the viewport adjust so my current line stays at about the same place on the visible screen as long as possible. hope you understand what I mean.

don’t know enough about the API to know if that’s doable.

btw, have you noticed sublime’s mem usage grow 2x to 3x once you’ve zoomed in and out a few times?

0 Likes

#14

It’s probably some kind of font cache

0 Likes