+2

Smartgit editor(s) should respect .editorconfig

Miro Kropáček 2 weeks ago updated by pgoiffon 1 week ago 6

I can't emphasise how many times per day I fight this issue: I change something in my editor, double-click in Smartgit to see the differences and I realise that tab settings is wrong. So I go to View -> Settings and adjust it. Yet again. Sure, I can save it as default but that works only until I switch to another repository.

How much easier my life would be if Smartgit read .editorconfig (https://editorconfig.org) from given repository!

GUI Changes view Settings

Hi Miro,
Thank you for your feedback, I understand what you would like to achieve.

Can you tell me a bit about your environment?

Daniel

Hi Daniel,

not sure what exactly do you have in mind. :-)


I use Linux + Kate as an editor (usually) for editing various open source projects. Very often a few at the same time (e.g. a project which requires SDL_mixer usually involves messing with the project, SDL and SDL_mixer at the same time) and as it goes, each of them has separate tab/space/indent conventions.

It's easy to switch between the projects (repositories) in SmartGit but when I bump into the issue mentioned - sometimes I need tabs + indent size 2, sometimes spaces + indent size 4 (although here it matters only if I want to edit something withing the diff editor of course) etc. Very frustrating.

When I discovered .editorconfig, all my issues went away, well, except when working with SmartGit. :-)

(don't get me wrong, I love it, I'm using it for more than 10+ years and paid for it for my commercial activities, too)

Thank you for the details!

Which exact options should be respected?

+2

Actually most of them are useful, I'll try to order them by importance/usefulness (IMHO, of course):

  1. indent_style, indent_size, tab_width (as mentioned above, indent_style = spaces is still useful with indent_size because then you can correctly edit files in diff view, too)
  2. charset (this would be godsend, currently I have to restart SmartGit with JAVA_TOOL_OPTIONS=-Dfile.encoding=<encoding> every time I need to work with some non-UTF8 source code (yes, such files still exist ;-))
  3. trim_trailing_whitespace, insert_final_newline
  4. end_of_line (this is perhaps implicitly done)

Respecting .editorconfig charset would be a workaround for the encoding change problem reported in https://smartgit.userecho.com/communities/1/topics/1764-system-encoding-diferent-on-2411