LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-10-2015, 12:10 PM   #1
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Rep: Reputation: Disabled
Gedit and Kate's serious troubles in C++.


Hi there,

It is Ubuntu 14.04. I have used Gedit for the past year or so mostly to write gnu fortran programs. Now I need to write code in C++ and immediately I got many serious problems. Let say I need to paste a chunk of code from another C++ program. Instead of pasting it in one place it would do it in numerous places which gives me a bunch of compile errors. I then installed kate and opened my file in it. Before I even saw any code I got pages and pages of strange output in the terminal and one of the lines really impressed me: "The application may misbehave" and misbehave it did. It is impossible to use because it mangles the code so badly I have to manually find places where it placed various chunks of code and remove them. The funny thing is that when I do search operation it goes through ALL files in the directory and finds similar patterns and lists them. It is a nightmare.

What is a good editor for C++ code? I would appreciate if people with experience would comment.

Thanks, -Alex

Last edited by AlexBB; 10-10-2015 at 12:16 PM.
 
Old 10-10-2015, 12:23 PM   #2
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: USA
Distribution: Lubuntu 14.04, 22.04, Windows 8.1 and 10
Posts: 6,282
Blog Entries: 4

Rep: Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842
Quote:
Originally Posted by AlexBB View Post
What is a good editor for C++ code?
I'm afraid I don't have any experience but would Eclipse, nano or emacs work better?

Regards...
 
Old 10-10-2015, 12:44 PM   #3
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Original Poster
Rep: Reputation: Disabled
Thanks, but I would prefer to hear from someone with direct experience: C++ and the editor's name, I guess. I just discovered one more problem. Apparently kate also inserted garbage into an unrelated file (written in fortran) and I had to edit it to clear.
 
Old 10-10-2015, 01:16 PM   #4
FredGSanford
Senior Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia 7 - Debian 10 - Artix Linux
Posts: 1,142
Blog Entries: 5

Rep: Reputation: 207Reputation: 207Reputation: 207
Take a look at geany....

http://www.geany.org/
 
Old 10-10-2015, 01:55 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
the copy paste issue is you having the mouse some place else when you r-click to paste

i do almost all my editing in kate ( was gedit ) and not had much trouble

but you do need to use your EYES and LOOK


but if you really HATE both

use "Emacs"
or the terminal program "VI"

you can even call gcc from within Emacs
 
Old 10-11-2015, 10:02 AM   #6
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Original Poster
Rep: Reputation: Disabled
John_W, thanks. I did some googling and discovered that anjuta has been designed specifically for C++, so I installed that. It is my second day with it now and it seems to be working. Very little trouble, if any so far. Thanks, - Alex
 
Old 10-11-2015, 01:44 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
anjuta
is a Development IDE

and not a text editor


though it dose have "code completion"

but syntax highlighting is basically in ALL of the editors
 
Old 10-11-2015, 02:25 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Vi/Vim.

/* Rant alert, directed at no one in particular... */

You can waste days and days trying to find and figure out how to use just the perfect integrated GUI desktop office editor for code editing, then hope the next round of new features does not break your use...

Or you can learn the very simple, powerful and always available shell/terminal based editors, which have the side benefit of working seamlessly and perfectly and simply within the total Unix-like environment of GNU/Linux. This means that as a by-product you get instant access to all those wonderful search and replace, sort, cut, paste, modify, script and custom on-the-fly filter tools - all for free, at your fingertips with zero additional hassle at all!

Of course that means you must work in a terminal window (ick! shudder!) and learn such difficult to remember navigational commands as cd and ls, and a few totally nightmarish modifiers like -a and -l, not to mention working through the built-in tutorial on the editor... and of course, you will need to organize your work and not rely on always having a pointy-clicky Open recent file... option to remember where it was for you .

But a day or two spent thinking about what you are doing vs days and days of ultimately fruitless search for just the perfect GUI application to do it for you seems like a small price to pay for a proven, reliable, simple, infinitely versatile and better way of doing things.

Of course there is that "old fashioned" stigma, and the loss of all that perceived pointy-clicky, if sometimes non-functional and cumbersome, GUI convenience...

/* End rant */

Last edited by astrogeek; 10-11-2015 at 02:31 PM. Reason: tpos, typs, typos
 
Old 10-11-2015, 07:58 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
@astrogeek :

Alos, vi/vim is avail on other *nix eg OS/X, *BSD, Solaris, HP-UX, AIX etc (definitely vi; probably vim depending...)
 
Old 10-12-2015, 10:01 AM   #10
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Original Poster
Rep: Reputation: Disabled
Well, on close inspection anjuta is even worse than Gedit and kate in mangling C++ code. I am desperate. I am wasting a lot of time trying to remove rogue pastes. I'm marking this thread as non-solved.

Anjuta also cannot search through the text. It freezes, changes the colour of the interface and then quits.

Also I wonder how could people release raw, untested editors like those?

I guess I will try to go back to VIM.

- Alex

Last edited by AlexBB; 10-12-2015 at 07:13 PM.
 
Old 10-12-2015, 02:48 PM   #11
Myk267
Member
 
Registered: Apr 2012
Location: California
Posts: 422
Blog Entries: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by AlexBB View Post
Well, on close inspection anjuta is even worse than [kateB]gedi[/B]t and kate in mangling C++ code. I am desperate. I am wasting a lot of time trying to remove rogue pastes. I'm marking this thread as non-solved.

Anjuta also cannot search through the text. It freezes, changes the colour of the interface and then quits.

Also I wonder how could people release raw, untested editors like those?

I guess I will try to go back to VIM.

- Alex
How is anyone supposed to help you when your description of these problems are so vague? What's a 'rogue paste'? Can you reproduce this issue you seem to invoke in every editor you touch? Without knowing anything about your specific problems, it's useless to suggest even more text editing programs for you to misuse.

Quote:
Originally Posted by AlexBB View Post
Also I wonder how could people release raw, untested editors like those?
Open source software doesn't come with a warranty.
 
Old 10-12-2015, 07:09 PM   #12
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Original Poster
Rep: Reputation: Disabled
To the last poster. What I am doing is converting gnu fortran program into an equivalent C++ program. So, I take a subroutine from Gfortran code, copy it and open the .cpp file. I find a place between two previously debugged C++ routines and paste what I have in clipboard. The code pastes there but I also find chunks of it a hundred lines below, fifty lines upwards, etc. Sometimes parts of it, like one line will be added to my previously debugged C++ lines, etc.

Is it a clear description? Obviously one cannot work like this. Interestingly I haven't had this problem when working on fortran code I moved chunks of code between the files, etc. What is the problem?

Thanks, - Alex

Last edited by AlexBB; 10-13-2015 at 03:20 PM.
 
Old 10-12-2015, 08:00 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
Also I wonder how could people release raw, untested editors like those?
gedit and Kate or Kwrite
are not untested !

they have been the default basic text editors for many years
also they ARE BASIC TEXT EDITORS -- for general use

converting FORTRAN to c++
f77 ? f90? what

FORTRAN is a mess


Quote:
So, I take a subroutine from Gfortran code, copy it and open the .cpp
the two do not mix well but ...


Quote:
I find a place between two previously debugged C++ routines and past what I have in clipboard. The code pastes there but I also find chunks of it a hundred lines below, fifty lines upwards, etc. Sometimes parts of it, like one line will be added to my previously debugged C++ lines, etc.
????????????????????
odd and is needing a WTF

the closet thing to that would be ...

is this fortran code by chance on a HTML <iframe> text section on some web page
that is using some CRAZY messed up CSS to be displayed on a telephone screen


this is NOT normal for opining a *.F77 or *.F90 code file and a *cpp file in tabs in kate or gedit

two screen shots
-- F90 code
copy one section to a new unnamed new doc ( in a new tab)
http://imgbox.com/RoRgSrHV
and paste
http://imgbox.com/Xiv4FiDJ
Attached Thumbnails
Click image for larger version

Name:	f90.1.jpg
Views:	13
Size:	195.9 KB
ID:	19786   Click image for larger version

Name:	f90.2.jpg
Views:	13
Size:	164.3 KB
ID:	19787  
 
Old 10-12-2015, 09:12 PM   #14
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
I wonder if you have some sort of filesystem or memory corruption?

Do the scattered segments appear immediately after you paste, or only after the file is saved and re-opened?

Last edited by astrogeek; 10-12-2015 at 09:15 PM.
 
Old 10-13-2015, 09:48 AM   #15
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
What the OP is describing is not Gedit standard behavior. If things are pasting to different places, it's either user error or a serious system memory problem. If you're getting the same things happening with multiple editors, then it's not the editor, it's something else.
 
  


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
[SOLVED] Changing shortcut keys for gedit using /.config/gedit/accels has no impact in program charlemagne-is-my-son Linux - Software 1 12-16-2014 08:16 AM
LXer: Kate/KDevelop October Sprint: What's new in Kate LXer Syndicated Linux News 0 11-24-2012 10:20 PM
A Gedit/Geany/Kate clone having formating control system Xeratul Programming 2 06-22-2011 03:43 PM
LXer: Getting Started With the Kate Text Editor: Kate For Coders LXer Syndicated Linux News 0 04-01-2009 11:40 PM
Kate Is Not Working, Kate editor is not starting in Redhat 9 apur Linux - General 4 05-11-2004 09:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:55 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