LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2024, 02:54 AM   #1
MakeTopSite
Member
 
Registered: Jan 2021
Location: EU
Distribution: Ubuntu, openSUSE Leap & TW, Devuan, Debian
Posts: 290

Rep: Reputation: 3
gvim can't find some matching braces in jsx code


It jumps to braces which are apparently wrong. I suppose it's a bug. Are there please some more reliable alternative editors ?
Code can be compiled (without any errors or warning).
 
Old 01-11-2024, 03:19 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,033

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
would be nice to show an example. At least.
 
1 members found this post helpful.
Old 01-11-2024, 03:27 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Something like this?
Code:
if (condition) { puts("literal '}' in string"); }
               ^                ^
 
Old 01-11-2024, 04:40 AM   #4
MakeTopSite
Member
 
Registered: Jan 2021
Location: EU
Distribution: Ubuntu, openSUSE Leap & TW, Devuan, Debian
Posts: 290

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by pan64 View Post
would be nice to show an example. At least.
Well but I need anonymize the code before posting here.
 
Old 01-11-2024, 04:41 AM   #5
MakeTopSite
Member
 
Registered: Jan 2021
Location: EU
Distribution: Ubuntu, openSUSE Leap & TW, Devuan, Debian
Posts: 290

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by NevemTeve View Post
Something like this?
Code:
if (condition) { puts("literal '}' in string"); }
               ^                ^
No this works as I expect.
 
Old 01-11-2024, 04:44 AM   #6
MakeTopSite
Member
 
Registered: Jan 2021
Location: EU
Distribution: Ubuntu, openSUSE Leap & TW, Devuan, Debian
Posts: 290

Original Poster
Rep: Reputation: 3
Code:
function func(props) { // I press % key on this brace
if (condition) { puts("literal '}' in string"); }
// } gvim jumps here but should not
// }
}  // I expect gvim jumps here
 
Old 01-11-2024, 05:20 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,033

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
adding the plugin matchup (or match-it) and setting the language will solve it.
 
1 members found this post helpful.
Old 01-11-2024, 06:34 AM   #8
MakeTopSite
Member
 
Registered: Jan 2021
Location: EU
Distribution: Ubuntu, openSUSE Leap & TW, Devuan, Debian
Posts: 290

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by pan64 View Post
adding the plugin matchup (or match-it) and setting the language will solve it.
It works thank you.

Unfortunately it only works one time. When I press % key repeatedly, it does nothing. I need close edited file and reopen it to work it again.
 
Old 01-11-2024, 06:55 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,033

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
I don't know what did you make and how did you try, it worked for me perfectly. Probably you only need to restart vi.
 
Old 01-14-2024, 01:26 AM   #10
MakeTopSite
Member
 
Registered: Jan 2021
Location: EU
Distribution: Ubuntu, openSUSE Leap & TW, Devuan, Debian
Posts: 290

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by pan64 View Post
I don't know what did you make and how did you try, it worked for me perfectly. Probably you only need to restart vi.
I've installed matchit according to this documentation: https://www.vim.org/scripts/script.php?script_id=39

I've restarted vim many times.

Last edited by MakeTopSite; 01-14-2024 at 01:35 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Proposed enhancement for gvim.desktop (package xap/vim-gvim). Didier Spaier Slackware 3 10-02-2016 11:48 AM
[SOLVED] regex pattern matching, with open braces or quotes being closed ansh007 Linux - General 11 08-31-2016 02:10 AM
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 05:30 PM
[SOLVED] Matching two tables of non-matching sizes astroumut Programming 3 03-03-2011 07:05 AM
Perl Script needed to be reversed to output matching, not non-matching 0bfuscated Programming 2 07-20-2010 10:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration