Home Download Buy Blog Forum Support

Always centered cursor

Re: Always centered cursor

Postby phillip.koebbe on Mon Jan 23, 2012 2:44 pm

Thanks for the explanation, quodlibet. I wasn't so much interested in how well it works out for people, so the notion of trying it out for myself is really sort of moot. I was more interested in why someone would use it. The idea of writing prose makes sense. I don't write prose or any type of literature, so the concept of distraction-free writing is not something I've ever given much thought to.

To be fair to the suggestions that I try it out myself, I did put the plugin in place. I quickly noticed the issues with selection. That alone would be enough to keep me from using it while trying to work. It would drive me bonkers and be a major distraction.

Neat stuff. One learns a lot by asking questions. Thanks for the answers.
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: Always centered cursor

Postby quodlibet on Mon Jan 23, 2012 6:44 pm

castles_made_of_sand wrote:You might get a cheap improvement by using the on_modified event instead.


Thanks for the input.

Using the on_modified event is what I originally was planning to use and the code that facelessuser provided. I switched to on_selection_modified because that was closer to the behavior I wanted. I knew that mouse-selection would be a disaster, but it doesn't bother me; I love scrolling with the keys with on_selection_modified. I have thought that it might be possible to put together a function (or series of functions) that centers the cursor on_modified, as well as every command that potentially moves the cursor up or down. But maybe that would be rewriting the on_selection_modified function :)

castles_made_of_sand wrote:`if view.match_selector(0, 'text.plain'): ...` can restrict to only text files.


Restricting it to text files or related syntaxes (markdown, textile etc.) is in the TODO, but it's a little more complicated than that. For this plugin to "work" properly, it needs a specific theme as well. And, as far as I can, tell plugins can't override a user's theme settings. (I derive this information from the fact that the "org mode" plugin doesn't do this, either.)

castles_made_of_sand wrote:Check out the `Idle Watcher` example at http://www.sublimetext.com/docs/plugin-examples, though you'll need to translate the example from ST1 to ST2.


I'll take a look at 'Idle Watcher', but I think a second is maybe half-a-second too slow for this purpose.

phillip.koebbe wrote:I quickly noticed the issues with selection. That alone would be enough to keep me from using it while trying to work. It would drive me bonkers and be a major distraction.


Writing code with this plugin drives me bonkers. But writing prose is a whole different beast.

To put it another way: what I call a line when I write code, I call a paragraph when I write prose. The semantic units are utterly different.

Alex
quodlibet
 
Posts: 554
Joined: Sat Jun 18, 2011 5:53 pm

Re: Always centered cursor

Postby Kensai on Thu May 17, 2012 8:08 pm

I'm a just a writer, not a coder at all. This functionality is very useful. However, I have been wondering ...

I recently added BufferScroll to my install of ST2 so I can have a single file cloned over multiple pane which will all scroll with me. One of the points of this behavior for my work is so I could, for example, set up with 3 columns and focus on the middle one while I work which would give me a column worth of text front and back of the point I'm working at. Very useful for me most of the time as I'm trying to make things flow into each other, agree with each other, etc.

Now the typewriter scrolling you have with this code works only to center the cursor in the first panel. If you try typing in any other panel, things get all wonkey, similarly to how things go when you try to make mouse selections (which, incidentally, is no problem for me, just thought I'd try it out to see for myself since reading of it in this thread). The most ideal situation would be for it to work in any panel you chose to place you're cursor, for a couple of reasons. First, I think the optimal default mode here is to be able to input text in the second panel and have 3 or 4 columns of sync scrolled material presenting a good panorama of the surrounding text. Second, I know there will be times when you'll see something in one of the panes you aren't currently inputting to that needs to be changed or expanded, and it will often be a great deal more useful to simply be able to click over to a spot and just start typing without things going crazy.

Regardless, this is useful as is, thank you. Just not optimal yet.

Kensai
Kensai
 
Posts: 33
Joined: Mon Aug 24, 2009 8:19 pm

Previous

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests