On Jul 18, 1:48 am, mobi phil <m...@mobiphil.com> wrote:

- Hide quoted text -
- Show quoted text -
> > Can you please do something about your line wrapping?  Trying to read
> > your messages is getting rather annoying.

> if you are reffering to me I do my best with manual wrapping, I can use for
> the
> moment  only the web browser to write email, and nothing else.

> > Anyway, where are you getting these “statistics” from?  I just ran a
> > simple test, opening a 185 MB text file in both editors.  Vim took 7
> > seconds, Emacs 14 seconds.  I don’t know about UltraEdit, but it’s
> > going faster as it doesn’t need to load the whole file, last time I
> > checked.  (Things may have changed to accomodate variable-width
> > encodings, which are always going to be an issue.)

> could be faster. Could do some sort of lazy reading. That is if certain
> variable is set, than read in only the first part of the buffer. Read the
> rest only when needed.

> More: I understand that the datatype is a linked list. For read only mode
> (view) the buffer should be linear. Probably then reading would be 
> faster.http://www.mobiphil.com/2008/06/opening-large-files-with-vim-is-howev...

> Goal?  Have you thought this through further than writing this email?

> > “Good algorithm”?  Do you know anything about implementing a text
> > editor?  Let me tell you, as someone who has written two and devoted
> > two years of research into the matter for my master’s thesis, that
> > writing a text editor is fucking hard.  Vim’s method of reading and
> > managing a buffer may not be optimal, but it’s pretty good and writing
> > something that’s better will require a lot of work.  A big whole
> > shitload of work.

> again data types used for view mode should not be the same as for editing
> mode.

> therefore if one would have an abstraction buffer with different
> implementations,
> for view mode and edit mode, than things could be improved. With object
> oriented
> languages that is easier to achieve, but it is possible with C, as we all
> know.

> > If this is in regard to the suggested C++ rewrite of Vim, then wow, just
> > wow.

> I think you mixed the two things. StarWing was referring to better syntax
> parsing.
> Rewrite in c++ would be an option... But why not create a C++ wrapper
> around
> the existing VIM functionality and and and ... imagination

> What Vim needs is a clearer separation of concerns in the source code.>  
> Different subsystems depend too much upon each other.  The overuse of
> > #ifdef’s also makes the code rather hard to understand.  What it
> > doesn’t need is a rewrite.

> That was discussed in this thread and the other one "plugin mechanism",

> rgrds,
> mobi phil

> being mobile, but including technologyhttp://mobiphil.com

UPDATE: sorry for my textwidth, I move to a new system, so my Vim's
textwidth is still 78, the text below is updated.

My algorithm against your view-mode & edit-mode data type:

We get a big (memory)buffer for use. maybe least 8K for a (vim)buffer.
one for buffer-info, and one for swap file. then, we open a swap file
for use.  we write buffer-info into swap file, for its first block.

then, read info in .viminfo file, find out which block should be read.
read 4K text of file (if any) into data page. now we have 8K
(memory)buffer for a (vim)buffer. one info-buffer, and one
swap-buffer. and info-buffer signed as synced.

we do anything need with 4K swap-buffer. the complex thing is decide
where we begin to do syntax highlight. after that the text will
display on screen.

when you "insert" something. get another buffer (if we don't have) for
input.  use something like vim_insert_mode(&buffer, 4096,
&info_struct); to call insert mode interface. text will put in buffer.
that's our insert- buffer.  register it in buffer-info (exactly in
undo-list of buffer-info). we alloca some space (e.g. 16 items) for
page-list and undo-list and etc. if needed, they can point to a new
block. after insert, we don't move text into swap-block. just make a
sign into swap-block, for display. we just sync swap-block in 1s or 10
times input.

now we have several block: info-block(4K), swap-block(4K*N), insert-
block(for multiuse, mainly undo system). they are all 4K, can swap
into swap file.  another memory are used by script system. but in
edit-system. I only want to use 4K block (maybe output to screen or
manage lists need good and careful design).

So, IMO view-mode and edit-mode are the same. view mode isn't contain
insert block, that's all. (they just skelecton, there are a dozen of
details on them.  I'm trying to implement them now :-)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui