texworks icon indicating copy to clipboard operation
texworks copied to clipboard

Fix/Enhance code completion

Open GoogleCodeExporter opened this issue 10 years ago • 3 comments

Currently navigation through the placeholders (bullets) in code completion
templates is bound to the key combination Alt+Tab. This combination is
usually used by the operating system to switch between different
windows/applications. use-ctrl-tab-to-navigate-completion-placeholders.diff
patches this so that Ctrl+Tab is used for navigating the placeholders instead.

xb_beta.diff fixes a problem in the code completion template file
tw-basic.txt (\betav is replaced by \beta)

Original issue reported on code.google.com by st.loeffler on 15 Jan 2009 at 6:31

Attachments:

GoogleCodeExporter avatar Mar 14 '15 10:03 GoogleCodeExporter

I have checked in these fixes; thanks.

The \betav typo looks like it dates all the way back to the CommandCompletion 
file from TeXShop!

The skip-to-next-placeholder function has been made platform-dependent, as 
Ctrl-TAB won't work for the 
Mac; there, Qt maps the Command key to the Ctrl modifier, and Cmd-TAB what OS X 
uses to switch applications. 
So I've left it as Alt-TAB there. Hope this will now work better for people.


Original comment by [email protected] on 15 Jan 2009 at 6:58

  • Changed state: Fixed

GoogleCodeExporter avatar Mar 14 '15 10:03 GoogleCodeExporter

Bug: code completion templates containing non-text characters don't behave as 
expected.

The definitions
--:=\textendash
<-:=\leftarrow

result in the latter not being recognized. This probably is a bug in
CompletingEdit::handleCompletionShortcut() or TWUtils::findNextWord() which 
don't
recognize sequences of non-word characters properly. Hence "-" is used for the
completion lookup instead of "<-", resulting in the expansion to \textendash.

Original comment by st.loeffler on 15 Jan 2009 at 7:01

GoogleCodeExporter avatar Mar 14 '15 10:03 GoogleCodeExporter

Yes, this is a problem; I hadn't noticed there were such entries in the list. 
(Is that in the default list, or is it an 
addition?) The completion code was designed to operate on "words", with support 
for the leading backslash and 
for -- hacked in as special-case exceptions, but it won't recognize arbitrary 
strings of non-wordforming 
characters.

I've reopened this issue for now, as this is worth thinking about, but it's not 
obvious to me exactly what the 
"best" behavior would be.

Original comment by [email protected] on 15 Jan 2009 at 7:19

  • Changed state: Accepted

GoogleCodeExporter avatar Mar 14 '15 10:03 GoogleCodeExporter