Ace Editor mark lines Jumpscroll to marked lines, Problem appendchild to line nr gutter - editor

i am playing with ace editor
i am trying to mark lines
and place an up down button at the marked line
for easy scroll up or down to the next marked line
mouseclick left of the line number to mark / unmark lines
it is working a little upto line 50
but if you scroll things are messed up
the code is a bit big 11000 lines
maybe you would try it at
plnkr.co/edit/ZEkhoGgs4ntDZzT0
or full screen at
run.plnkr.co/plunks/ZEkhoGgs4ntDZzT0/
fullscreen screenshot of ace editor with marked lines and easy scroll buttons
screenshot of ace editor with marked lines and easy scroll buttons

Related

How would one go about implementing the stock iOS emoji keyboard programmatically?

It seems there's two main sections:
Let's call them emojiCollection and bottomBar. bottomBar seems simple enough, a UIStackView that's horizontal, that contains a back to main keyboard button, backspace, and a bunch of categories in the middle.
emojiCollection is trickier for me to understand, and my questions are:
1) how would one have "sections" of emojis, where there is a title at the top that remains in place until you get to the next section. Is this all just one UICollectionView?
2) How would you go about highlighting the section in bottomBar to identify which section you're in.
3) Seeing that it's horizontal and extends past the screen, would it be placed in a UIView that has some width proportional to the amount of rows, or would it automatically keep growing?
EDIT: To answer Losiowaty's question, this is how I would like to build it:

Inserting a chevron into a button like Apple does?

I would like to find an efficient way to add chevrons to my buttons similar to how Apple does in iTunes. For example, in the image below, you can see a chevron after the text "See All" and "Terms and Conditions." Is there a unicode character that looks like this, or if not is there an easy way to achieve the same effect?
I tried searching for unicode characters, but all the chevrons I found were either too thick, too tall, or too small.
Note: I realize I could use auto layout with a UIImageView, but that seems like overkill, especially if I want center alignment of both elements as in the "Terms and Conditions" example below. That would involve something similar such as adding a superview to the button and the image, adding the necessary constraints to size it to the subview's frames, then aligning this new superview to the center. This would produce about 8 constraints with 3 views instead of ideally 2 constraints and a single view. Plus, it wouldn't make the chevron tappable. (Not a big deal on an iPhone because of the fuzzy finger matching, but in the simulator it's noticeable.)
I'm hoping there is any easier way to do this such as using a unicode character, or adding an image directly inside the button.
I just noticed they have similar icons on their website:
In this case, they created a custom font appleicons_text:
They then add the more class to any element that needs a chevron. The relevant CSS class that actually adds the chevron is:
.more:after {
font-family: as-AppleIcons;
content: ""
}
Note that the content looks empty, but there is actually a hidden chevron character near the second quote. If you have the font installed, you should presumably see the chevron icon. (Pasting that line into text edit will reveal a question mark character.)
Finally, they ensure that the as-AppleIcons will show in your browser:
#font-face {
font-family: as-AppleIcons;
url(assets/ac-appleicons/fonts/appleicons_text.ttf) format("truetype")
}
Note: I omitted a bunch of css code that wasn't directly relevant to this answer.
There is a possibility that Apple imported this font into iOS and is using an NSAttributedString to produce the same effect.
Update: It looks like there is an open source project that does something similar called Font Awesome with over 650 icons so far.

How to shift drawn text to top on UIView?

I am drawing text on a UIView using core graphics, the restriction with this is that when the UIView is fully drawn to the end i can't shift all drawn text above to create empty line at the bottom to draw new text. I don't want to use the UITextView and UITableView.
A visual explanation:
Suppose a have a view as below to draw the text-
So I am on the last line in this view and when this line is completely filled, I have to shift to one line below which is not there. What I want to do is to shift the whole screen text one line up (shifting out the first line from screen), to make space for new line.
This view is actually a larger one to provide scroll back, but to explain the situation I just mentioned so.
Is there any way to do so? Please suggest.
If you want to provide scroll back, it means that you don't want to shift the whole text up to make space for one more line. Because in doing so you will lose the first line.
What you need to do is resize the view and make it bigger, this way you have more space to draw some more lines.
I would advise you to use a UITableView instead. It's too much work to draw the text by yourself and provide scrolling and all for no apparent advantage. Maybe just so you can learn how to do it :)

How do I change the speed of text motion when paging up/down in Sublime Text 3?

When I'm editing a file in Sublime Text 3, if I press Page Down, the text slides down to the next page. How do I change the speed (or not let it scroll at all)?
Go to Preferences->Settings - User
Add the line:
"scroll_speed": 1.0
(Note: this is a JavaScript file. If you add the above line at the end, don't forget to add a comma to the previous line; if you add the line in the middle somewhere, add a comma!)
For the speed (From the Default Settings):
// Set to 0 to disable smooth scrolling. Set to a value between 0 and 1 to
// scroll slower, or set to larger than 1 to scroll faster

Implementing 'About' view in iOS using Xamarin Studio

How do I autosize Labels so they contain all the text, but don't take up any more space then necessary and stay vertically spaced the same whether the user is in portrait or landscape mode?
I am trying to implement a simple control that displays information about my app in paragraph form. It will have Headings, and Paragraphs. I am having problems correctly positioning things relative to each other and have them auto adjust as the user rotates their device and changes orientation.
In the example below, I have 4 labels. 2 are for headings and are bolded with larger font, 2 have standard font, but are long and have lots of text. I want to be able to have all the text visible on each label and have none cut off. I also, want all the labels as close as they can be to each other. So, their containing rectangles have to change based on all of the other label's height. So when I change from landscape to portrait orientation, the paragraphs may take 8 lines instead of the 3 lines it takes in landscape mode. I want the controls to shift to have the same amount of Vertical white space between each of them.
Here is a sample:
About this program
Thank you for downloading this app. It is designed to do some
wonderful things and will make all your wildest dreams come true.
Help
In order to use this program, use the tab bar at the bottom of the
screen to select what you want to do. When the view opens, slide the
items across the view until you are done.
I'll quote Mattt Thompson:
This is the type of thing TextKit was created for. Check out Wenderlich's tutorial for an easy start.
I followed the advice in Jason's comment and it works like a charm:
Try using a UIWebView and embedded HTML for your content. – Jason Oct
30 at 19:23
Thanks Jason !!

Resources