Page 2 of 2
					
				Re: Align inline comments to a certain column
				Posted: 08.11.2023 09:34
				by main Alexey
				I will try to code this in the nearest N (<9) days.
			 
			
					
				Re: Align inline comments to a certain column
				Posted: 08.11.2023 15:51
				by main Alexey
				I made first version of the command.
Plugin CudaExt - my fork. command is here: "Plugins / CudaExt / Align / Align line-comments to a certain column".
To try it:
- remove CudaExt plugin if it's installed
- get my fork: "Plugins / Addons Manager / Install from Git", enter URL 
https://github.com/CudaText-addons/cuda_ext
- restart Cud
Please test.
 
			
					
				Re: Align inline comments to a certain column
				Posted: 09.11.2023 09:48
				by Layerprogg
				Hi Alexey, works!
But there should be a treshold value for the algorithm.
All existing comments left of that threshold value should be ignored.
Example: 
I often use a little comment at the end of a switch command to better identify the ending parenthesis.
I don't want this comment to be aligned with the pluging at i.e. column 80.
switch(cond) {
  case 'ch':
  break;
  
  case nr:
  break;
  
  default: break;
} // switch
			 
			
					
				Re: Align inline comments to a certain column
				Posted: 09.11.2023 09:59
				by main Alexey
				hmm, how plugin can detect "this comment is not to change"? e.g. "} // switch" line - what is special for this line for plugin? how to detect all such lines "to not touch"?
			 
			
					
				Re: Align inline comments to a certain column
				Posted: 09.11.2023 10:14
				by Layerprogg
				Perhaps i didn't say it clear enough.
For me there are two  numbers of interest:
1st: the column number to which the comments should be aligned.
2nd: a column number that says: ignore this line if a comment starts to the left of this column.
For my example this means: Align all comments to column 80 but ignore the line if there is a comment beginning left of i.e. column 40
best regards
			 
			
					
				Re: Align inline comments to a certain column
				Posted: 09.11.2023 10:26
				by main Alexey
				okay. I updated the Git repo on github. changed to the prompt to ask for 2 options, 2nd option is "minimal allowed column of comment".
			 
			
					
				Re: Align inline comments to a certain column
				Posted: 09.11.2023 10:34
				by Layerprogg
				Hurray, that's it. Thank you very much
			 
			
					
				Re: Align inline comments to a certain column
				Posted: 09.11.2023 10:35
				by main Alexey
				todo for this command: support e.g. PHP lexer (currently PHP lexer blocks the code to work).