Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

A_caret fails in Sublime text editor



  • Please log in to reply
5 replies to this topic
A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

A_caret x/y always gives me a constant value no matter where I position my cursor in Sublime text.

 

For example, try this code while running Subilme text

#x::Msgbox,% "x -- " A_caretx "`ny -- " A_carety

You always get the same value for the variables. 

 

Why is that ?? Is it because Sublime text has the innovative Multiple-cursors feature ? and if that's true , any workarounds ..


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


faqbot
  • Members
  • 997 posts
  • Last active:
  • Joined: 10 Apr 2012
That is not specific to ST but also browsers and many other programs that use "non standard methods". Sometimes you can use COM or ACC to find the position. There will be other commands that don't work with ST (or other programs) either.

A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Examples please grin.png


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
✓  Best Answer

The documentation says:

 

Note that some windows (e.g. certain versions of MS Word) report the same caret position regardless of its actual position.

 

You can draw a line and call it a "caret", but as far as the system is concerned, it's not a caret unless you called CreateCaret to create it and SetCaretPos to position it.



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Thanks for the explaination, Lexikos . Bit sorry that nothing can be done.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


JnLLnd
  • Members
  • 193 posts
  • Last active: Jul 23 2015 02:15 AM
  • Joined: 30 Dec 2007

I read about this discussion in the ClipJump thread.

Is there a way to find out if the A_CaretX/Y values are accurate? That way, a script would know when to rely on them and when to use a fall back method.