Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More context-aware autocomplete parenthesis #316

Closed
thatlittleboy opened this issue Sep 7, 2018 · 0 comments
Closed

More context-aware autocomplete parenthesis #316

thatlittleboy opened this issue Sep 7, 2018 · 0 comments

Comments

@thatlittleboy
Copy link
Contributor

Environment

  • TeXstudio: 2.12.11 (git_97bf709) -- Default settings
  • Qt: 5.8
  • OS: Windows 10
  • TeX distribution: MikTeX 2.9

Actual behavior

The auto-complete parenthesis function is nice, but it fails in very typical cases of use, demonstrated below:

% Simple example
\footnote{BEFORE first second third AFTER}

% Real life example
@article{abcd,
	title={The chronicles of ABBA and Beegees -- A bibliography},
	author={A. B. Charles},
	journal={Phys. Rev. B}
}

In the first example, the first word's parenthesis was set correctly but the second was not. Pressing the { key replaced second instead of putting parenthesis around it.
Note also a second { key later, the second word stored in the buffer came back out.

In the second, more relevant example, is in .bib files.
As you may know, it is not uncommon to have to "protect" capitalized words in the bibliography fields, more commonly in the 'title' field. In the case where you have two or more words to protect, the parser is just unable to recognize the context that it is still within braces (the outermost one from title={...).
Then, one would have to put the braces around the words manually.
(Yes, one can always protect the whole title, like

title={{The chronicles of ABBA and Beegees -- A bibliography}},

but I don't do that, and I don't believe that it's good practice either way).

Expected behavior

For the auto-complete parenthesis to be more context-aware -- for it to be more aware that it is still encapsulated in braces in (at least) the two examples above; instead of just checking if the nearest brace behind the cursor is a closing one or not (I'm guessing this is the approach now..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant