Author Topic: B3: Can't type characters in empty file with "Top Of File"  (Read 850 times)

rowbearto

  • Senior Community Member
  • Posts: 1468
  • Hero Points: 111
B3: Can't type characters in empty file with "Top Of File"
« on: September 08, 2017, 02:32:58 am »
Tools->Options->Appearance->Top of file line -> Set to "ON"

Outside of SE, create a file of size 0 bytes, such as: "touch main.cc"

Open main.cc in SE. Try to type new characters, they don't show up in the editor window.

If "Top of file line" is disabled, then typed characters do appear in the editor window.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4896
  • Hero Points: 399
Re: B3: Can't type characters in empty file with "Top Of File"
« Reply #1 on: September 08, 2017, 03:01:18 am »
SlickEdit won't let you type characters into the top of file line. It's a read-only line. You must press enter first so that there is a line below the top of file line.

rowbearto

  • Senior Community Member
  • Posts: 1468
  • Hero Points: 111
Re: B3: Can't type characters in empty file with "Top Of File"
« Reply #2 on: September 08, 2017, 03:15:31 am »
I see this now.

But then it begs the question, shouldn't SE place the cursor after the "Top of File" line upon opening the file when the file size is 0 so that one can start typing? It is not intuitive that I need to press <ENTER> first.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4896
  • Hero Points: 399
Re: B3: Can't type characters in empty file with "Top Of File"
« Reply #3 on: September 08, 2017, 01:39:53 pm »
That would be inconsistent with how slickedit handles other lines in the file.

Sounds like you want an option for handling the last line eol like other products. This is something we've had requests for and it seems like a good idea.

rowbearto

  • Senior Community Member
  • Posts: 1468
  • Hero Points: 111
Re: B3: Can't type characters in empty file with "Top Of File"
« Reply #4 on: September 08, 2017, 01:54:48 pm »
Clark: Could you please explain more what you mean by: "an option for handling the last line eol like other products"? I don't quite understand what you mean here.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4896
  • Hero Points: 399
Re: B3: Can't type characters in empty file with "Top Of File"
« Reply #5 on: September 08, 2017, 03:19:40 pm »
For example, when you create a new file, SlickEdit creates an empty line with <CR><LF> at the end. Other products would create a new file with an empty line without <CR><LF> at the end. Now lets say you have a file with exactly the following in it "111<CR><LF>". When SlickEdit displays the file, you will see a file with exactly one line and you can't cursor past line 1. With other products, you would have two lines where the second line doesn't not have a <CR><LF> at the end.

This other method has it's positives and negatives. It has the advantage of better supporting an empty file. Some use it as method for knowing whether a line ends with <CR><LF> (more of an emulation thing). It has the disadvantage in how it handles certain situations where the last non-blank line is terminated with <CR><LF>. Do a search and replace (replace "^" with "x") will do one replace too many and there's no work around. SlickEdit doesn't not have this problem. Pick your poison.

rowbearto

  • Senior Community Member
  • Posts: 1468
  • Hero Points: 111
Re: B3: Can't type characters in empty file with "Top Of File"
« Reply #6 on: September 08, 2017, 03:24:53 pm »
Thanks for the explanation.

Typing into an empty file is not that important to me, it was just something I noticed when creating a debug project with lots of empty files, and since it is beta period I thought I would report any "bug" I see. So I think it is low priority to "fix" this.