Is this possible in a plugin?
Posted: Fri 28 Mar, 2014 07:37
Hi! I would like to provide some functionality in my plugins, but I rather suspect they are impossible to implement without writing a completely new FAR editor. But perhaps someone can suggest a way which would make this possible:
1) Virtual wrap: The plugin AutoWrap makes it possible to wrap lines at a certain column, but it does it by inserting a hard EOL in the file. I would prefer a virtual wrap, where the lines are only wrapped for "visual purposes" but in fact the existence or non-existence of the wrap does not change the file itself. The only way I can think of would be marking a line as "continuing" or "normal", and then at EE_CLOSE (or possibly EE_SAVE) reinterpreting the file according to the flag. But there doesn't seem any way to add a user-defined flag to a particular line. Or is there?
2) Filter: I would like to be able to choose a (possibly non-continuous) selection of lines and only display these lines in the editor. The user could make any changes he liked with them, then exit the filter mode and the lines would be applied to the original file. I could probably do that by opening a new editor with just the selected lines, then on close of this new editor the selected lines would be deleted in the old editor and the lines from the new editor would be added to the old one. But that seems rather ugly, with a great possibility of failure. Am I overlooking something?
Thanks.
1) Virtual wrap: The plugin AutoWrap makes it possible to wrap lines at a certain column, but it does it by inserting a hard EOL in the file. I would prefer a virtual wrap, where the lines are only wrapped for "visual purposes" but in fact the existence or non-existence of the wrap does not change the file itself. The only way I can think of would be marking a line as "continuing" or "normal", and then at EE_CLOSE (or possibly EE_SAVE) reinterpreting the file according to the flag. But there doesn't seem any way to add a user-defined flag to a particular line. Or is there?
2) Filter: I would like to be able to choose a (possibly non-continuous) selection of lines and only display these lines in the editor. The user could make any changes he liked with them, then exit the filter mode and the lines would be applied to the original file. I could probably do that by opening a new editor with just the selected lines, then on close of this new editor the selected lines would be deleted in the old editor and the lines from the new editor would be added to the old one. But that seems rather ugly, with a great possibility of failure. Am I overlooking something?
Thanks.