jed-users mailing list

[2016 Date Index] [2016 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[jed-users] C++ source formatting


All,

I know I have seen this somewhere before, but cannot find the page now. Some years ago there used to be a Web page which showed how to fix Jed C++ template/style to put { and } where they are supposed to go as shown below:


#include <array>
#include <iostream>

int main()
{

   std::array<int, 3> arr{ 2, 3, 5 };

   for( auto i : arr)
   {
        std::cout << i << std::endl;
   }

}

I'm on Ubuntu 16.04 64-bit. My .jedrc looks as follows, mainly because the icky/nasty terminal sends the same response for ctrl-home and ctrl-end as it does for just home and end.

require ("keydefs");
require ("cua");
require ("wmark.sl");
%unsetkey ("\e0");
%setkey ("beg_of_buffer", "\eOH" );
%setkey ("end_of_buffer", "\eOF" );

USE_TABS = 0;
TAB_DEFAULT = 4;
WRAP = 0;

If I just free-type the above program in this happens:

#include <array>
#include <iostream>

int main()
{
   std::array<int, 3> arr
     {
        2, 3, 5
     }
   ;

   for( auto i : arr)
     {
        std::cout << i << std::endl;
     }

}

Thanks,
Roland

--
Roland Hughes, President
Logikal Solutions
(630)-205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog

_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


[2016 date index] [2016 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]