Closed xcme closed 3 years ago
do you mean that typing (|(text)
must give you ()(text)
? it doesnt do it, because auto-closing is blocked at that position (|(
.
and 'why it's blocked'-- code thinks that you type some complex code, it ignores ALL after current+next char ((
.
No, I mean if my current state is (|text)
where | means current cursor position and I press ( it gives me ((|text)
as expected.
But if my current state is (text|)
and I press ) then editor ignores it and gives me (text)|
that was made "like in other apps", ie auto-close-code checks next char, and if it's 'bad char' is don't auto-close. it's typing of (
.
on typing )
auto-close-code doesn't work.
ah, typing )
. yes - it skips chars depending on next char.
ah, typing
)
. yes - it skips chars depending on next char.
But is it the right way? If you have func1(val)
and then decide to edit it to get func1(func2(val))
you go inside the brackets, put the caret before val
and type func2(
. Then you place the caret after val
and type )
but nothing happens. To make it work you have to put the caret behind the bracket )
before closing it.
If you have something like func1(func2(val1), func3(val3, val2))) it's very easy to get confused here and lost one 'right' bracket. I see no reason to skip )
because in that way auto close works as auto ignore :) And I'm asking if anyone sees it.
will think. BTW, other editors, how do they work (maybe VScode,Atom, EmEditor, Subl)?
Notepad++ doesn't skip right )
, so I get ((test))
. Auto-close works
Made a fix! now if f(|)
it skips the )
,
if f(text|)
it do not skip.
But what do you personally think? Why ST skips right )
to?
We can ask other guys for that @kvichans @JairoMartinezA @OlehL @tmsg-gh @halfbrained
ST skips right ) maybe like Cud before-- they didnot get report about it
Maybe because if you are just typing f(arg).field
, without skipping you will get an extra bracket f(arg).field)
?
Maybe because if you are just typing
f(arg).field
, without skipping you will get an extra bracketf(arg).field)
?
Hmm. Good point! But if you really type it that way you don't really need auto-completion then, do you?
Hmm. Good point! But if you really type it that way you don't really need auto-completion then, do you?
I do and I do :) (kisses himself) But still this 'smart behavior' hinders me more then helps :D so I'm quite happy with the change
@xcme done in 1.128.5. is it working ok?
Scenario:
1 - Select many carets as follow:
2 - Write (
, CT just puts the pairs of brackets in the first position:
@JairoMartinezA, yes but it isn't a new issue. Old versions have the same behaviour. It makes decision for the first line and then applies it for all the rest.
@Alexey-T now it's OK but can we also fix the issue above?
Thanks for reporting, will try to fix
@JairoMartinezA Pls post your user.json. I cannot repro this- I got ths
did carets have selections? my picture- not.
Pls new issue.
@Alexey-T try put caret exactly as you see on the first screenshot. It depends on if the whitespace at left or at right.
beta in http://uvviewsoft.com/c/
Beta version is:
updated beta again. That's why Jairo's picture was, when carets 2...max didn't enter (
. code found AT LEAST one caret which gave auto-close. if it was found, normal typing of '(' is blocked.
not sure how to change logic here.
OK,I fixed it. Jairo's picture case--solved now. Bt updated!
The current way to deal with autocomplete is ok for me, when there are only trailing spaces, CT autocompletes with closing brackets, but when there is a mix of spaces and chars after carets ignore autocompletes. 👍
current code makes pair ()
for all carets or nothing.
not sure how to change logic here.
Another idea:
As far I understand the goal of auto closing, it helps type CODE which could be performed quickly. On the other hand, multi-selection is needed for editing TEXT and is usually performed much slowly and accurate. So, it's OK to disable all busters for multi editing.
What do you think?
And another idea:
So, if all the lines have the same pattern then auto close works according user settings. If not, it should be disabled. If it's too difficult to analyze each line - just disable it with multi-selection (first idea here).
Made a change, agree that auto-pair is not needed for mul-carets
Beta updated
Checked the behaviour in last beta an for me it looks good.
Thanks for finding this. seems solved.
Type text and then put bracket ( directly in front of it and ) directly behind. You will get (text). Then put another pair of brackets () in the same way. You will get ((text) because the right ')' is ignored. The same behaviour is in Sublime. But why? I like autoclosing but find this approach a bit annoying. But true coders might be OK with that because they know something I don't know. Could anyone, please, explain?