using callwords when caret isn't at colum 1

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

using callwords when caret isn't at colum 1

Postby syrupcore » Wed Jul 30, 2008 8:18 am

If you hit tab and use a callword that has content in the "Insert after caret", the snippet is inserted at the beginning of the line and includes a pipe (|) with some portion of the snippet content missing based on the caret's current column position - 1. Here's a series of experiments inserting a snippet with "123456789" as it's content in the "Insert after caret" box. The first is with the caret in position 1 and the rest are hitting and additional space time each.

Code: Select all
123456789
|23456789
|13456789
|12456789
|12356789
|12346789


The second line is a single space so "1" is removed, the third is two spaces so "2" is removed. The | is actually ending up where the cursor is supposed to be according to the snippet. So, if you change the 123456789 snippet to be "1234" in "before caret" and "56789" to "after caret" you get:

Code: Select all
one tab: 1234|5679 with the caret blinking between 7 and 9
two spaces: 1234|5789 with the caret between 5 and 7
anything position beyond 10 columns: 1234|5678 with the caret after the 8


Your cursor ends up as equal to: whatever your starting position was + the position of the caret according to the snippet.

Couple of other scenarios I came across:
If the snippet only has content in the "before" box
or
If the snippet has a linebreak in the before or after boxes, it renders fine from any position but it is rendered starting at column 1. For instance, try it with the included javascript function() snippet.


I'm using 9.0.0.97.

Thanks,
Will
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when cursor isn't at colum 1

Postby syrupcore » Wed Jul 30, 2008 8:40 am

Just to add, snippets called when not on column 1 via keyboard shortcuts work just fine. Again, try the js function snippet included in the library.

Actually, the cursor returns to the 1st column in that example, no matter where you call it from. I reckon it should insert to the same column as the snippet text but I'm getting ahead myself here. :)
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when cursor isn't at colum 1

Postby Karlis » Sat Aug 02, 2008 6:09 pm

I'm afraid I do not get it. Or it does not happen for me. Any chance of having a wink video?
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
Karlis
Site Admin
 
Posts: 3601
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe

Re: using callwords when cursor isn't at colum 1

Postby syrupcore » Sun Aug 03, 2008 2:01 am

User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when caret isn't at colum 1

Postby syrupcore » Sun Aug 03, 2008 2:12 am

to recreate this...

  1. Create a snippet with "123456789" in the "insert after" box.
  2. Assign a callword to this snippet
  3. In the editor, type the callword and hit ctrl+J (should render fine)
  4. New line, hit space and then type the callword and hit ctrl+j (you'll be missing the 1 and there will be a | instead)
  5. New line, hit two spaces and then type the callword and hit ctrl+j (you'll be missing the 2 and there will be a | instead)

Where ever the cursor is in relation to column 1, that's the number that will be replaced with a pipe. Behavior is slightly different when there's text in both the before and after boxes - give it a try. Also, when it's all in the "before" box, the snippet is rendered on column 1. It should, I think, be rendered where the caret is when it's called (which it does if you use a keyboard shortcut instead of a callword).

Will
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when caret isn't at colum 1

Postby syrupcore » Mon Aug 04, 2008 6:38 pm

Found it... I think. Works fine when tabbed if "constrain cursor to text" is UNchecked.
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when caret isn't at colum 1

Postby syrupcore » Wed Aug 06, 2008 8:37 am

I don't know if this is related but ran into this tonight.

If you create a snippet with this in the before box
Code: Select all
<form action="form-action">
   <fieldset>
      <legend>


and this in the after box
Code: Select all
</legend>

      <label for=""></label>
      <input type="text" id="" name="" />

      <button type="submit" value=""></button>

   </fieldset>
</form>


The <legend> line comes out wacky.
Code: Select all
<lgend>|</legend> 


Doesn't matter from which column you call the snippet. This happens if the "Constrain Cursor to Text" is checked or unchecked. The snippet works fine if you use a keyboard shortcut instead of a callword.


Hope all of this stuff is helpful and not annoying.

Thanks,
Will
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when caret isn't at colum 1

Postby syrupcore » Sat Aug 09, 2008 5:19 am

hello? able to recreate?
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when caret isn't at colum 1

Postby Gatis » Fri Aug 15, 2008 5:35 pm

Sorry for the delayed reply.
Yes, we could reproduce the problem. However, the problem could only be reproduced if the option "Constraint cursor to text" was enabled.
We need to do some more testing, but the fix seems to be alright, and it will be included in the next update.
If you, syrupcore, are willing to see if it works fine now, please drop an email at our support email address and we shall give you the test version before next update.
Kind regards,
Gatis Avots
Gatis
Blumentals Software Developer
 
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: using callwords when caret isn't at colum 1

Postby syrupcore » Sat Aug 23, 2008 8:25 pm

Thanks gatis. Email sent.
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa

Re: using callwords when caret isn't at colum 1

Postby syrupcore » Fri Oct 03, 2008 11:08 pm

note: this has been resolved in v9.0.99

Thanks guys!
User avatar
syrupcore
Top Contributor
 
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 41 guests