Hi,
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7). Of course, these people (or people who were editing the same source afterwards) also use spaces so sometimes it happens that I have e.g. tab size set to 4 but the other file I edit has tab size 2 and it uses spaces too, so what I see is that the lines using tab get indented less than the lines using spaces. I usually ignore it, but sometimes the code is so unreadable that I have to change the tab size. And this is the problem - with geany you have to do it either per project or globally, it's not possible for a single file. So I have to switch it in the project settings, look at the file, and switch it back again because I return back to a file with different indent size.
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes. This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
Cheers,
Jiri
On Tue, 20 Jul 2010 22:20:52 +0200% Jiří Techet techet@gmail.com wrote:
Hi,
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7). Of course, these people (or people who were editing the same source afterwards) also use spaces so sometimes it happens that I have e.g. tab size set to 4 but the other file I edit has tab size 2 and it uses spaces too, so what I see is that the lines using tab get indented less than the lines using spaces. I usually ignore it, but sometimes the code is so unreadable that I have to change the tab size. And this is the problem - with geany you have to do it either per project or globally, it's not possible for a single file. So I have to switch it in the project settings, look at the file, and switch it back again because I return back to a file with different indent size.
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes.
I think it may be useful, though I've never really needed it.
This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
For me, a better way would be to support Emacs/Vi mode lines. I know Gedit has a plugin for that, maybe this functionality can be borrowed from there. Mode lines will be also useful for specifying document encoding so that user don't have to choose it manually each time it opens the file (I sometimes have to work with files in cp1251, traditional codepage for Russian Windows…).
Best regards, Eugene.
On Wed, Jul 21, 2010 at 07:08, Eugene Arshinov earshinov@gmail.com wrote:
On Tue, 20 Jul 2010 22:20:52 +0200% Jiří Techet techet@gmail.com wrote:
Hi,
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7). Of course, these people (or people who were editing the same source afterwards) also use spaces so sometimes it happens that I have e.g. tab size set to 4 but the other file I edit has tab size 2 and it uses spaces too, so what I see is that the lines using tab get indented less than the lines using spaces. I usually ignore it, but sometimes the code is so unreadable that I have to change the tab size. And this is the problem - with geany you have to do it either per project or globally, it's not possible for a single file. So I have to switch it in the project settings, look at the file, and switch it back again because I return back to a file with different indent size.
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes.
I think it may be useful, though I've never really needed it.
This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
For me, a better way would be to support Emacs/Vi mode lines. I know Gedit has a plugin for that, maybe this functionality can be borrowed from there. Mode lines will be also useful for specifying document encoding so that user don't have to choose it manually each time it opens the file (I sometimes have to work with files in cp1251, traditional codepage for Russian Windows…).
I'm not saying I dislike your idea (it would surely be good to have), but it doesn't solve my problem. The problem is that I mustn't change the sources unless it's some kind of bugfix/feature enhancement. Otherwise I would have already reformatted the sources with some code beautifier.
Cheers,
Jiri
Best regards, Eugene. _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Tue, 20 Jul 2010 22:20:52 +0200 Jiří Techet techet@gmail.com wrote:
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7).
I have the same problem sometimes, with my company sources, but even our medium-class commercial IDE only supports per-filetype tab widths. Is it reasonable to expect per-document widths from Geany?
A fast solution would be to write a simple a plugin that declares keys for tab widths 2 to 8, by default Alt+2 to Alt+8, and calls sci_send_message(current, SCI_SETTABWIDTH). They won't be saved, but at least you'll be able to switch quickly and per-document.
BTW, there is a bug in the Project -> Preferences: when changing the indentation Width, at least with Type:Tabs, the previous width is applied, instead of the current one. Edit -> Preferences works fine.
On Thu, Jul 22, 2010 at 20:05, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
On Tue, 20 Jul 2010 22:20:52 +0200 Jiří Techet techet@gmail.com wrote:
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7).
I have the same problem sometimes, with my company sources, but even our medium-class commercial IDE only supports per-filetype tab widths. Is it reasonable to expect per-document widths from Geany?
My experience is that the "bigger" the IDE is, the less control you have over your files. These IDEs usually expect that the whole project is managed by them, and all the files use the same file encodings, tab sizes and line ends. Things work if you really let the IDE control and manage your sources - otherwise using them is a real pain. So I wouldn't take the big players as a benchmark here - geany has a different philosophy.
Geany is already pretty feature rich in what you can set per file - indent type, line ends, syntax highlight, file encoding and from what I see, tab sizes are probably the only missing piece.
A fast solution would be to write a simple a plugin that declares keys for tab widths 2 to 8, by default Alt+2 to Alt+8, and calls sci_send_message(current, SCI_SETTABWIDTH). They won't be saved, but at least you'll be able to switch quickly and per-document.
Yes, would be possible, I'm just not sure if it's a good idea to make a new plugin for every single minor feature. I'm perfectly fine with tab sizes not being saved into the sessions file though - I was suggesting this just to make things consistent with the other settings, but it's OK for me if this feature is not implemented (less work for me).
From technical point of view I think it's better to call the API
function editor_set_indent_type() - I believe this way the custom tab size would be preserved even when the document is reloaded (but I haven't studied the sources much so I may be wrong).
BTW, there is a bug in the Project -> Preferences: when changing the indentation Width, at least with Type:Tabs, the previous width is applied, instead of the current one. Edit -> Preferences works fine.
I knew there was something like that - I experienced something similar too. I may look at it if I have some time left.
Regards,
Jiri
-- E-gards: Jimmy _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Am Dienstag, den 20.07.2010, 22:20 +0200 schrieb Jiří Techet:
Hi,
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7). Of course, these people (or people who were editing the same source afterwards) also use spaces so sometimes it happens that I have e.g. tab size set to 4 but the other file I edit has tab size 2 and it uses spaces too, so what I see is that the lines using tab get indented less than the lines using spaces. I usually ignore it, but sometimes the code is so unreadable that I have to change the tab size. And this is the problem - with geany you have to do it either per project or globally, it's not possible for a single file. So I have to switch it in the project settings, look at the file, and switch it back again because I return back to a file with different indent size.
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes. This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
I second the idea of the per-document tab-width. Maybe I would design the menu a bit in another way and provide a small dialog with a text field or spinner where you can setup the tab-width. :) (I guess it's not possible to integrate something like a text field or spinner into a menu?)
Best Regards, Dominic
On Fri, Jul 23, 2010 at 00:18, Dominic Hopf dmaphy@googlemail.com wrote:
Am Dienstag, den 20.07.2010, 22:20 +0200 schrieb Jiří Techet:
Hi,
I have one more feature idea and would like to ask if it is something that others would like to see too before I start implementing it. I'm working on a project where everyone expresses his personality by using different tab width for indenting - I have already seen sources with tab size of 2, 3, 4, 5, 6 and 8 (it's just a matter of time until I see a source with tab width 7). Of course, these people (or people who were editing the same source afterwards) also use spaces so sometimes it happens that I have e.g. tab size set to 4 but the other file I edit has tab size 2 and it uses spaces too, so what I see is that the lines using tab get indented less than the lines using spaces. I usually ignore it, but sometimes the code is so unreadable that I have to change the tab size. And this is the problem - with geany you have to do it either per project or globally, it's not possible for a single file. So I have to switch it in the project settings, look at the file, and switch it back again because I return back to a file with different indent size.
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes. This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
I second the idea of the per-document tab-width. Maybe I would design the menu a bit in another way and provide a small dialog with a text field or spinner where you can setup the tab-width. :) (I guess it's not possible to integrate something like a text field or spinner into a menu?)
I suggested the settings to work this way because all the other per document settings (indent type, file type, encoding, line endings) are implemented as radio menu items. But can be done the way you suggest, I don't care much. I'll wait for Enrico's or Nick's opinion on this.
Cheers,
Jiri
Best Regards, Dominic
-- Dominic Hopf dmaphy@googlemail.com
Key Fingerprint: A7DF C4FC 07AE 4DDC 5CA0 BD93 AAB0 6019 CA7D 868D
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Fri, 23 Jul 2010 19:23:49 +0200 Jiří Techet techet@gmail.com wrote:
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes. This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
I second the idea of the per-document tab-width.
As we now have 3 devs in favour, perhaps we should support it ;-)
There is a related issue with applying changed default indent settings - ask the user whether to apply the new settings to all documents in the session. But this is something we should do anyway IMO, just mentioning it.
Maybe I would design the menu a bit in another way and provide a small dialog with a text field or spinner where you can setup the tab-width. :) (I guess it's not possible to integrate something like a text field or spinner into a menu?)
I suggested the settings to work this way because all the other per document settings (indent type, file type, encoding, line endings) are implemented as radio menu items. But can be done the way you suggest, I don't care much. I'll wait for Enrico's or Nick's opinion on this.
I think radio buttons is fine, I think 2-8 is reasonable.
Regards, Nick
On Wed, Aug 11, 2010 at 14:25, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 23 Jul 2010 19:23:49 +0200 Jiří Techet techet@gmail.com wrote:
I would propose to have one more entry in the Document menu called e.g. "Tab size" and placed under "Indent type" with a submenu containing numbers from 2 to 8 (I hope there is nobody so crazy that he would use tab for a single char indent or go over 8 characters) with a radio button selecting the active selection. The user could change the default tab size of the active document to anything he wishes. This settings could also be saved into the project/session file so the files get reloaded with the same tab size settings. What do you think about this feature?
I second the idea of the per-document tab-width.
As we now have 3 devs in favour, perhaps we should support it ;-)
Great! Let me know if you think that the indent sizes should be saved in the session file list as well.
There is a related issue with applying changed default indent settings
- ask the user whether to apply the new settings to all documents in
the session. But this is something we should do anyway IMO, just mentioning it.
Maybe I would design the menu a bit in another way and provide a small dialog with a text field or spinner where you can setup the tab-width. :) (I guess it's not possible to integrate something like a text field or spinner into a menu?)
I suggested the settings to work this way because all the other per document settings (indent type, file type, encoding, line endings) are implemented as radio menu items. But can be done the way you suggest, I don't care much. I'll wait for Enrico's or Nick's opinion on this.
I think radio buttons is fine, I think 2-8 is reasonable.
At the end I made the range 1-8. Even though I can't imagine someone would use 1-size indent with ANSI style, it could be used for GNU style where you would indent { by one and the code by one as well (so in fact the code would be indented by two).
Jiri
Regards, Nick _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel