how to enable horizontal scrolling in atom editor using keystrokes? - atom-editor

I have long lines of code. But i don't want to use soft wraps because it breaks the nice formatting - and there isn't enough space on my screen anyway.
I want to scroll horizontally - left or right based on keystrokes for example:
ctrl + right arrow/ ctrl + left arrow
What is the command for horizontal scrolling?
Or at least be able to press the scroll wheel of the mouse and drag left or right.. like it's possible in the browser sometimes.
Right now i do it with the horizontal bar from the bottom of the editor. It's soo time consuming. Thank you:)

Found it! It's actually very simple: use shift + scroll wheel.
Couldn't find a keyboard-only solution yet.

Related

Why is my input submit icon placed to the left of the input text box?

I am trying to understand what's going on with my Google Custom Search Engine in the sidebar on the left here: http://bit.ly/1bmsJsi
I want the icon with the magnifying glass on the right of the text box instead of on the left. As far as I can tell looking at the code and my CSS, that's what ought to happen.
If someone can help me figure out why it goes on the left I would greatly appreciate it!
Put the item floating left BEFORE the item it's floating left beside (currently it's after it).

Flex: preventing tree's vertical scroll bar overlapping view

I have an mx:Tree, but when the vertical scroll bar appears, it overlaps the content of the tree (odd that the horizontal bar does not). That might be acceptable for the text, but the stripe that I create using the item renderer, for certain items, seems to make it an anathema to the QA guys. How can I keep this from happening?
I have an idea for a workaround: I could make use the item renderer to stop the drawing a little bit short of the right side of the view (not that I can reliably get the width of a scroll bar) but I can't even figure out how wide the displayable part of a tree is--all the properties of a tree seem to be about its entire width, which includes the entire area coverable using the horizontal scroll bar. However, the blue stripe signifying a selected item doesn't seem to have that problem--it stops short of the scroll bar. In any case, when trying to find the displayable region, I don't know if I could handle the added complication of when the horizontal scroll bar is moved. Much better if someone could tell me how to put the veritcal bar outside the displayable tree area (or shrink the displayable area, of course). Thanks.
I'm using the Flex 3.5 SDK
I was able to find the solution when researching horizontal scrollbar issue on list and tree component. The blog to which it links eventually shows a kind of hacky solution (in the readers' comments) that shows how to make sure that none of the drawing is done beyond a certain boundary.

QTextEdit: scroll down automatically only if the scrollbar is at the bottom

There's a QTextEdit that displays quite a lot of text. It is NOT editable. Suppose I want to read something around the beginning, scroll up, but then a new line is added and the scrollbar automatically goes to the bottom. I experience similar problems when using various programs (regardless of the language they were written in). How does one deal with this problem?
The behavior I want when a new line is added to the text:
if the scrollbar is at the bottom, scroll down automatically.
if the scrollbar is elsewhere, don't scroll
I suppose that
ensureCursorVisible()
is not the solution, since the QTextEdit is not editable, the user won't click inside it, and the position of the cursor is not the same as the position of the vertical scrollbar.
I would make Scroll bar position listener, which will remember position on scrolling (and also check is it at the bottom or not).
Then, when new line is added, check is it at bottom, if is scroll down, if is somewhere else then scroll back to that position.
Check this QScrollBar, you can grab it from QTextEdit via horizontalScrollBar() and verticalScrollBar().
More concrete, I would connect slot with signal from QScrollBar - valueChanged(int value) and play with values as it is described here.
It is not necessary to connect a scrollbar listener. Just query the scrollbar before appending text:
QScrollBar *scrollbar = textedit->verticalScrollBar();
bool scrollbarAtBottom = (scrollbar->value() >= (scrollbar->maximum() - 4));
int scrollbarPrevValue = scrollbar->value();
The "minus 4" hack in scrollbarAtBottom is necessary since ensureCursorVisible() does not scroll exactly to the bottom, but some fixed amount above. Check it with your font sizes.
Now you can insert the text:
textedit->moveCursor(QTextCursor::End);
// begin with newline if text is not empty
if (! textedit->document()->isEmpty())
textedit->insertHtml(QStringLiteral("<br>"));
textedit->insertHtml(QStringLiteral("My text here."))
After that operation, either scroll to the bottom, or fix the scrollbar such that it does not move at all:
if (scrollbarAtBottom)
textedit->ensureCursorVisible();
else
textedit->verticalScrollBar()->setValue(scrollbarPrevValue);

menu bar where the width of the text is variable

I need to know how do I get the menu where the background depends upon the text entered. As in the image, the background gets expended irrespective of the text in the menu item. Also the sides of the background image should not get distorted.The image is here.
I still tend to use the sliding doors technique for this kind of thing.
http://www.alistapart.com/articles/slidingdoors/
Although there is probably a newer and more elegant solution these days.

move image in text area in flex

alt text http://img31.imageshack.us/img31/1183/tedit.jpg
Hi Guys,
I am trying to make a text editor in Flex.
i can move image on mouse click.
Problem is it moves with the key up or down handler. But it moves out of text area after the last line in textarea. And it also doesn't move with scroll.
Pls give suggestions for these problems.
Thanks.
Regards,
Shivang
You may want to increase the white space of your 'text editor'. Just have numbers up till person entered text. That way when you move to the bottom you are not moving outside of the textArea.
would need more example of what is going wrong with the key up or down handler. What events are you trying to capture? How are you dragging the image?
good luck.

Resources