From: SourceForge.net <no...@so...> - 2012-02-10 20:04:08
|
Plugin Feature Requests item #1964979, was opened at 2008-05-15 17:53 Message generated for change (Comment added) made by jarekczek You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=997936&aid=1964979&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: WhiteSpace Group: None >Status: Pending >Resolution: Rejected Priority: 5 Private: No Submitted By: Craig McQueen (cmcqueen1975) Assigned to: Nobody/Anonymous (nobody) >Summary: WhiteSpace: remove trailing spaces from the edited line Initial Comment: When editing source files, indentation automatically inserts spaces. For someone like me who is "a little pedantic", these trailing spaces hanging around are less than ideal. And there are many other situations where trailing spaces can be left "hanging around". What would be good is for jEdit to be a little smarter about spaces. These features should probably be optional, or implemented via a plugin. Suggestion 1: "virtual spaces" When auto-indenting, don't actually insert spaces immediately. Just position the cursor at the appropriate column. _If_ the user then types something on that line, _then_ spaces can actually be inserted. _If_ the user doesn't type something on that line (e.g. move away from that line, or hit Enter for the next line), then no spaces are left on that line. Suggestion 2: automatic removal of trailing spaces When a user has edited a line, and then moves away from that line, automatically remove trailing spaces on that line. Note: Don't change lines that the user hasn't edited. The WhiteSpace plugin has an option to remove trailing spaces when a file is saved. But this has the disadvantage that when editing a file in a multiple-developer scenario, and other developers _do_ leave trailing spaces, and using version control, a particular check-in of edits will potentially show many lines changed simply due to trailing spaces being removed. But I just want to be tidy within the scope of my own edits, and not fiddle with spaces throughout the rest of the file. ---------------------------------------------------------------------- >Comment By: Jarek Czekalski (jarekczek) Date: 2012-02-10 12:04 Message: Suggestion 1 seems unrealistic and would rather be a core feature. The only open case is now the second suggestion. Yeah, it would be a safe feature that could be always on. ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2008-05-29 19:15 Message: Logged In: YES user_id=935841 Originator: NO Moving this to Plugin Feature Requests, and changing subject to be related to WhiteSpace plugin. If someone woudl like to enhance the WhiteSpace plugin to include these missing features, please submit a patch to the plugin patches tracker. ---------------------------------------------------------------------- Comment By: Kazutoshi Satoda (k_satoda) Date: 2008-05-16 14:38 Message: Logged In: YES user_id=1483238 Originator: NO I have not used the The WhiteSpace plugin's option because the same reason Craig said. Now I got inspired Suggestion 2 and made a quick implementation in a few lines of bsh. if (textArea.isEditable()) { int lineIndex = textArea.getCaretLine(); textArea.insertEnterAndIndent(); textArea.getBuffer().removeTrailingWhiteSpace(new int [] {lineIndex}); } else { textArea.getToolkit().beep(); } Binding this to ENTER, I'm feeling happy for now. I'll continue testing this in real work. Having this as an action in WhiteSpace plugin may be a solution for this request? ---------------------------------------------------------------------- Comment By: Robert Schwenn (rschwenn) Date: 2008-05-16 11:02 Message: Logged In: YES user_id=1486645 Originator: NO There are related requests: #1574625, #1869411. ---------------------------------------------------------------------- Comment By: Matthieu Casanova (kpouer) Date: 2008-05-16 02:05 Message: Logged In: YES user_id=285591 Originator: NO Hi, did you try the Whitespace plugin ? It has an option to remove trailing whitespace before saving files ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=997936&aid=1964979&group_id=588 |